fixed setting for Samba account expiration and added deactivation
This commit is contained in:
parent
cb6d51c0c1
commit
9e8d184b66
|
@ -156,6 +156,10 @@ function loadUserProfile($profile) {
|
||||||
$acc->smb_flagsD = chop(substr($line, 12, strlen($line)-12));
|
$acc->smb_flagsD = chop(substr($line, 12, strlen($line)-12));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (substr($line, 0, 12) == "smb_flagsX: ") {
|
||||||
|
$acc->smb_flagsX = chop(substr($line, 12, strlen($line)-12));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (substr($line, 0, 15) == "smb_homedrive: ") {
|
if (substr($line, 0, 15) == "smb_homedrive: ") {
|
||||||
$acc->smb_homedrive = chop(substr($line, 15, strlen($line)-15));
|
$acc->smb_homedrive = chop(substr($line, 15, strlen($line)-15));
|
||||||
continue;
|
continue;
|
||||||
|
@ -419,6 +423,7 @@ function saveUserProfile($account, $profile) {
|
||||||
if (isset($account->smb_password_no)) fputs($file, "smb_password_no: " . $account->smb_password_no . "\n");
|
if (isset($account->smb_password_no)) fputs($file, "smb_password_no: " . $account->smb_password_no . "\n");
|
||||||
if (isset($account->smb_useunixpwd)) fputs($file, "smb_useunixpwd: " . $account->smb_useunixpwd . "\n");
|
if (isset($account->smb_useunixpwd)) fputs($file, "smb_useunixpwd: " . $account->smb_useunixpwd . "\n");
|
||||||
if (isset($account->smb_flagsD)) fputs($file, "smb_flagsD: " . $account->smb_flagsD . "\n");
|
if (isset($account->smb_flagsD)) fputs($file, "smb_flagsD: " . $account->smb_flagsD . "\n");
|
||||||
|
if (isset($account->smb_flagsX)) fputs($file, "smb_flagsX: " . $account->smb_flagsX . "\n");
|
||||||
if (isset($account->smb_homedrive)) fputs($file, "smb_homedrive: " . $account->smb_homedrive . "\n");
|
if (isset($account->smb_homedrive)) fputs($file, "smb_homedrive: " . $account->smb_homedrive . "\n");
|
||||||
if (isset($account->smb_scriptPath)) fputs($file, "smb_scriptPath: " . $scriptPath . "\n");
|
if (isset($account->smb_scriptPath)) fputs($file, "smb_scriptPath: " . $scriptPath . "\n");
|
||||||
if (isset($account->smb_profilePath)) fputs($file, "smb_profilePath: " . $profpath . "\n");
|
if (isset($account->smb_profilePath)) fputs($file, "smb_profilePath: " . $profpath . "\n");
|
||||||
|
|
|
@ -171,6 +171,14 @@ if ($_GET['type'] == "user") {
|
||||||
echo ("<br><br><a href=\"javascript:history.back()\">" . _("Back to Profile Editor") . "</a>");
|
echo ("<br><br><a href=\"javascript:history.back()\">" . _("Back to Profile Editor") . "</a>");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
if (($_POST['smb_flagsX'] == "1") || ($_POST['smb_flagsX'] == "0")) {
|
||||||
|
$acct->smb_flagsX = $_POST['smb_flagsX'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
StatusMessage("ERROR", _("Wrong parameter for Samba option: Account is disabled!"), $_POST['smb_flagsX']);
|
||||||
|
echo ("<br><br><a href=\"javascript:history.back()\">" . _("Back to Profile Editor") . "</a>");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
if ($_POST['smb_homedrive'] && ereg("^[D-Z]:$", $_POST['smb_homedrive'])) {
|
if ($_POST['smb_homedrive'] && ereg("^[D-Z]:$", $_POST['smb_homedrive'])) {
|
||||||
$acct->smb_homedrive = $_POST['smb_homedrive'];
|
$acct->smb_homedrive = $_POST['smb_homedrive'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,11 +252,21 @@ echo ("</tr>\n");
|
||||||
// password expires
|
// password expires
|
||||||
echo ("<tr>\n");
|
echo ("<tr>\n");
|
||||||
echo ("<td align=\"right\"><b>" . _("Password does not expire") . ": </b></td>\n");
|
echo ("<td align=\"right\"><b>" . _("Password does not expire") . ": </b></td>\n");
|
||||||
|
echo ("<td><select name=\"smb_flagsX\">\n");
|
||||||
|
if ($acct->smb_flagsX == "0") echo ("<option selected value=0>"._("no")."</option><option value=1>"._("yes")."</option>\n");
|
||||||
|
else echo ("<option selected value=1>"._("yes")."</option><option value=0>"._("no")."</option>\n");
|
||||||
|
echo ("</select></td>\n");
|
||||||
|
echo ("<td><a href=\"../help.php?HelpNumber=429\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
|
||||||
|
echo ("</tr>\n");
|
||||||
|
|
||||||
|
// account is disabled
|
||||||
|
echo ("<tr>\n");
|
||||||
|
echo ("<td align=\"right\"><b>" . _("Account is deactivated") . ": </b></td>\n");
|
||||||
echo ("<td><select name=\"smb_flagsD\">\n");
|
echo ("<td><select name=\"smb_flagsD\">\n");
|
||||||
if ($acct->smb_flagsD == "0") echo ("<option selected value=0>"._("no")."</option><option value=1>"._("yes")."</option>\n");
|
if ($acct->smb_flagsD == "0") echo ("<option selected value=0>"._("no")."</option><option value=1>"._("yes")."</option>\n");
|
||||||
else echo ("<option selected value=1>"._("yes")."</option><option value=0>"._("no")."</option>\n");
|
else echo ("<option selected value=1>"._("yes")."</option><option value=0>"._("no")."</option>\n");
|
||||||
echo ("</select></td>\n");
|
echo ("</select></td>\n");
|
||||||
echo ("<td><a href=\"../help.php?HelpNumber=429\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
|
echo ("<td><a href=\"../help.php?HelpNumber=432\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
|
||||||
echo ("</tr>\n");
|
echo ("</tr>\n");
|
||||||
|
|
||||||
// empty row
|
// empty row
|
||||||
|
|
Loading…
Reference in New Issue