removed smb_pwdcanchange/smb_mustchange from profiles

This commit is contained in:
Roland Gruber 2003-07-20 18:01:01 +00:00
parent 723f963e29
commit bed6a48af7
4 changed files with 4 additions and 56 deletions

View File

@ -5,12 +5,9 @@ unix_pwdwarn: 10
unix_pwdallowlogin: 10
unix_pwdminage: 1
unix_pwdmaxage: 180
unix_pwdexpire_day: 1
unix_pwdexpire_mon: 1
unix_pwdexpire_yea: 2010
unix_pwdexpire: 1262300400
unix_deactivated: 0
smb_password_no: 0
smb_useunixpwd: 1
smb_pwdcanchange: 1
smb_pwdmustchange: 0
smb_flagsD: 1
smb_homedrive: U:

View File

@ -80,7 +80,7 @@ function getHostProfiles() {
// loads an user profile with name $profile (without .pru)
// the return value is an account object
// if $timestamps is true, smb_pwdcanchange and smb_pwdmustchange are returned as timestamp
function loadUserProfile($profile, $timestamps=True) {
function loadUserProfile($profile) {
if (!eregi("^([0-9]|[a-z]|-|_)*$", $profile)) exit;
$acc = new account();
$file = substr(__FILE__, 0, strlen(__FILE__) - 17) . "/config/profiles/users/" . $profile . ".pru";
@ -147,14 +147,6 @@ function loadUserProfile($profile, $timestamps=True) {
$acc->smb_flagsD = chop(substr($line, 12, strlen($line)-12));
continue;
}
if (substr($line, 0, 18) == "smb_pwdcanchange: ") {
$acc->smb_pwdcanchange = chop(substr($line, 18, strlen($line)-18));
continue;
}
if (substr($line, 0, 19) == "smb_pwdmustchange: ") {
$acc->smb_pwdmustchange = chop(substr($line, 19, strlen($line)-19));
continue;
}
if (substr($line, 0, 15) == "smb_homedrive: ") {
$acc->smb_homedrive = chop(substr($line, 15, strlen($line)-15));
continue;
@ -181,11 +173,6 @@ function loadUserProfile($profile, $timestamps=True) {
}
}
fclose($file);
// set timestamps if needed
if ($timestamps) {
$acct->smb_pwdcanchange = ($acct->smb_pwdcanchange * 86400) + time();
$acct->smb_pwdmustchange = ($acct->smb_pwdmustchange * 86400) + time();
}
}
else {
StatusMessage("ERROR", "", _("Unable to load profile! ") . $file);
@ -279,8 +266,6 @@ function saveUserProfile($account, $profile) {
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_flagsD)) fputs($file, "smb_flagsD: " . $account->smb_flagsD . "\n");
if (isset($account->smb_pwdcanchange)) fputs($file, "smb_pwdcanchange: " . $account->smb_pwdcanchange . "\n");
if (isset($account->smb_pwdmustchange)) fputs($file, "smb_pwdmustchange: " . $account->smb_pwdmustchange . "\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

@ -161,22 +161,6 @@ if ($_GET['type'] == "user") {
echo ("<br><br><a href=\"javascript:history.back()\">" . _("Back to Profile Editor") . "</a>");
exit;
}
if (!$_POST['smb_pwdcanchange'] || is_numeric($_POST['smb_pwdcanchange'])) {
$acct->smb_pwdcanchange = $_POST['smb_pwdcanchange'];
}
else {
StatusMessage("ERROR", "", _("Wrong parameter for Samba option: user can change password!") . " " . $_POST['smb_pwdcanchange']);
echo ("<br><br><a href=\"javascript:history.back()\">" . _("Back to Profile Editor") . "</a>");
exit;
}
if (!$_POST['smb_pwdmustchange'] || is_numeric($_POST['smb_pwdmustchange'])) {
$acct->smb_pwdmustchange = $_POST['smb_pwdmustchange'];
}
else {
StatusMessage("ERROR", "", _("Wrong parameter for Samba option: user must change password!") . " " . $_POST['smb_pwdmustchange']);
echo ("<br><br><a href=\"javascript:history.back()\">" . _("Back to Profile Editor") . "</a>");
exit;
}
if ($_POST['smb_homedrive'] && ereg("^[D-Z]:$", $_POST['smb_homedrive'])) {
$acct->smb_homedrive = $_POST['smb_homedrive'];
}

View File

@ -55,7 +55,7 @@ for ($i = 0; $i < sizeof($shelllist); $i++) {
// check if profile should be edited
if ($_GET['edit']) {
$acct = loadUserProfile($_GET['edit'], False);
$acct = loadUserProfile($_GET['edit']);
}
// search available groups
@ -244,24 +244,6 @@ echo ("</select></td>\n");
echo ("<td><a href=\"../help.php?HelpNumber=310\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
echo ("</tr>\n");
// user can change his password
echo ("<tr>\n");
echo ("<td align=\"right\"><b>" . _("User can change password") . ": </b></td>\n");
echo ("<td>\n");
echo ("<input type=\"text\" name=\"smb_pwdcanchange\" value=\"" . $acct->smb_pwdcanchange . "\">\n");
echo ("</td>\n");
echo ("<td><a href=\"../help.php?HelpNumber=302\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
echo ("</tr>\n");
// user must change his password
echo ("<tr>\n");
echo ("<td align=\"right\"><b>" . _("User must change password") . ": </b></td>\n");
echo ("<td>\n");
echo ("<input type=\"text\" name=\"smb_pwdmustchange\" value=\"" . $acct->smb_pwdmustchange . "\">\n");
echo ("</td>\n");
echo ("<td><a href=\"../help.php?HelpNumber=303\" target=\"lamhelp\">" . _("Help") . "</a></td>\n");
echo ("</tr>\n");
// empty row
echo ("<tr><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td></tr>\n");