\n";
echo "| \n";
$this->printCommonControls();
echo " |
\n";
echo "";
// print title bar
$titleBarContainer = new htmlResponsiveRow();
$titleBarContainer->setCSSClasses(['maxrow']);
$titleGroup = new htmlGroup();
if ($this->titleBarIcon !== null) {
$titleGroup->addElement($this->titleBarIcon);
$titleGroup->addElement(new htmlSpacer('1rem', null));
}
$titleBarTitleText = new htmlOutputText($this->titleBarTitle, false);
$titleGroup->addElement($titleBarTitleText);
$titleBarContainer->add(new htmlDiv(null, $titleGroup, ['titleBarTitle', 'text-left']), 12, 12, 4);
$titleBarSubtitleText = new htmlOutputText($this->titleBarSubtitle, false);
$titleBarContainer->add(new htmlDiv(null, $titleBarSubtitleText, ['titleBarSubtitle', 'responsiveLabel']), 12, 12, 8);
$titleBarSuffixRdn = new htmlResponsiveRow();
$titleBarSuffixRdn->add(new htmlHorizontalLine(), 12);
// suffix
$suffixList = [];
foreach ($this->getOUs() as $suffix) {
$suffixList[getAbstractDN($suffix)] = $suffix;
}
if (($this->dnSuffix != '') && !in_array_ignore_case($this->dnSuffix, $this->getOUs())) {
$suffixList[getAbstractDN($this->dnSuffix)] = $this->dnSuffix;
}
$selectedSuffix = [$this->dnSuffix];
$suffixSelect = new htmlResponsiveSelect('accountContainerSuffix', $suffixList, $selectedSuffix, _('Suffix'));
$suffixSelect->setHasDescriptiveElements(true);
$suffixSelect->setRightToLeftTextDirection(true);
$suffixSelect->setShortLabel();
$suffixSelect->setSortElements(false);
$titleBarSuffixRdn->add($suffixSelect, 12, 12, 7);
// RDN selection
$rdnlist = getRDNAttributes($this->type->getId());
$rdnSelect = new htmlResponsiveSelect('accountContainerRDN', $rdnlist, [$this->rdn], _('RDN identifier'), '400');
$rdnSelect->setShortLabel();
$rdnSelect->setSortElements(false);
$titleBarSuffixRdn->add($rdnSelect, 12, 12, 5);
$titleBarContainer->add($titleBarSuffixRdn);
$titleBarDiv = new htmlDiv(null, $titleBarContainer, ['titleBar']);
parseHtml(null, $titleBarDiv, [], false);
echo '';
echo ' ';
echo '| ';
// tab menu
$this->printModuleTabs();
echo ' | ';
echo " \n";
// content area
// display html-code from modules
try {
$return = call_user_func([$this->module[$this->order[$this->current_page]], 'display_html_' . $this->subpage]);
}
catch (LAMException $e) {
$return = new htmlStatusMessage('ERROR', $e->getTitle(), $e->getMessage());
}
parseHtml($this->order[$this->current_page], $return, [], false);
echo " \n";
echo ' | ';
echo ' ';
echo ' ';
echo " \n";
echo " |
\n";
// Display rest of html-page
echo "
\n";
}
/**
* Prints the input fields of the central password service.
*/
private function printPasswordPromt(): void {
echo "\n";
echo "
\n";
$printContainer = false;
$container = new htmlResponsiveRow();
$container->setCSSClasses(['text-left']);
$title = new htmlTitle(_('Set password'));
$container->add($title);
// password fields
$pwdInput1 = new htmlResponsiveInputField(_('Password'), 'newPassword1', null, '404');
$pwdInput1->setIsPassword(true, true);
$container->add($pwdInput1);
$pwdInput2 = new htmlResponsiveInputField(_('Repeat password'), 'newPassword2');
$pwdInput2->setIsPassword(true);
$pwdInput2->setSameValueFieldID('newPassword1');
$container->add($pwdInput2);
// print force password change option
$forceChangeSupported = [];
foreach ($this->module as $module) {
if (($module instanceof passwordService) && $module->supportsForcePasswordChange()) {
$forceChangeSupported[] = $module;
}
}
if (!empty($forceChangeSupported)) {
$container->addLabel(new htmlLabel('lamForcePasswordChange', _('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()));
$forcePwdGroup->addElement(new htmlSpacer('0.1rem', null));
}
$forcePwdGroup->addElement(new htmlHelpLink('406'));
$container->addField($forcePwdGroup);
$container->addVerticalSpacer('0.25rem');
}
if (isLAMProVersion() && (isset($this->attributes_orig['mail'][0]) || $this->anyModuleManagesMail())) {
$pwdMailCheckbox = new htmlResponsiveInputCheckbox('lamPasswordChangeSendMail', false, _('Send via mail'), '407');
$pwdMailCheckbox->setTableRowsToShow(['lamPasswordChangeMailAddress']);
$container->add($pwdMailCheckbox);
if ($_SESSION['config']->getLamProMailAllowAlternateAddress() != 'false') {
$alternateMail = '';
$pwdResetModule = $this->getAccountModule('passwordSelfReset');
if ($pwdResetModule !== null) {
$backupMail = $pwdResetModule->getBackupEmail();
if (!empty($backupMail)) {
$alternateMail = $pwdResetModule->getBackupEmail();
}
}
$alternateMailInput = new htmlResponsiveInputField(_('Alternate recipient'), 'lamPasswordChangeMailAddress', $alternateMail, '410');
$container->add($alternateMailInput);
}
}
if (isLAMProVersion() && ($this->attributes_orig !== null) && (getSmsPhoneNumber($this->attributes_orig) !== null)) {
$container->add(new htmlResponsiveInputCheckbox('lamPasswordChangeSendSms', false, _('Send via SMS'), '412'));
}
$container->addVerticalSpacer('0.25rem');
// password modules
$moduleContainer = new htmlGroup();
foreach ($this->module as $name => $module) {
if (($module instanceof passwordService) && $module->managesPasswordAttributes()) {
$printContainer = true;
$buttonImage = $module->getIcon();
if ($buttonImage != null) {
if (!(str_starts_with($buttonImage, 'http')) && !(str_starts_with($buttonImage, '/'))) {
$buttonImage = '../../graphics/' . $buttonImage;
}
$moduleContainer->addElement(new htmlImage($buttonImage, '16px', '16px', getModuleAlias($name, $this->type->getScope())));
}
$moduleContainer->addElement(new htmlInputCheckbox('password_cb_' . $name, true));
$moduleContainer->addElement(new htmlLabel('password_cb_' . $name, getModuleAlias($name, $this->type->getScope())));
$moduleContainer->addElement(new htmlSpacer('10px', null));
}
}
$container->add($moduleContainer);
// buttons
$container->addVerticalSpacer('1rem');
$buttonGroup = new htmlGroup();
$okButton = new htmlButton('changePwdOk', _('Ok'));
$okButton->setCSSClasses(['lam-primary']);
$okButton->setOnClick("passwordHandleInput('false', '../misc/ajax.php?function=passwordChange&editKey="
. htmlspecialchars($this->base) . "', '" . getSecurityTokenName() . "', '" . getSecurityTokenValue()
. "', '" . _('Ok') . "'); return false;");
$buttonGroup->addElement($okButton);
$randomButton = new htmlButton('changePwdRandom', _('Set random password'));
$randomButton->setCSSClasses(['lam-secondary']);
$randomButton->setOnClick("passwordHandleInput('true', '../misc/ajax.php?function=passwordChange&editKey="
. htmlspecialchars($this->base) . "', '" . getSecurityTokenName() . "', '" . getSecurityTokenValue()
. "', '" . _('Ok') . "'); return false;");
$buttonGroup->addElement($randomButton);
$cancelButton = new htmlButton('changePwdCancel', _('Cancel'));
$cancelButton->setOnClick("document.querySelector('.modal-pwd-options').classList.remove('show-modal'); return false;");
$buttonGroup->addElement($cancelButton);
$container->add($buttonGroup);
// generate HTML
if ($printContainer) {
parseHtml(null, $container, [], false);
}
echo "
\n";
echo "
\n";
}
/**
* Sets the new password in all selected account modules.
*
* @param array