🚜 fix(core) Replace calls to DEBUG by logging::debug

issue #6065
parent ebdbe5c5
......@@ -105,7 +105,7 @@ if (!is_readable(CONFIG_DIR.'/'.CONFIG_FILE)) {
$config = new config(CONFIG_DIR.'/'.CONFIG_FILE, $BASE_DIR);
session::set('config', $config);
session::set('DEBUGLEVEL', $config->get_cfg_value('DEBUGLEVEL'));
@DEBUG(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, 'config');
logging::debug(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, 'config');
/* Configuration was reloaded, so plist needs to be as well */
session::un_set('plist');
unset($plist);
......
......@@ -40,9 +40,9 @@ session::start();
reset_errors();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
@DEBUG(DEBUG_POST, __LINE__, __FUNCTION__, __FILE__, $_POST, '_POST');
logging::debug(DEBUG_POST, __LINE__, __FUNCTION__, __FILE__, $_POST, '_POST');
}
@DEBUG(DEBUG_SESSION, __LINE__, __FUNCTION__, __FILE__, $_SESSION, '_SESSION');
logging::debug(DEBUG_SESSION, __LINE__, __FUNCTION__, __FILE__, $_SESSION, '_SESSION');
/* Logged in? Simple security check */
if (!session::is_set('connected')) {
......@@ -86,7 +86,7 @@ if (session::get('_LAST_PAGE_REQUEST') != '') {
session::set('_LAST_PAGE_REQUEST', time());
@DEBUG(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config");
logging::debug(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config");
/* Set template compile directory */
$smarty->compile_dir = $config->get_cfg_value("templateCompileDirectory", SPOOL_DIR);
......@@ -109,14 +109,14 @@ $smarty->assign('hideMenus', FALSE);
/* check user expiration status */
$expired = $ui->expired_status();
if (($expired == POSIX_WARN_ABOUT_EXPIRATION) && !session::is_set('POSIX_WARN_ABOUT_EXPIRATION__DONE')) {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $expired, 'This user account ('.$ui->uid.') is about to expire');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $expired, 'This user account ('.$ui->uid.') is about to expire');
// The users password is about to expire soon, display a warning message.
logging::log('security', 'fusiondirectory', '', [], 'password for user "'.$ui->uid.'" is about to expire');
msg_dialog::display(_('Password change'), _('Your password is about to expire, please change your password!'), INFO_DIALOG);
session::set('POSIX_WARN_ABOUT_EXPIRATION__DONE', TRUE);
} elseif ($expired == POSIX_FORCE_PASSWORD_CHANGE) {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $expired, 'This user account expired');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $expired, 'This user account expired');
// The password is expired, we are now going to enforce a new one from the user.
......
......@@ -72,7 +72,7 @@ class CopyPasteHandler
*/
function add_to_queue ($dn, $action, $type)
{
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'add_to_queue');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'add_to_queue');
if (!in_array($action, ['cut','copy'])) {
trigger_error(sprintf('Specified action "%s" does not exists for copy & paste.', $action));
......@@ -136,7 +136,7 @@ class CopyPasteHandler
*/
protected function load_entry_from_ldap ($entry)
{
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $entry['dn'], 'load_entry_from_ldap');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $entry['dn'], 'load_entry_from_ldap');
if (!isset($entry['tab_class']) && !isset($entry['type'])) {
return [];
}
......
......@@ -60,7 +60,7 @@ class Language
bindtextdomain($domain, LOCALE_DIR);
textdomain($domain);
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, 'Setting language to');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, 'Setting language to');
}
$ret = FALSE;
......@@ -70,7 +70,7 @@ class Language
$ret = TRUE;
if (session::is_set('plist')) {
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, session::get('lang'), 'Plist already loaded with language');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, session::get('lang'), 'Plist already loaded with language');
}
session::un_set('plist');
session::set('lang', $lang);
......
......@@ -965,7 +965,7 @@ class config
if (($tabclass == 'GROUPTABS') && class_available('mixedGroup')) {
$tabclass = 'OGROUP-USERTABS';
}
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $tabclass, "Adding $class to tab list");
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $tabclass, "Adding $class to tab list");
if (!isset($this->data['TABS'][$tabclass])) {
$this->data['TABS'][$tabclass] = [];
}
......@@ -1007,7 +1007,7 @@ class config
$value['tabClass'] = 'simpleTabs';
}
$this->data['OBJECTS'][strtoupper($key)] = $value;
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $tabclass, "Adding $class as main tab of");
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $tabclass, "Adding $class as main tab of");
if (!isset($this->data['TABS'][$tabclass])) {
$this->data['TABS'][$tabclass] = [];
}
......@@ -1015,7 +1015,7 @@ class config
}
}
} elseif (class_available($class) && is_subclass_of($class, 'simpleService')) {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $class, "Adding service");
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $class, "Adding service");
if (!isset($this->data['TABS']['SERVERSERVICE'])) {
$this->data['TABS']['SERVERSERVICE'] = [];
}
......@@ -1057,7 +1057,7 @@ class config
];
/* Extract categories definitions from object types */
foreach ($this->data['OBJECTS'] as $key => $infos) {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $infos['aclCategory'], "ObjectType $key category");
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $infos['aclCategory'], "ObjectType $key category");
if (strtoupper($infos['aclCategory']) == $key) {
$cat = $infos['aclCategory'];
if (!isset($this->data['CATEGORIES'][$cat])) {
......@@ -1135,7 +1135,7 @@ class config
}
}
}
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, join(',', array_unique($acl)), "Class $class categories");
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, join(',', array_unique($acl)), "Class $class categories");
/* Feed menu */
if (isset($plInfo['plSection'])) {
$section = $plInfo['plSection'];
......
......@@ -221,7 +221,7 @@ class LDAP
$this->error = 'Could not connect to LDAP server';
}
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'connect');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'connect');
}
/*!
......@@ -234,11 +234,11 @@ class LDAP
$this->error = "Success";
$this->hascon = TRUE;
$this->reconnect = TRUE;
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rebind');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rebind');
return 0;
} else {
$this->error = "Could not bind to " . $credentials['ADMINDN'];
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rebind');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rebind');
return NULL;
}
}
......@@ -260,7 +260,7 @@ class LDAP
{
@ldap_unbind($this->cid);
$this->cid = NULL;
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, '', 'unbind');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, '', 'unbind');
}
/*!
......@@ -272,7 +272,7 @@ class LDAP
@ldap_close($this->cid);
$this->hascon = FALSE;
}
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, '', 'disconnect');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, '', 'disconnect');
}
/*!
......@@ -359,11 +359,11 @@ class LDAP
}
$this->log("LDAP operation: time=".$diff." operation=search('".$this->basedn."', '$filter')");
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'search(base="'.$this->basedn.'",scope="'.$scope.'",filter="'.$filter.'")');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'search(base="'.$this->basedn.'",scope="'.$scope.'",filter="'.$filter.'")');
return $this->sr[$srp];
} else {
$this->error = "Could not connect to LDAP server";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'search(base="'.$this->basedn.'",scope="'.$scope.'",filter="'.$filter.'")');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'search(base="'.$this->basedn.'",scope="'.$scope.'",filter="'.$filter.'")');
return "";
}
}
......@@ -428,11 +428,11 @@ class LDAP
$this->error = @ldap_error($this->cid);
$this->resetResult($srp);
$this->hasres[$srp] = TRUE;
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'cat(dn="'.$dn.'",filter="'.$filter.'")');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'cat(dn="'.$dn.'",filter="'.$filter.'")');
return $this->sr[$srp];
} else {
$this->error = "Could not connect to LDAP server";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'cat(dn="'.$dn.'",filter="'.$filter.'")');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'cat(dn="'.$dn.'",filter="'.$filter.'")');
return "";
}
}
......@@ -451,11 +451,11 @@ class LDAP
$this->connect();
}
$res = @ldap_read($this->cid, $dn, $filter, ["objectClass"]);
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'object_match_filter(dn="'.$dn.'",filter="'.$filter.'")');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'object_match_filter(dn="'.$dn.'",filter="'.$filter.'")');
return @ldap_count_entries($this->cid, $res);
} else {
$this->error = "Could not connect to LDAP server";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'object_match_filter(dn="'.$dn.'",filter="'.$filter.'")');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'object_match_filter(dn="'.$dn.'",filter="'.$filter.'")');
return FALSE;
}
}
......@@ -476,7 +476,7 @@ class LDAP
} else {
$this->error = "Could not connect to LDAP server";
}
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $size, 'set_size_limit');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $size, 'set_size_limit');
}
/*!
......@@ -507,16 +507,16 @@ class LDAP
if (!isset($att)) {
$att = [];
}
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'fetch()');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'fetch()');
return $att;
} else {
$this->error = "Perform a fetch with no search";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'fetch()');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'fetch()');
return "";
}
} else {
$this->error = "Could not connect to LDAP server";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'fetch()');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'fetch()');
return "";
}
}
......@@ -582,16 +582,16 @@ class LDAP
if ($this->hasres[$srp]) {
$rv = @ldap_count_entries($this->cid, $this->sr[$srp]);
$this->error = @ldap_error($this->cid);
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'count()');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'count()');
return $rv;
} else {
$this->error = "Perform a Fetch with no Search";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'count()');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'count()');
return "";
}
} else {
$this->error = "Could not connect to LDAP server";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'count()');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'count()');
return "";
}
}
......@@ -616,11 +616,11 @@ class LDAP
$r = ldap_mod_del($this->cid, $dn, $attrs);
$this->error = @ldap_error($this->cid);
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rm('.$dn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rm('.$dn.')');
return $r;
} else {
$this->error = 'Could not connect to LDAP server';
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rm('.$dn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rm('.$dn.')');
return '';
}
}
......@@ -637,11 +637,11 @@ class LDAP
$r = @ldap_mod_add($this->cid, $dn, $attrs);
$this->error = @ldap_error($this->cid);
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'mod_add('.$dn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'mod_add('.$dn.')');
return $r;
} else {
$this->error = "Could not connect to LDAP server";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'mod_add('.$dn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'mod_add('.$dn.')');
return "";
}
}
......@@ -659,11 +659,11 @@ class LDAP
}
$r = @ldap_delete($this->cid, $deletedn);
$this->error = @ldap_error($this->cid);
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rmdir('.$deletedn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rmdir('.$deletedn.')');
return ($r ? $r : 0);
} else {
$this->error = "Could not connect to LDAP server";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rmdir('.$deletedn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rmdir('.$deletedn.')');
return "";
}
}
......@@ -713,11 +713,11 @@ class LDAP
/* Check if destination dn exists, if not the
server may not support this operation */
$r &= is_resource($this->dn_exists($dest));
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rename("'.$source.'","'.$dest.'")');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rename("'.$source.'","'.$dest.'")');
return $r;
} else {
$this->error = "Could not connect to LDAP server";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rename("'.$source.'","'.$dest.'")');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rename("'.$source.'","'.$dest.'")');
return FALSE;
}
}
......@@ -759,11 +759,11 @@ class LDAP
}
}
$this->error = @ldap_error($this->cid);
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rmdir_recursive("'.$deletedn.'")');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rmdir_recursive("'.$deletedn.'")');
return ($r ? $r : 0);
} else {
$this->error = "Could not connect to LDAP server";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rmdir_recursive("'.$deletedn.'")');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'rmdir_recursive("'.$deletedn.'")');
return "";
}
}
......@@ -789,7 +789,7 @@ class LDAP
$str = " - <b>attribute: ".preg_replace("/:.*$/", "", $this->get_additional_error())."</b>";
}
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $attrs, "Erroneous data");
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $attrs, "Erroneous data");
return $str;
}
......@@ -813,11 +813,11 @@ class LDAP
if (!$this->success()) {
$this->error .= $this->makeReadableErrors($this->error, $attrs);
}
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'modify('.$this->basedn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'modify('.$this->basedn.')');
return ($r ? $r : 0);
} else {
$this->error = "Could not connect to LDAP server";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'modify('.$this->basedn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'modify('.$this->basedn.')');
return "";
}
}
......@@ -838,11 +838,11 @@ class LDAP
}
$r = @ldap_modify_batch($this->cid, $this->basedn, $changes);
$this->error = @ldap_error($this->cid);
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'modify_batch('.$this->basedn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'modify_batch('.$this->basedn.')');
return $r;
} else {
$this->error = 'Could not connect to LDAP server';
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'modify_batch('.$this->basedn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'modify_batch('.$this->basedn.')');
return FALSE;
}
}
......@@ -863,11 +863,11 @@ class LDAP
if (!$this->success()) {
$this->error .= $this->makeReadableErrors($this->error, $attrs);
}
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'add('.$this->basedn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'add('.$this->basedn.')');
return ($r ? $r : 0);
} else {
$this->error = "Could not connect to LDAP server";
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'add('.$this->basedn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->error, 'add('.$this->basedn.')');
return "";
}
}
......@@ -987,9 +987,9 @@ class LDAP
$this->add($na);
if (!$this->success()) {
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $cdn, 'dn');
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $na, 'Content');
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->get_error(), 'LDAP error');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $cdn, 'dn');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $na, 'Content');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $this->get_error(), 'LDAP error');
msg_dialog::display(_('LDAP error'), msgPool::ldaperror($this->get_error(), $cdn, LDAP_ADD, get_class()), LDAP_ERROR);
return FALSE;
......@@ -1161,7 +1161,7 @@ class LDAP
function dn_exists ($dn)
{
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, '', 'dn_exists('.$dn.')');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, '', 'dn_exists('.$dn.')');
return @ldap_read($this->cid, $dn, "(objectClass=*)", ["objectClass"]);
}
......@@ -1518,7 +1518,7 @@ class LDAP
$res = @ldap_read($ds, '', 'objectClass=*', ['namingContexts']);
$attrs = @ldap_get_entries($ds, $res);
@DEBUG(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $attrs[0]['namingcontexts'], 'get_naming_contexts');
logging::debug(DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__, $attrs[0]['namingcontexts'], 'get_naming_contexts');
return $attrs[0]['namingcontexts'];
}
}
......@@ -338,7 +338,7 @@ class objects
$tabClass = $infos['tabClass'];
$tabObject = new $tabClass($type, $dn);
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, "Openned as $type object");
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, "Openned as $type object");
return $tabObject;
}
......@@ -406,7 +406,7 @@ class objects
$attrsObject->is_template = TRUE;
$tabObject = new $tabClass($type, 'new', $attrsObject);
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, "Create template of $type");
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, "Create template of $type");
return $tabObject;
}
......
......@@ -110,7 +110,7 @@ class passwordRecovery extends standAlonePage
msg_dialog::displayChecks($this->message);
}
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->step, "Step");
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->step, "Step");
$smarty = get_smarty();
......@@ -149,7 +149,7 @@ class passwordRecovery extends standAlonePage
$this->loginAttribute = $config->get_cfg_value('passwordRecoveryLoginAttribute', 'uid');
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $config->get_cfg_value('passwordRecoveryActivated'), "passwordRecoveryActivated");
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $config->get_cfg_value('passwordRecoveryActivated'), "passwordRecoveryActivated");
return ($config->get_cfg_value('passwordRecoveryActivated') == "TRUE");
}
......@@ -341,7 +341,7 @@ class passwordRecovery extends standAlonePage
$reinit_link .= '&login='.urlencode($this->login);
$reinit_link .= '&email_address='.urlencode($this->email_address);
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $reinit_link, 'Setting link to');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $reinit_link, 'Setting link to');
/* Send the mail */
$body = sprintf($this->mail_body, $this->login, $reinit_link);
......
......@@ -129,7 +129,7 @@ class standAlonePage
/* Parse configuration file */
$config = new config(CONFIG_DIR.'/'.CONFIG_FILE, $BASE_DIR);
session::set('DEBUGLEVEL', $config->get_cfg_value('debuglevel'));
@DEBUG(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, 'config');
logging::debug(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, 'config');
return $config;
}
......
......@@ -100,7 +100,7 @@ function __fusiondirectory_autoload ($class_name)
if (isset($class_mapping["$class_name"])) {
require_once($BASE_DIR.'/'.$class_mapping["$class_name"]);
} else {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $class_name, 'Could not load');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $class_name, 'Could not load');
if (isset($config) && is_object($config) &&
$config->get_cfg_value('displayerrors') == 'TRUE') {
list($trace, ) = html_trace();
......
......@@ -440,7 +440,7 @@ class management
// Handle actions (POSTs and GETs)
$action = $this->detectPostActions();
if (!empty($action['action'])) {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action, 'Action');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action, 'Action');
try {
$str = $this->handleAction($action);
if (!empty($str)) {
......@@ -670,7 +670,7 @@ class management
return;
} else {
if (!$cancel) {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Template applied!');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Template applied!');
}
del_lock($this->currentDn);
if (empty($this->currentDns)) {
......@@ -711,7 +711,7 @@ class management
// Open object
$this->openTabObject(objects::create($type));
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Create entry initiated');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Create entry initiated');
}
function newEntryTemplate (array $action)
......@@ -725,7 +725,7 @@ class management
// Open object
$this->openTabObject(objects::createTemplate($type));
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Create template entry initiated');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Create template entry initiated');
}
function newEntryFromTemplate (array $action)
......@@ -834,7 +834,7 @@ class management
// Open object
$this->openTabObject(objects::open($this->currentDn, $entry->getTemplatedType()));
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Edit entry initiated');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Edit entry initiated');
if (isset($action['subaction'])
&& ($this->handleSubAction($action) === FALSE)) {
trigger_error('Was not able to handle subaction: '.$action['subaction']);
......@@ -874,7 +874,7 @@ class management
msg_dialog::displayChecks($msgs);
return;
} else {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Entry saved');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Entry saved');
$this->remove_lock();
$this->closeDialogs();
}
......@@ -892,7 +892,7 @@ class management
if (count($msgs)) {
msg_dialog::displayChecks($msgs);
} else {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Modifications applied');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Modifications applied');
$this->tabObject->re_init();
/* Avoid applying the POST a second time */
$_POST = [];
......@@ -909,7 +909,7 @@ class management
$disallowed = [];
$this->currentDns = [];
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action['targets'], 'Entry deletion requested');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action['targets'], 'Entry deletion requested');
// Check permissons for each target
foreach ($action['targets'] as $dn) {
......@@ -973,7 +973,7 @@ class management
function removeConfirmed (array $action)
{
global $ui;
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Entry deletion confirmed');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Entry deletion confirmed');
foreach ($this->currentDns as $dn) {
$entry = $this->listing->getEntry($dn);
......@@ -1028,11 +1028,11 @@ class management
$entry = $this->listing->getEntry($dn);
if (($action['action'] == 'copy') && $entry->checkAcl('r')) {
$this->cpHandler->add_to_queue($dn, 'copy', $entry->getTemplatedType());
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Entry copied!');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Entry copied!');
}
if (($action['action'] == 'cut') && $entry->checkAcl('rd')) {
$this->cpHandler->add_to_queue($dn, 'cut', $entry->getTemplatedType());
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Entry cut!');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Entry cut!');
}
}
}
......@@ -1065,7 +1065,7 @@ class management
function createSnapshotDialog (array $action)
{
global $config, $ui;
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action['targets'], 'Snapshot creation initiated!');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action['targets'], 'Snapshot creation initiated!');
$this->currentDn = array_pop($action['targets']);
if (empty($this->currentDn)) {
......@@ -1102,7 +1102,7 @@ class management
}
if ($ui->allow_snapshot_restore($this->currentDn, $aclCategories, empty($action['targets']))) {
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Snapshot restoring initiated!');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Snapshot restoring initiated!');
$this->dialogObject = new SnapshotRestoreDialog($this->currentDn, $this, empty($action['targets']), $aclCategories);
} else {
msg_dialog::display(_('Permission'), sprintf(_('You are not allowed to restore a snapshot for %s.'), $this->currentDn),
......@@ -1192,7 +1192,7 @@ class management
$entry = $this->listing->getEntry($dn);
if ($entry->snapshotCreationAllowed()) {
$this->snapHandler->createSnapshot($dn, $description, $entry->type);
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snapshot created!');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snapshot created!');
} else {
msg_dialog::display(_('Permission'), sprintf(_('You are not allowed to restore a snapshot for %s.'), $dn),
ERROR_DIALOG);
......@@ -1209,7 +1209,7 @@ class management
global $ui;
if (!empty($dn) && $ui->allow_snapshot_restore($dn, $this->dialogObject->aclCategory, $this->dialogObject->global)) {
$dn = $this->snapHandler->restoreSnapshot($dn);
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snapshot restored');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snapshot restored');
$this->closeDialogs();
if ($dn !== FALSE) {
$this->listing->focusDn($dn);
......@@ -1237,7 +1237,7 @@ class management
global $ui;
if (!empty($dn) && $ui->allow_snapshot_delete($dn, $this->dialogObject->aclCategory)) {
$this->snapHandler->removeSnapshot($dn);
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snapshot deleted');
logging::debug(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snapshot deleted');
} else {