From 5261442687ad37ae24a477b49d3d5448d336ce3b Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 17 Nov 2003 16:21:59 +0000 Subject: [PATCH] updated to new smb_flags structure --- lam/lib/profiles.inc | 12 ++++++------ lam/templates/profedit/profilecreate.php | 6 +++--- lam/templates/profedit/profileuser.php | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lam/lib/profiles.inc b/lam/lib/profiles.inc index db3872d3..b56aab67 100644 --- a/lam/lib/profiles.inc +++ b/lam/lib/profiles.inc @@ -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"); diff --git a/lam/templates/profedit/profilecreate.php b/lam/templates/profedit/profilecreate.php index 2bffd766..ce945e56 100644 --- a/lam/templates/profedit/profilecreate.php +++ b/lam/templates/profedit/profilecreate.php @@ -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']); diff --git a/lam/templates/profedit/profileuser.php b/lam/templates/profedit/profileuser.php index 35b67df6..3180e437 100644 --- a/lam/templates/profedit/profileuser.php +++ b/lam/templates/profedit/profileuser.php @@ -238,7 +238,7 @@ echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); @@ -258,7 +258,7 @@ echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); @@ -268,7 +268,7 @@ echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n");
" . _("Set Samba password") . ": " . _("Help") . "
" . _("Password does not expire") . ": " . _("Help") . "
" . _("Account is deactivated") . ": " . _("Help") . "