substituted base->ldap/config with 'ldap'/'config'

This commit is contained in:
Roland Gruber 2004-09-12 10:27:14 +00:00
parent 32e319da6a
commit 7e9befcd6f
7 changed files with 26 additions and 26 deletions

View File

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

View File

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

View File

@ -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; $i<count($_SESSION[$this->ldap]->objectClasses) || $i==-1; $i++) {
if (strpos($_SESSION[$this->ldap]->objectClasses[$i], "NAME 'posixAccount'")) $line = $i;
for ($i=0; $i<count($_SESSION['ldap']->objectClasses) || $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; $i<count($_SESSION[$this->ldap]->objectClasses) || $i==-1; $i++) {
if (strpos($_SESSION[$this->ldap]->objectClasses[$i], "NAME 'sambaAccount'")) $line = $i;
for ($i=0; $i<count($_SESSION['ldap']->objectClasses) || $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; $i<count($_SESSION[$this->ldap]->objectClasses) || $i==-1; $i++) {
if (strpos($_SESSION[$this->ldap]->objectClasses[$i], "NAME 'sambaSamAccount'")) $line = $i;
for ($i=0; $i<count($_SESSION['ldap']->objectClasses) || $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; $i<count($DNs); $i++) {
// 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($result[$DNs[$i]], 0, strrpos($result[$DNs[$i]], "-"));
for ($i=0; $i<count($sambaDomains); $i++ )

View File

@ -105,7 +105,7 @@ class quota extends baseModule {
function module_ready() {
if (!isset($_SESSION[$_SESSION[$this->base]->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;

View File

@ -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 '';
}

View File

@ -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; $i<count($sambaDomains); $i++ )
@ -240,7 +240,7 @@ class sambaGroupMapping extends baseModule {
if (!$profile) {
// 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; $i<count($sambaDomains); $i++ )
if ($post['sambaDomainName'] == $sambaDomains[$i]->name) {
$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; $i<count($sambaDomains); $i++ ) {

View File

@ -168,14 +168,14 @@ class sambaSamAccount extends baseModule {
function sambaLMPassword($newpassword=false) {
if (is_string($newpassword)) {
// Write new password
$this->attributes['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; $i<count($sambaDomains); $i++ )
if ($this->attributes['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; $i<count($sambaDomains); $i++ )
if ($this->attributes['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; $i<count($sambaDomains); $i++ ) {
$sambaDomainNames[] = $sambaDomains[$i]->name;
if ($this->attributes['sambaDomainName'][0] == $sambaDomains[$i]->name)