- Ajout de la méthode LSdebugDefined() et utilisation dans index_ajax.php et

modify.php
This commit is contained in:
Benjamin Renard 2008-10-13 10:58:48 +00:00
parent 5435f1355b
commit 7a79198d2f
3 changed files with 9 additions and 4 deletions

View file

@ -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
*

View file

@ -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);

View file

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