diff --git a/lam/lib/types/user.inc b/lam/lib/types/user.inc
index 521c58ab..4e5a7032 100644
--- a/lam/lib/types/user.inc
+++ b/lam/lib/types/user.inc
@@ -301,97 +301,103 @@ class user extends baseType {
&& (!$unixAvailable || $unixLocked)
&& (!$sambaAvailable || $sambaLocked)
&& (!$ppolicyAvailable || $ppolicyLocked);
- $dialog = '
';
+
+ $container = new htmlTable();
+
// show radio buttons for lock/unlock
$radioDisabled = true;
- $lockChecked = ' checked="checked"';
- $unlockChecked = '';
+ $selectedRadio = 'lock';
$onchange = '';
if ($partiallyLocked && !$fullyLocked) {
$radioDisabled = false;
- $onchange = ' onchange="if (jQuery(\'#lam_accountStatusActionRadioLock:checked\').val()) {' .
+ $onchange = 'if (jQuery(\'#lam_accountStatusAction0:checked\').val()) {' .
'jQuery(\'#lam_accountStatusDialogLockDiv\').removeClass(\'hidden\');' .
'jQuery(\'#lam_accountStatusDialogUnlockDiv\').addClass(\'hidden\');' .
'}' .
'else {' .
'jQuery(\'#lam_accountStatusDialogLockDiv\').addClass(\'hidden\');' .
'jQuery(\'#lam_accountStatusDialogUnlockDiv\').removeClass(\'hidden\');' .
- '};"';
+ '};';
}
if ($fullyLocked) {
- $lockChecked = '';
- $unlockChecked = ' checked="checked"';
+ $selectedRadio = 'unlock';
}
if (!$radioDisabled) {
- $dialog .= '
' . _('Lock') . '
';
- $dialog .= '
' . _('Unlock') . '
';
+ $radio = new htmlRadio('lam_accountStatusAction', array(_('Lock') => 'lock', _('Unlock') => 'unlock'), $selectedRadio);
+ $radio->setOnchangeEvent($onchange);
+ $container->addElement($radio, true);
}
else {
- $radioValue = 'lock';
- if ($lockChecked == '') {
- $radioValue = 'unlock';
- }
- $dialog .= '
' . _('Lock') . '
';
- $dialog .= '
' . _('Unlock') . '
';
- $dialog .= '
';
+ $radio = new htmlRadio('lam_accountStatusActionDisabled', array(_('Lock') => 'lock', _('Unlock') => 'unlock'), $selectedRadio);
+ $radio->setIsEnabled(false);
+ $container->addElement($radio, true);
+ $container->addElement(new htmlHiddenInput('lam_accountStatusAction', $selectedRadio), true);
}
- $dialog .= '
';
+
+ $container->addElement(new htmlHiddenInput('lam_accountStatusResult', 'cancel'), true);
+
// locking part
if (!$fullyLocked) {
- $dialog .= '
';
+ $lockContent = new htmlTable();
+
if ($unixAvailable && !$unixLocked) {
- $dialog .= ' | ';
- $dialog .= ' | ';
- $dialog .= '' . _('Unix') . ' | ';
+ $lockContent->addElement(new htmlImage('../../graphics/tux.png'));
+ $lockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusLockUnix', true, _('Unix'), null, false), true);
}
if ($sambaAvailable && !$sambaLocked) {
- $dialog .= '
| ';
- $dialog .= ' | ';
- $dialog .= '' . _('Samba 3') . ' | ';
+ $lockContent->addElement(new htmlImage('../../graphics/samba.png'));
+ $lockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusLockSamba', true, _('Samba 3'), null, false), true);
}
if ($ppolicyAvailable && !$ppolicyLocked) {
- $dialog .= '
| ';
- $dialog .= ' | ';
- $dialog .= '' . _('PPolicy') . ' | ';
+ $lockContent->addElement(new htmlImage('../../graphics/security.png'));
+ $lockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusLockPPolicy', true, _('PPolicy'), null, false), true);
}
if ($unixAvailable) {
- $dialog .= '
| ';
- $dialog .= ' | ';
- $dialog .= '' . _('Remove from all Unix groups') . ' | ';
+ $lockContent->addElement(new htmlImage('../../graphics/groupBig.png'));
+ $lockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusRemoveUnixGroups', true, _('Remove from all Unix groups'), null, false), true);
}
if ($unixAvailable && posixAccount::areGroupOfNamesActive()) { // check unixAvailable because Unix module removes group memberships
- $dialog .= '
| ';
- $dialog .= ' | ';
- $dialog .= '' . _('Remove from all group of (unique) names') . ' | ';
+ $lockContent->addElement(new htmlImage('../../graphics/groupBig.png'));
+ $lockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusRemoveGONGroups', true, _('Remove from all group of (unique) names'), null, false), true);
}
- $dialog .= '
';
+
+ $lockDiv = new htmlDiv('lam_accountStatusDialogLockDiv', $lockContent);
+ $container->addElement($lockDiv, true);
}
// unlocking part
if ($partiallyLocked) {
- $unlockClass = 'hidden';
- if ($fullyLocked) {
- $unlockClass = '';
- }
- $dialog .= '
';
+ $unlockContent = new htmlTable();
+
if ($unixAvailable && $unixLocked) {
- $dialog .= ' | ';
- $dialog .= ' | ';
- $dialog .= '' . _('Unix') . ' | ';
+ $unlockContent->addElement(new htmlImage('../../graphics/tux.png'));
+ $unlockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusUnlockUnix', true, _('Unix'), null, false), true);
}
if ($sambaAvailable && $sambaLocked) {
- $dialog .= '
| ';
- $dialog .= ' | ';
- $dialog .= '' . _('Samba 3') . ' | ';
+ $unlockContent->addElement(new htmlImage('../../graphics/samba.png'));
+ $unlockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusUnlockSamba', true, _('Samba 3'), null, false), true);
}
if ($ppolicyAvailable && $ppolicyLocked) {
- $dialog .= '
| ';
- $dialog .= ' | ';
- $dialog .= '' . _('PPolicy') . ' | ';
+ $unlockContent->addElement(new htmlImage('../../graphics/security.png'));
+ $unlockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusUnlockPPolicy', true, _('PPolicy'), null, false), true);
}
- $dialog .= '
';
+
+ $unlockDiv = new htmlDiv('lam_accountStatusDialogUnlockDiv', $unlockContent);
+ if (!$fullyLocked) {
+ $unlockDiv->setCSSClasses(array('hidden'));
+ }
+ $container->addElement($unlockDiv, true);
}
- $dialog .= '
';
- return $dialog;
+
+ $div = new htmlDiv('lam_accountStatusDialog', $container);
+ $div->setCSSClasses(array('hidden'));
+
+ $tabindex = 999;
+ ob_start();
+ parseHtml(null, $div, array(), false, $tabindex, 'user');
+ $output = ob_get_contents();
+ ob_clean();
+
+ return $output;
}
/**