diff --git a/lam/lib/profiles.inc b/lam/lib/profiles.inc
index cc5b9443..f05d63ba 100644
--- a/lam/lib/profiles.inc
+++ b/lam/lib/profiles.inc
@@ -135,6 +135,10 @@ function loadUserProfile($profile) {
$acc->unix_deactivated = chop(substr($line, 18, strlen($line)-18));
continue;
}
+ if (substr($line, 0, 11) == "unix_host: ") {
+ $acc->unix_host = chop(substr($line, 11, strlen($line)-11));
+ continue;
+ }
if (substr($line, 0, 17) == "smb_password_no: ") {
$acc->smb_password_no = chop(substr($line, 17, strlen($line)-17));
continue;
@@ -264,6 +268,7 @@ function saveUserProfile($account, $profile) {
if (isset($account->unix_pwdmaxage)) fputs($file, "unix_pwdmaxage: " . $account->unix_pwdmaxage . "\n");
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_useunixpwd)) fputs($file, "smb_useunixpwd: " . $account->smb_useunixpwd . "\n");
if (isset($account->smb_flagsD)) fputs($file, "smb_flagsD: " . $account->smb_flagsD . "\n");
diff --git a/lam/templates/profedit/profilecreate.php b/lam/templates/profedit/profilecreate.php
index 51ed6aa4..6e1ea00d 100644
--- a/lam/templates/profedit/profilecreate.php
+++ b/lam/templates/profedit/profilecreate.php
@@ -60,7 +60,7 @@ if ($_GET['type'] == "user") {
$acct->general_group = $_POST['general_group'];
}
else {
- StatusMessage("ERROR", "", _("Primary group name is invalid!") . " " . $_POST['general_group']);
+ StatusMessage("ERROR", _("Primary group name is invalid!"), $_POST['general_group']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -71,7 +71,7 @@ if ($_GET['type'] == "user") {
$acct->general_homedir = $_POST['general_homedir'];
}
elseif ($_POST['general_homedir']) {
- StatusMessage("ERROR", "", _("Homedir is invalid!") . " " . $_POST['general_homedir']);
+ StatusMessage("ERROR", _("Homedir is invalid!"), $_POST['general_homedir']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -79,7 +79,7 @@ if ($_GET['type'] == "user") {
$acct->general_shell = $_POST['general_shell'];
}
else {
- StatusMessage("ERROR", "", _("Shell is invalid!") . " " . $_POST['general_shell']);
+ StatusMessage("ERROR", _("Shell is invalid!"), $_POST['general_shell']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -87,7 +87,7 @@ if ($_GET['type'] == "user") {
$acct->unix_password_no = $_POST['unix_password_no'];
}
else {
- StatusMessage("ERROR", "", _("Wrong parameter for login disable!") . " " . $_POST['unix_password_no']);
+ StatusMessage("ERROR", _("Wrong parameter for login disable!"), $_POST['unix_password_no']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -95,7 +95,7 @@ if ($_GET['type'] == "user") {
$acct->unix_pwdwarn = $_POST['unix_pwdwarn'];
}
elseif ($_POST['unix_pwdwarn']) {
- StatusMessage("ERROR", "", _("Wrong parameter for Unix password warning!") . " " . $_POST['unix_pwdwarn']);
+ StatusMessage("ERROR", _("Wrong parameter for Unix password warning!"), $_POST['unix_pwdwarn']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -103,7 +103,7 @@ if ($_GET['type'] == "user") {
$acct->unix_pwdminage = $_POST['unix_pwdminage'];
}
elseif ($_POST['unix_pwdminage']) {
- StatusMessage("ERROR", "", _("Password minimum age is not numeric!") . " " . $_POST['unix_pwdminage']);
+ StatusMessage("ERROR", _("Password minimum age is not numeric!"), $_POST['unix_pwdminage']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -111,7 +111,7 @@ if ($_GET['type'] == "user") {
$acct->unix_pwdmaxage = $_POST['unix_pwdmaxage'];
}
elseif ($_POST['unix_pwdmaxage']) {
- StatusMessage("ERROR", "", _("Password maximum age is not numeric!") . " " . $_POST['unix_pwdmaxage']);
+ StatusMessage("ERROR", _("Password maximum age is not numeric!"), $_POST['unix_pwdmaxage']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -119,7 +119,15 @@ if ($_GET['type'] == "user") {
$acct->unix_pwdexpire = mktime(0, 0, 0, $_POST['unix_pwdexpire_mon'], $_POST['unix_pwdexpire_day'], $_POST['unix_pwdexpire_yea']);
}
else {
- StatusMessage("ERROR", "", _("Wrong parameter for Unix password expiry!"));
+ StatusMessage("ERROR", _("Wrong parameter for Unix password expiry!"));
+ echo ("
" . _("Back to Profile Editor") . "");
+ exit;
+ }
+ if ($_POST['unix_host'] && eregi("^[a-z0-9]+(,[a-z0-9]+)*$", $_POST['unix_host'])) {
+ $acct->unix_host = $_POST['unix_host'];
+ }
+ elseif ($_POST['unix_host']) {
+ StatusMessage("ERROR", _("Unix workstations are invalid!"), $_POST['unix_host']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -127,7 +135,7 @@ if ($_GET['type'] == "user") {
$acct->unix_deactivated = $_POST['unix_deactivated'];
}
else {
- StatusMessage("ERROR", "", _("Wrong parameter for Unix account activation!") . " " . $_POST['unix_deactivated']);
+ StatusMessage("ERROR", _("Wrong parameter for Unix account activation!"), $_POST['unix_deactivated']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -135,7 +143,7 @@ if ($_GET['type'] == "user") {
$acct->unix_pwdallowlogin = $_POST['unix_pwdallowlogin'];
}
elseif ($_POST['unix_pwdallowlogin']) {
- StatusMessage("ERROR", "", _("Password expiry is not numeric!") . " " . $_POST['unix_pwdallowlogin']);
+ StatusMessage("ERROR", _("Password expiry is not numeric!"), $_POST['unix_pwdallowlogin']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -143,7 +151,7 @@ if ($_GET['type'] == "user") {
$acct->smb_password_no = $_POST['smb_password_no'];
}
else {
- StatusMessage("ERROR", "", _("Wrong parameter for Samba option: Set Samba Password!") . " " . $_POST['smb_password_no']);
+ StatusMessage("ERROR", _("Wrong parameter for Samba option: Set Samba Password!"), $_POST['smb_password_no']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -151,7 +159,7 @@ if ($_GET['type'] == "user") {
$acct->smb_useunixpwd = $_POST['smb_useunixpwd'];
}
else {
- StatusMessage("ERROR", "", _("Wrong parameter for Samba option: Set Unix Password for Samba!") . " " . $_POST['smb_useunixpwd']);
+ StatusMessage("ERROR", _("Wrong parameter for Samba option: Set Unix Password for Samba!"), $_POST['smb_useunixpwd']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -159,7 +167,7 @@ if ($_GET['type'] == "user") {
$acct->smb_flagsD = $_POST['smb_flagsD'];
}
else {
- StatusMessage("ERROR", "", _("Wrong parameter for Samba option: Account does not expire!") . " " . $_POST['smb_flagsD']);
+ StatusMessage("ERROR", _("Wrong parameter for Samba option: Account does not expire!"), $_POST['smb_flagsD']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -167,7 +175,7 @@ if ($_GET['type'] == "user") {
$acct->smb_homedrive = $_POST['smb_homedrive'];
}
else {
- StatusMessage("ERROR", "", _("Wrong parameter for Samba option: home drive!") . " " . $_POST['smb_homedrive']);
+ StatusMessage("ERROR", _("Wrong parameter for Samba option: home drive!"), $_POST['smb_homedrive']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -177,7 +185,7 @@ if ($_GET['type'] == "user") {
$acct->smb_smbhome = $_POST['smb_smbhome'];
}
elseif ($_POST['smb_smbhome']) {
- StatusMessage("ERROR", "", _("Samba home directory is invalid!") . " " . $_POST['smb_smbhome']);
+ StatusMessage("ERROR", _("Samba home directory is invalid!"), $_POST['smb_smbhome']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -187,7 +195,7 @@ if ($_GET['type'] == "user") {
$acct->smb_profilePath = $_POST['smb_profilepath'];
}
elseif ($_POST['smb_profilepath']) {
- StatusMessage("ERROR", "", _("Profile path is invalid!") . " " . $_POST['smb_profilepath']);
+ StatusMessage("ERROR", _("Profile path is invalid!"), $_POST['smb_profilepath']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -197,7 +205,7 @@ if ($_GET['type'] == "user") {
$acct->smb_scriptPath = $_POST['smb_scriptPath'];
}
elseif ($_POST['smb_scriptPath']) {
- StatusMessage("ERROR", "", _("Script path is invalid!") . " " . $_POST['smb_scriptPath']);
+ StatusMessage("ERROR", _("Script path is invalid!"), $_POST['smb_scriptPath']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -205,7 +213,7 @@ if ($_GET['type'] == "user") {
$acct->smb_smbuserworkstations = $_POST['smb_smbuserworkstations'];
}
elseif ($_POST['smb_smbuserworkstations']) {
- StatusMessage("ERROR", "", _("Samba workstations are invalid!") . " " . $_POST['smb_smbuserworkstations']);
+ StatusMessage("ERROR", _("Samba workstations are invalid!"), $_POST['smb_smbuserworkstations']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -213,7 +221,7 @@ if ($_GET['type'] == "user") {
$acct->smb_domain = $_POST['smb_domain'];
}
elseif ($_POST['smb_domain']) {
- StatusMessage("ERROR", "", _("Domain name is invalid!") . " " . $_POST['smb_domain']);
+ StatusMessage("ERROR", _("Domain name is invalid!"), $_POST['smb_domain']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -221,7 +229,7 @@ if ($_GET['type'] == "user") {
$profname = $_POST['profname'];
}
else {
- StatusMessage("ERROR", "", _("Invalid profile name!"));
+ StatusMessage("ERROR", _("Invalid profile name!"), $_POST['profname']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -240,7 +248,7 @@ elseif ($_GET['type'] == "host") {
$acct->general_group = $_POST['general_group'];
}
else {
- StatusMessage("ERROR", "", _("Primary group name is invalid!") . " " . $_POST['general_group']);
+ StatusMessage("ERROR", _("Primary group name is invalid!"), $_POST['general_group']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
@@ -248,7 +256,7 @@ elseif ($_GET['type'] == "host") {
$acct->smb_domain = $_POST['smb_domain'];
}
elseif ($_POST['smb_domain']) {
- StatusMessage("ERROR", "", _("Domain name is invalid!") . " " . $_POST['smb_domain']);
+ StatusMessage("ERROR", _("Domain name is invalid!"), $_POST['smb_domain']);
echo ("
" . _("Back to Profile Editor") . "");
exit;
}
diff --git a/lam/templates/profedit/profileuser.php b/lam/templates/profedit/profileuser.php
index 7cfd97fb..816085d1 100644
--- a/lam/templates/profedit/profileuser.php
+++ b/lam/templates/profedit/profileuser.php
@@ -195,6 +195,16 @@ echo ("\n");
// empty row
echo ("