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()); } }