updated to new smb_flags structure

This commit is contained in:
Roland Gruber 2003-11-17 16:21:59 +00:00
parent 8494a2f4ad
commit 5261442687
3 changed files with 12 additions and 12 deletions

View File

@ -145,7 +145,7 @@ function loadUserProfile($profile) {
continue;
}
if (substr($line, 0, 17) == "smb_password_no: ") {
$acc->smb_password_no = chop(substr($line, 17, strlen($line)-17));
$acc->smb_flags['N'] = chop(substr($line, 17, strlen($line)-17));
continue;
}
if (substr($line, 0, 16) == "smb_useunixpwd: ") {
@ -153,11 +153,11 @@ function loadUserProfile($profile) {
continue;
}
if (substr($line, 0, 12) == "smb_flagsD: ") {
$acc->smb_flagsD = chop(substr($line, 12, strlen($line)-12));
$acc->smb_flags['D'] = chop(substr($line, 12, strlen($line)-12));
continue;
}
if (substr($line, 0, 12) == "smb_flagsX: ") {
$acc->smb_flagsX = chop(substr($line, 12, strlen($line)-12));
$acc->smb_flags['X'] = chop(substr($line, 12, strlen($line)-12));
continue;
}
if (substr($line, 0, 15) == "smb_homedrive: ") {
@ -426,10 +426,10 @@ function saveUserProfile($account, $profile) {
if (isset($account->unix_pwdexpire)) fputs($file, "unix_pwdexpire: " . $account->unix_pwdexpire . "\n");
if (isset($account->unix_deactivated)) fputs($file, "unix_deactivated: " . $account->unix_deactivated . "\n");
if (isset($account->unix_host)) fputs($file, "unix_host: " . $account->unix_host . "\n");
if (isset($account->smb_password_no)) fputs($file, "smb_password_no: " . $account->smb_password_no . "\n");
if (isset($account->smb_flags['N'])) fputs($file, "smb_password_no: " . $account->smb_flags['N'] . "\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_flagsX)) fputs($file, "smb_flagsX: " . $account->smb_flagsX . "\n");
if (isset($account->smb_flags['D'])) fputs($file, "smb_flagsD: " . $account->smb_flags['D'] . "\n");
if (isset($account->smb_flags['X'])) fputs($file, "smb_flagsX: " . $account->smb_flags['X'] . "\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_profilePath)) fputs($file, "smb_profilePath: " . $profpath . "\n");

View File

@ -151,7 +151,7 @@ if ($_GET['type'] == "user") {
exit;
}
if (($_POST['smb_password_no'] == "1") || ($_POST['smb_password_no'] == "0")) {
$acct->smb_password_no = $_POST['smb_password_no'];
$acct->smb_flags['N'] = $_POST['smb_password_no'];
}
else {
StatusMessage("ERROR", _("Wrong parameter for Samba option: Set Samba Password!"), $_POST['smb_password_no']);
@ -167,7 +167,7 @@ if ($_GET['type'] == "user") {
exit;
}
if (($_POST['smb_flagsD'] == "1") || ($_POST['smb_flagsD'] == "0")) {
$acct->smb_flagsD = $_POST['smb_flagsD'];
$acct->smb_flags['D'] = $_POST['smb_flagsD'];
}
else {
StatusMessage("ERROR", _("Wrong parameter for Samba option: Account does not expire!"), $_POST['smb_flagsD']);
@ -175,7 +175,7 @@ if ($_GET['type'] == "user") {
exit;
}
if (($_POST['smb_flagsX'] == "1") || ($_POST['smb_flagsX'] == "0")) {
$acct->smb_flagsX = $_POST['smb_flagsX'];
$acct->smb_flags['X'] = $_POST['smb_flagsX'];
}
else {
StatusMessage("ERROR", _("Wrong parameter for Samba option: Account is disabled!"), $_POST['smb_flagsX']);

View File

@ -238,7 +238,7 @@ echo ("<table border=0>\n");
echo ("<tr>\n");
echo ("<td align=\"right\"><b>" . _("Set Samba password") . ": </b></td>\n");
echo ("<td><select name=\"smb_password_no\">\n");
if ($acct->smb_password_no == "1") echo ("<option selected value=1>"._("no")."</option><option value=0>"._("yes")."</option>\n");
if ($acct->smb_flags['N']) echo ("<option selected value=1>"._("no")."</option><option value=0>"._("yes")."</option>\n");
else echo ("<option selected value=0>"._("yes")."</option><option value=1>"._("no")."</option>\n");
echo ("</select></td>\n");
echo ("<td><a href=\"../help.php?HelpNumber=426\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
@ -258,7 +258,7 @@ echo ("</tr>\n");
echo ("<tr>\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");
if ($acct->smb_flags['X'] == "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");
@ -268,7 +268,7 @@ echo ("</tr>\n");
echo ("<tr>\n");
echo ("<td align=\"right\"><b>" . _("Account is deactivated") . ": </b></td>\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_flags['D'] == "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=432\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");