diff --git a/lam/lib/modules/main.inc b/lam/lib/modules/main.inc index e87f7f5d..2023b926 100644 --- a/lam/lib/modules/main.inc +++ b/lam/lib/modules/main.inc @@ -223,7 +223,7 @@ class main extends baseModule { if (count($table)!=0) $return[] = array ( 0 => array ( 'kind' => 'table', 'value' => $table ) ); // loop through all suffixes $rootsuffix = call_user_func(array($_SESSION['config'], 'get_' . ucfirst($_SESSION[$this->base]->type) . 'Suffix')); - foreach ($_SESSION[$_SESSION[$this->base]->ldap]->search_units($rootsuffix) as $suffix) { + foreach ($_SESSION['ldap']->search_units($rootsuffix) as $suffix) { if ($_SESSION[$this->base]->dn) { if ($_SESSION[$this->base]->dn == $suffix) $option_selected = $suffix; else $suffixes[] = $suffix; diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index 5753fcc8..76423e67 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -223,13 +223,13 @@ class posixAccount extends baseModule { function userPassword($newpassword=false) { if (is_string($newpassword)) { // Write new password - $this->attributes['userPassword'][0] = base64_encode($_SESSION[$_SESSION[$this->base]->ldap]->encrypt($newpassword)); + $this->attributes['userPassword'][0] = base64_encode($_SESSION['ldap']->encrypt($newpassword)); return 0; } else { if ($this->attributes['userPassword'][0]!='') { // Read existing password if set - return $_SESSION[$_SESSION[$this->base]->ldap]->decrypt(base64_decode($this->attributes['userPassword'][0])); + return $_SESSION['ldap']->decrypt(base64_decode($this->attributes['userPassword'][0])); } else return ''; } @@ -364,7 +364,7 @@ class posixAccount extends baseModule { // Add new memberships if (is_array($this->groups)) foreach ($this->groups as $group) { - $dn = $_SESSION[$_SESSION[$this->base]->ldap]->in_cache ($group, 'cn', 'group'); + $dn = $_SESSION['ldap']->in_cache ($group, 'cn', 'group'); $return[$dn]['add']['memberUid'][0] = $this->attributes['uid'][0]; } } @@ -664,7 +664,7 @@ class posixAccount extends baseModule { 1 => array ( 'kind' => 'input', 'name' => 'homeDirectory', 'type' => 'text', 'size' => '30', 'maxlength' => '255', 'value' => $this->attributes['homeDirectory'][0]), 2 => array ('kind' => 'help', 'value' => 'homeDirectory')); if (!$profile) { - if ($this->orig['homeDirectory']=='' && isset($_SESSION[$_SESSION[$this->base]->config]->scriptPath)) { + if ($this->orig['homeDirectory']=='' && isset($_SESSION['config']->scriptPath)) { $return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Create home directory') ), 1 => array ( 'kind' => 'input', 'name' => 'createhomedir', 'type' => 'checkbox', 'checked' => $this->createhomedir), 2 => array ('kind' => 'help', 'value' => 'createhomedir')); @@ -694,7 +694,7 @@ class posixAccount extends baseModule { } function display_html_delete($post) { - if ($_SESSION[$this->base]->type=='user' && isset($_SESSION[$_SESSION[$this->base]->config]->scriptPath)) { + if ($_SESSION[$this->base]->type=='user' && isset($_SESSION['config']->scriptPath)) { $return[] = array ( 0 => array ( 'kind' => 'text', 'text' => _('Delete home directory') ), 1 => array ( 'kind' => 'input', 'name' => 'deletehomedir', 'type' => 'checkbox'), 2 => array ('kind' => 'help', 'value' => 'deletehomedir')); diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc index 921d4aaa..e982e580 100644 --- a/lam/lib/modules/posixGroup.inc +++ b/lam/lib/modules/posixGroup.inc @@ -222,13 +222,13 @@ class posixGroup extends baseModule { function userPassword($newpassword=false) { if (is_string($newpassword)) { // Write new password - $this->attributes['userPassword'][0] = base64_encode($_SESSION[$_SESSION[$this->base]->ldap]->encrypt($newpassword)); + $this->attributes['userPassword'][0] = base64_encode($_SESSION['ldap']->encrypt($newpassword)); return 0; } else { if ($this->attributes['userPassword'][0]!='') { // Read existing password if set - return $_SESSION[$_SESSION[$this->base]->ldap]->decrypt(base64_decode($this->attributes['userPassword'][0])); + return $_SESSION['ldap']->decrypt(base64_decode($this->attributes['userPassword'][0])); } else return ''; } @@ -358,8 +358,8 @@ class posixGroup extends baseModule { if ($this->changegids) { // get gidNumber $line=-1; - for ($i=0; $ildap]->objectClasses) || $i==-1; $i++) { - if (strpos($_SESSION[$this->ldap]->objectClasses[$i], "NAME 'posixAccount'")) $line = $i; + for ($i=0; $iobjectClasses) || $i==-1; $i++) { + if (strpos($_SESSION['ldap']->objectClasses[$i], "NAME 'posixAccount'")) $line = $i; } if ($line!=-1) { $result = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('gidNumber', 'posixAccount', '*'); @@ -369,8 +369,8 @@ class posixGroup extends baseModule { } // change primaryGroupID $line=-1; - for ($i=0; $ildap]->objectClasses) || $i==-1; $i++) { - if (strpos($_SESSION[$this->ldap]->objectClasses[$i], "NAME 'sambaAccount'")) $line = $i; + for ($i=0; $iobjectClasses) || $i==-1; $i++) { + if (strpos($_SESSION['ldap']->objectClasses[$i], "NAME 'sambaAccount'")) $line = $i; } if ($line!=-1) { $result = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('primaryGroupID', 'sambaAccount', '*'); @@ -381,15 +381,15 @@ class posixGroup extends baseModule { } // change sambaPrimaryGroupSID $line=-1; - for ($i=0; $ildap]->objectClasses) || $i==-1; $i++) { - if (strpos($_SESSION[$this->ldap]->objectClasses[$i], "NAME 'sambaSamAccount'")) $line = $i; + for ($i=0; $iobjectClasses) || $i==-1; $i++) { + if (strpos($_SESSION['ldap']->objectClasses[$i], "NAME 'sambaSamAccount'")) $line = $i; } if ($line!=-1) { $result = $_SESSION[$_SESSION[$this->base]->cache]->get_cache('sambaPrimaryGroupSID', 'sambaSamAccount', '*'); $DNs = array_keys($result); for ($i=0; $ibase]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); + $sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); // Get Domain-SID from group SID $domainSID = substr($result[$DNs[$i]], 0, strrpos($result[$DNs[$i]], "-")); for ($i=0; $ibase]->config]->scriptPath)) return $false; + if (!isset($_SESSION['config']->scriptPath)) return $false; if ($_SESSION[$this->base]->type=='user' && $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0]=='') return false; if ($_SESSION[$this->base]->type=='group' && $_SESSION[$this->base]->module['posixGroup']->attributes['cn'][0]=='') return false; return true; diff --git a/lam/lib/modules/sambaAccount.inc b/lam/lib/modules/sambaAccount.inc index f24c3969..4acd54e4 100644 --- a/lam/lib/modules/sambaAccount.inc +++ b/lam/lib/modules/sambaAccount.inc @@ -236,14 +236,14 @@ class sambaAccount extends baseModule { function lmPassword($newpassword=false) { if (is_string($newpassword)) { // Write new password - $this->attributes['lmPassword'][0] = base64_encode($_SESSION[$_SESSION[$this->base]->ldap]->encrypt($newpassword)); + $this->attributes['lmPassword'][0] = base64_encode($_SESSION['ldap']->encrypt($newpassword)); return 0; } else { if ($this->useunixpwd) return $_SESSION[$this->base]->module['posixAccount']->userPassword(); if ($this->attributes['lmPassword'][0]!='') { // Read existing password if set - return $_SESSION[$_SESSION[$this->base]->ldap]->decrypt(base64_decode($this->attributes['lmPassword'][0])); + return $_SESSION['ldap']->decrypt(base64_decode($this->attributes['lmPassword'][0])); } else return ''; } diff --git a/lam/lib/modules/sambaGroupMapping.inc b/lam/lib/modules/sambaGroupMapping.inc index f9e7ed80..ea4235df 100644 --- a/lam/lib/modules/sambaGroupMapping.inc +++ b/lam/lib/modules/sambaGroupMapping.inc @@ -207,7 +207,7 @@ class sambaGroupMapping extends baseModule { */ function save_attributes() { // Get Domain SID from name - $sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); + $sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); // Get Domain-SID from group SID $domainSID = substr($this->attributes['sambaSID'][0], 0, strrpos($this->attributes['sambaSID'][0], "-")); for ($i=0; $ibase]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); + $sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); for ($i=0; $iname) { $SID = $sambaDomains[$i]->SID; @@ -277,7 +277,7 @@ class sambaGroupMapping extends baseModule { */ function display_html_attributes($post, $profile=false) { // Get Domain SID from name - $sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); + $sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); // Get Domain-SID from group SID $domainSID = substr($this->attributes['sambaSID'][0], 0, strrpos($this->attributes['sambaSID'][0], "-")); for ($i=0; $iattributes['sambaLMPassword'][0] = base64_encode($_SESSION[$_SESSION[$this->base]->ldap]->encrypt($newpassword)); + $this->attributes['sambaLMPassword'][0] = base64_encode($_SESSION['ldap']->encrypt($newpassword)); return 0; } else { if ($this->useunixpwd) return $_SESSION[$this->base]->module['posixAccount']->userPassword(); if ($this->attributes['sambaLMPassword'][0]!='') { // Read existing password if set - return $_SESSION[$_SESSION[$this->base]->ldap]->decrypt(base64_decode($this->attributes['sambaLMPassword'][0])); + return $_SESSION['ldap']->decrypt(base64_decode($this->attributes['sambaLMPassword'][0])); } else return ''; } @@ -268,7 +268,7 @@ class sambaSamAccount extends baseModule { * it's psssible uidNumber has changed */ // Get Domain SID from name - $sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); + $sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); for ($i=0; $iattributes['sambaDomainName'][0] == $sambaDomains[$i]->name) { $SID = $sambaDomains[$i]->SID; @@ -315,7 +315,7 @@ class sambaSamAccount extends baseModule { // Load attributes $this->attributes['sambaDomainName'][0] = $post['sambaDomainName']; // Get Domain SID from name - $sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); + $sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); for ($i=0; $iattributes['sambaDomainName'][0] == $sambaDomains[$i]->name) { $SID = $sambaDomains[$i]->SID; @@ -485,7 +485,7 @@ class sambaSamAccount extends baseModule { */ function display_html_attributes($post, $profile=false) { // Get Domain SID from name - $sambaDomains = $_SESSION[$_SESSION[$this->base]->ldap]->search_domains($_SESSION[$_SESSION[$this->base]->config]->get_domainSuffix()); + $sambaDomains = $_SESSION['ldap']->search_domains($_SESSION['config']->get_domainSuffix()); for ($i=0; $iname; if ($this->attributes['sambaDomainName'][0] == $sambaDomains[$i]->name)