responsive self service

This commit is contained in:
Roland Gruber 2015-08-06 19:20:54 +00:00
parent 5342ee41ad
commit a74e645ea3
4 changed files with 119 additions and 122 deletions

View File

@ -936,7 +936,7 @@ class pykotaUser extends baseModule {
* @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) {
if ($passwordChangeOnly) { if ($passwordChangeOnly) {
@ -949,86 +949,70 @@ class pykotaUser extends baseModule {
if (in_array('pykotaBalance', $fields)) { if (in_array('pykotaBalance', $fields)) {
$pykotaBalance = ''; $pykotaBalance = '';
if (isset($attributes['pykotaBalance'][0])) $pykotaBalance = $attributes['pykotaBalance'][0]; if (isset($attributes['pykotaBalance'][0])) $pykotaBalance = $attributes['pykotaBalance'][0];
$return['pykotaBalance'] = new htmlTableRow(array( $row = new htmlResponsiveRow();
new htmlOutputText($this->getSelfServiceLabel('pykotaBalance', _('Balance'))), new htmlOutputText($pykotaBalance) $row->add(new htmlOutputText($this->getSelfServiceLabel('pykotaBalance', _('Balance'))), 12, 6, 6, 'responsiveLabel');
)); $row->add(new htmlOutputText($pykotaBalance), 12, 6, 6, 'responsiveField');
$return['pykotaBalance'] = $row;
} }
if (in_array('pykotaLifeTimePaid', $fields)) { if (in_array('pykotaLifeTimePaid', $fields)) {
$pykotaLifeTimePaid = ''; $pykotaLifeTimePaid = '';
if (isset($attributes['pykotaLifeTimePaid'][0])) $pykotaLifeTimePaid = $attributes['pykotaLifeTimePaid'][0]; if (isset($attributes['pykotaLifeTimePaid'][0])) $pykotaLifeTimePaid = $attributes['pykotaLifeTimePaid'][0];
$return['pykotaLifeTimePaid'] = new htmlTableRow(array( $row = new htmlResponsiveRow();
new htmlOutputText($this->getSelfServiceLabel('pykotaLifeTimePaid', _('Total paid'))), new htmlOutputText($pykotaLifeTimePaid) $row->add(new htmlOutputText($this->getSelfServiceLabel('pykotaLifeTimePaid', _('Total paid'))), 12, 6, 6, 'responsiveLabel');
)); $row->add(new htmlOutputText($pykotaLifeTimePaid), 12, 6, 6, 'responsiveField');
$return['pykotaLifeTimePaid'] = $row;
} }
// payment history // payment history
if (in_array('pykotaPayments', $fields)) { if (in_array('pykotaPayments', $fields)) {
$pykotaPayments = new htmlTable(); $pykotaPayments = new htmlResponsiveRow();
$pykotaPayments->colspan = 5;
if (!empty($attributes['pykotaPayments'][0])) { if (!empty($attributes['pykotaPayments'][0])) {
$spacer = new htmlSpacer('10px', null); $pykotaPayments->add(new htmlOutputText(_('Date')), 3, 3, 3, 'bold');
$pykotaPayments->addElement(new htmlOutputText(_('Date')), false, true); $pykotaPayments->add(new htmlOutputText(_('Amount')), 3, 3, 3, 'bold');
$pykotaPayments->addElement($spacer); $pykotaPayments->add(new htmlOutputText(_('Comment')), 6, 6, 6, 'bold');
$pykotaPayments->addElement(new htmlOutputText(_('Amount')), false, true);
$pykotaPayments->addElement($spacer);
$pykotaPayments->addElement(new htmlOutputText(_('Comment')), true, true);
rsort($attributes['pykotaPayments']); rsort($attributes['pykotaPayments']);
foreach ($attributes['pykotaPayments'] as $payment) { foreach ($attributes['pykotaPayments'] as $payment) {
$parts = explode(' # ', $payment); $parts = explode(' # ', $payment);
$pykotaPayments->addElement(new htmlOutputText($parts[0])); $pykotaPayments->add(new htmlOutputText($parts[0]), 3);
$pykotaPayments->addElement($spacer);
$amount = new htmlOutputText($parts[1]); $amount = new htmlOutputText($parts[1]);
$amount->alignment = htmlElement::ALIGN_RIGHT; $amount->alignment = htmlElement::ALIGN_RIGHT;
$pykotaPayments->addElement($amount); $pykotaPayments->add($amount, 3);
$pykotaPayments->addElement($spacer); $comment = empty($parts[2]) ? '' : $parts[2];
if (!empty($parts[2])) { $pykotaPayments->add(new htmlOutputText(base64_decode($parts[2])), 6);
$pykotaPayments->addElement(new htmlOutputText(base64_decode($parts[2])));
}
$pykotaPayments->addNewLine();
} }
} }
$pykotaPaymentsLabel = new htmlOutputText($this->getSelfServiceLabel('pykotaPayments', _('Payment history'))); $row->add(new htmlSpacer(null, '10px'), 12);
$pykotaPaymentsLabel->alignment = htmlElement::ALIGN_TOP; $row = new htmlResponsiveRow();
$return['pykotaPayments'] = new htmlTableRow(array( $row->add(new htmlOutputText($this->getSelfServiceLabel('pykotaPayments', _('Payment history'))), 12, 12, 12, 'bold text-left');
$pykotaPaymentsLabel, $pykotaPayments $row->add($pykotaPayments, 12);
)); $return['pykotaPayments'] = $row;
} }
// job history // job history
if (in_array('pykotaJobHistory', $fields) && !empty($this->selfServiceSettings->moduleSettings['pykotaUser_jobSuffix'][0]) && !empty($attributes['pykotaUserName'][0])) { if (in_array('pykotaJobHistory', $fields) && !empty($this->selfServiceSettings->moduleSettings['pykotaUser_jobSuffix'][0]) && !empty($attributes['pykotaUserName'][0])) {
$jobs = $this->getJobs($attributes['pykotaUserName'][0], $this->selfServiceSettings->moduleSettings['pykotaUser_jobSuffix'][0]); $jobs = $this->getJobs($attributes['pykotaUserName'][0], $this->selfServiceSettings->moduleSettings['pykotaUser_jobSuffix'][0]);
$pykotaJobs = new htmlTable(); $pykotaJobs = new htmlResponsiveRow();
$pykotaJobs->colspan = 5; $pykotaJobs->add(new htmlOutputText(_('Date')), 3, 3, 3, 'bold');
$spacer = new htmlSpacer('10px', null); $pykotaJobs->add(new htmlOutputText(_('Printer')), 3, 3, 3, 'bold');
$pykotaJobs->addElement(new htmlOutputText(_('Date')), false, true); $pykotaJobs->add(new htmlOutputText(_('Price')), 2, 2, 2, 'bold');
$pykotaJobs->addElement($spacer); $pykotaJobs->add(new htmlOutputText(_('Size')), 1, 1, 1, 'bold');
$pykotaJobs->addElement(new htmlOutputText(_('Printer')), false, true);
$pykotaJobs->addElement($spacer);
$pykotaJobs->addElement(new htmlOutputText(_('Price')), false, true);
$pykotaJobs->addElement($spacer);
$pykotaJobs->addElement(new htmlOutputText(_('Size')), false, true);
$pykotaJobs->addElement($spacer);
$title = new htmlOutputText(_('Title')); $title = new htmlOutputText(_('Title'));
$title->alignment = htmlElement::ALIGN_LEFT; $title->alignment = htmlElement::ALIGN_LEFT;
$pykotaJobs->addElement($title, true, true); $pykotaJobs->add($title, 3, 3, 3, 'bold');
foreach ($jobs as $job) { foreach ($jobs as $job) {
$pykotaJobs->addElement(new htmlOutputText(formatLDAPTimestamp($job['createtimestamp'][0]))); $pykotaJobs->add(new htmlOutputText(formatLDAPTimestamp($job['createtimestamp'][0])), 3);
$pykotaJobs->addElement($spacer); $pykotaJobs->add(new htmlOutputText($job['pykotaprintername'][0]), 3);
$pykotaJobs->addElement(new htmlOutputText($job['pykotaprintername'][0]));
$pykotaJobs->addElement($spacer);
$price = new htmlOutputText($job['pykotajobprice'][0]); $price = new htmlOutputText($job['pykotajobprice'][0]);
$price->alignment = htmlElement::ALIGN_RIGHT; $price->alignment = htmlElement::ALIGN_RIGHT;
$pykotaJobs->addElement($price); $pykotaJobs->add($price, 2);
$pykotaJobs->addElement($spacer);
$size = new htmlOutputText($job['pykotajobsize'][0]); $size = new htmlOutputText($job['pykotajobsize'][0]);
$size->alignment = htmlElement::ALIGN_RIGHT; $size->alignment = htmlElement::ALIGN_RIGHT;
$pykotaJobs->addElement($size); $pykotaJobs->add($size, 1);
$pykotaJobs->addElement($spacer); $pykotaJobs->add(new htmlOutputText($job['pykotatitle'][0]), 3);
$pykotaJobs->addElement(new htmlOutputText($job['pykotatitle'][0]), true);
} }
$pykotaJobsLabel = new htmlOutputText($this->getSelfServiceLabel('pykotaJobHistory', _('Job history'))); $row = new htmlResponsiveRow();
$pykotaJobsLabel->alignment = htmlElement::ALIGN_TOP; $row->add(new htmlSpacer(null, '10px'), 12);
$return['pykotaJobHistory'] = new htmlTableRow(array( $row->add(new htmlOutputText($this->getSelfServiceLabel('pykotaJobHistory', _('Job history'))), 12, 12, 12, 'bold text-left');
$pykotaJobsLabel, $pykotaJobs $row->add($pykotaJobs, 12);
)); $return['pykotaJobHistory'] = $row;
} }
return $return; return $return;
} }

View File

@ -66,7 +66,7 @@ class sambaSamAccount extends baseModule implements passwordService {
private $cachedDomainList = null; private $cachedDomainList = null;
/** delimiter for lamdaemon commands */ /** delimiter for lamdaemon commands */
private static $SPLIT_DELIMITER = "###x##y##x###"; private static $SPLIT_DELIMITER = "###x##y##x###";
/** /**
* Creates a new sambaSamAccount object. * Creates a new sambaSamAccount object.
@ -124,7 +124,7 @@ class sambaSamAccount 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() {
@ -135,7 +135,7 @@ class sambaSamAccount 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() {
@ -609,10 +609,10 @@ class sambaSamAccount extends baseModule implements passwordService {
if ($attrs['uid'][0]=='') return false; if ($attrs['uid'][0]=='') return false;
return true; return true;
} }
/** /**
* This function is used to check if all settings for this module have been made. * This function is used to check if all settings for this module have been made.
* *
* @see baseModule::module_complete * @see baseModule::module_complete
* *
* @return boolean true, if settings are complete * @return boolean true, if settings are complete
@ -624,7 +624,7 @@ class sambaSamAccount extends baseModule implements passwordService {
if ($this->get_scope() == "host") { if ($this->get_scope() == "host") {
$attrs = $this->getAccountContainer()->getAccountModule('posixAccount')->getAttributes(); $attrs = $this->getAccountContainer()->getAccountModule('posixAccount')->getAttributes();
if (substr($attrs['uid'][0], -1, 1) != '$') { if (substr($attrs['uid'][0], -1, 1) != '$') {
return false; return false;
} }
} }
if (!isset($this->attributes['sambaSID']) || ($this->attributes['sambaSID'] == '')) { if (!isset($this->attributes['sambaSID']) || ($this->attributes['sambaSID'] == '')) {
@ -1035,7 +1035,7 @@ class sambaSamAccount extends baseModule implements passwordService {
if (isset($this->attributes['sambaMungedDial'][0])) { if (isset($this->attributes['sambaMungedDial'][0])) {
$mDial->load($this->attributes['sambaMungedDial'][0]); $mDial->load($this->attributes['sambaMungedDial'][0]);
} }
$mDial->setTsLogin(!isset($_POST['tsAllowLogin'])); $mDial->setTsLogin(!isset($_POST['tsAllowLogin']));
$mDial->ctx['CtxWFHomeDir'] = $_POST['tsHomeDir']; $mDial->ctx['CtxWFHomeDir'] = $_POST['tsHomeDir'];
$mDial->ctx['CtxWFHomeDirDrive'] = $_POST['tsHomeDrive']; $mDial->ctx['CtxWFHomeDirDrive'] = $_POST['tsHomeDrive'];
$mDial->ctx['CtxWFProfilePath'] = $_POST['tsProfilePath']; $mDial->ctx['CtxWFProfilePath'] = $_POST['tsProfilePath'];
@ -1057,7 +1057,7 @@ class sambaSamAccount 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() {
@ -1168,7 +1168,7 @@ class sambaSamAccount extends baseModule implements passwordService {
$tempTable->addElement(new htmlAccountPageButton(get_class($this), 'time', 'sambaKickoffTime', _('Change'))); $tempTable->addElement(new htmlAccountPageButton(get_class($this), 'time', 'sambaKickoffTime', _('Change')));
$return->addElement($tempTable); $return->addElement($tempTable);
$return->addElement(new htmlHelpLink('expireDate'), true); $return->addElement(new htmlHelpLink('expireDate'), true);
// home drive // home drive
if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideHomeDrive')) { if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideHomeDrive')) {
$drives = array('-'); $drives = array('-');
for ($i=90; $i>67; $i--) $drives[] = chr($i).':'; for ($i=90; $i>67; $i--) $drives[] = chr($i).':';
@ -1278,7 +1278,7 @@ class sambaSamAccount extends baseModule implements passwordService {
} }
$return->addElement(new htmlSpacer(null, '10px'), true); $return->addElement(new htmlSpacer(null, '10px'), true);
$remButton = new htmlButton('remObjectClass', _('Remove Samba 3 extension')); $remButton = new htmlButton('remObjectClass', _('Remove Samba 3 extension'));
$remButton->colspan = 3; $remButton->colspan = 3;
$return->addElement($remButton); $return->addElement($remButton);
@ -1300,7 +1300,7 @@ class sambaSamAccount extends baseModule implements passwordService {
// Get list of all hosts. // Get list of all hosts.
$userWorkstations = array(); $userWorkstations = array();
$availableUserWorkstations = array(); $availableUserWorkstations = array();
$result = $this->getHostList(); $result = $this->getHostList();
foreach ($result as $host) $availableUserWorkstations[] = str_replace("$", '', $host); foreach ($result as $host) $availableUserWorkstations[] = str_replace("$", '', $host);
sort($availableUserWorkstations, SORT_STRING); sort($availableUserWorkstations, SORT_STRING);
@ -1327,9 +1327,9 @@ class sambaSamAccount extends baseModule implements passwordService {
$wsAvailSelect->setMultiSelect(true); $wsAvailSelect->setMultiSelect(true);
$return->addElement($wsAvailSelect); $return->addElement($wsAvailSelect);
$return->addNewLine(); $return->addNewLine();
$return->addElement(new htmlSpacer(null, '10px'), true); $return->addElement(new htmlSpacer(null, '10px'), true);
$backButton = new htmlAccountPageButton(get_class($this), 'attributes', 'back', _('Back')); $backButton = new htmlAccountPageButton(get_class($this), 'attributes', 'back', _('Back'));
$backButton->colspan = 3; $backButton->colspan = 3;
$return->addElement($backButton); $return->addElement($backButton);
@ -1393,11 +1393,11 @@ class sambaSamAccount extends baseModule implements passwordService {
} }
$return->addElement(new htmlOutputText("$hour:00 - $hour:59")); $return->addElement(new htmlOutputText("$hour:00 - $hour:59"));
for ($d = 0; $d < 7; $d++) { for ($d = 0; $d < 7; $d++) {
$return->addElement($boxes[$h][$d]); $return->addElement($boxes[$h][$d]);
} }
$return->addNewLine(); $return->addNewLine();
} }
$return->addElement(new htmlSpacer(null, '10px'), true); $return->addElement(new htmlSpacer(null, '10px'), true);
$buttonContainer = new htmlTable(); $buttonContainer = new htmlTable();
$buttonContainer->colspan = 5; $buttonContainer->colspan = 5;
@ -1454,7 +1454,7 @@ class sambaSamAccount extends baseModule implements passwordService {
$buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'back' . $attr, _('Cancel'))); $buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'back' . $attr, _('Cancel')));
$buttons->colspan = 6; $buttons->colspan = 6;
$return->addElement($buttons); $return->addElement($buttons);
return $return; return $return;
} }
/** /**
@ -1540,9 +1540,9 @@ class sambaSamAccount extends baseModule implements passwordService {
$buttonContainer->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'abort', _('Cancel'))); $buttonContainer->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'abort', _('Cancel')));
$buttonContainer->colspan = 3; $buttonContainer->colspan = 3;
$return->addElement($buttonContainer); $return->addElement($buttonContainer);
return $return; return $return;
} }
/** /**
* Displays manage profile path page. * Displays manage profile path page.
* *
@ -2225,7 +2225,7 @@ class sambaSamAccount 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();
@ -2236,27 +2236,27 @@ class sambaSamAccount extends baseModule implements passwordService {
return $return; return $return;
} }
if (in_array('password', $fields)) { if (in_array('password', $fields)) {
$pwdTable = new htmlTable(); $group = new htmlGroup();
$pwdTable->colspan = 3; $pwd1 = new htmlResponsiveInputField($this->getSelfServiceLabel('password', _('New password')), 'sambaSamAccount_password');
$pwd1 = new htmlTableExtendedInputField($this->getSelfServiceLabel('password', _('New password')), 'sambaSamAccount_password');
$pwd1->setIsPassword(true, true); $pwd1->setIsPassword(true, true);
$pwdTable->addElement($pwd1, true); $group->addElement($pwd1);
$pwd2 = new htmlTableExtendedInputField(_('Reenter password'), 'sambaSamAccount_password2'); $pwd2 = new htmlResponsiveInputField(_('Reenter password'), 'sambaSamAccount_password2');
$pwd2->setIsPassword(true); $pwd2->setIsPassword(true);
$pwd2->setSameValueFieldID('sambaSamAccount_password'); $pwd2->setSameValueFieldID('sambaSamAccount_password');
$pwdTable->addElement($pwd2); $group->addElement($pwd2);
$return['password'] = new htmlTableRow(array( $row = new htmlResponsiveRow();
$pwdTable $row->add($group, 12);
)); $return['password'] = $row;
} }
if (in_array('sambaPwdLastSet', $fields)) { if (in_array('sambaPwdLastSet', $fields)) {
$sambaPwdLastSet = ''; $sambaPwdLastSet = '';
if (isset($attributes['sambaPwdLastSet'][0])) { if (isset($attributes['sambaPwdLastSet'][0])) {
$sambaPwdLastSet = date('d.m.Y H:i', $attributes['sambaPwdLastSet'][0]); $sambaPwdLastSet = date('d.m.Y H:i', $attributes['sambaPwdLastSet'][0]);
} }
$return['sambaPwdLastSet'] = new htmlTableRow(array( $row = new htmlResponsiveRow();
new htmlOutputText($this->getSelfServiceLabel('sambaPwdLastSet', _('Last password change'))), new htmlOutputText($sambaPwdLastSet) $row->add(new htmlOutputText($this->getSelfServiceLabel('sambaPwdLastSet', _('Last password change'))), 12, 6, 6, 'responsiveLabel');
)); $row->add(new htmlOutputText($sambaPwdLastSet), 12, 6, 6, 'responsiveField');
$return['sambaPwdLastSet'] = $row;
} }
return $return; return $return;
} }
@ -2269,7 +2269,7 @@ class sambaSamAccount 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: array of values with informational value (e.g. to be used later by pre/postModify actions) * <br>info: array of 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
@ -2362,13 +2362,13 @@ class sambaSamAccount 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 true; return true;
} }
/** /**
* 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.
@ -2394,7 +2394,7 @@ class sambaSamAccount extends baseModule implements passwordService {
} }
return array(); return array();
} }
/** /**
* Returns the group name of the group with the given group ID. * Returns the group name of the group with the given group ID.
* *
@ -2408,7 +2408,7 @@ class sambaSamAccount extends baseModule implements passwordService {
} }
return null; return null;
} }
/** /**
* Returns the time when the user needs to change his password. * Returns the time when the user needs to change his password.
* *
@ -2422,7 +2422,7 @@ class sambaSamAccount extends baseModule implements passwordService {
$return = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; $return = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
// check if password expires at all // check if password expires at all
if ($this->noexpire) { if ($this->noexpire) {
return $return; return $return;
} }
// check if there is a time set for the last password change // check if there is a time set for the last password change
if (!isset($this->attributes['sambaPwdLastSet'][0])) { if (!isset($this->attributes['sambaPwdLastSet'][0])) {
@ -2440,7 +2440,7 @@ class sambaSamAccount extends baseModule implements passwordService {
} }
return $return; return $return;
} }
/** /**
* Returns the time when the user can change his password. * Returns the time when the user can change his password.
* *
@ -2468,7 +2468,7 @@ class sambaSamAccount extends baseModule implements passwordService {
} }
return $return; return $return;
} }
/** /**
* Returns a list of existing hosts. * Returns a list of existing hosts.
* *
@ -2533,25 +2533,25 @@ class sambaSamAccount extends baseModule implements passwordService {
$this->attributes['sambaKickoffTime'][0] = gmmktime(0, 0, 0, intval($month), intval($day), $this->attributes['sambaKickoffTime'][0] = gmmktime(0, 0, 0, intval($month), intval($day),
intval($year)); intval($year));
} }
/** /**
* Returns if the Samba extension is enabled. * Returns if the Samba extension is enabled.
* *
* @return boolean Samba extension is active * @return boolean Samba extension is active
*/ */
public function isExtensionEnabled() { public function isExtensionEnabled() {
return in_array('sambaSamAccount', $this->attributes['objectClass']); return in_array('sambaSamAccount', $this->attributes['objectClass']);
} }
/** /**
* Returns if the Samba part of the current account is deactivated. * Returns if the Samba part of the current account is deactivated.
* *
* @return boolean account is locked * @return boolean account is locked
*/ */
public function isDeactivated() { public function isDeactivated() {
return $this->deactivated; return $this->deactivated;
} }
/** /**
* Deactivates this account. * Deactivates this account.
*/ */
@ -2563,7 +2563,7 @@ class sambaSamAccount extends baseModule implements passwordService {
} }
$this->attributes['sambaAcctFlags'][0] = $flags; $this->attributes['sambaAcctFlags'][0] = $flags;
} }
/** /**
* Activates this account. * Activates this account.
*/ */
@ -2572,7 +2572,7 @@ class sambaSamAccount extends baseModule implements passwordService {
$this->attributes['sambaAcctFlags'][0] = str_replace('D', '', $this->attributes['sambaAcctFlags'][0]); $this->attributes['sambaAcctFlags'][0] = str_replace('D', '', $this->attributes['sambaAcctFlags'][0]);
$this->attributes['sambaAcctFlags'][0] = str_replace(']', ' ]', $this->attributes['sambaAcctFlags'][0]); $this->attributes['sambaAcctFlags'][0] = str_replace(']', ' ]', $this->attributes['sambaAcctFlags'][0]);
} }
} }
?> ?>

View File

@ -37,7 +37,7 @@ $Id$
* @package modules * @package modules
*/ */
class shadowAccount extends baseModule implements passwordService { class shadowAccount extends baseModule implements passwordService {
/** /**
* Creates a new shadowAccount object. * Creates a new shadowAccount object.
* *
@ -69,7 +69,7 @@ class shadowAccount 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() {
@ -80,7 +80,7 @@ class shadowAccount 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() {
@ -318,7 +318,7 @@ class shadowAccount extends baseModule implements passwordService {
$pwdWarnInput->setFieldSize(5); $pwdWarnInput->setFieldSize(5);
$pwdWarnInput->setValidationRule(htmlElement::VALIDATE_NUMERIC); $pwdWarnInput->setValidationRule(htmlElement::VALIDATE_NUMERIC);
$return->addElement($pwdWarnInput, true); $return->addElement($pwdWarnInput, true);
$shPwdExpiration = ''; $shPwdExpiration = '';
if (isset($this->attributes['shadowInactive'][0])) $shPwdExpiration = $this->attributes['shadowInactive'][0]; if (isset($this->attributes['shadowInactive'][0])) $shPwdExpiration = $this->attributes['shadowInactive'][0];
$pwdExpInput = new htmlTableExtendedInputField(_('Password expiration'), 'shadowInactive', $shPwdExpiration, 'shadowInactive'); $pwdExpInput = new htmlTableExtendedInputField(_('Password expiration'), 'shadowInactive', $shPwdExpiration, 'shadowInactive');
@ -326,7 +326,7 @@ class shadowAccount extends baseModule implements passwordService {
$pwdExpInput->setFieldSize(5); $pwdExpInput->setFieldSize(5);
$pwdExpInput->setValidationRule(htmlElement::VALIDATE_NUMERIC); $pwdExpInput->setValidationRule(htmlElement::VALIDATE_NUMERIC);
$return->addElement($pwdExpInput, true); $return->addElement($pwdExpInput, true);
$shMinAge = ''; $shMinAge = '';
if (isset($this->attributes['shadowMin'][0])) $shMinAge = $this->attributes['shadowMin'][0]; if (isset($this->attributes['shadowMin'][0])) $shMinAge = $this->attributes['shadowMin'][0];
$minAgeInput = new htmlTableExtendedInputField(_('Minimum password age'), 'shadowMin', $shMinAge, 'shadowMin'); $minAgeInput = new htmlTableExtendedInputField(_('Minimum password age'), 'shadowMin', $shMinAge, 'shadowMin');
@ -334,7 +334,7 @@ class shadowAccount extends baseModule implements passwordService {
$minAgeInput->setFieldSize(5); $minAgeInput->setFieldSize(5);
$minAgeInput->setValidationRule(htmlElement::VALIDATE_NUMERIC); $minAgeInput->setValidationRule(htmlElement::VALIDATE_NUMERIC);
$return->addElement($minAgeInput, true); $return->addElement($minAgeInput, true);
$shMaxAge = ''; $shMaxAge = '';
if (isset($this->attributes['shadowMax'][0])) $shMaxAge = $this->attributes['shadowMax'][0]; if (isset($this->attributes['shadowMax'][0])) $shMaxAge = $this->attributes['shadowMax'][0];
$maxAgeInput = new htmlTableExtendedInputField(_('Maximum password age'), 'shadowMax', $shMaxAge, 'shadowMax'); $maxAgeInput = new htmlTableExtendedInputField(_('Maximum password age'), 'shadowMax', $shMaxAge, 'shadowMax');
@ -342,7 +342,7 @@ class shadowAccount extends baseModule implements passwordService {
$maxAgeInput->setFieldSize(5); $maxAgeInput->setFieldSize(5);
$maxAgeInput->setValidationRule(htmlElement::VALIDATE_NUMERIC); $maxAgeInput->setValidationRule(htmlElement::VALIDATE_NUMERIC);
$return->addElement($maxAgeInput, true); $return->addElement($maxAgeInput, true);
$expirationDate = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; $expirationDate = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
if (isset($this->attributes['shadowExpire'][0])) { if (isset($this->attributes['shadowExpire'][0])) {
$shAccExpirationDate = $this->attributes['shadowExpire'][0]; $shAccExpirationDate = $this->attributes['shadowExpire'][0];
@ -355,7 +355,7 @@ class shadowAccount extends baseModule implements passwordService {
$expireTable->addElement(new htmlAccountPageButton('shadowAccount', 'expire', 'open', 'edit.png', true, _('Change'))); $expireTable->addElement(new htmlAccountPageButton('shadowAccount', 'expire', 'open', 'edit.png', true, _('Change')));
$return->addElement($expireTable); $return->addElement($expireTable);
$return->addElement(new htmlHelpLink('shadowExpire'), true); $return->addElement(new htmlHelpLink('shadowExpire'), true);
$pwdChangeDate = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; $pwdChangeDate = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
if (isset($this->attributes['shadowLastChange'][0])) { if (isset($this->attributes['shadowLastChange'][0])) {
$shPwdChangeDate = $this->attributes['shadowLastChange'][0]; $shPwdChangeDate = $this->attributes['shadowLastChange'][0];
@ -371,7 +371,7 @@ class shadowAccount extends baseModule implements passwordService {
} }
$return->addElement($pwdChangeTable); $return->addElement($pwdChangeTable);
$return->addElement(new htmlHelpLink('shadowLastChange'), true); $return->addElement(new htmlHelpLink('shadowLastChange'), true);
$return->addElement(new htmlOutputText(''), true); $return->addElement(new htmlOutputText(''), true);
$remButton = new htmlAccountPageButton('shadowAccount', 'attributes', 'remObjectClass', _('Remove Shadow account extension')); $remButton = new htmlAccountPageButton('shadowAccount', 'attributes', 'remObjectClass', _('Remove Shadow account extension'));
$remButton->colspan = 4; $remButton->colspan = 4;
@ -433,9 +433,9 @@ class shadowAccount extends baseModule implements passwordService {
null, null, null); null, null, null);
} }
} }
return $errors; return $errors;
} }
/** /**
* This function will create the meta HTML code to show a page with the expiration date. * This function will create the meta HTML code to show a page with the expiration date.
* *
@ -498,9 +498,9 @@ class shadowAccount extends baseModule implements passwordService {
elseif (isset($_POST['form_subpage_shadowAccount_attributes_delPwdChange'])) { elseif (isset($_POST['form_subpage_shadowAccount_attributes_delPwdChange'])) {
unset($this->attributes['shadowLastChange']); unset($this->attributes['shadowLastChange']);
} }
return $errors; return $errors;
} }
/** /**
* This function will create the meta HTML code to show a page with the password change date. * This function will create the meta HTML code to show a page with the password change date.
* *
@ -654,13 +654,13 @@ class shadowAccount 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 true; return true;
} }
/** /**
* 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.
@ -702,7 +702,7 @@ class shadowAccount extends baseModule implements passwordService {
$this->attributes['shadowExpire'][0] = intval(gmmktime(0, 0, 0, intval($month), intval($day), $this->attributes['shadowExpire'][0] = intval(gmmktime(0, 0, 0, intval($month), intval($day),
intval($year))/3600/24); intval($year))/3600/24);
} }
/** /**
* Sets the last password change date of this account. * Sets the last password change date of this account.
* If all parameters are null the password change date will be removed. * If all parameters are null the password change date will be removed.
@ -719,7 +719,7 @@ class shadowAccount extends baseModule implements passwordService {
$this->attributes['shadowLastChange'][0] = intval(gmmktime(0, 0, 0, intval($month), intval($day), $this->attributes['shadowLastChange'][0] = intval(gmmktime(0, 0, 0, intval($month), intval($day),
intval($year))/3600/24); intval($year))/3600/24);
} }
/** /**
* Returns the meta HTML code for each input field. * Returns the meta HTML code for each input field.
* format: array(<field1> => array(<META HTML>), ...) * format: array(<field1> => array(<META HTML>), ...)
@ -729,7 +729,7 @@ class shadowAccount 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();
@ -742,9 +742,10 @@ class shadowAccount extends baseModule implements passwordService {
$date = getdate($attributes['shadowLastChange'][0] * 3600 * 24); $date = getdate($attributes['shadowLastChange'][0] * 3600 * 24);
$shadowLastChange = $date['mday'] . "." . $date['mon'] . "." . $date['year']; $shadowLastChange = $date['mday'] . "." . $date['mon'] . "." . $date['year'];
} }
$return['shadowLastChange'] = new htmlTableRow(array( $row = new htmlResponsiveRow();
new htmlOutputText($this->getSelfServiceLabel('shadowLastChange', _('Last password change'))), new htmlOutputText($shadowLastChange) $row->add(new htmlOutputText($this->getSelfServiceLabel('shadowLastChange', _('Last password change'))), 12, 6, 6, 'responsiveLabel');
)); $row->add(new htmlOutputText($shadowLastChange), 12, 6, 6, 'responsiveField');
$return['shadowLastChange'] = $row;
} }
return $return; return $return;
} }

View File

@ -149,6 +149,18 @@ table.collapse {
text-align: right; text-align: right;
} }
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.bold {
font-weight: bold;
}
/** buttons */ /** buttons */
.saveButton { .saveButton {
background-image: url(../graphics/save.png) !important; background-image: url(../graphics/save.png) !important;
@ -661,7 +673,7 @@ h4.schema_oclass_sub {
/** responsive styles */ /** responsive styles */
div.dialog-page { div.dialog-page {
max-width: 45em; float: left;
} }
/* mobile */ /* mobile */