fix for schema test

This commit is contained in:
Roland Gruber 2013-04-20 08:32:12 +00:00
parent c78e65d4f5
commit 687dcd25c6
3 changed files with 10 additions and 7 deletions

View File

@ -93,7 +93,7 @@ class windowsGroup extends baseModule {
// module dependencies
$return['dependencies'] = array('depends' => array(), 'conflicts' => array());
// managed object classes
$return['objectClasses'] = array('group');
$return['objectClasses'] = array('group', 'securityPrincipal', 'mailRecipient');
// managed attributes
$return['attributes'] = array('cn', 'description', 'info', 'mail', 'member', 'sAMAccountName', 'groupType');
// help Entries

View File

@ -58,7 +58,7 @@ class windowsHost extends baseModule {
// module dependencies
$return['dependencies'] = array('depends' => array(), 'conflicts' => array());
// managed object classes
$return['objectClasses'] = array('computer');
$return['objectClasses'] = array('computer', 'securityPrincipal');
// managed attributes
$return['attributes'] = array('cn', 'description', 'location', 'sAMAccountName', 'managedBy', 'operatingSystem', 'operatingSystemVersion', 'dNSHostName');
// help Entries

View File

@ -79,7 +79,7 @@ class windowsUser extends baseModule implements passwordService {
// module dependencies
$return['dependencies'] = array('depends' => array(), 'conflicts' => array());
// managed object classes
$return['objectClasses'] = array('user');
$return['objectClasses'] = array('user', 'securityPrincipal');
// managed attributes
$return['attributes'] = array('cn', 'sAMAccountName', 'description', 'displayName', 'givenName', 'initials',
'l', 'mail', 'otherTelephone', 'physicalDeliveryOfficeName', 'postalCode', 'postOfficeBox', 'sn', 'st',
@ -615,7 +615,7 @@ class windowsUser extends baseModule implements passwordService {
}
// deactivated
$deactivated = isset($_POST['deactivated']) && ($_POST['deactivated'] == 'on');
windowsUser::setIsDeactivated($this->attributes, $deactivated);
windowsUser::setIsDeactivated($deactivated);
// no expire
$noExpire = isset($_POST['noExpire']) && ($_POST['noExpire'] == 'on');
windowsUser::setIsNeverExpiring($this->attributes, $noExpire);
@ -928,7 +928,7 @@ class windowsUser extends baseModule implements passwordService {
$errors[] = array('ERROR', sprintf(_('Account %s:'), $i) . ' windowsUser_deactivated', _('Please enter either yes or no.'));
}
else {
$this->setIsDeactivated($userAccountControlAttr, $booleanOptions[$rawAccounts[$i][$ids['windowsUser_deactivated']]]);
$this->setIsDeactivated($booleanOptions[$rawAccounts[$i][$ids['windowsUser_deactivated']]], $userAccountControlAttr);
}
}
// password does not expire
@ -1265,10 +1265,13 @@ class windowsUser extends baseModule implements passwordService {
/**
* Sets if the account is currently deactivated.
*
* @param array $attrs LDAP attributes to modify
* @param boolean $deactivated is deactivated
* @param array $attrs LDAP attributes to modify (default $this->attributes)
*/
public static function setIsDeactivated(&$attrs, $deactivated) {
public function setIsDeactivated($deactivated, &$attrs = null) {
if ($attrs == null) {
$attrs = &$this->attributes;
}
foreach ($attrs as $key => $value) {
if (strtolower($key) == 'useraccountcontrol') {
if ($deactivated) {