Commit d7c94fc4 authored by Benoit Mortier's avatar Benoit Mortier
Browse files

Fixes: #2595 Cleaning some code

parent d8041a76
...@@ -83,8 +83,8 @@ class baseSelector { ...@@ -83,8 +83,8 @@ class baseSelector {
function setBase($base) function setBase($base)
{ {
if (isset($this->pathMapping[$base])) { if (isset($this->pathMapping[$base])) {
$this->base = $base; $this->base = $base;
$this->lastState = TRUE; $this->lastState = TRUE;
return $this->update(TRUE); return $this->update(TRUE);
} else { } else {
$this->lastState = FALSE; $this->lastState = FALSE;
...@@ -124,17 +124,14 @@ class baseSelector { ...@@ -124,17 +124,14 @@ class baseSelector {
global $config; global $config;
$this->pathMapping = array(); $this->pathMapping = array();
$selected = ($this->base == $config->current['BASE']?"Selected":""); $selected = ($this->base == $config->current['BASE']);
$first = TRUE;
$last_indent = 2;
foreach ($bases as $base => $dummy) { foreach ($bases as $base => $dummy) {
// Build path style display // Build path style display
$elements = explode(',', substr($base, 0, strlen($base) - strlen($config->current['BASE']))); $elements = explode(',', substr($base, 0, strlen($base) - strlen($config->current['BASE'])));
$elements = array_reverse($elements, TRUE); $elements = array_reverse($elements, TRUE);
$this->pathMapping[$base] = ($base == $config->current['BASE']? '/' : ldap::fix(preg_replace('/(^|,)[a-z0-9]+=/i', '/', implode(',', $elements)))); $this->pathMapping[$base] = ($selected? '/' : ldap::fix(preg_replace('/(^|,)[a-z0-9]+=/i', '/', implode(',', $elements))));
} }
// Save bases to session for autocompletion // Save bases to session for autocompletion
......
<?php <?php
/* /*
This code is part of FusionDirectory (http://www.fusiondirectory.org/) This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier Copyright (C) 2003-2010 Cajus Pollmeier
...@@ -30,7 +29,6 @@ ...@@ -30,7 +29,6 @@
*/ */
class filter class filter
{ {
var $xmlData; var $xmlData;
var $elements = array(); var $elements = array();
var $elementValues = array(); var $elementValues = array();
...@@ -55,8 +53,6 @@ class filter ...@@ -55,8 +53,6 @@ class filter
*/ */
function filter($filename) function filter($filename)
{ {
global $config;
// Load eventually passed filename // Load eventually passed filename
if (!$this->load($filename)) { if (!$this->load($filename)) {
die("Cannot parse $filename!"); die("Cannot parse $filename!");
...@@ -629,7 +625,6 @@ class filter ...@@ -629,7 +625,6 @@ class filter
*/ */
function processAutocomplete() function processAutocomplete()
{ {
global $class_mapping;
$result = array(); $result = array();
// Introduce maximum number of entries // Introduce maximum number of entries
......
...@@ -34,8 +34,8 @@ define("SPECIALS_OVERRIDE", TRUE); ...@@ -34,8 +34,8 @@ define("SPECIALS_OVERRIDE", TRUE);
* ldap operations easy * ldap operations easy
*/ */
class LDAP{ class LDAP
{
var $hascon = FALSE; var $hascon = FALSE;
var $reconnect = FALSE; var $reconnect = FALSE;
var $tls = FALSE; var $tls = FALSE;
...@@ -1073,7 +1073,6 @@ class LDAP{ ...@@ -1073,7 +1073,6 @@ class LDAP{
$admin = escapeshellarg($this->binddn); $admin = escapeshellarg($this->binddn);
$filter = escapeshellarg($filter); $filter = escapeshellarg($filter);
$cmd = "ldapsearch -x -LLLL -D {$admin} {$filter} {$limit} {$scope} -H {$host} -b {$dn} -w {$pwd} "; $cmd = "ldapsearch -x -LLLL -D {$admin} {$filter} {$limit} {$scope} -H {$host} -b {$dn} -w {$pwd} ";
// Create list of process pipes // Create list of process pipes
...@@ -1248,8 +1247,9 @@ class LDAP{ ...@@ -1248,8 +1247,9 @@ class LDAP{
trigger_error("Can't import ldif, can't read config object."); trigger_error("Can't import ldif, can't read config object.");
} }
if ($this->reconnect) {
if ($this->reconnect) $this->connect(); $this->connect();
}
$ret = FALSE; $ret = FALSE;
$rows = preg_split("/\n/", $str_attr); $rows = preg_split("/\n/", $str_attr);
...@@ -1520,7 +1520,7 @@ class LDAP{ ...@@ -1520,7 +1520,7 @@ class LDAP{
die ("Can't bind to LDAP. No check possible!"); die ("Can't bind to LDAP. No check possible!");
} }
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
$r = ldap_bind ($ds, $admin, $password); ldap_bind ($ds, $admin, $password);
/* Get base to look for naming contexts */ /* Get base to look for naming contexts */
$sr = @ldap_read ($ds, "", "objectClass=*", array("+")); $sr = @ldap_read ($ds, "", "objectClass=*", array("+"));
...@@ -1538,7 +1538,7 @@ class LDAP{ ...@@ -1538,7 +1538,7 @@ class LDAP{
die ("Can't bind to LDAP. No check possible!"); die ("Can't bind to LDAP. No check possible!");
} }
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
$r = ldap_bind ($ds, $admin, $password); ldap_bind ($ds, $admin, $password);
/* Get base to look for naming contexts */ /* Get base to look for naming contexts */
$sr = @ldap_read ($ds, "", "objectClass=*", array("+")); $sr = @ldap_read ($ds, "", "objectClass=*", array("+"));
......
...@@ -396,8 +396,7 @@ class management ...@@ -396,8 +396,7 @@ class management
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $target, "Entry removel confirmed!"); @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $target, "Entry removel confirmed!");
foreach ($this->dns as $key => $dn) { foreach ($this->dns as $dn) {
// Check permissions, are we allowed to remove this object? // Check permissions, are we allowed to remove this object?
$acl = $this->ui->get_permissions($dn, $aclCategory."/".$this->aclPlugin); $acl = $this->ui->get_permissions($dn, $aclCategory."/".$this->aclPlugin);
if (preg_match("/d/", $acl)) { if (preg_match("/d/", $acl)) {
...@@ -758,7 +757,7 @@ class management ...@@ -758,7 +757,7 @@ class management
$msgs = $this->tabObject->check(); $msgs = $this->tabObject->check();
if (count($msgs)) { if (count($msgs)) {
msg_dialog::displayChecks($msgs); msg_dialog::displayChecks($msgs);
return ""; return;
} else { } else {
$this->tabObject->save(); $this->tabObject->save();
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dns, "Entry saved!"); @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dns, "Entry saved!");
...@@ -770,7 +769,7 @@ class management ...@@ -770,7 +769,7 @@ class management
$msgs = $this->dialogObject->check(); $msgs = $this->dialogObject->check();
if (count($msgs)) { if (count($msgs)) {
msg_dialog::displayChecks($msgs); msg_dialog::displayChecks($msgs);
return ""; return;
} else { } else {
$this->dialogObject->save(); $this->dialogObject->save();
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dns, "Entry saved!"); @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dns, "Entry saved!");
......
...@@ -41,8 +41,6 @@ class objects ...@@ -41,8 +41,6 @@ class objects
*/ */
static function ls ($type, $attrs = NULL, $ou = NULL, $filter = '') static function ls ($type, $attrs = NULL, $ou = NULL, $filter = '')
{ {
global $config;
if ($attrs === NULL) { if ($attrs === NULL) {
$infos = self::infos($type); $infos = self::infos($type);
$attrs = $infos['mainAttr']; $attrs = $infos['mainAttr'];
...@@ -95,8 +93,6 @@ class objects ...@@ -95,8 +93,6 @@ class objects
*/ */
static function count ($type, $ou = NULL, $filter = '') static function count ($type, $ou = NULL, $filter = '')
{ {
global $config;
try { try {
$ldap = self::search($type, array('dn'), $ou, $filter); $ldap = self::search($type, array('dn'), $ou, $filter);
} catch (EmptyFilterException $e) { } catch (EmptyFilterException $e) {
...@@ -229,8 +225,6 @@ class objects ...@@ -229,8 +225,6 @@ class objects
static function isOfType ($attrs, $type) static function isOfType ($attrs, $type)
{ {
global $config;
//TODO : cache ldapFilter objects? //TODO : cache ldapFilter objects?
$infos = self::infos($type); $infos = self::infos($type);
$filter = ldapFilter::parse($infos['filter']); $filter = ldapFilter::parse($infos['filter']);
......
...@@ -106,9 +106,6 @@ class xml { ...@@ -106,9 +106,6 @@ class xml {
//Initializations //Initializations
$xml_array = array(); $xml_array = array();
$parents = array();
$opened_tags = array();
$arr = array();
$current = &$xml_array; //Refference $current = &$xml_array; //Refference
......
...@@ -734,7 +734,6 @@ function add_lock($object, $user) ...@@ -734,7 +734,6 @@ function add_lock($object, $user)
unset($cache['READ_ONLY'][$object]); unset($cache['READ_ONLY'][$object]);
} }
/* Just a sanity check... */ /* Just a sanity check... */
if ($object == "" || $user == "") { if ($object == "" || $user == "") {
msg_dialog::display(_("Internal error"), _("Error while adding a lock. Contact the developers!"), ERROR_DIALOG); msg_dialog::display(_("Internal error"), _("Error while adding a lock. Contact the developers!"), ERROR_DIALOG);
...@@ -1342,7 +1341,6 @@ function convert_department_dn($dn, $base = NULL) ...@@ -1342,7 +1341,6 @@ function convert_department_dn($dn, $base = NULL)
return "/"; return "/";
} }
$dep = ""; $dep = "";
foreach (explode(',', $dn) as $rdn) { foreach (explode(',', $dn) as $rdn) {
$dep = preg_replace("/^[^=]+=/", "", $rdn)."/".$dep; $dep = preg_replace("/^[^=]+=/", "", $rdn)."/".$dep;
...@@ -1873,7 +1871,6 @@ function range_selector($dcnt, $start, $range = 25, $post_var = FALSE) ...@@ -1873,7 +1871,6 @@ function range_selector($dcnt, $start, $range = 25, $post_var = FALSE)
} }
$ppage = (int)(($start / $range) + 0.5); $ppage = (int)(($start / $range) + 0.5);
/* Align selected page to +/- max_entries/2 */ /* Align selected page to +/- max_entries/2 */
$begin = $ppage - $max_entries / 2; $begin = $ppage - $max_entries / 2;
$end = $ppage + $max_entries / 2; $end = $ppage + $max_entries / 2;
...@@ -3098,13 +3095,14 @@ function generate_smb_nt_hash($password) ...@@ -3098,13 +3095,14 @@ function generate_smb_nt_hash($password)
/* Lock or unlock samba account */ /* Lock or unlock samba account */
function lock_samba_account($mode, $attrs) function lock_samba_account($mode, $attrs)
{ {
global $config;
$modify = array('sambaNTPassword' => $attrs['sambaNTPassword'][0]); $modify = array('sambaNTPassword' => $attrs['sambaNTPassword'][0]);
if ($config->get_cfg_value("sambaGenLMPassword", "FALSE") == "TRUE") { if ($config->get_cfg_value("sambaGenLMPassword", "FALSE") == "TRUE") {
$modify['sambaLMPassword'] = $attrs['sambaLMPassword'][0]; $modify['sambaLMPassword'] = $attrs['sambaLMPassword'][0];
} else { } else {
$modify['sambaLMPassword'] = array(); $modify['sambaLMPassword'] = array();
} }
foreach ($modify as $key => &$pwd) { foreach ($modify as &$pwd) {
if (is_array($pwd)) { if (is_array($pwd)) {
continue; continue;
} }
...@@ -3118,7 +3116,7 @@ function lock_samba_account($mode, $attrs) ...@@ -3118,7 +3116,7 @@ function lock_samba_account($mode, $attrs)
$pwd = preg_replace("/^\!/", "", $pwd); $pwd = preg_replace("/^\!/", "", $pwd);
} }
} }
unset($value); unset($pwd);
return $modify; return $modify;
} }
...@@ -3659,7 +3657,8 @@ function fix_dos_linebreaks($str) ...@@ -3659,7 +3657,8 @@ function fix_dos_linebreaks($str)
return preg_replace('/\\r\\n/', "\n", $str); return preg_replace('/\\r\\n/', "\n", $str);
} }
function load_all_classes() { function load_all_classes()
{
global $BASE_DIR, $class_list, $class_mapping; global $BASE_DIR, $class_list, $class_mapping;
/* Initially load all classes */ /* Initially load all classes */
$class_list = get_declared_classes(); $class_list = get_declared_classes();
......
...@@ -56,9 +56,9 @@ class Step_Checks extends setup_step ...@@ -56,9 +56,9 @@ class Step_Checks extends setup_step
/* Execute all checks */ /* Execute all checks */
function run_checks() function run_checks()
{ {
$this->basic_checks = array(); $this->basic_checks = array();
$this->config_checks = array(); $this->config_checks = array();
$this->is_writeable = array(); $this->is_writeable = array();
/* PHP version check */ /* PHP version check */
$N = _("Checking PHP version"); $N = _("Checking PHP version");
...@@ -157,7 +157,6 @@ class Step_Checks extends setup_step ...@@ -157,7 +157,6 @@ class Step_Checks extends setup_step
$M = FALSE; $M = FALSE;
$this->basic_checks[] = array("NAME" => $N , "DESC" => $D , "RESULT" => $R , "SOLUTION" => $S , "MUST" => $M ); $this->basic_checks[] = array("NAME" => $N , "DESC" => $D , "RESULT" => $R , "SOLUTION" => $S , "MUST" => $M );
/* PHP Configuration checks */ /* PHP Configuration checks */
/* Register_globals off */ /* Register_globals off */
...@@ -168,7 +167,6 @@ class Step_Checks extends setup_step ...@@ -168,7 +167,6 @@ class Step_Checks extends setup_step
$M = FALSE; $M = FALSE;
$this->config_checks[] = array("NAME" => $N , "DESC" => $D , "RESULT" => $R , "SOLUTION" => $S , "MUST" => $M ); $this->config_checks[] = array("NAME" => $N , "DESC" => $D , "RESULT" => $R , "SOLUTION" => $S , "MUST" => $M );
/* session lifetime set to >=86400 seconds ? */ /* session lifetime set to >=86400 seconds ? */
$N = "session.gc_maxlifetime &gt;= <b>86400</b>"; $N = "session.gc_maxlifetime &gt;= <b>86400</b>";
$D = _("PHP uses this value for the garbage collector to delete old sessions.")." ". $D = _("PHP uses this value for the garbage collector to delete old sessions.")." ".
...@@ -227,9 +225,7 @@ class Step_Checks extends setup_step ...@@ -227,9 +225,7 @@ class Step_Checks extends setup_step
$M = FALSE; $M = FALSE;
$this->config_checks[] = array("NAME" => $N , "DESC" => $D , "RESULT" => $R , "SOLUTION" => $S , "MUST" => $M ); $this->config_checks[] = array("NAME" => $N , "DESC" => $D , "RESULT" => $R , "SOLUTION" => $S , "MUST" => $M );
/* Configuration file */
/* Configuration file
*/
/* Check if we can create a config file.*/ /* Check if we can create a config file.*/
$N = _("Configuration writeable"); $N = _("Configuration writeable");
...@@ -240,7 +236,6 @@ class Step_Checks extends setup_step ...@@ -240,7 +236,6 @@ class Step_Checks extends setup_step
|| (!file_exists(CONFIG_DIR."/".CONFIG_FILE) && is_writeable(CONFIG_DIR)); || (!file_exists(CONFIG_DIR."/".CONFIG_FILE) && is_writeable(CONFIG_DIR));
$M = FALSE; $M = FALSE;
$this->is_writeable[] = array("NAME" => $N , "DESC" => $D , "RESULT" => $R , "SOLUTION" => $S , "MUST" => $M ); $this->is_writeable[] = array("NAME" => $N , "DESC" => $D , "RESULT" => $R , "SOLUTION" => $S , "MUST" => $M );
} }
......
...@@ -163,7 +163,6 @@ class Step_Config3 extends setup_step ...@@ -163,7 +163,6 @@ class Step_Config3 extends setup_step
function save_config_in_ldap () function save_config_in_ldap ()
{ {
global $BASE_DIR;
$cv = $this->parent->captured_values; $cv = $this->parent->captured_values;
$attrs = array( $attrs = array(
......
...@@ -77,7 +77,8 @@ class Step_Finish extends setup_step ...@@ -77,7 +77,8 @@ class Step_Finish extends setup_step
function execute() function execute()
{ {
global $config, $BASE_DIR; global $BASE_DIR;
if (!function_exists("posix_getgrgid")) { if (!function_exists("posix_getgrgid")) {
$webgroup = ""; $webgroup = "";
} else { } else {
...@@ -94,7 +95,7 @@ class Step_Finish extends setup_step ...@@ -94,7 +95,7 @@ class Step_Finish extends setup_step
* - Permisssion are set correctly * - Permisssion are set correctly
*/ */
if(isset($_POST['next']) && $exists && !$this->is_world_readable(CONFIG_DIR."/".CONFIG_FILE)){ if (isset($_POST['next']) && $exists && !$this->is_world_readable(CONFIG_DIR."/".CONFIG_FILE)) {
$this->insertConfigDefaults(); $this->insertConfigDefaults();
session::destroy(); session::destroy();
header("Location: index.php"); header("Location: index.php");
...@@ -110,13 +111,13 @@ class Step_Finish extends setup_step ...@@ -110,13 +111,13 @@ class Step_Finish extends setup_step
if ($exists && $this->is_world_readable(CONFIG_DIR."/".CONFIG_FILE)) { if ($exists && $this->is_world_readable(CONFIG_DIR."/".CONFIG_FILE)) {
$err_msg = _("Your configuration file is currently world readable. Please update the file permissions!"); $err_msg = _("Your configuration file is currently world readable. Please update the file permissions!");
} elseif(!$exists) { } elseif (!$exists) {
$err_msg = _("The configuration is currently not readable or it does not exists."); $err_msg = _("The configuration is currently not readable or it does not exists.");
} }
$smarty = get_smarty(); $smarty = get_smarty();
$smarty->assign("err_msg", $err_msg); $smarty->assign("err_msg", $err_msg);
$smarty->assign("msg2", sprintf(_("After downloading and placing the file under %s, please make sure that the user the webserver is running with is able to read %s, while other users shouldn't."),CONFIG_DIR,CONFIG_FILE)); $smarty->assign("msg2", sprintf(_("After downloading and placing the file under %s, please make sure that the user the webserver is running with is able to read %s, while other users shouldn't."), CONFIG_DIR, CONFIG_FILE));
$smarty->assign("cv", $this->parent->captured_values); $smarty->assign("cv", $this->parent->captured_values);
return $smarty->fetch("$BASE_DIR/setup/setup_finish.tpl"); return $smarty->fetch("$BASE_DIR/setup/setup_finish.tpl");
......
...@@ -112,7 +112,7 @@ class Step_Migrate extends setup_step ...@@ -112,7 +112,7 @@ class Step_Migrate extends setup_step
/* One valid admin dn */ /* One valid admin dn */
var $valid_admin = FALSE; var $valid_admin = FALSE;
function Step_Migrate() function __construct()
{ {
$this->update_strings(); $this->update_strings();
} }
...@@ -554,7 +554,6 @@ class Step_Migrate extends setup_step ...@@ -554,7 +554,6 @@ class Step_Migrate extends setup_step
$this->show_details = $only_ldif; $this->show_details = $only_ldif;
/* Establish ldap connection */ /* Establish ldap connection */
$cv = $this->parent->captured_values;
$ldap = $this->get_ldap_link(); $ldap = $this->get_ldap_link();
/* Add gosaAccount objectClass to the selected users */ /* Add gosaAccount objectClass to the selected users */
...@@ -679,7 +678,6 @@ class Step_Migrate extends setup_step ...@@ -679,7 +678,6 @@ class Step_Migrate extends setup_step
$this->show_details = $only_ldif; $this->show_details = $only_ldif;
/* Establish ldap connection */ /* Establish ldap connection */
$cv = $this->parent->captured_values;
$ldap = $this->get_ldap_link(); $ldap = $this->get_ldap_link();
/* Add gosaDepartment objectClass to each selected entry */ /* Add gosaDepartment objectClass to each selected entry */
...@@ -785,7 +783,7 @@ class Step_Migrate extends setup_step ...@@ -785,7 +783,7 @@ class Step_Migrate extends setup_step
$valid_admin = $member; $valid_admin = $member;
} }
$valid_users .= $users[$member].", "; $valid_users .= $users[$member].", ";
$FD_1_0_8_found = TRUE; $FD_1_0_8_found = TRUE;
} }
if (isset($groups[$member])) { if (isset($groups[$member])) {
$ldap->cat($member); $ldap->cat($member);
...@@ -832,7 +830,7 @@ class Step_Migrate extends setup_step ...@@ -832,7 +830,7 @@ class Step_Migrate extends setup_step
$valid_admin = $member; $valid_admin = $member;
} }
$valid_users .= $users[$member].", "; $valid_users .= $users[$member].", ";
$FD_1_0_7_found = TRUE; $FD_1_0_7_found = TRUE;
} }
} }
if (isset($groups[$member])) { if (isset($groups[$member])) {
...@@ -878,7 +876,7 @@ class Step_Migrate extends setup_step ...@@ -878,7 +876,7 @@ class Step_Migrate extends setup_step
$valid_admin = $member; $valid_admin = $member;
} }
$valid_users .= $users[$member].", "; $valid_users .= $users[$member].", ";
$FD_1_0_7_found = TRUE; $FD_1_0_7_found = TRUE;
} }
if (isset($groups[$member])) { if (isset($groups[$member])) {
$ldap->cat($member); $ldap->cat($member);
...@@ -963,12 +961,11 @@ class Step_Migrate extends setup_step ...@@ -963,12 +961,11 @@ class Step_Migrate extends setup_step
if ($attrs = $ldap->fetch()) { if ($attrs = $ldap->fetch()) {
$roledn = $attrs['dn']; $roledn = $attrs['dn'];
} else { } else {
$roledn = 'cn=admin,'.get_ou(aclRoleRDN).$cv['base']; $roledn = 'cn=admin,'.get_ou('aclRoleRDN').$cv['base'];
if ($only_ldif) { if (!$only_ldif) {
} else {
$ldap->create_missing_trees($roledn); $ldap->create_missing_trees($roledn);
$ldap->cd($roledn); $ldap->cd($roledn);
$attrs_role = array( $attrs_role = array(
'cn' => 'admin', 'cn' => 'admin',
'objectclass' => array( 'top', 'gosaRole' ), 'objectclass' => array( 'top', 'gosaRole' ),
'gosaAclTemplate' => '0:all;cmdrw' 'gosaAclTemplate' => '0:all;cmdrw'
...@@ -1992,7 +1989,6 @@ class Step_Migrate extends setup_step ...@@ -1992,7 +1989,6 @@ class Step_Migrate extends setup_step
function move($source, $destination) function move($source, $destination)
{ {
/* Establish ldap connection */ /* Establish ldap connection */
$cv = $this->parent->captured_values;
$ldap = $this->get_ldap_link(); $ldap = $this->get_ldap_link();
/* Update object references in gosaGroupOfNames */ /* Update object references in gosaGroupOfNames */
...@@ -2304,7 +2300,6 @@ class Step_Migrate extends setup_step ...@@ -2304,7 +2300,6 @@ class Step_Migrate extends setup_step
function migrate_services() function migrate_services()
{ {
/* Establish ldap connection */ /* Establish ldap connection */
$cv = $this->parent->captured_values;
$ldap = $this->get_ldap_link(); $ldap = $this->get_ldap_link