responsive self service

This commit is contained in:
Roland Gruber 2015-08-09 07:22:01 +00:00
parent a74e645ea3
commit d5ea258c10
2 changed files with 90 additions and 87 deletions

View File

@ -42,7 +42,7 @@ class posixAccount extends baseModule implements passwordService {
// Variables // Variables
/** delimiter for lamdaemon commands */ /** delimiter for lamdaemon commands */
private static $SPLIT_DELIMITER = "###x##y##x###"; private static $SPLIT_DELIMITER = "###x##y##x###";
/* These two variables keep an array of groups the user is also member of. */ /* These two variables keep an array of groups the user is also member of. */
/** current group list */ /** current group list */
private $groups; private $groups;
@ -66,7 +66,7 @@ class posixAccount extends baseModule implements passwordService {
private $cachedUIDList = null; private $cachedUIDList = null;
/** caches the list of known user names */ /** caches the list of known user names */
private $cachedUserNameList = null; private $cachedUserNameList = null;
/** replacements for common umlauts */ /** replacements for common umlauts */
private $umlautReplacements = array( private $umlautReplacements = array(
'ä' => 'ae', 'Ä' => 'Ae', 'ö' => 'oe', 'Ö' => 'Oe', 'ü' => 'ue', 'Ü' => 'Ue', 'ä' => 'ae', 'Ä' => 'Ae', 'ö' => 'oe', 'Ö' => 'Oe', 'ü' => 'ue', 'Ü' => 'Ue',
@ -84,7 +84,7 @@ class posixAccount extends baseModule implements passwordService {
// make optional if needed // make optional if needed
$this->autoAddObjectClasses = !$this->isOptional(); $this->autoAddObjectClasses = !$this->isOptional();
} }
/** /**
* This function fills the error message array with messages. * This function fills the error message array with messages.
**/ **/
@ -134,7 +134,7 @@ class posixAccount extends baseModule implements passwordService {
/** /**
* Returns true if this module can manage accounts of the current type, otherwise false. * Returns true if this module can manage accounts of the current type, otherwise false.
* *
* @return boolean true if module fits * @return boolean true if module fits
*/ */
public function can_manage() { public function can_manage() {
@ -145,7 +145,7 @@ class posixAccount extends baseModule implements passwordService {
* Returns meta data that is interpreted by parent class * Returns meta data that is interpreted by parent class
* *
* @return array array with meta data * @return array array with meta data
* *
* @see baseModule::get_metaData() * @see baseModule::get_metaData()
*/ */
function get_metaData() { function get_metaData() {
@ -294,7 +294,7 @@ class posixAccount extends baseModule implements passwordService {
$configContainerOptions->addElement(new htmlOutputText(' ')); $configContainerOptions->addElement(new htmlOutputText(' '));
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_hideposixGroups', false, _('Unix groups'), null, false)); $configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_hideposixGroups', false, _('Unix groups'), null, false));
} }
} }
$hiddenOptionsContainer->addElement($configContainerOptions); $hiddenOptionsContainer->addElement($configContainerOptions);
$configOptionsContainer->addElement($hiddenOptionsContainer, true); $configOptionsContainer->addElement($hiddenOptionsContainer, true);
$advancedOptions = new htmlTable(); $advancedOptions = new htmlTable();
@ -303,7 +303,7 @@ class posixAccount extends baseModule implements passwordService {
$advancedOptionsAccordion = new htmlAccordion('posixAccountAdvancedOptions', array(_('Advanced options') => $advancedOptions), false); $advancedOptionsAccordion = new htmlAccordion('posixAccountAdvancedOptions', array(_('Advanced options') => $advancedOptions), false);
$advancedOptionsAccordion->colspan = 5; $advancedOptionsAccordion->colspan = 5;
$configOptionsContainer->addElement($advancedOptionsAccordion); $configOptionsContainer->addElement($advancedOptionsAccordion);
$return['config_options']['all'] = $configOptionsContainer; $return['config_options']['all'] = $configOptionsContainer;
// upload // upload
$return['upload_preDepends'] = array('inetOrgPerson'); $return['upload_preDepends'] = array('inetOrgPerson');
@ -430,7 +430,7 @@ class posixAccount extends baseModule implements passwordService {
'description' => _('Gecos'), 'description' => _('Gecos'),
'help' => 'gecos', 'help' => 'gecos',
'example' => _('pc01,Room 2.34') 'example' => _('pc01,Room 2.34')
); );
} }
} }
// available PDF fields // available PDF fields
@ -718,7 +718,7 @@ class posixAccount extends baseModule implements passwordService {
if (isset($this->orig[$pwdAttrName][0]) && isset($this->attributes[$pwdAttrName][0])) { if (isset($this->orig[$pwdAttrName][0]) && isset($this->attributes[$pwdAttrName][0])) {
if ((pwd_is_enabled($this->orig[$pwdAttrName][0]) && pwd_is_enabled($this->attributes[$pwdAttrName][0])) if ((pwd_is_enabled($this->orig[$pwdAttrName][0]) && pwd_is_enabled($this->attributes[$pwdAttrName][0]))
|| (!pwd_is_enabled($this->orig[$pwdAttrName][0]) && !pwd_is_enabled($this->attributes[$pwdAttrName][0]))) { || (!pwd_is_enabled($this->orig[$pwdAttrName][0]) && !pwd_is_enabled($this->attributes[$pwdAttrName][0]))) {
$return[$this->getAccountContainer()->dn_orig]['info']['userPasswordStatusChange'][0] = 'unchanged'; $return[$this->getAccountContainer()->dn_orig]['info']['userPasswordStatusChange'][0] = 'unchanged';
} }
elseif (pwd_is_enabled($this->orig[$pwdAttrName][0])) { elseif (pwd_is_enabled($this->orig[$pwdAttrName][0])) {
$return[$this->getAccountContainer()->dn_orig]['info']['userPasswordStatusChange'][0] = 'locked'; $return[$this->getAccountContainer()->dn_orig]['info']['userPasswordStatusChange'][0] = 'locked';
@ -743,7 +743,7 @@ class posixAccount extends baseModule implements passwordService {
$this->groups[] = $this->getGroupName($this->attributes['gidNumber'][0]); $this->groups[] = $this->getGroupName($this->attributes['gidNumber'][0]);
} }
} }
// Set additional group memberships // Set additional group memberships
if (isset($this->orig['uid'][0]) && ($this->orig['uid'][0] != '') && ($this->attributes['uid'][0] != $this->orig['uid'][0])) { if (isset($this->orig['uid'][0]) && ($this->orig['uid'][0] != '') && ($this->attributes['uid'][0] != $this->orig['uid'][0])) {
// find affected groups // find affected groups
@ -788,7 +788,7 @@ class posixAccount extends baseModule implements passwordService {
/** /**
* Runs the postmodify actions. * Runs the postmodify actions.
* *
* @see baseModule::postModifyActions() * @see baseModule::postModifyActions()
* *
* @param boolean $newAccount * @param boolean $newAccount
@ -976,7 +976,7 @@ class posixAccount extends baseModule implements passwordService {
} }
return $messages; return $messages;
} }
/** /**
* Additional LDAP operations on delete. * Additional LDAP operations on delete.
* *
@ -1010,7 +1010,7 @@ class posixAccount extends baseModule implements passwordService {
/** /**
* Allows the module to run commands before the LDAP entry is deleted. * Allows the module to run commands before the LDAP entry is deleted.
* *
* @return array Array which contains status messages. Each entry is an array containing the status message parameters. * @return array Array which contains status messages. Each entry is an array containing the status message parameters.
*/ */
function preDeleteActions() { function preDeleteActions() {
@ -1063,7 +1063,7 @@ class posixAccount extends baseModule implements passwordService {
} }
return $return; return $return;
} }
/** /**
* Processes user input of the primary module page. * Processes user input of the primary module page.
* It checks if all input values are correct and updates the associated LDAP attributes. * It checks if all input values are correct and updates the associated LDAP attributes.
@ -1412,7 +1412,7 @@ class posixAccount extends baseModule implements passwordService {
/** /**
* Returns the HTML meta data for the main account page. * Returns the HTML meta data for the main account page.
* *
* @return htmlElement HTML meta data * @return htmlElement HTML meta data
*/ */
function display_html_attributes() { function display_html_attributes() {
@ -1428,7 +1428,7 @@ class posixAccount extends baseModule implements passwordService {
return $return; return $return;
} }
$shelllist = $this->getShells(); // list of all valid shells $shelllist = $this->getShells(); // list of all valid shells
// set default values // set default values
if (empty($this->attributes['uid'][0])) { if (empty($this->attributes['uid'][0])) {
if ($this->getAccountContainer()->getAccountModule('inetOrgPerson') != null) { if ($this->getAccountContainer()->getAccountModule('inetOrgPerson') != null) {
@ -1474,7 +1474,7 @@ class posixAccount extends baseModule implements passwordService {
$this->attributes['cn'][0] = $_POST['uid']; $this->attributes['cn'][0] = $_POST['uid'];
} }
} }
$userName = ''; $userName = '';
if (isset($this->attributes['uid'][0])) $userName = $this->attributes['uid'][0]; if (isset($this->attributes['uid'][0])) $userName = $this->attributes['uid'][0];
$uidLabel = _("User name"); $uidLabel = _("User name");
@ -1506,7 +1506,7 @@ class posixAccount extends baseModule implements passwordService {
$gidNumberSelect = new htmlTableExtendedSelect('gidNumber', $groups, $primaryGroup, _('Primary group'), 'gidNumber'); $gidNumberSelect = new htmlTableExtendedSelect('gidNumber', $groups, $primaryGroup, _('Primary group'), 'gidNumber');
$gidNumberSelect->setHasDescriptiveElements(true); $gidNumberSelect->setHasDescriptiveElements(true);
$return->addElement($gidNumberSelect, true); $return->addElement($gidNumberSelect, true);
if ($this->get_scope()=='user') { if ($this->get_scope()=='user') {
// additional groups // additional groups
if (!$this->isBooleanConfigOptionSet('posixAccount_hidegon') || !$this->isBooleanConfigOptionSet('posixAccount_hideposixGroups')) { if (!$this->isBooleanConfigOptionSet('posixAccount_hidegon') || !$this->isBooleanConfigOptionSet('posixAccount_hideposixGroups')) {
@ -1620,7 +1620,7 @@ class posixAccount extends baseModule implements passwordService {
$groups = array_flip($groups); $groups = array_flip($groups);
unset ($groups[$group]); unset ($groups[$group]);
$groups = array_flip($groups); $groups = array_flip($groups);
$unixContainer = new htmlTable(); $unixContainer = new htmlTable();
$unixContainer->alignment = htmlElement::ALIGN_TOP; $unixContainer->alignment = htmlElement::ALIGN_TOP;
$unixContainer->addElement(new htmlSubTitle(_("Unix groups")), true); $unixContainer->addElement(new htmlSubTitle(_("Unix groups")), true);
@ -1630,12 +1630,12 @@ class posixAccount extends baseModule implements passwordService {
$unixContainer->addElement(new htmlOutputText($group), true); $unixContainer->addElement(new htmlOutputText($group), true);
} }
} }
else { else {
$unixContainer->addElement(new htmlOutputText(_("Selected groups"))); $unixContainer->addElement(new htmlOutputText(_("Selected groups")));
$unixContainer->addElement(new htmlOutputText('')); $unixContainer->addElement(new htmlOutputText(''));
$unixContainer->addElement(new htmlOutputText(_("Available groups"))); $unixContainer->addElement(new htmlOutputText(_("Available groups")));
$unixContainer->addNewLine(); $unixContainer->addNewLine();
$remSelect = new htmlSelect('removegroups', $this->groups, null, 15); $remSelect = new htmlSelect('removegroups', $this->groups, null, 15);
$remSelect->setMultiSelect(true); $remSelect->setMultiSelect(true);
$remSelect->setTransformSingleSelect(false); $remSelect->setTransformSingleSelect(false);
@ -1650,7 +1650,7 @@ class posixAccount extends baseModule implements passwordService {
$addSelect->setTransformSingleSelect(false); $addSelect->setTransformSingleSelect(false);
$unixContainer->addElement($addSelect, true); $unixContainer->addElement($addSelect, true);
} }
$return->addElement($unixContainer); $return->addElement($unixContainer);
} }
@ -1658,9 +1658,9 @@ class posixAccount extends baseModule implements passwordService {
if (!$this->isBooleanConfigOptionSet('posixAccount_hideposixGroups')) { if (!$this->isBooleanConfigOptionSet('posixAccount_hideposixGroups')) {
$return->addElement(new htmlSpacer('100px', null)); $return->addElement(new htmlSpacer('100px', null));
} }
$gons = $this->findGroupOfNames(); $gons = $this->findGroupOfNames();
$gonContainer = new htmlTable(); $gonContainer = new htmlTable();
$gonContainer->alignment = htmlElement::ALIGN_TOP; $gonContainer->alignment = htmlElement::ALIGN_TOP;
$gonContainer->addElement(new htmlSubTitle(_("Groups of names")), true); $gonContainer->addElement(new htmlSubTitle(_("Groups of names")), true);
@ -1668,7 +1668,7 @@ class posixAccount extends baseModule implements passwordService {
$gonContainer->addElement(new htmlOutputText('')); $gonContainer->addElement(new htmlOutputText(''));
$gonContainer->addElement(new htmlOutputText(_("Available groups"))); $gonContainer->addElement(new htmlOutputText(_("Available groups")));
$gonContainer->addNewLine(); $gonContainer->addNewLine();
$selectedGons = array(); $selectedGons = array();
for ($i = 0; $i < sizeof($this->gonList); $i++) { for ($i = 0; $i < sizeof($this->gonList); $i++) {
if (isset($gons[$this->gonList[$i]])) { if (isset($gons[$this->gonList[$i]])) {
@ -1681,7 +1681,7 @@ class posixAccount extends baseModule implements passwordService {
$availableGons[$attr['cn'][0]] = $dn; $availableGons[$attr['cn'][0]] = $dn;
} }
} }
$remGonSelect = new htmlSelect('removegons', $selectedGons, null, 15); $remGonSelect = new htmlSelect('removegons', $selectedGons, null, 15);
$remGonSelect->setMultiSelect(true); $remGonSelect->setMultiSelect(true);
$remGonSelect->setTransformSingleSelect(false); $remGonSelect->setTransformSingleSelect(false);
@ -1700,7 +1700,7 @@ class posixAccount extends baseModule implements passwordService {
$gonContainer->addNewLine(); $gonContainer->addNewLine();
$return->addElement($gonContainer); $return->addElement($gonContainer);
} }
$return->addNewLine(); $return->addNewLine();
$backGroup = new htmlGroup(); $backGroup = new htmlGroup();
@ -2458,7 +2458,7 @@ class posixAccount extends baseModule implements passwordService {
$errors = array(); $errors = array();
if (($result != false) && (sizeof($result) == 1)) { if (($result != false) && (sizeof($result) == 1)) {
$parts = explode(",", $result[0]); $parts = explode(",", $result[0]);
if (in_array($parts[0], array('ERROR', 'WARN'))) { if (in_array($parts[0], array('ERROR', 'WARN'))) {
$errors[] = $parts; $errors[] = $parts;
} }
} }
@ -2577,7 +2577,7 @@ class posixAccount extends baseModule implements passwordService {
/** /**
* Gets the free UID numbers from an Samba pool entry in LDAP. * Gets the free UID numbers from an Samba pool entry in LDAP.
* *
* @param integer $count number of needed free UIDs. * @param integer $count number of needed free UIDs.
* @param array $errors list of error messages where errors can be added * @param array $errors list of error messages where errors can be added
* @return mixed null if no UIDs are free else an array of free UIDs * @return mixed null if no UIDs are free else an array of free UIDs
@ -2610,7 +2610,7 @@ class posixAccount extends baseModule implements passwordService {
/** /**
* Gets the free UID numbers from a domain info entry in LDAP. * Gets the free UID numbers from a domain info entry in LDAP.
* *
* @param integer $count number of needed free UIDs. * @param integer $count number of needed free UIDs.
* @param array $errors list of error messages where errors can be added * @param array $errors list of error messages where errors can be added
* @return mixed null if no UIDs are free else an array of free UIDs * @return mixed null if no UIDs are free else an array of free UIDs
@ -2650,28 +2650,25 @@ class posixAccount extends baseModule implements passwordService {
* @param array $attributes attributes of LDAP account * @param array $attributes attributes of LDAP account
* @param boolean $passwordChangeOnly indicates that the user is only allowed to change his password and no LDAP content is readable * @param boolean $passwordChangeOnly indicates that the user is only allowed to change his password and no LDAP content is readable
* @param array $readOnlyFields list of read-only fields * @param array $readOnlyFields list of read-only fields
* @return array list of meta HTML elements (field name => htmlTableRow) * @return array list of meta HTML elements (field name => htmlResponsiveRow)
*/ */
function getSelfServiceOptions($fields, $attributes, $passwordChangeOnly, $readOnlyFields) { function getSelfServiceOptions($fields, $attributes, $passwordChangeOnly, $readOnlyFields) {
$return = array(); $return = array();
if (in_array('password', $fields)) { if (in_array('password', $fields)) {
$pwdTable = new htmlTable(); $row = new htmlResponsiveRow();
$pwdTable->colspan = 3;
if (!empty($this->selfServiceSettings->moduleSettings['posixAccount_useOldPwd']) && ($this->selfServiceSettings->moduleSettings['posixAccount_useOldPwd'][0] == 'true')) { if (!empty($this->selfServiceSettings->moduleSettings['posixAccount_useOldPwd']) && ($this->selfServiceSettings->moduleSettings['posixAccount_useOldPwd'][0] == 'true')) {
$pwd0 = new htmlTableExtendedInputField(_('Old password'), 'posixAccount_passwordOld'); $pwd0 = new htmlResponsiveInputField(_('Old password'), 'posixAccount_passwordOld');
$pwd0->setIsPassword(true, true); $pwd0->setIsPassword(true, true);
$pwdTable->addElement($pwd0, true); $row->add($pwd0, 12);
} }
$pwd1 = new htmlTableExtendedInputField($this->getSelfServiceLabel('password', _('New password')), 'posixAccount_password'); $pwd1 = new htmlResponsiveInputField($this->getSelfServiceLabel('password', _('New password')), 'posixAccount_password');
$pwd1->setIsPassword(true, true); $pwd1->setIsPassword(true, true);
$pwdTable->addElement($pwd1, true); $row->add($pwd1, 12);
$pwd2 = new htmlTableExtendedInputField(_('Reenter password'), 'posixAccount_password2'); $pwd2 = new htmlResponsiveInputField(_('Reenter password'), 'posixAccount_password2');
$pwd2->setIsPassword(true); $pwd2->setIsPassword(true);
$pwd2->setSameValueFieldID('posixAccount_password'); $pwd2->setSameValueFieldID('posixAccount_password');
$pwdTable->addElement($pwd2); $row->add($pwd2, 12);
$return['password'] = new htmlTableRow(array( $return['password'] = $row;
$pwdTable
));
} }
if ($passwordChangeOnly) { if ($passwordChangeOnly) {
return $return; // only password fields as long no LDAP content can be read return $return; // only password fields as long no LDAP content can be read
@ -2683,9 +2680,10 @@ class posixAccount extends baseModule implements passwordService {
if (in_array('cn', $readOnlyFields)) { if (in_array('cn', $readOnlyFields)) {
$cnField = new htmlOutputText($cn); $cnField = new htmlOutputText($cn);
} }
$return['cn'] = new htmlTableRow(array( $row = new htmlResponsiveRow();
new htmlOutputText($this->getSelfServiceLabel('cn', _('Common name'))), $cnField $row->add(new htmlOutputText($this->getSelfServiceLabel('cn', _('Common name'))), 12, 6, 6, 'responsiveLabel');
)); $row->add($cnField, 12, 6, 6, 'responsiveField');
$return['cn'] = $row;
} }
if (in_array('loginShell', $fields)) { if (in_array('loginShell', $fields)) {
$shelllist = $this->getShells(); // list of all valid shells $shelllist = $this->getShells(); // list of all valid shells
@ -2695,9 +2693,10 @@ class posixAccount extends baseModule implements passwordService {
if (in_array('loginShell', $readOnlyFields)) { if (in_array('loginShell', $readOnlyFields)) {
$loginShellField = new htmlOutputText($loginShell); $loginShellField = new htmlOutputText($loginShell);
} }
$return['loginShell'] = new htmlTableRow(array( $row = new htmlResponsiveRow();
new htmlOutputText($this->getSelfServiceLabel('loginShell', _('Login shell'))), $loginShellField $row->add(new htmlOutputText($this->getSelfServiceLabel('loginShell', _('Login shell'))), 12, 6, 6, 'responsiveLabel');
)); $row->add($loginShellField, 12, 6, 6, 'responsiveField');
$return['loginShell'] = $row;
} }
return $return; return $return;
} }
@ -2710,7 +2709,7 @@ class posixAccount extends baseModule implements passwordService {
* <br>del: array of attributes to remove * <br>del: array of attributes to remove
* <br>mod: array of attributes to modify * <br>mod: array of attributes to modify
* <br>"info" are values with informational value (e.g. to be used later by pre/postModify actions) * <br>"info" are values with informational value (e.g. to be used later by pre/postModify actions)
* *
* Calling this method does not require the existence of an enclosing {@link accountContainer}. * Calling this method does not require the existence of an enclosing {@link accountContainer}.
* *
* @param string $fields input fields * @param string $fields input fields
@ -2789,7 +2788,7 @@ class posixAccount extends baseModule implements passwordService {
} }
return $return; return $return;
} }
/** /**
* This method specifies if a module manages password attributes. * This method specifies if a module manages password attributes.
* @see passwordService::managesPasswordAttributes * @see passwordService::managesPasswordAttributes
@ -2802,13 +2801,13 @@ class posixAccount extends baseModule implements passwordService {
/** /**
* Specifies if this module supports to force that a user must change his password on next login. * Specifies if this module supports to force that a user must change his password on next login.
* *
* @return boolean force password change supported * @return boolean force password change supported
*/ */
public function supportsForcePasswordChange() { public function supportsForcePasswordChange() {
return false; return false;
} }
/** /**
* This function is called whenever the password should be changed. Account modules * This function is called whenever the password should be changed. Account modules
* must change their password attributes only if the modules list contains their module name. * must change their password attributes only if the modules list contains their module name.
@ -2853,7 +2852,7 @@ class posixAccount extends baseModule implements passwordService {
} }
return array(); return array();
} }
/** /**
* Returns the group ID of the given group. * Returns the group ID of the given group.
* *
@ -2867,7 +2866,7 @@ class posixAccount extends baseModule implements passwordService {
} }
return null; return null;
} }
/** /**
* Returns the group name of the group with the given group ID. * Returns the group name of the group with the given group ID.
* *
@ -2881,7 +2880,7 @@ class posixAccount extends baseModule implements passwordService {
} }
return null; return null;
} }
/** /**
* Returns the group DN of the given group. * Returns the group DN of the given group.
* *
@ -2895,7 +2894,7 @@ class posixAccount extends baseModule implements passwordService {
} }
return null; return null;
} }
/** /**
* Finds all existing LDAP groups. * Finds all existing LDAP groups.
* *
@ -2927,7 +2926,7 @@ class posixAccount extends baseModule implements passwordService {
$this->groupCache = $return; $this->groupCache = $return;
return $return; return $return;
} }
/** /**
* Finds all existing LDAP group of names. * Finds all existing LDAP group of names.
* *
@ -2967,7 +2966,7 @@ class posixAccount extends baseModule implements passwordService {
$this->gonCache = $return; $this->gonCache = $return;
return $return; return $return;
} }
/** /**
* Returns a list of existing UID numbers. * Returns a list of existing UID numbers.
* *
@ -3008,20 +3007,20 @@ class posixAccount extends baseModule implements passwordService {
sort($this->cachedUIDList, SORT_NUMERIC); sort($this->cachedUIDList, SORT_NUMERIC);
return $this->cachedUIDList; return $this->cachedUIDList;
} }
/** /**
* Checks if the given user name already exists in LDAP. * Checks if the given user name already exists in LDAP.
* *
* @param String $userName user name * @param String $userName user name
* @return boolean true if already exists * @return boolean true if already exists
*/ */
private function userNameExists($userName) { private function userNameExists($userName) {
return in_array($userName, $this->getUserNames()); return in_array($userName, $this->getUserNames());
} }
/** /**
* Returns a list of all user names in LDAP. * Returns a list of all user names in LDAP.
* *
* @return array user names * @return array user names
*/ */
private function getUserNames() { private function getUserNames() {
@ -3058,10 +3057,10 @@ class posixAccount extends baseModule implements passwordService {
} }
return $this->cachedUserNameList; return $this->cachedUserNameList;
} }
/** /**
* Returns if LAM manages group of names entries. * Returns if LAM manages group of names entries.
* *
* @return boolean group of names are active * @return boolean group of names are active
*/ */
public static function areGroupOfNamesActive() { public static function areGroupOfNamesActive() {
@ -3082,7 +3081,7 @@ class posixAccount extends baseModule implements passwordService {
} }
return false; return false;
} }
/** /**
* Returns a suggestion for the user name. * Returns a suggestion for the user name.
* By deafult this wil be the first character of the first name plus the last name. * By deafult this wil be the first character of the first name plus the last name.
@ -3124,7 +3123,7 @@ class posixAccount extends baseModule implements passwordService {
$format = str_replace(array(' ', '_', '-'), array('', '', ''), $format); $format = str_replace(array(' ', '_', '-'), array('', '', ''), $format);
return $format; return $format;
} }
/** /**
* Returns if this account can be locked. * Returns if this account can be locked.
* This is the case if a hashed password is set ("{" at the beginning). * This is the case if a hashed password is set ("{" at the beginning).
@ -3135,16 +3134,16 @@ class posixAccount extends baseModule implements passwordService {
} }
return false; return false;
} }
/** /**
* Returns if the Unix part of the current account is locked. * Returns if the Unix part of the current account is locked.
* *
* @return boolean password is locked * @return boolean password is locked
*/ */
public function isLocked() { public function isLocked() {
return isset($this->attributes[$this->getPasswordAttrName()][0]) && !pwd_is_enabled($this->attributes[$this->getPasswordAttrName()][0]); return isset($this->attributes[$this->getPasswordAttrName()][0]) && !pwd_is_enabled($this->attributes[$this->getPasswordAttrName()][0]);
} }
/** /**
* Locks the user password of this account. * Locks the user password of this account.
*/ */
@ -3154,7 +3153,7 @@ class posixAccount extends baseModule implements passwordService {
$this->attributes[$pwdAttrName][0] = pwd_disable($this->attributes[$pwdAttrName][0]); $this->attributes[$pwdAttrName][0] = pwd_disable($this->attributes[$pwdAttrName][0]);
} }
} }
/** /**
* Unlocks the user password of this account. * Unlocks the user password of this account.
*/ */
@ -3164,28 +3163,28 @@ class posixAccount extends baseModule implements passwordService {
$this->attributes[$pwdAttrName][0] = pwd_enable($this->attributes[$pwdAttrName][0]); $this->attributes[$pwdAttrName][0] = pwd_enable($this->attributes[$pwdAttrName][0]);
} }
} }
/** /**
* Removes all Unix group memberships from this user. * Removes all Unix group memberships from this user.
*/ */
public function removeFromUnixGroups() { public function removeFromUnixGroups() {
$this->groups = array(); $this->groups = array();
} }
/** /**
* Removes all group of names memberships from this user. * Removes all group of names memberships from this user.
*/ */
public function removeFromGONGroups() { public function removeFromGONGroups() {
$this->gonList = array(); $this->gonList = array();
} }
/** /**
* Returns the next possible user name based on the given one. * Returns the next possible user name based on the given one.
* If the user name does not end with a number then a "2" is added. * If the user name does not end with a number then a "2" is added.
* User names with numbers at the end are simply increased by one. * User names with numbers at the end are simply increased by one.
* <br> * <br>
* <br>Attention: This user name might still be in use. This needs to be checked separately. * <br>Attention: This user name might still be in use. This needs to be checked separately.
* *
* @param String $userName user name * @param String $userName user name
* @return String new user name * @return String new user name
*/ */
@ -3236,10 +3235,10 @@ class posixAccount extends baseModule implements passwordService {
} }
return $userName; return $userName;
} }
/** /**
* Returns the list of possible login shells. * Returns the list of possible login shells.
* *
* @return array login shells * @return array login shells
*/ */
private function getShells() { private function getShells() {
@ -3263,11 +3262,11 @@ class posixAccount extends baseModule implements passwordService {
'/bin/sh' '/bin/sh'
); );
} }
/** /**
* Returns if the cn attribute should be managed. * Returns if the cn attribute should be managed.
* If Windows modules are active then cn will not be managed. * If Windows modules are active then cn will not be managed.
* *
* @return boolean manage cn attribute * @return boolean manage cn attribute
*/ */
private function manageCn() { private function manageCn() {
@ -3282,10 +3281,10 @@ class posixAccount extends baseModule implements passwordService {
} }
return false; return false;
} }
/** /**
* Returns if the Unix part can be added and removed. * Returns if the Unix part can be added and removed.
* *
* @return boolean is optional * @return boolean is optional
*/ */
private function isOptional() { private function isOptional() {
@ -3294,7 +3293,7 @@ class posixAccount extends baseModule implements passwordService {
/** /**
* Returns if the Windows module is active. * Returns if the Windows module is active.
* *
* @return boolean is Windows * @return boolean is Windows
*/ */
private function isWindows() { private function isWindows() {
@ -3304,7 +3303,7 @@ class posixAccount extends baseModule implements passwordService {
/** /**
* Returns the password attribute. * Returns the password attribute.
* Usually, this is userPassword. If Windows modules are active this is unixUserPassword. * Usually, this is userPassword. If Windows modules are active this is unixUserPassword.
* *
* @return boolean attribute name * @return boolean attribute name
*/ */
private function getPasswordAttrName() { private function getPasswordAttrName() {
@ -3317,11 +3316,11 @@ class posixAccount extends baseModule implements passwordService {
} }
return $name; return $name;
} }
/** /**
* Returns the home directory attribute. * Returns the home directory attribute.
* Usually, this is homeDirectory. If Windows modules are active this is unixHomeDirectory. * Usually, this is homeDirectory. If Windows modules are active this is unixHomeDirectory.
* *
* @return boolean attribute name * @return boolean attribute name
*/ */
private function getHomedirAttrName() { private function getHomedirAttrName() {
@ -3334,7 +3333,7 @@ class posixAccount extends baseModule implements passwordService {
} }
return $name; return $name;
} }
/** /**
* Syncs the group of names with groups. * Syncs the group of names with groups.
*/ */
@ -3351,7 +3350,7 @@ class posixAccount extends baseModule implements passwordService {
} }
} }
} }
} }
?> ?>

View File

@ -672,6 +672,10 @@ h4.schema_oclass_sub {
/** responsive styles */ /** responsive styles */
.row input {
width: 100%;
}
div.dialog-page { div.dialog-page {
float: left; float: left;
} }