responsive

This commit is contained in:
Roland Gruber 2019-09-26 19:44:17 +02:00
parent 3ad1b5c20a
commit 302acfa2d9
1 changed files with 52 additions and 50 deletions

View File

@ -1090,12 +1090,11 @@ class windowsUser extends baseModule implements passwordService {
*/ */
public function display_html_attributes() { public function display_html_attributes() {
$this->initCache(); $this->initCache();
$containerLeft = new htmlTable(); $containerLeft = new htmlResponsiveRow();
$containerLeft->alignment = htmlElement::ALIGN_TOP;
if ($this->getAccountContainer()->isNewAccount && !isset($this->attributes['userAccountControl'][0])) { if ($this->getAccountContainer()->isNewAccount && !isset($this->attributes['userAccountControl'][0])) {
$this->attributes['userAccountControl'][0] = windowsUser::DEFAULT_ACCOUNT_CONTROL; $this->attributes['userAccountControl'][0] = windowsUser::DEFAULT_ACCOUNT_CONTROL;
} }
$containerLeft->addElement(new htmlSubTitle(_('General')), true); $containerLeft->add(new htmlSubTitle(_('General')), 12);
// user name // user name
$userPrincipalName = ''; $userPrincipalName = '';
$userPrincipalNameDomain = ''; $userPrincipalNameDomain = '';
@ -1113,12 +1112,12 @@ class windowsUser extends baseModule implements passwordService {
} }
$userPrincipalNameLabel = new htmlOutputText(_('User name')); $userPrincipalNameLabel = new htmlOutputText(_('User name'));
$userPrincipalNameLabel->setMarkAsRequired(true); $userPrincipalNameLabel->setMarkAsRequired(true);
$containerLeft->addElement($userPrincipalNameLabel); $containerLeft->addLabel($userPrincipalNameLabel);
$userPrincipalNameGroup = new htmlGroup(); $userPrincipalNameGroup = new htmlGroup();
$userPrincipalNameGroup->addElement(new htmlInputField('userPrincipalName', $userPrincipalName, '15')); $userPrincipalNameGroup->addElement(new htmlInputField('userPrincipalName', $userPrincipalName, '15'));
$userPrincipalNameGroup->addElement(new htmlSelect('userPrincipalNameDomain', $domains, array($userPrincipalNameDomain))); $userPrincipalNameGroup->addElement(new htmlSelect('userPrincipalNameDomain', $domains, array($userPrincipalNameDomain)));
$containerLeft->addElement($userPrincipalNameGroup); $userPrincipalNameGroup->addElement(new htmlHelpLink('userPrincipalName'));
$containerLeft->addElement(new htmlHelpLink('userPrincipalName'), true); $containerLeft->addField($userPrincipalNameGroup);
if (!$this->isBooleanConfigOptionSet('windowsUser_hidesAMAccountName', true)) { if (!$this->isBooleanConfigOptionSet('windowsUser_hidesAMAccountName', true)) {
$this->addSimpleInputTextField($containerLeft, 'sAMAccountName', _('User name (pre W2K)')); $this->addSimpleInputTextField($containerLeft, 'sAMAccountName', _('User name (pre W2K)'));
} }
@ -1129,7 +1128,7 @@ class windowsUser extends baseModule implements passwordService {
$this->addSimpleInputTextField($containerLeft, 'initials', _('Initials')); $this->addSimpleInputTextField($containerLeft, 'initials', _('Initials'));
$this->addSimpleInputTextField($containerLeft, 'description', _('Description')); $this->addSimpleInputTextField($containerLeft, 'description', _('Description'));
// address area // address area
$containerLeft->addElement(new htmlSubTitle(_('Address')), true); $containerLeft->add(new htmlSubTitle(_('Address')), 12);
$this->addSimpleInputTextField($containerLeft, 'streetAddress', _('Street'), false, 20, true); $this->addSimpleInputTextField($containerLeft, 'streetAddress', _('Street'), false, 20, true);
$this->addSimpleInputTextField($containerLeft, 'postOfficeBox', _('Post office box')); $this->addSimpleInputTextField($containerLeft, 'postOfficeBox', _('Post office box'));
$this->addSimpleInputTextField($containerLeft, 'postalCode', _('Postal code')); $this->addSimpleInputTextField($containerLeft, 'postalCode', _('Postal code'));
@ -1137,7 +1136,7 @@ class windowsUser extends baseModule implements passwordService {
$this->addSimpleInputTextField($containerLeft, 'st', _('State')); $this->addSimpleInputTextField($containerLeft, 'st', _('State'));
$this->addSimpleInputTextField($containerLeft, 'physicalDeliveryOfficeName', _('Office name')); $this->addSimpleInputTextField($containerLeft, 'physicalDeliveryOfficeName', _('Office name'));
// contact data area // contact data area
$containerLeft->addElement(new htmlSubTitle(_('Contact data')), true); $containerLeft->add(new htmlSubTitle(_('Contact data')), 12);
$this->addSimpleInputTextField($containerLeft, 'mail', _('Email address')); $this->addSimpleInputTextField($containerLeft, 'mail', _('Email address'));
$this->addMultiValueInputTextField($containerLeft, 'otherMailbox', _('Email alias')); $this->addMultiValueInputTextField($containerLeft, 'otherMailbox', _('Email alias'));
if (!$this->isBooleanConfigOptionSet('windowsUser_hideproxyAddresses', true)) { if (!$this->isBooleanConfigOptionSet('windowsUser_hideproxyAddresses', true)) {
@ -1164,7 +1163,7 @@ class windowsUser extends baseModule implements passwordService {
$this->addMultiValueInputTextField($containerLeft, 'url', _('Other web sites')); $this->addMultiValueInputTextField($containerLeft, 'url', _('Other web sites'));
// work details area // work details area
if ($this->manageWorkDetails()) { if ($this->manageWorkDetails()) {
$containerLeft->addElement(new htmlSubTitle(_('Work details')), true); $containerLeft->add(new htmlSubTitle(_('Work details')), 12);
if (!$this->isBooleanConfigOptionSet('windowsUser_hidetitle', true)) { if (!$this->isBooleanConfigOptionSet('windowsUser_hidetitle', true)) {
$this->addSimpleInputTextField($containerLeft, 'title', _('Job title'), false, null, false, array_slice($this->titleCache, 0, 300)); $this->addSimpleInputTextField($containerLeft, 'title', _('Job title'), false, null, false, array_slice($this->titleCache, 0, 300));
} }
@ -1196,55 +1195,63 @@ class windowsUser extends baseModule implements passwordService {
$this->addMultiValueInputTextField($containerLeft, 'o', _('Organisation'), false, null, false, array_slice($this->oCache, 0, 300)); $this->addMultiValueInputTextField($containerLeft, 'o', _('Organisation'), false, null, false, array_slice($this->oCache, 0, 300));
} }
if (!$this->isBooleanConfigOptionSet('windowsUser_hidemanager', true)) { if (!$this->isBooleanConfigOptionSet('windowsUser_hidemanager', true)) {
$containerLeft->addElement(new htmlOutputText(_('Manager'))); $containerLeft->addLabel(new htmlOutputText(_('Manager')));
$managerGroup = new htmlGroup(); $managerGroup = new htmlGroup();
$managerVal = (empty($this->attributes['manager'][0])) ? '-' : getAbstractDN($this->attributes['manager'][0]); $managerVal = (empty($this->attributes['manager'][0])) ? '-' : getAbstractDN($this->attributes['manager'][0]);
$managerGroup->addElement(new htmlOutputText($managerVal)); $managerGroup->addElement(new htmlOutputText($managerVal));
$managerGroup->addElement(new htmlSpacer('5px', null)); $managerGroup->addElement(new htmlSpacer('0.5rem', null));
$managerGroup->addElement(new htmlAccountPageButton(get_class($this), 'manager', 'change', _("Change"))); $managerGroup->addElement(new htmlAccountPageButton(get_class($this), 'manager', 'change', _("Change")));
$containerLeft->addElement($managerGroup); $managerGroup->addElement(new htmlSpacer('0.5rem', null));
$containerLeft->addElement(new htmlHelpLink('manager'), true); $managerGroup->addElement(new htmlHelpLink('manager'), true);
$containerLeft->addField($managerGroup);
} }
} }
// account area // account area
$containerLeft->addElement(new htmlSubTitle(_('Account')), true); $containerLeft->add(new htmlSubTitle(_('Account')), 12);
// password change required // password change required
$pwdMustChange = false; $pwdMustChange = false;
if (isset($this->attributes['pwdLastSet'][0]) && ($this->attributes['pwdLastSet'][0] === '0')) { if (isset($this->attributes['pwdLastSet'][0]) && ($this->attributes['pwdLastSet'][0] === '0')) {
$pwdMustChange = true; $pwdMustChange = true;
} }
$containerLeft->addElement(new htmlTableExtendedInputCheckbox('forcePasswordChangeOption', $pwdMustChange, _("User must change password"), 'pwdMustChange'), true); $containerLeft->add(new htmlResponsiveInputCheckbox('forcePasswordChangeOption', $pwdMustChange, _("User must change password"), 'pwdMustChange'), 12);
// deactivated // deactivated
$deactivated = windowsUser::isDeactivated($this->attributes); $deactivated = windowsUser::isDeactivated($this->attributes);
$containerLeft->addElement(new htmlTableExtendedInputCheckbox('deactivated', $deactivated, _("Account is deactivated"), 'deactivated'), true); $containerLeft->add(new htmlResponsiveInputCheckbox('deactivated', $deactivated, _("Account is deactivated"), 'deactivated'), 12);
// password does not expire // password does not expire
$noExpire = windowsUser::isNeverExpiring($this->attributes); $noExpire = windowsUser::isNeverExpiring($this->attributes);
$containerLeft->addElement(new htmlTableExtendedInputCheckbox('noExpire', $noExpire, _("Password does not expire"), 'noExpire'), true); $containerLeft->add(new htmlResponsiveInputCheckbox('noExpire', $noExpire, _("Password does not expire"), 'noExpire'), 12);
// require smartcard // require smartcard
$requireCard = windowsUser::isSmartCardRequired($this->attributes); $requireCard = windowsUser::isSmartCardRequired($this->attributes);
$containerLeft->addElement(new htmlTableExtendedInputCheckbox('requireCard', $requireCard, _("Require smartcard"), 'requireCard'), true); $containerLeft->add(new htmlResponsiveInputCheckbox('requireCard', $requireCard, _("Require smartcard"), 'requireCard'), 12);
// account expiration // account expiration
$containerLeft->addElement(new htmlOutputText(_('Account expiration date'))); $containerLeft->addLabel(new htmlOutputText(_('Account expiration date')));
$accountExpiresGroup = new htmlGroup(); $accountExpiresGroup = new htmlGroup();
$accountExpiresGroup->addElement(new htmlOutputText($this->formatAccountExpires())); $accountExpiresGroup->addElement(new htmlOutputText($this->formatAccountExpires()));
$accountExpiresGroup->addElement(new htmlSpacer('5px', null)); $accountExpiresGroup->addElement(new htmlSpacer('0.5rem', null));
$accountExpiresGroup->addElement(new htmlAccountPageButton(get_class($this), 'accountExpires', 'edit', _('Change'))); $accountExpiresGroup->addElement(new htmlAccountPageButton(get_class($this), 'accountExpires', 'edit', _('Change')));
$containerLeft->addElement($accountExpiresGroup); $accountExpiresGroup->addElement(new htmlSpacer('0.5rem', null));
$containerLeft->addElement(new htmlHelpLink('accountExpires'), true); $accountExpiresGroup->addElement(new htmlHelpLink('accountExpires'), true);
$containerLeft->addField($accountExpiresGroup);
// last password change // last password change
if (!$this->isBooleanConfigOptionSet('windowsUser_hidepwdLastSet')) { if (!$this->isBooleanConfigOptionSet('windowsUser_hidepwdLastSet')) {
$containerLeft->addElement(new htmlOutputText(_('Last password change'))); $containerLeft->addLabel(new htmlOutputText(_('Last password change')));
$containerLeft->addElement(new htmlOutputText($this->formatPwdLastSet())); $pwdLastSetGroup = new htmlGroup();
$containerLeft->addElement(new htmlHelpLink('pwdLastSet'), true); $pwdLastSetGroup->addElement(new htmlOutputText($this->formatPwdLastSet()));
$pwdLastSetGroup->addElement(new htmlSpacer('0.5rem', null));
$pwdLastSetGroup->addElement(new htmlHelpLink('pwdLastSet'));
$containerLeft->addField($pwdLastSetGroup);
} }
// last login // last login
if (!$this->isBooleanConfigOptionSet('windowsUser_hidelastLogonTimestamp')) { if (!$this->isBooleanConfigOptionSet('windowsUser_hidelastLogonTimestamp')) {
$containerLeft->addElement(new htmlOutputText(_('Last login'))); $containerLeft->addLabel(new htmlOutputText(_('Last login')));
$containerLeft->addElement(new htmlOutputText($this->formatLastLogonTimestamp())); $lastLogonTimestampGroup = new htmlGroup();
$containerLeft->addElement(new htmlHelpLink('lastLogonTimestamp'), true); $lastLogonTimestampGroup->addElement(new htmlOutputText($this->formatLastLogonTimestamp()));
$lastLogonTimestampGroup->addElement(new htmlSpacer('0.5rem', null));
$lastLogonTimestampGroup->addElement(new htmlHelpLink('lastLogonTimestamp'));
$containerLeft->addField($lastLogonTimestampGroup);
} }
// user profile area // user profile area
$containerLeft->addElement(new htmlSubTitle(_('User profile')), true); $containerLeft->add(new htmlSubTitle(_('User profile')), 12);
// profile path // profile path
$this->addSimpleInputTextField($containerLeft, 'profilePath', _('Profile path')); $this->addSimpleInputTextField($containerLeft, 'profilePath', _('Profile path'));
// logon script // logon script
@ -1260,13 +1267,13 @@ class windowsUser extends baseModule implements passwordService {
else { else {
$selected = array('-'); $selected = array('-');
} }
$containerLeft->addElement(new htmlTableExtendedSelect('homeDrive', $drives, $selected, _('Home drive'), 'homeDrive'), true); $containerLeft->add(new htmlResponsiveSelect('homeDrive', $drives, $selected, _('Home drive'), 'homeDrive'), 12);
// home directory // home directory
$this->addSimpleInputTextField($containerLeft, 'homeDirectory', _('Home directory')); $this->addSimpleInputTextField($containerLeft, 'homeDirectory', _('Home directory'));
// NIS attributes // NIS attributes
if (!$this->isBooleanConfigOptionSet('windowsUser_hidemsSFU30Name', true) || !$this->isBooleanConfigOptionSet('windowsUser_hidemsSFU30NisDomain', true)) { if (!$this->isBooleanConfigOptionSet('windowsUser_hidemsSFU30Name', true) || !$this->isBooleanConfigOptionSet('windowsUser_hidemsSFU30NisDomain', true)) {
$containerLeft->addElement(new htmlSubTitle(_('NIS')), true); $containerLeft->add(new htmlSubTitle(_('NIS')), 12);
if (!$this->isBooleanConfigOptionSet('windowsUser_hidemsSFU30Name', true)) { if (!$this->isBooleanConfigOptionSet('windowsUser_hidemsSFU30Name', true)) {
$this->addSimpleInputTextField($containerLeft, 'msSFU30Name', _('NIS name')); $this->addSimpleInputTextField($containerLeft, 'msSFU30Name', _('NIS name'));
} }
@ -1275,14 +1282,9 @@ class windowsUser extends baseModule implements passwordService {
} }
} }
$containerLeft->addElement(new htmlEqualWidth(array('streetAddress', 'cn')), true); $containerRight = new htmlResponsiveRow();
$containerRight = new htmlTable();
$containerRight->alignment = htmlElement::ALIGN_TOP;
// photo // photo
if (!$this->isBooleanConfigOptionSet('windowsUser_hidejpegPhoto', true)) { if (!$this->isBooleanConfigOptionSet('windowsUser_hidejpegPhoto', true)) {
$imageContainer = new htmlTable();
$imageContainer->alignment = htmlElement::ALIGN_TOP;
$photoFile = '../../graphics/userDefault.png'; $photoFile = '../../graphics/userDefault.png';
$noPhoto = true; $noPhoto = true;
if (isset($this->attributes['jpegPhoto'][0])) { if (isset($this->attributes['jpegPhoto'][0])) {
@ -1296,20 +1298,20 @@ class windowsUser extends baseModule implements passwordService {
$img = new htmlImage($photoFile); $img = new htmlImage($photoFile);
$img->setCSSClasses(array('photo')); $img->setCSSClasses(array('photo'));
$img->enableLightbox(); $img->enableLightbox();
$imageContainer->addElement($img, true); $containerRight->add($img, 12);
$containerRight->addVerticalSpacer('0.5rem');
if ($noPhoto) { if ($noPhoto) {
$imageContainer->addElement(new htmlAccountPageButton(get_class($this), 'photo', 'open', _('Add photo'))); $containerRight->add(new htmlAccountPageButton(get_class($this), 'photo', 'open', _('Add photo')), 12);
} }
else { else {
$imageContainer->addElement(new htmlButton('delPhoto', _('Delete photo'))); $containerRight->add(new htmlButton('delPhoto', _('Delete photo')), 12);
} }
$containerRight->addElement($imageContainer, true); $containerRight->addVerticalSpacer('2rem');
$containerRight->addElement(new htmlSpacer(null, '20px'), true);
} }
// groups // groups
$containerRight->addElement(new htmlSubTitle(_('Groups')), true); $containerRight->add(new htmlSubTitle(_('Groups')), 12);
$containerRight->addElement(new htmlAccountPageButton(get_class($this), 'group', 'edit', _('Edit groups')), true); $containerRight->add(new htmlAccountPageButton(get_class($this), 'group', 'edit', _('Edit groups')), 12);
$containerRight->addElement(new htmlSpacer(null, '10px'), true); $containerRight->addVerticalSpacer('1rem');
$groupsList = new htmlGroup(); $groupsList = new htmlGroup();
$groupCNs = array(); $groupCNs = array();
for ($i = 0; $i < sizeof($this->groupList); $i++) { for ($i = 0; $i < sizeof($this->groupList); $i++) {
@ -1320,12 +1322,12 @@ class windowsUser extends baseModule implements passwordService {
$groupsList->addElement(new htmlOutputText($cn)); $groupsList->addElement(new htmlOutputText($cn));
$groupsList->addElement(new htmlOutputText('<br>', false)); $groupsList->addElement(new htmlOutputText('<br>', false));
} }
$containerRight->addElement($groupsList); $containerRight->add($groupsList, 12);
$container = new htmlTable(); $container = new htmlResponsiveRow();
$container->addElement($containerLeft); $container->add($containerLeft, 12, 7);
$container->addElement(new htmlSpacer('40px', null)); $container->add(new htmlSpacer('1rem', null), 0, 1);
$container->addElement($containerRight); $container->add($containerRight, 12, 4);
return $container; return $container;
} }