From 7a79198d2f77d01528222fd530d24ea1a4d80b03 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 13 Oct 2008 10:58:48 +0000 Subject: [PATCH] =?UTF-8?q?-=20Ajout=20de=20la=20m=C3=A9thode=20LSdebugDef?= =?UTF-8?q?ined()=20et=20utilisation=20dans=20index=5Fajax.php=20et=20=09m?= =?UTF-8?q?odify.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/includes/functions.php | 6 ++++++ trunk/index_ajax.php | 5 ++--- trunk/modify.php | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/trunk/includes/functions.php b/trunk/includes/functions.php index b5c5961b..17c5fdc8 100644 --- a/trunk/includes/functions.php +++ b/trunk/includes/functions.php @@ -156,6 +156,12 @@ function LSdebug_print($return=false) { return; } +function LSdebugDefined() { + if (!$GLOBALS['LSdebug']['active']) + return; + return (!empty($GLOBALS['LSdebug']['fields'])); +} + /** * Vérifie la compatibilite des DN * diff --git a/trunk/index_ajax.php b/trunk/index_ajax.php index 60b92f14..5271564b 100644 --- a/trunk/index_ajax.php +++ b/trunk/index_ajax.php @@ -410,9 +410,8 @@ if (isset($_REQUEST['imgload'])) { $data['imgload'] = $_REQUEST['imgload']; } -$debug_txt = LSdebug_print(true); -if ($debug_txt != "") { - $data['LSdebug'] = $debug_txt; +if (LSdebugDefined()) { + $data['LSdebug'] = LSdebug_print(true); } echo json_encode($data); diff --git a/trunk/modify.php b/trunk/modify.php index 092e67a3..252aa02f 100644 --- a/trunk/modify.php +++ b/trunk/modify.php @@ -54,7 +54,7 @@ if($LSsession -> startLSsession()) { // MàJ des données de l'objet LDAP if ($object -> updateData('modify')) { $GLOBALS['LSsession'] -> addInfo(_("L'objet a bien été modifié.")); - if (!$GLOBALS['LSdebug']['active']) { + if ((!LSdebugDefined()) && !$GLOBALS['LSerror']->errorsDefined()) { $GLOBALS['LSsession'] -> redirect('view.php?LSobject='.$LSobject.'&dn='.$object -> getDn()); } }