diff --git a/lam/templates/profedit/profilecreate.php b/lam/templates/profedit/profilecreate.php index dae2b673..c64b7598 100644 --- a/lam/templates/profedit/profilecreate.php +++ b/lam/templates/profedit/profilecreate.php @@ -249,7 +249,28 @@ if ($_GET['type'] == "user") { // save host profile elseif ($_GET['type'] == "host") { - + $acct = new account(); + // check input + if ($_POST['general_group'] && eregi("^[a-z]([a-z0-9_\\-])*$", $_POST['general_group'])) { + $acct->general_group = $_POST['general_group']; + } + else { + StatusMessage("ERROR", "", _("Primary group name is invalid!") . " " . $_POST['general_group']); + echo ("

" . _("Back to profile editor...") . ""); + exit; + } + if ($_POST['smb_domain'] && eregi("^[a-z0-9_\\-]+$", $_POST['smb_domain'])) { + $acct->smb_domain = $_POST['smb_domain']; + } + elseif ($_POST['smb_domain']) { + StatusMessage("ERROR", "", _("Domain name is invalid!") . " " . $_POST['smb_domain']); + echo ("

" . _("Back to profile editor...") . ""); + exit; + } + // save profile + saveHostProfile($acct, $profname); + echo ("

" . _("Profile ") . $profname . _(" was saved.") . "

"); + echo ("

" . _("Back to profile editor") . "

"); } // error: no or wrong type diff --git a/lam/templates/profedit/profilehost.php b/lam/templates/profedit/profilehost.php index 55ce926f..68e59df7 100644 --- a/lam/templates/profedit/profilehost.php +++ b/lam/templates/profedit/profilehost.php @@ -25,6 +25,7 @@ $Id$ include_once("../../lib/profiles.inc"); include_once("../../lib/ldap.inc"); +include_once("../../lib/account.inc"); // start session session_save_path("../../sess"); @@ -36,3 +37,77 @@ if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) { exit; } +// print header +echo ("\n"); +echo ("\n"); +echo ("\n\n\n
\n"); + +$acct = new Account(); + +// check if profile should be edited +if ($_GET['edit']) { + $acct = loadHostProfile($_GET['edit']); +} + +// search available groups +$groups = findgroups(); + +// display formular +echo ("
\n"); + + +// Unix part +echo ("
" . _("Host attributes") . "\n"); +echo ("\n"); + +// primary group +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +// empty row +echo ("\n"); + +// domain +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); + +echo ("
" . _("Primary group") . ": " . _("Help") . "
   
" . _("Domain") . ": smb_domain . "\" name=\"smb_domain\">" . _("Help") . "
\n"); +echo ("
\n"); + + +echo ("

\n"); + +// profile name and submit/abort buttons +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo (""); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo ("\n"); +echo (""); +echo ("\n"); +echo ("
" . _("Profile Name") . ":" . _("Help") . "
 
\n"); +echo (" 
\n"); + +echo ("
\n"); + + + +?>