show modules for force password change

This commit is contained in:
Roland Gruber 2018-04-15 10:42:02 +02:00
parent 5d9beec96d
commit 743c7b9559
1 changed files with 11 additions and 4 deletions

View File

@ -1101,15 +1101,22 @@ class accountContainer {
$pwdInput2->setSameValueFieldID('newPassword1'); $pwdInput2->setSameValueFieldID('newPassword1');
$container->addElement($pwdInput2, true); $container->addElement($pwdInput2, true);
// print force password change option // print force password change option
$forceChangeSupported = false; $forceChangeSupported = array();
foreach ($this->module as $name => $module) { foreach ($this->module as $name => $module) {
if (($module instanceof passwordService) && $module->supportsForcePasswordChange()) { if (($module instanceof passwordService) && $module->supportsForcePasswordChange()) {
$forceChangeSupported = true; $forceChangeSupported[] = $module;
break; break;
} }
} }
if ($forceChangeSupported) { if (!empty($forceChangeSupported)) {
$container->addElement(new htmlTableExtendedInputCheckbox('lamForcePasswordChange', false, _('Force password change'))); $container->addElement(new htmlOutputText(_('Force password change')));
$forcePwdGroup = new htmlGroup();
$forcePwdGroup->addElement(new htmlInputCheckbox('lamForcePasswordChange', false));
$forcePwdGroup->addElement(new htmlSpacer('1rem', null));
foreach ($forceChangeSupported as $module) {
$forcePwdGroup->addElement(new htmlImage('../../graphics/' . $module->getIcon(), '16px', '16px', $module->get_alias(), $module->get_alias()));
}
$container->addElement($forcePwdGroup);
$container->addElement(new htmlHelpLink('406'), true); $container->addElement(new htmlHelpLink('406'), true);
} }
if (isLAMProVersion() && (isset($this->attributes_orig['mail'][0]) || $this->anyModuleManagesMail())) { if (isLAMProVersion() && (isset($this->attributes_orig['mail'][0]) || $this->anyModuleManagesMail())) {