meta HTML
This commit is contained in:
parent
283f8ccbdc
commit
2e63c5685d
|
@ -301,97 +301,103 @@ class user extends baseType {
|
||||||
&& (!$unixAvailable || $unixLocked)
|
&& (!$unixAvailable || $unixLocked)
|
||||||
&& (!$sambaAvailable || $sambaLocked)
|
&& (!$sambaAvailable || $sambaLocked)
|
||||||
&& (!$ppolicyAvailable || $ppolicyLocked);
|
&& (!$ppolicyAvailable || $ppolicyLocked);
|
||||||
$dialog = '<div id="lam_accountStatusDialog" class="hidden">';
|
|
||||||
|
$container = new htmlTable();
|
||||||
|
|
||||||
// show radio buttons for lock/unlock
|
// show radio buttons for lock/unlock
|
||||||
$radioDisabled = true;
|
$radioDisabled = true;
|
||||||
$lockChecked = ' checked="checked"';
|
$selectedRadio = 'lock';
|
||||||
$unlockChecked = '';
|
|
||||||
$onchange = '';
|
$onchange = '';
|
||||||
if ($partiallyLocked && !$fullyLocked) {
|
if ($partiallyLocked && !$fullyLocked) {
|
||||||
$radioDisabled = false;
|
$radioDisabled = false;
|
||||||
$onchange = ' onchange="if (jQuery(\'#lam_accountStatusActionRadioLock:checked\').val()) {' .
|
$onchange = 'if (jQuery(\'#lam_accountStatusAction0:checked\').val()) {' .
|
||||||
'jQuery(\'#lam_accountStatusDialogLockDiv\').removeClass(\'hidden\');' .
|
'jQuery(\'#lam_accountStatusDialogLockDiv\').removeClass(\'hidden\');' .
|
||||||
'jQuery(\'#lam_accountStatusDialogUnlockDiv\').addClass(\'hidden\');' .
|
'jQuery(\'#lam_accountStatusDialogUnlockDiv\').addClass(\'hidden\');' .
|
||||||
'}' .
|
'}' .
|
||||||
'else {' .
|
'else {' .
|
||||||
'jQuery(\'#lam_accountStatusDialogLockDiv\').addClass(\'hidden\');' .
|
'jQuery(\'#lam_accountStatusDialogLockDiv\').addClass(\'hidden\');' .
|
||||||
'jQuery(\'#lam_accountStatusDialogUnlockDiv\').removeClass(\'hidden\');' .
|
'jQuery(\'#lam_accountStatusDialogUnlockDiv\').removeClass(\'hidden\');' .
|
||||||
'};"';
|
'};';
|
||||||
}
|
}
|
||||||
if ($fullyLocked) {
|
if ($fullyLocked) {
|
||||||
$lockChecked = '';
|
$selectedRadio = 'unlock';
|
||||||
$unlockChecked = ' checked="checked"';
|
|
||||||
}
|
}
|
||||||
if (!$radioDisabled) {
|
if (!$radioDisabled) {
|
||||||
$dialog .= '<input id="lam_accountStatusActionRadioLock" type="radio" name="lam_accountStatusAction" value="lock"' . $onchange . $lockChecked . '> ' . _('Lock') . '<br>';
|
$radio = new htmlRadio('lam_accountStatusAction', array(_('Lock') => 'lock', _('Unlock') => 'unlock'), $selectedRadio);
|
||||||
$dialog .= '<input id="lam_accountStatusActionRadioUnlock" type="radio" name="lam_accountStatusAction" value="unlock"' . $onchange . $unlockChecked . '> ' . _('Unlock') . '<br><br>';
|
$radio->setOnchangeEvent($onchange);
|
||||||
|
$container->addElement($radio, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$radioValue = 'lock';
|
$radio = new htmlRadio('lam_accountStatusActionDisabled', array(_('Lock') => 'lock', _('Unlock') => 'unlock'), $selectedRadio);
|
||||||
if ($lockChecked == '') {
|
$radio->setIsEnabled(false);
|
||||||
$radioValue = 'unlock';
|
$container->addElement($radio, true);
|
||||||
}
|
$container->addElement(new htmlHiddenInput('lam_accountStatusAction', $selectedRadio), true);
|
||||||
$dialog .= '<input id="lam_accountStatusActionRadioLockDisabled" type="radio" name="lam_accountStatusActionDisabled" disabled value="lock"' . $onchange . $lockChecked . '> ' . _('Lock') . '<br>';
|
|
||||||
$dialog .= '<input id="lam_accountStatusActionRadioUnlockDisabled" type="radio" name="lam_accountStatusActionDisabled" disabled value="unlock"' . $onchange . $unlockChecked . '> ' . _('Unlock') . '<br><br>';
|
|
||||||
$dialog .= '<input type="hidden" name="lam_accountStatusAction" value="' . $radioValue . '">';
|
|
||||||
}
|
}
|
||||||
$dialog .= '<input type="hidden" name="lam_accountStatusResult" id="lam_accountStatusResult" value="cancel">';
|
|
||||||
|
$container->addElement(new htmlHiddenInput('lam_accountStatusResult', 'cancel'), true);
|
||||||
|
|
||||||
// locking part
|
// locking part
|
||||||
if (!$fullyLocked) {
|
if (!$fullyLocked) {
|
||||||
$dialog .= '<div id="lam_accountStatusDialogLockDiv"><table border=0>';
|
$lockContent = new htmlTable();
|
||||||
|
|
||||||
if ($unixAvailable && !$unixLocked) {
|
if ($unixAvailable && !$unixLocked) {
|
||||||
$dialog .= '<tr><td><input type="checkbox" name="lam_accountStatusLockUnix" checked="checked"></td>';
|
$lockContent->addElement(new htmlImage('../../graphics/tux.png'));
|
||||||
$dialog .= '<td><img alt="" src="../../graphics/tux.png"></td>';
|
$lockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusLockUnix', true, _('Unix'), null, false), true);
|
||||||
$dialog .= '<td>' . _('Unix') . '</td>';
|
|
||||||
}
|
}
|
||||||
if ($sambaAvailable && !$sambaLocked) {
|
if ($sambaAvailable && !$sambaLocked) {
|
||||||
$dialog .= '<tr><td><input type="checkbox" name="lam_accountStatusLockSamba" checked="checked"></td>';
|
$lockContent->addElement(new htmlImage('../../graphics/samba.png'));
|
||||||
$dialog .= '<td><img alt="" src="../../graphics/samba.png"></td>';
|
$lockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusLockSamba', true, _('Samba 3'), null, false), true);
|
||||||
$dialog .= '<td>' . _('Samba 3') . '</td>';
|
|
||||||
}
|
}
|
||||||
if ($ppolicyAvailable && !$ppolicyLocked) {
|
if ($ppolicyAvailable && !$ppolicyLocked) {
|
||||||
$dialog .= '<tr><td><input type="checkbox" name="lam_accountStatusLockPPolicy" checked="checked"></td>';
|
$lockContent->addElement(new htmlImage('../../graphics/security.png'));
|
||||||
$dialog .= '<td><img alt="" src="../../graphics/security.png"></td>';
|
$lockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusLockPPolicy', true, _('PPolicy'), null, false), true);
|
||||||
$dialog .= '<td>' . _('PPolicy') . '</td>';
|
|
||||||
}
|
}
|
||||||
if ($unixAvailable) {
|
if ($unixAvailable) {
|
||||||
$dialog .= '<tr><td><input type="checkbox" name="lam_accountStatusRemoveUnixGroups" checked="checked"></td>';
|
$lockContent->addElement(new htmlImage('../../graphics/groupBig.png'));
|
||||||
$dialog .= '<td><img alt="" src="../../graphics/groupBig.png"></td>';
|
$lockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusRemoveUnixGroups', true, _('Remove from all Unix groups'), null, false), true);
|
||||||
$dialog .= '<td>' . _('Remove from all Unix groups') . '</td>';
|
|
||||||
}
|
}
|
||||||
if ($unixAvailable && posixAccount::areGroupOfNamesActive()) { // check unixAvailable because Unix module removes group memberships
|
if ($unixAvailable && posixAccount::areGroupOfNamesActive()) { // check unixAvailable because Unix module removes group memberships
|
||||||
$dialog .= '<tr><td><input type="checkbox" name="lam_accountStatusRemoveGONGroups" checked="checked"></td>';
|
$lockContent->addElement(new htmlImage('../../graphics/groupBig.png'));
|
||||||
$dialog .= '<td><img alt="" src="../../graphics/groupBig.png"></td>';
|
$lockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusRemoveGONGroups', true, _('Remove from all group of (unique) names'), null, false), true);
|
||||||
$dialog .= '<td>' . _('Remove from all group of (unique) names') . '</td>';
|
|
||||||
}
|
}
|
||||||
$dialog .= '</table></div>';
|
|
||||||
|
$lockDiv = new htmlDiv('lam_accountStatusDialogLockDiv', $lockContent);
|
||||||
|
$container->addElement($lockDiv, true);
|
||||||
}
|
}
|
||||||
// unlocking part
|
// unlocking part
|
||||||
if ($partiallyLocked) {
|
if ($partiallyLocked) {
|
||||||
$unlockClass = 'hidden';
|
$unlockContent = new htmlTable();
|
||||||
if ($fullyLocked) {
|
|
||||||
$unlockClass = '';
|
|
||||||
}
|
|
||||||
$dialog .= '<div id="lam_accountStatusDialogUnlockDiv" class="' . $unlockClass . '"><table border=0>';
|
|
||||||
if ($unixAvailable && $unixLocked) {
|
if ($unixAvailable && $unixLocked) {
|
||||||
$dialog .= '<tr><td><input type="checkbox" name="lam_accountStatusUnlockUnix" checked="checked"></td>';
|
$unlockContent->addElement(new htmlImage('../../graphics/tux.png'));
|
||||||
$dialog .= '<td><img alt="" src="../../graphics/tux.png"></td>';
|
$unlockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusUnlockUnix', true, _('Unix'), null, false), true);
|
||||||
$dialog .= '<td>' . _('Unix') . '</td>';
|
|
||||||
}
|
}
|
||||||
if ($sambaAvailable && $sambaLocked) {
|
if ($sambaAvailable && $sambaLocked) {
|
||||||
$dialog .= '<tr><td><input type="checkbox" name="lam_accountStatusUnlockSamba" checked="checked"></td>';
|
$unlockContent->addElement(new htmlImage('../../graphics/samba.png'));
|
||||||
$dialog .= '<td><img alt="" src="../../graphics/samba.png"></td>';
|
$unlockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusUnlockSamba', true, _('Samba 3'), null, false), true);
|
||||||
$dialog .= '<td>' . _('Samba 3') . '</td>';
|
|
||||||
}
|
}
|
||||||
if ($ppolicyAvailable && $ppolicyLocked) {
|
if ($ppolicyAvailable && $ppolicyLocked) {
|
||||||
$dialog .= '<tr><td><input type="checkbox" name="lam_accountStatusUnlockPPolicy" checked="checked"></td>';
|
$unlockContent->addElement(new htmlImage('../../graphics/security.png'));
|
||||||
$dialog .= '<td><img alt="" src="../../graphics/security.png"></td>';
|
$unlockContent->addElement(new htmlTableExtendedInputCheckbox('lam_accountStatusUnlockPPolicy', true, _('PPolicy'), null, false), true);
|
||||||
$dialog .= '<td>' . _('PPolicy') . '</td>';
|
|
||||||
}
|
}
|
||||||
$dialog .= '</table></div>';
|
|
||||||
|
$unlockDiv = new htmlDiv('lam_accountStatusDialogUnlockDiv', $unlockContent);
|
||||||
|
if (!$fullyLocked) {
|
||||||
|
$unlockDiv->setCSSClasses(array('hidden'));
|
||||||
|
}
|
||||||
|
$container->addElement($unlockDiv, true);
|
||||||
}
|
}
|
||||||
$dialog .= '</div>';
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue