added rfc2307bisPosixGroup

This commit is contained in:
Roland Gruber 2008-12-18 12:06:23 +00:00
parent a864a2f4d5
commit a5a71f27b1
1 changed files with 22 additions and 5 deletions

View File

@ -60,7 +60,7 @@ class phpGroupwareGroup extends baseModule {
// alias name // alias name
$return["alias"] = "phpGroupWare"; $return["alias"] = "phpGroupWare";
// module dependencies // module dependencies
$return['dependencies'] = array('depends' => array('posixGroup'), 'conflicts' => array()); $return['dependencies'] = array('depends' => array(array('posixGroup', 'rfc2307bisPosixGroup')), 'conflicts' => array());
// LDAP filter // LDAP filter
$return["ldap_filter"] = array('or' => "(objectClass=phpgwGroup)"); $return["ldap_filter"] = array('or' => "(objectClass=phpgwGroup)");
// managed object classes // managed object classes
@ -75,7 +75,7 @@ class phpGroupwareGroup extends baseModule {
) )
); );
// upload dependencies // upload dependencies
$return['upload_preDepends'] = array('posixGroup'); $return['upload_preDepends'] = array('posixGroup', 'rfc2307bisPosixGroup');
// upload fields // upload fields
$return['upload_columns'] = array( $return['upload_columns'] = array(
array( array(
@ -142,16 +142,33 @@ class phpGroupwareGroup extends baseModule {
* <br>"remove" are attributes which have to be removed from LDAP entry * <br>"remove" are attributes which have to be removed from LDAP entry
* <br>"modify" are attributes which have to been modified in LDAP entry * <br>"modify" are attributes which have to been modified in LDAP entry
*/ */
function save_attributes() { public function save_attributes() {
if (!in_array('phpgwGroup', $this->attributes['objectClass'])) { if (!in_array('phpgwGroup', $this->attributes['objectClass'])) {
return parent::save_attributes(); return parent::save_attributes();
} }
// set phpgwGroupID to GID number for new accounts // set phpgwGroupID to GID number for new accounts
$attrs = $this->getAccountContainer()->getAccountModule('posixGroup')->getAttributes(); $this->attributes['phpgwGroupID'][0] = $this->getGID();
$this->attributes['phpgwGroupID'][0] = $attrs['gidNumber'][0];
return parent::save_attributes(); return parent::save_attributes();
} }
/**
* Gets the GID number from the Unix group module.
*
* @return String GID number
*/
private function getGID() {
$modules = array('posixGroup', 'rfc2307bisPosixGroup');
for ($i = 0; $i < sizeof($modules); $i++) {
if ($this->getAccountContainer()->getAccountModule($modules[$i]) != null) {
$attrs = $this->getAccountContainer()->getAccountModule($modules[$i])->getAttributes();
if (isset($attrs['gidNumber'][0])) {
return $attrs['gidNumber'][0];
}
}
}
return null;
}
/** /**
* Allows the module to run commands after the LDAP entry is changed or created. * Allows the module to run commands after the LDAP entry is changed or created.
* *