use new meta HTML classes

This commit is contained in:
Roland Gruber 2010-10-09 14:37:15 +00:00
parent 38cb096ce3
commit 8b57f77d86
1 changed files with 132 additions and 212 deletions

View File

@ -684,12 +684,12 @@ class sambaSamAccount extends baseModule implements passwordService {
*/ */
function process_attributes() { function process_attributes() {
// add extension // add extension
if (isset($_POST['form_subpage_sambaSamAccount_attributes_addObjectClass'])) { if (isset($_POST['addObjectClass'])) {
$this->attributes['objectClass'][] = 'sambaSamAccount'; $this->attributes['objectClass'][] = 'sambaSamAccount';
return array(); return array();
} }
// remove extension // remove extension
elseif (isset($_POST['form_subpage_sambaSamAccount_attributes_remObjectClass'])) { elseif (isset($_POST['remObjectClass'])) {
$this->attributes['objectClass'] = array_delete(array('sambaSamAccount'), $this->attributes['objectClass']); $this->attributes['objectClass'] = array_delete(array('sambaSamAccount'), $this->attributes['objectClass']);
$attrKeys = array_keys($this->attributes); $attrKeys = array_keys($this->attributes);
for ($k = 0; $k < sizeof($attrKeys); $k++) { for ($k = 0; $k < sizeof($attrKeys); $k++) {
@ -823,7 +823,7 @@ class sambaSamAccount extends baseModule implements passwordService {
// Get Domain SID // Get Domain SID
$this->attributes['sambaPrimaryGroupSID'][0] = $SID."-".$this->rids[$rids[$i]]; $this->attributes['sambaPrimaryGroupSID'][0] = $SID."-".$this->rids[$rids[$i]];
} }
} }
if (!$wrid) { if (!$wrid) {
$gidnumber = $attrs['gidNumber'][0]; $gidnumber = $attrs['gidNumber'][0];
$groups = $_SESSION['cache']->get_cache(array('gidNumber', 'sambaSID'), 'sambaGroupMapping', 'group'); $groups = $_SESSION['cache']->get_cache(array('gidNumber', 'sambaSID'), 'sambaGroupMapping', 'group');
@ -1021,22 +1021,22 @@ 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 array HTML meta data * @return htmlElement HTML meta data
*/ */
function display_html_attributes() { function display_html_attributes() {
$return = array(); $return = new htmlTable();
if (in_array('sambaSamAccount', $this->attributes['objectClass'])) { if (in_array('sambaSamAccount', $this->attributes['objectClass'])) {
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) != '$') {
StatusMessage("ERROR", _('Host name must end with $!'), _('Please check your settings on the Unix page!')); $return->addElement(new htmlStatusMessage("ERROR", _('Host name must end with $!'), _('Please check your settings on the Unix page!')), true);
} }
} }
// Get Domain SID from user SID // Get Domain SID from user SID
$sambaDomains = search_domains(); $sambaDomains = search_domains();
if (sizeof($sambaDomains) == 0) { if (sizeof($sambaDomains) == 0) {
StatusMessage("ERROR", _('No Samba 3 domains found in LDAP! Please create one first.'), ''); $return->addElement(new htmlStatusMessage("ERROR", _('No Samba 3 domains found in LDAP! Please create one first.')), true);
return array(); return $return;
} }
if (isset($this->attributes['sambaSID'][0]) && $this->attributes['sambaSID'][0] != '') { if (isset($this->attributes['sambaSID'][0]) && $this->attributes['sambaSID'][0] != '') {
$domainSID = substr($this->attributes['sambaSID'][0], 0, strrpos($this->attributes['sambaSID'][0], "-")); $domainSID = substr($this->attributes['sambaSID'][0], 0, strrpos($this->attributes['sambaSID'][0], "-"));
@ -1057,54 +1057,40 @@ class sambaSamAccount extends baseModule implements passwordService {
} }
} }
} }
// display name
$displayName = ''; $displayName = '';
if (isset($this->attributes['displayName'][0])) $displayName = $this->attributes['displayName'][0]; if (isset($this->attributes['displayName'][0])) $displayName = $this->attributes['displayName'][0];
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Display name'), 'displayName', $displayName, 'displayName'), true);
array('kind' => 'text', 'text' => _('Display name')),
array('kind' => 'input', 'type' => 'text', 'name' => 'displayName', 'size' => '20', 'value' => $displayName),
array('kind' => 'help', 'value' => 'displayName'));
if ($this->get_scope()=='user') { if ($this->get_scope()=='user') {
$return[] = array( // user account
array('kind' => 'input', 'name' => 'sambaAcctFlagsU', 'type' => 'hidden', 'value' => 'true')); $return->addElement(new htmlHiddenInput('sambaAcctFlagsU', 'true'), true);
$return[] = array( // no password
array('kind' => 'text', 'text' => _('Use no password') ), $return->addElement(new htmlTableExtendedInputCheckbox('sambaAcctFlagsN', $this->nopwd, _('Use no password'), 'noPassword'), true);
array('kind' => 'input', 'name' => 'sambaAcctFlagsN', 'type' => 'checkbox', 'checked' => $this->nopwd), // no password expiry
array('kind' => 'help', 'value' => 'noPassword')); $return->addElement(new htmlTableExtendedInputCheckbox('sambaAcctFlagsX', $this->noexpire, _('Password does not expire'), 'noExpire'), true);
$return[] = array( // account deactivated
array('kind' => 'text', 'text' => _('Password does not expire') ), $return->addElement(new htmlTableExtendedInputCheckbox('sambaAcctFlagsD', $this->deactivated, _('Account is deactivated'), 'deactivated'), true);
array('kind' => 'input', 'name' => 'sambaAcctFlagsX', 'type' => 'checkbox', 'checked' => $this->noexpire), // account locked
array('kind' => 'help', 'value' => 'noExpire'));
$return[] = array(
array('kind' => 'text', 'text' => _('Account is deactivated') ),
array('kind' => 'input', 'name' => 'sambaAcctFlagsD', 'type' => 'checkbox', 'checked' => $this->deactivated),
array('kind' => 'help', 'value' => 'deactivated'));
$locked = false; $locked = false;
if (isset($this->attributes['sambaAcctFlags'][0]) && (strpos($this->attributes['sambaAcctFlags'][0], "L") !== false)) { if (isset($this->attributes['sambaAcctFlags'][0]) && (strpos($this->attributes['sambaAcctFlags'][0], "L") !== false)) {
$locked = true; $locked = true;
} }
$return[] = array( $return->addElement(new htmlTableExtendedInputCheckbox('sambaAcctFlagsL', $locked, _('Account is locked'), 'locked'), true);
array('kind' => 'text', 'text' => _('Account is locked') ), // password change at next login
array('kind' => 'input', 'name' => 'sambaAcctFlagsL', 'type' => 'checkbox', 'checked' => $locked), $return->addElement(new htmlTableExtendedInputCheckbox('passwordIsExpired', $this->expirePassword, _('Password change at next login'), 'passwordIsExpired'), true);
array('kind' => 'help', 'value' => 'locked')); // password can be changed
$return->addElement(new htmlOutputText(_('User can change password')));
$return[] = array( $tempTable = new htmlTable();
array('kind' => 'text', 'text' => _('Password change at next login') ), $tempTable->addElement(new htmlOutputText($this->getPasswordCanChangeTime($sambaDomains, $sel_domain), false));
array('kind' => 'input', 'name' => 'passwordIsExpired', 'type' => 'checkbox', 'checked' => $this->expirePassword), $return->addElement($tempTable);
array('kind' => 'help', 'value' => 'passwordIsExpired')); $return->addElement(new htmlHelpLink('pwdCanChange'), true);
// password must be changed
$return[] = array( $return->addElement(new htmlOutputText(_('User must change password')));
array('kind' => 'text', 'text' => _('User can change password')), $tempTable = new htmlTable();
array('kind' => 'table', 'value' => array(array( $tempTable->addElement(new htmlOutputText($this->getPasswordMustChangeTime($sambaDomains, $sel_domain), false));
array('kind' => 'text', 'text' => $this->getPasswordCanChangeTime($sambaDomains, $sel_domain)), $return->addElement($tempTable);
))), $return->addElement(new htmlHelpLink('pwdMustChange'), true);
array('kind' => 'help', 'value' => 'pwdCanChange' )); // account expiration time
$return[] = array(
array('kind' => 'text', 'text' => _('User must change password')),
array('kind' => 'table', 'value' => array(array(
array('kind' => 'text', 'text' => $this->getPasswordMustChangeTime($sambaDomains, $sel_domain)),
))),
array('kind' => 'help', 'value' => 'pwdMustChange' ));
$dateValue = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; $dateValue = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
if (isset($this->attributes['sambaKickoffTime'][0])) { if (isset($this->attributes['sambaKickoffTime'][0])) {
if ($this->attributes['sambaKickoffTime'][0] > 2147483648) { if ($this->attributes['sambaKickoffTime'][0] > 2147483648) {
@ -1115,14 +1101,13 @@ class sambaSamAccount extends baseModule implements passwordService {
$dateValue = $date['mday'] . "." . $date['mon'] . "." . $date['year']; $dateValue = $date['mday'] . "." . $date['mon'] . "." . $date['year'];
} }
} }
$return[] = array( $return->addElement(new htmlOutputText(_('Account expiration date')));
array('kind' => 'text', 'text' => _('Account expiration date')), $tempTable = new htmlTable();
array('kind' => 'table', 'value' => array(array( $tempTable->addElement(new htmlOutputText($dateValue, false));
array('kind' => 'text', 'text' => $dateValue), $tempTable->addElement(new htmlAccountPageButton(get_class($this), 'time', 'sambaKickoffTime', _('Change')));
array('kind' => 'input', 'name' => 'form_subpage_sambaSamAccount_time_sambaKickoffTime', 'type' => 'submit', 'value' => _('Change')) $return->addElement($tempTable);
))), $return->addElement(new htmlHelpLink('expireDate'), true);
array('kind' => 'help', 'value' => 'expireDate' )); // 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).':';
@ -1130,47 +1115,37 @@ class sambaSamAccount extends baseModule implements passwordService {
$selected = array ($this->attributes['sambaHomeDrive'][0]); $selected = array ($this->attributes['sambaHomeDrive'][0]);
} }
else $selected = array('-'); else $selected = array('-');
$return[] = array( $return->addElement(new htmlTableExtendedSelect('sambaHomeDrive', $drives, $selected, _('Home drive'), 'homeDrive'), true);
array('kind' => 'text', 'text' => _('Home drive') ),
array('kind' => 'select', 'name' => 'sambaHomeDrive', 'options' => $drives, 'options_selected' => $selected),
array('kind' => 'help', 'value' => 'homeDrive' ));
} }
// home path
if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideHomePath')) { if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideHomePath')) {
$sambaHomePath = ''; $sambaHomePath = '';
if (isset($this->attributes['sambaHomePath'][0])) { if (isset($this->attributes['sambaHomePath'][0])) {
$sambaHomePath = $this->attributes['sambaHomePath'][0]; $sambaHomePath = $this->attributes['sambaHomePath'][0];
} }
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Home path'), 'sambaHomePath', $sambaHomePath, 'homePath'), true);
array('kind' => 'text', 'text' => _('Home path') ),
array('kind' => 'input', 'type' => 'text', 'name' => 'sambaHomePath', 'size' => '20', 'maxlength' => '255', 'value' => $sambaHomePath),
array('kind' => 'help', 'value' => 'homePath' ));
} }
if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideProfilePath')) { if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideProfilePath')) {
$sambaProfilePath = ''; $sambaProfilePath = '';
if (isset($this->attributes['sambaProfilePath'][0])) { if (isset($this->attributes['sambaProfilePath'][0])) {
$sambaProfilePath = $this->attributes['sambaProfilePath'][0]; $sambaProfilePath = $this->attributes['sambaProfilePath'][0];
} }
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Profile path'), 'sambaProfilePath', $sambaProfilePath, 'profilePath'), true);
array('kind' => 'text', 'text' => _('Profile path') ),
array('kind' => 'input', 'type' => 'text', 'name' => 'sambaProfilePath', 'size' => '20', 'maxlength' => '255', 'value' => $sambaProfilePath),
array('kind' => 'help', 'value' => 'profilePath' ));
} }
// logon script
if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideLogonScript')) { if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideLogonScript')) {
$sambaLogonScript = ''; $sambaLogonScript = '';
if (isset($this->attributes['sambaLogonScript'][0])) { if (isset($this->attributes['sambaLogonScript'][0])) {
$sambaLogonScript = $this->attributes['sambaLogonScript'][0]; $sambaLogonScript = $this->attributes['sambaLogonScript'][0];
} }
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Logon script'), 'sambaLogonScript', $sambaLogonScript, 'scriptPath'), true);
array('kind' => 'text', 'text' => _('Logon script') ),
array('kind' => 'input', 'type' => 'text', 'name' => 'sambaLogonScript', 'size' => '20', 'maxlength' => '255', 'value' => $sambaLogonScript),
array('kind' => 'help', 'value' => 'scriptPath' ));
} }
if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideWorkstations')) { if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideWorkstations')) {
$return[] = array( $return->addElement(new htmlOutputText(_('Samba workstations')));
array('kind' => 'text', 'text' => _('Samba workstations') ), $return->addElement(new htmlAccountPageButton(get_class($this), 'sambaUserWorkstations', 'open', _('Edit workstations')));
array('kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_sambaSamAccount_sambaUserWorkstations_open', 'value' => _('Edit workstations')), $return->addElement(new htmlHelpLink('userWorkstations'), true);
array('kind' => 'help', 'value' => 'userWorkstations' ));
} }
// Windows group
$names = array_keys($this->rids); $names = array_keys($this->rids);
$wrid=false; $wrid=false;
$options = array(); $options = array();
@ -1180,15 +1155,14 @@ class sambaSamAccount extends baseModule implements passwordService {
$selected[] = $names[$i]; $selected[] = $names[$i];
$wrid=true; $wrid=true;
} }
else $options[] = $names[$i]; $options[] = $names[$i];
} }
$attrs = $this->getAccountContainer()->getAccountModule('posixAccount')->getAttributes(); $attrs = $this->getAccountContainer()->getAccountModule('posixAccount')->getAttributes();
if ($wrid) $options[] = $this->getGroupName($attrs['gidNumber'][0]); $options[] = $this->getGroupName($attrs['gidNumber'][0]);
else $selected[] = $this->getGroupName($attrs['gidNumber'][0]); if (!$wrid) {
$return[] = array( $selected[] = $this->getGroupName($attrs['gidNumber'][0]);
array('kind' => 'text', 'text' => _('Windows group')), }
array('kind' => 'select', 'name' => 'sambaPrimaryGroupSID', 'options' => $options, 'options_selected' => $selected), $return->addElement(new htmlTableExtendedSelect('sambaPrimaryGroupSID', $options, $selected, _('Windows group'), 'group'), true);
array('kind' => 'help', 'value' => 'group'));
// display if group SID should be mapped to a well known SID // display if group SID should be mapped to a well known SID
$options = array_keys($this->rids); $options = array_keys($this->rids);
$options[] = '-'; $options[] = '-';
@ -1204,51 +1178,41 @@ class sambaSamAccount extends baseModule implements passwordService {
} }
} }
else $selected[] = "-"; else $selected[] = "-";
$return[] = array( $return->addElement(new htmlTableExtendedSelect('sambaSID', $options, $selected, _('Special user'), 'specialUser'), true);
array('kind' => 'text', 'text' => _('Special user') ), }
array('kind' => 'select', 'name' => 'sambaSID', 'options' => $options, 'options_selected' => $selected), // domain
array('kind' => 'help', 'value' => 'specialUser' )); $return->addElement(new htmlTableExtendedSelect('sambaDomainName', $sambaDomainNames, $sel_domain, _('Domain'), 'domain'), true);
}
$return[] = array(
array('kind' => 'text', 'text' => _('Domain') . "*" ),
array('kind' => 'select', 'name' => 'sambaDomainName', 'options' => $sambaDomainNames, 'options_selected' => $sel_domain),
array('kind' => 'help', 'value' => 'domain' ));
// logon hours and terminal server options // logon hours and terminal server options
if ($this->get_scope()=='user') { if ($this->get_scope()=='user') {
if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideLogonHours')) { if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideLogonHours')) {
$return[] = array( $return->addElement(new htmlOutputText(_('Logon hours')));
array('kind' => 'text', 'text' => _('Logon hours')), $return->addElement(new htmlAccountPageButton(get_class($this), 'logonHours', 'open', _('Edit')));
array('kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_sambaSamAccount_logonHours_open', 'value' => _('Edit')), $return->addElement(new htmlHelpLink('logonHours'), true);
array('kind' => 'help', 'value' => 'logonHours'));
} }
if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideTerminalServer')) { if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideTerminalServer')) {
$return[] = array( $return->addElement(new htmlOutputText(_('Terminal server options')));
array('kind' => 'text', 'text' => _('Terminal server options') ), $return->addElement(new htmlAccountPageButton(get_class($this), 'terminalServer', 'open', _('Edit')));
array('kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_sambaSamAccount_terminalServer_open', 'value' => _('Edit')), $return->addElement(new htmlHelpLink('terminalServer'), true);
array('kind' => 'help', 'value' => 'terminalServer'));
} }
} }
// reset host password // reset host password
if ($this->get_scope()=='host') { if ($this->get_scope()=='host') {
$return[] = array(array ( 'kind' => 'input', 'name' => 'sambaAcctFlagsW', 'type' => 'hidden', 'value' => 'true' )); // host account
$return[] = array( $return->addElement(new htmlHiddenInput('sambaAcctFlagsW', 'true'), true);
array('kind' => 'text', 'text' => _('Reset password') ), // password reset
array('kind' => 'input', 'type' => 'submit', 'name' => 'ResetSambaPassword', 'value' => _('Reset')), $return->addElement(new htmlOutputText(_('Reset password')));
array('kind' => 'help', 'value' => 'resetPassword' )); $return->addElement(new htmlButton('ResetSambaPassword', _('Reset')));
$return->addElement(new htmlHelpLink('resetPassword'), true);
} }
$return[] = array(
array('kind' => 'text', 'text' => '&nbsp;') $return->addElement(new htmlSpacer(null, '10px'), true);
);
$return[] = array( $remButton = new htmlButton('remObjectClass', _('Remove Samba 3 extension'));
array('kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_sambaSamAccount_attributes_remObjectClass', $remButton->colspan = 3;
'value' => _('Remove Samba 3 extension'), 'td' => array('colspan' => '3')) $return->addElement($remButton);
);
} }
else { else {
$return[] = array( $return->addElement(new htmlButton('addObjectClass', _('Add Samba 3 extension')));
array('kind' => 'text', 'text' => '&nbsp;'),
array('kind' => 'input', 'type' => 'submit', 'name' => 'form_subpage_sambaSamAccount_attributes_addObjectClass', 'value' => _('Add Samba 3 extension'))
);
} }
return $return; return $return;
} }
@ -1381,7 +1345,7 @@ class sambaSamAccount extends baseModule implements passwordService {
* @return htmlElement meta HTML code * @return htmlElement meta HTML code
*/ */
function display_html_time() { function display_html_time() {
$return = array(); $return = new htmlTable();
// determine attribute // determine attribute
if (isset($_POST['form_subpage_sambaSamAccount_time_sambaKickoffTime'])) { if (isset($_POST['form_subpage_sambaSamAccount_time_sambaKickoffTime'])) {
$attr = 'sambaKickoffTime'; $attr = 'sambaKickoffTime';
@ -1396,46 +1360,37 @@ class sambaSamAccount extends baseModule implements passwordService {
for ( $i=1; $i<=31; $i++ ) $mday[] = $i; for ( $i=1; $i<=31; $i++ ) $mday[] = $i;
for ( $i=1; $i<=12; $i++ ) $mon[] = $i; for ( $i=1; $i<=12; $i++ ) $mon[] = $i;
for ( $i=2003; $i<=2030; $i++ ) $year[] = $i; for ( $i=2003; $i<=2030; $i++ ) $year[] = $i;
$return[] = array( $return->addElement(new htmlOutputText($text));
array('kind' => 'text', 'text' => $text), $return->addElement(new htmlSelect('expire_day', $mday, array($date['mday'])));
array('kind' => 'table', 'value' => array(array( $return->addElement(new htmlSelect('expire_mon', $mon, array($date['mon'])));
array('kind' => 'select', 'name' => 'expire_day', 'options' => $mday, 'options_selected' => $date['mday']), $return->addElement(new htmlSelect('expire_yea', $year, array($date['year'])));
array('kind' => 'select', 'name' => 'expire_mon', 'options' => $mon, 'options_selected' => $date['mon']), $return->addElement(new htmlHelpLink($help), true);
array('kind' => 'select', 'name' => 'expire_yea', 'options' => $year, 'options_selected' => $date['year'])))), $buttons = new htmlTable();
array('kind' => 'help', 'value' => $help)); $buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'change' . $attr, _('Change')));
$buttons = array();
$buttons[] = array('kind' => 'input', 'name' => 'form_subpage_sambaSamAccount_attributes_change' . $attr, 'type' => 'submit', 'value' => _('Change'));
if (isset($this->attributes[$attr][0])) { if (isset($this->attributes[$attr][0])) {
$buttons[] = array('kind' => 'input', 'name' => 'form_subpage_sambaSamAccount_attributes_del' . $attr, 'type' => 'submit', 'value' => _('Remove')); $buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'del' . $attr, _('Remove')));
} }
$buttons[] = array('kind' => 'input', 'name' => 'form_subpage_sambaSamAccount_attributes_back' . $attr, 'type' => 'submit', 'value' => _('Cancel')); $buttons->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'back' . $attr, _('Cancel')));
$return[] = array( $buttons->colspan = 6;
array('kind' => 'table', 'td' => array('colspan' => 3), 'value' => array($buttons)) $return->addElement($buttons);
);
return $return; return $return;
} }
/** /**
* This function will create the HTML page to edit the terminal server options. * This function will create the HTML page to edit the terminal server options.
* *
* @return array meta HTML code * @return htmlElement meta HTML code
*/ */
function display_html_terminalServer() { function display_html_terminalServer() {
$return = array(); $return = new htmlTable();
$mDial = new sambaMungedDial(); $mDial = new sambaMungedDial();
if (isset($this->attributes['sambaMungedDial'][0])) { if (isset($this->attributes['sambaMungedDial'][0])) {
$mDial->load($this->attributes['sambaMungedDial'][0]); $mDial->load($this->attributes['sambaMungedDial'][0]);
} }
// terminal server login // terminal server login
$return[] = array( $return->addElement(new htmlTableExtendedInputCheckbox('tsAllowLogin', $mDial->getTsLogin(), _('Allow terminal server login'), 'tsAllowLogin'), true);
array('kind' => 'text', 'text' => _('Allow terminal server login')),
array('kind' => 'input', 'name' => 'tsAllowLogin', 'type' => 'checkbox', 'checked' => $mDial->getTsLogin()),
array('kind' => 'help', 'value' => 'tsAllowLogin'));
// home directory // home directory
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Home directory'), 'tsHomeDir', $mDial->ctx['CtxWFHomeDir'], 'tsHomeDir'), true);
array('kind' => 'text', 'text' => _('Home directory')),
array('kind' => 'input', 'name' => 'tsHomeDir', 'type' => 'text', 'value' => $mDial->ctx['CtxWFHomeDir']),
array('kind' => 'help', 'value' => 'tsHomeDir'));
// home drive // home drive
$drives = array(); $drives = array();
for ($i=90; $i>67; $i--) $drives[] = chr($i).':'; for ($i=90; $i>67; $i--) $drives[] = chr($i).':';
@ -1443,96 +1398,61 @@ class sambaSamAccount extends baseModule implements passwordService {
if (isset($mDial->ctx['CtxWFHomeDirDrive'])) { if (isset($mDial->ctx['CtxWFHomeDirDrive'])) {
$selTsDrive = array($mDial->ctx['CtxWFHomeDirDrive']); $selTsDrive = array($mDial->ctx['CtxWFHomeDirDrive']);
} }
$return[] = array( $return->addElement(new htmlTableExtendedSelect('tsHomeDrive', $drives, $selTsDrive, _('Home drive'), 'homeDrive'), true);
array('kind' => 'text', 'text' => _('Home drive')),
array('kind' => 'select', 'size' => 1, 'name' => 'tsHomeDrive', 'options' => $drives, 'options_selected' => $selTsDrive),
array('kind' => 'help', 'value' => 'homeDrive'));
// profile path // profile path
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Profile path'), 'tsProfilePath', $mDial->ctx['CtxWFProfilePath'], 'tsProfilePath'), true);
array('kind' => 'text', 'text' => _('Profile path')),
array('kind' => 'input', 'name' => 'tsProfilePath', 'type' => 'text', 'value' => $mDial->ctx['CtxWFProfilePath']),
array('kind' => 'help', 'value' => 'tsProfilePath'));
// use startup program and working dir from client // use startup program and working dir from client
$return[] = array( $return->addElement(new htmlTableExtendedInputCheckbox('tsInherit', $mDial->getInheritMode(), _('Inherit client startup configuration'), 'tsInherit'), true);
array('kind' => 'text', 'text' => _('Inherit client startup configuration')),
array('kind' => 'input', 'name' => 'tsInherit', 'type' => 'checkbox', 'checked' => $mDial->getInheritMode()),
array('kind' => 'help', 'value' => 'tsInherit'));
// startup program // startup program
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Initial program'), 'tsInitialProgram', $mDial->ctx['CtxInitialProgram'], 'tsInitialProgram'), true);
array('kind' => 'text', 'text' => _('Initial program')),
array('kind' => 'input', 'name' => 'tsInitialProgram', 'type' => 'text', 'value' => $mDial->ctx['CtxInitialProgram']),
array('kind' => 'help', 'value' => 'tsInitialProgram'));
// working dir // working dir
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Working directory'), 'tsWorkDirectory', $mDial->ctx['CtxWorkDirectory'], 'tsWorkDirectory'), true);
array('kind' => 'text', 'text' => _('Working directory')),
array('kind' => 'input', 'name' => 'tsWorkDirectory', 'type' => 'text', 'value' => $mDial->ctx['CtxWorkDirectory']),
array('kind' => 'help', 'value' => 'tsWorkDirectory'));
// connection time limit // connection time limit
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Connection time limit'), 'tsConnectionLimit', $mDial->ctx['CtxMaxConnectionTime'], 'tsTimeLimit'), true);
array('kind' => 'text', 'text' => _('Connection time limit')),
array('kind' => 'input', 'name' => 'tsConnectionLimit', 'type' => 'text', 'value' => $mDial->ctx['CtxMaxConnectionTime']),
array('kind' => 'help', 'value' => 'tsTimeLimit'));
// disconnection time limit // disconnection time limit
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Disconnection time limit'), 'tsDisconnectionLimit', $mDial->ctx['CtxMaxDisconnectionTime'], 'tsTimeLimit'), true);
array('kind' => 'text', 'text' => _('Disconnection time limit')),
array('kind' => 'input', 'name' => 'tsDisconnectionLimit', 'type' => 'text', 'value' => $mDial->ctx['CtxMaxDisconnectionTime']),
array('kind' => 'help', 'value' => 'tsTimeLimit'));
// idle time limit // idle time limit
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Idle time limit'), 'tsIdleLimit', $mDial->ctx['CtxMaxIdleTime'], 'tsTimeLimit'), true);
array('kind' => 'text', 'text' => _('Idle time limit')),
array('kind' => 'input', 'name' => 'tsIdleLimit', 'type' => 'text', 'value' => $mDial->ctx['CtxMaxIdleTime']),
array('kind' => 'help', 'value' => 'tsTimeLimit'));
// connect client drives // connect client drives
$return[] = array( $return->addElement(new htmlTableExtendedInputCheckbox('tsConnectDrives', $mDial->getConnectClientDrives(), _('Connect client drives'), 'tsConnectDrives'), true);
array('kind' => 'text', 'text' => _('Connect client drives')),
array('kind' => 'input', 'name' => 'tsConnectDrives', 'type' => 'checkbox', 'checked' => $mDial->getConnectClientDrives()),
array('kind' => 'help', 'value' => 'tsConnectDrives'));
// connect client printers // connect client printers
$return[] = array( $return->addElement(new htmlTableExtendedInputCheckbox('tsConnectPrinters', $mDial->getConnectClientPrinters(), _('Connect client printers'), 'tsConnectPrinters'), true);
array('kind' => 'text', 'text' => _('Connect client printers')),
array('kind' => 'input', 'name' => 'tsConnectPrinters', 'type' => 'checkbox', 'checked' => $mDial->getConnectClientPrinters()),
array('kind' => 'help', 'value' => 'tsConnectPrinters'));
// client printer is default // client printer is default
$return[] = array( $return->addElement(new htmlTableExtendedInputCheckbox('tsClientPrinterDefault', $mDial->getDefaultPrinter(), _('Client printer is default'), 'tsClientPrinterDefault'), true);
array('kind' => 'text', 'text' => _('Client printer is default')),
array('kind' => 'input', 'name' => 'tsClientPrinterDefault', 'type' => 'checkbox', 'checked' => $mDial->getDefaultPrinter()),
array('kind' => 'help', 'value' => 'tsClientPrinterDefault'));
// shadowing // shadowing
$shadowOptions = array( $shadowOptions = array(
array("0", _("disabled")), _("disabled") => "0",
array("1", _("input on, notify on")), _("input on, notify on") => "1",
array("2", _("input on, notify off")), _("input on, notify off") => "2",
array("3", _("input off, notify on")), _("input off, notify on") => "3",
array("4", _("input off, notify off"))); _("input off, notify off") => "4");
$selShadow = array($mDial->getShadow()); $selShadow = array($mDial->getShadow());
$return[] = array( $shadowSelect = new htmlTableExtendedSelect('tsShadowing', $shadowOptions, $selShadow, _('Shadowing'), 'tsShadowing');
array('kind' => 'text', 'text' => _('Shadowing')), $shadowSelect->setHasDescriptiveElements(true);
array('kind' => 'select', 'size' => 1, 'name' => 'tsShadowing', 'descriptiveOptions' => true, 'options' => $shadowOptions, 'options_selected' => $selShadow), $return->addElement($shadowSelect, true);
array('kind' => 'help', 'value' => 'tsShadowing'));
// broken connection // broken connection
$brokenConnOptions = array( $brokenConnOptions = array(
array("0", _("disconnect")), _("disconnect") => "0",
array("1", _("reset"))); _("reset") => "1");
$selbrokenConn = array($mDial->getBrokenConn()); $selbrokenConn = array($mDial->getBrokenConn());
$return[] = array( $brokenConnSelect = new htmlTableExtendedSelect('tsBrokenConn', $brokenConnOptions, $selbrokenConn, _('On broken or timed out connection'), 'tsBrokenConn');
array('kind' => 'text', 'text' => _('On broken or timed out connection')), $brokenConnSelect->setHasDescriptiveElements(true);
array('kind' => 'select', 'size' => 1, 'name' => 'tsBrokenConn', 'descriptiveOptions' => true, 'options' => $brokenConnOptions, 'options_selected' => $selbrokenConn), $return->addElement($brokenConnSelect, true);
array('kind' => 'help', 'value' => 'tsBrokenConn'));
// reconnect // reconnect
$reconnectOptions = array( $reconnectOptions = array(
array("0", _("from any client")), _("from any client") => "0",
array("1", _("from previous client only"))); _("from previous client only") => "1");
$selReconnect = array($mDial->getReConn()); $selReconnect = array($mDial->getReConn());
$return[] = array( $reconnectSelect = new htmlTableExtendedSelect('tsReconnect', $reconnectOptions, $selReconnect, _('Reconnect if disconnected'), 'tsReconnect');
array('kind' => 'text', 'text' => _('Reconnect if disconnected')), $reconnectSelect->setHasDescriptiveElements(true);
array('kind' => 'select', 'size' => 1, 'name' => 'tsReconnect', 'descriptiveOptions' => true, 'options' => $reconnectOptions, 'options_selected' => $selReconnect), $return->addElement($reconnectSelect, true);
array('kind' => 'help', 'value' => 'tsReconnect'));
// buttons // buttons
$return[] = array(array('kind' => 'text', 'text' => '&nbsp;')); $return->addElement(new htmlSpacer(null, '10px'), true);
$return[] = array( $buttonContainer = new htmlTable();
array('kind' => 'input', 'name' => 'form_subpage_sambaSamAccount_attributes_submit', 'type' => 'submit', 'value' => _('Ok'), 'td' => array('align' => 'right')), $buttonContainer->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'submit', _('Ok')));
array('kind' => 'input', 'name' => 'form_subpage_sambaSamAccount_attributes_abort', 'type' => 'submit', 'value' => _('Cancel'), 'td' => array('align' => 'left')) $buttonContainer->addElement(new htmlAccountPageButton(get_class($this), 'attributes', 'abort', _('Cancel')));
); $buttonContainer->colspan = 3;
$return->addElement($buttonContainer);
return $return; return $return;
} }