From b29106b78350cd875f820ee76954239861e7b7f6 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 16 Apr 2005 13:41:17 +0000 Subject: [PATCH] replaced load_ldap_attributes with parent class function call --- lam/lib/baseModule.inc | 8 ++++++-- lam/lib/modules/account.inc | 8 -------- lam/lib/modules/inetOrgPerson.inc | 10 ---------- lam/lib/modules/posixAccount.inc | 2 +- lam/lib/modules/posixGroup.inc | 2 +- lam/lib/modules/sambaAccount.inc | 2 +- lam/lib/modules/sambaGroupMapping.inc | 9 --------- lam/lib/modules/sambaSamAccount.inc | 2 +- lam/lib/modules/shadowAccount.inc | 2 +- 9 files changed, 11 insertions(+), 34 deletions(-) diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc index f57838cf..0c23fb9c 100644 --- a/lam/lib/baseModule.inc +++ b/lam/lib/baseModule.inc @@ -100,10 +100,13 @@ class baseModule { } - /* This function loads all standard ldap attributes. It is used + /** + * This function loads all standard LDAP attributes. It is used * by the modules to reduce code + * + * @param array $attr attribute list */ - function load_ldap_attributes($attr) { + function load_attributes($attr) { // Load attributes which are displayed $objectClassName = $this->attributes['objectClass']; // unset count entries @@ -124,6 +127,7 @@ class baseModule { if (in_array($objectClassName[0], $attr['objectClass'])) $this->orig['objectClass'] = $objectClassName; else $this->orig['objectClass'] = array(); + return 0; } /** diff --git a/lam/lib/modules/account.inc b/lam/lib/modules/account.inc index 857b7d68..23015bcc 100644 --- a/lam/lib/modules/account.inc +++ b/lam/lib/modules/account.inc @@ -114,14 +114,6 @@ class account extends baseModule { return array('attributes'); } - /* This function loads all attributes into the object - * $attr is an array as it's retured from ldap_get_attributes - */ - function load_attributes($attr) { - $this->load_ldap_attributes($attr); - return 0; - } - /* This function returns an array with 4 entries: * array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr), 'lamdaemon' => array(cmds)), DN2 .... ) * DN is the DN to change. It may be possible to change several DNs, diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index 72f08162..4f809717 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -314,16 +314,6 @@ class inetOrgPerson extends baseModule { return array('attributes'); } - /* This function loads all attributes into the object - * $attr is an array as it's retured from ldap_get_attributes - */ - function load_attributes($attr) { - $this->load_ldap_attributes($attr); - return 0; - } - - - /* This function returns an array with 4 entries: * array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr), 'lamdaemon' => array(cmds)), DN2 .... ) * DN is the DN to change. It may be possible to change several DNs, diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index be26125e..abd76ea6 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -431,7 +431,7 @@ class posixAccount extends baseModule { * $attr is an array as it's retured from ldap_get_attributes */ function load_attributes($attr) { - $this->load_ldap_attributes($attr); + parent::load_attributes($attr); // get all additional groupmemberships $dn_groups = $_SESSION['cache']->get_cache('memberUid', 'posixGroup', 'group'); diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc index ac43a9d6..347f0d0c 100644 --- a/lam/lib/modules/posixGroup.inc +++ b/lam/lib/modules/posixGroup.inc @@ -398,7 +398,7 @@ class posixGroup extends baseModule { * $attr is an array as it's retured from ldap_get_attributes */ function load_attributes($attr) { - $this->load_ldap_attributes($attr); + parent::load_attributes($attr); // Delete password. We don't want to show an encrypted password because it makes no sense $this->userPassword(''); return 0; diff --git a/lam/lib/modules/sambaAccount.inc b/lam/lib/modules/sambaAccount.inc index f57635b3..9ed5ff11 100644 --- a/lam/lib/modules/sambaAccount.inc +++ b/lam/lib/modules/sambaAccount.inc @@ -471,7 +471,7 @@ class sambaAccount extends baseModule { * $attr is an array as it's retured from ldap_get_attributes */ function load_attributes($attr) { - $this->load_ldap_attributes($attr); + parent::load_attributes($attr); if (strpos($this->attributes['acctFlags'][0], "D")) $this->deactivated = true; if (strpos($this->attributes['acctFlags'][0], "N")) $this->nopwd = true; if (strpos($this->attributes['acctFlags'][0], "X")) $this->noexpire = true; diff --git a/lam/lib/modules/sambaGroupMapping.inc b/lam/lib/modules/sambaGroupMapping.inc index 6ca8b928..f565fa12 100644 --- a/lam/lib/modules/sambaGroupMapping.inc +++ b/lam/lib/modules/sambaGroupMapping.inc @@ -345,15 +345,6 @@ class sambaGroupMapping extends baseModule { } } - /* This function loads all attributes into the object - * $attr is an array as it's retured from ldap_get_attributes - */ - function load_attributes($attr) { - $this->load_ldap_attributes($attr); - return 0; - } - - /** this functin fills the error message array with messages **/ function load_Messages() { diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index 98b33ae0..64cf011b 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -421,7 +421,7 @@ class sambaSamAccount extends baseModule { * $attr is an array as it's retured from ldap_get_attributes */ function load_attributes($attr) { - $this->load_ldap_attributes($attr); + parent::load_attributes($attr); if (strpos($this->attributes['sambaAcctFlags'][0], "D")) $this->deactivated = true; if (strpos($this->attributes['sambaAcctFlags'][0], "N")) $this->nopwd = true; if (strpos($this->attributes['sambaAcctFlags'][0], "X")) $this->noexpire = true; diff --git a/lam/lib/modules/shadowAccount.inc b/lam/lib/modules/shadowAccount.inc index d1bdcb7f..dd903e75 100644 --- a/lam/lib/modules/shadowAccount.inc +++ b/lam/lib/modules/shadowAccount.inc @@ -237,7 +237,7 @@ class shadowAccount extends baseModule { */ unset($this->attributes['userPassword']); unset($this->orig['userPassword']); - $this->load_ldap_attributes($attr); + parent::load_attributes($attr); return 0; }