2003-04-21 14:03:30 +00:00
< ? php
2003-04-21 14:07:22 +00:00
/*
$Id $
This code is part of LDAP Account Manager ( http :// www . sourceforge . net / projects / lam )
Copyright ( C ) 2003 Tilo Lutz
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , write to the Free Software
Foundation , Inc . , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 USA
LDAP Account Manager displays table for creating or modifying accounts in LDAP
*/
2003-04-21 14:03:30 +00:00
2003-04-24 16:10:29 +00:00
include_once ( '../lib/account.inc' ); // File with custom functions
2003-05-03 19:15:23 +00:00
include_once ( '../lib/config.inc' ); // File with configure-functions
include_once ( '../lib/ldap.inc' ); // LDAP-functions
include_once ( '../lib/profiles.inc' ); // functions to load and save profiles
2003-05-07 18:19:09 +00:00
include_once ( '../lib/status.inc' ); // Return error-message
2003-04-21 14:03:30 +00:00
2003-05-14 21:12:17 +00:00
2003-04-21 14:03:30 +00:00
registervars (); // Register all needed variables in session and register session
$error = " 0 " ;
2003-05-02 12:52:42 +00:00
if ( $_GET [ 'type' ] ) { // Type is true if account.php was called from Users/Group/Hosts-List
$_SESSION [ 'type2' ] = $_GET [ 'type' ]; // Register $type in Session for further usage
2003-04-21 14:03:30 +00:00
$_SESSION [ 'account' ] = " " ; // Delete $_SESSION['account'] because values are now invalid
$_SESSION [ 'account_old' ] = " " ; // Delete $_SESSION['account_old'] because values are now invalid
$_SESSION [ 'account_temp' ] = " " ; // Delete $_SESSION['account_temp'] because values are now invalid
$_SESSION [ 'modify' ] = 0 ; // Set modify back to false
2003-05-01 17:02:57 +00:00
$_SESSION [ 'shelllist' ] = getshells (); // Write List of all valid shells in variable
2003-05-15 20:59:26 +00:00
if ((( $_GET [ 'type' ] == 'user' ) || ( $_GET [ 'type' ] == 'group' )) && ( $_SESSION [ 'config' ] -> scriptServer ) && ( ! $_GET [ 'DN' ])) getquotas ();
2003-04-21 14:03:30 +00:00
}
2003-05-02 12:52:42 +00:00
if ( $_GET [ 'DN' ] ) { // $DN is true if an entry should be modified and account.php was called from Users/Group/Host-List
2003-04-21 14:03:30 +00:00
$_SESSION [ 'modify' ] = 1 ;
2003-05-02 12:52:42 +00:00
$DN = str_replace ( " \ ' " , '' , $_GET [ 'DN' ]);
switch ( $_SESSION [ 'type2' ]) {
2003-04-23 15:47:00 +00:00
case 'user' : loaduser ( $DN ); break ;
2003-05-15 20:59:26 +00:00
case 'group' :
loadgroup ( $DN );
if ( ! session_is_registered ( 'final_changegids' )) session_register ( 'final_changegids' );
else $_SESSION [ 'final_changegids' ] = '' ;
break ;
2003-04-23 15:47:00 +00:00
case 'host' : loadhost ( $DN ); break ;
2003-04-21 14:03:30 +00:00
}
}
2003-05-02 12:52:42 +00:00
switch ( $_POST [ 'select' ]) {
2003-04-21 14:03:30 +00:00
case 'general' :
2003-05-14 21:12:17 +00:00
if ( ! $_POST [ 'load' ]) { // No Profile was loaded
// Write alle values in temporary object
if ( $_POST [ 'f_general_username' ]) $_SESSION [ 'account_temp' ] -> general_username = $_POST [ 'f_general_username' ];
else $_SESSION [ 'account_temp' ] -> general_username = $_POST [ 'f_general_username' ];
if ( $_POST [ 'f_general_surname' ]) $_SESSION [ 'account_temp' ] -> general_surname = $_POST [ 'f_general_surname' ];
else $_SESSION [ 'account_temp' ] -> general_surname = " " ;
if ( $_POST [ 'f_general_givenname' ]) $_SESSION [ 'account_temp' ] -> general_givenname = $_POST [ 'f_general_givenname' ];
else $_SESSION [ 'account_temp' ] -> general_givenname = " " ;
if ( $_POST [ 'f_general_uidNumber' ]) $_SESSION [ 'account_temp' ] -> general_uidNumber = $_POST [ 'f_general_uidNumber' ];
else $_SESSION [ 'account_temp' ] -> general_uidNumber = " " ;
if ( $_POST [ 'f_general_group' ]) $_SESSION [ 'account_temp' ] -> general_group = $_POST [ 'f_general_group' ];
if ( $_POST [ 'f_general_groupadd' ]) $_SESSION [ 'account_temp' ] -> general_groupadd = $_POST [ 'f_general_groupadd' ];
if ( $_POST [ 'f_general_homedir' ]) $_SESSION [ 'account_temp' ] -> general_homedir = $_POST [ 'f_general_homedir' ];
else $_SESSION [ 'account_temp' ] -> general_homedir = " " ;
if ( $_POST [ 'f_general_shell' ]) $_SESSION [ 'account_temp' ] -> general_shell = $_POST [ 'f_general_shell' ];
if ( $_POST [ 'f_general_gecos' ]) $_SESSION [ 'account_temp' ] -> general_gecos = $_POST [ 'f_general_gecos' ];
else $_SESSION [ 'account_temp' ] -> general_gecos = " " ;
// Check Values
$error = checkglobal (); // account.inc
// Check which part Site should be displayd
if ( $_POST [ 'next' ] && ( $error == " 0 " ))
switch ( $_SESSION [ 'type2' ]) {
case 'user' : $select_local = 'unix' ; break ;
case 'group' : $select_local = 'quota' ; break ;
case 'host' : $select_local = 'unix' ; break ;
}
}
2003-04-21 14:03:30 +00:00
break ;
case 'unix' :
// Write alle values in temporary object
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_unix_password' ]) $_SESSION [ 'account_temp' ] -> unix_password = $_POST [ 'f_unix_password' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> unix_password = '' ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'genpass' ]) { $_SESSION [ 'account_temp' ] -> unix_password = genpasswd (); }
if ( $_POST [ 'f_unix_password_no' ]) $_SESSION [ 'account_temp' ] -> unix_password_no = $_POST [ 'f_unix_password_no' ];
2003-04-24 11:59:26 +00:00
else $_SESSION [ 'account_temp' ] -> unix_password_no = false ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_unix_pwdwarn' ]) $_SESSION [ 'account_temp' ] -> unix_pwdwarn = $_POST [ 'f_unix_pwdwarn' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> unix_pwdwarn = '' ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_unix_pwdallowlogin' ]) $_SESSION [ 'account_temp' ] -> unix_pwdallowlogin = $_POST [ 'f_unix_pwdallowlogin' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> unix_pwdallowlogin = '' ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_unix_pwdmaxage' ]) $_SESSION [ 'account_temp' ] -> unix_pwdmaxage = $_POST [ 'f_unix_pwdmaxage' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> unix_pwdmaxage = '' ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_unix_pwdminage' ]) $_SESSION [ 'account_temp' ] -> unix_pwdminage = $_POST [ 'f_unix_pwdminage' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> unix_pwdminage = '' ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_unix_pwdexpire_day' ]) $_SESSION [ 'account_temp' ] -> unix_pwdexpire_day = $_POST [ 'f_unix_pwdexpire_day' ];
if ( $_POST [ 'f_unix_pwdexpire_mon' ]) $_SESSION [ 'account_temp' ] -> unix_pwdexpire_mon = $_POST [ 'f_unix_pwdexpire_mon' ];
if ( $_POST [ 'f_unix_pwdexpire_yea' ]) $_SESSION [ 'account_temp' ] -> unix_pwdexpire_yea = $_POST [ 'f_unix_pwdexpire_yea' ];
if ( $_POST [ 'f_unix_deactivated' ]) $_SESSION [ 'account_temp' ] -> unix_deactivated = $_POST [ 'f_unix_deactivated' ];
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> unix_deactivated = false ;
// Check Values
$error = checkunix (); // account.inc
// Check which part Site should be displayd
2003-05-07 16:53:03 +00:00
if ( $_POST [ 'genpass' ]) $select_local = 'unix' ;
2003-05-17 11:19:03 +00:00
if ( $_POST [ 'respass' ]) {
$_SESSION [ 'account_temp' ] -> unix_password_no = 1 ;
$_SESSION [ 'account_temp' ] -> smb_password_no = 1 ;
$_SESSION [ 'account' ] -> unix_password_no = 1 ;
$_SESSION [ 'account' ] -> smb_password_no = 1 ;
}
2003-05-14 21:12:17 +00:00
if (( $_POST [ 'next' ]) && ( $error == " 0 " )) $select_local = 'samba' ;
else $select_local = 'unix' ;
if ( $_POST [ 'back' ]) $select_local = 'general' ;
2003-04-21 14:03:30 +00:00
break ;
case 'samba' :
// Write alle values in temporary object
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_password' ]) $_SESSION [ 'account_temp' ] -> smb_password = $_POST [ 'f_smb_password' ];
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> smb_password = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_password_no' ]) $_SESSION [ 'account_temp' ] -> smb_password_no = $_POST [ 'f_smb_password_no' ];
2003-04-24 11:59:26 +00:00
else $_SESSION [ 'account_temp' ] -> smb_password_no = false ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_useunixpwd' ]) $_SESSION [ 'account_temp' ] -> smb_useunixpwd = $_POST [ 'f_smb_useunixpwd' ];
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> smb_useunixpwd = false ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_pwdcanchange' ]) $_SESSION [ 'account_temp' ] -> smb_pwdcanchange = $_POST [ 'f_smb_pwdcanchange' ];
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> smb_pwdcanchange = false ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_pwdmustchange' ]) $_SESSION [ 'account_temp' ] -> smb_pwdmustchange = $_POST [ 'f_smb_pwdmustchange' ];
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> smb_pwdmustchange = false ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_homedrive' ]) $_SESSION [ 'account_temp' ] -> smb_homedrive = $_POST [ 'f_smb_homedrive' ];
if ( $_POST [ 'f_smb_scriptpath' ]) $_SESSION [ 'account_temp' ] -> smb_scriptpath = $_POST [ 'f_smb_scriptpath' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> smb_scriptpath = '' ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_smbuserworkstations' ]) $_SESSION [ 'account_temp' ] -> smb_smbuserworkstations = $_POST [ 'f_smb_smbuserworkstations' ];
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> smb_smbuserworkstations = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_smbhome' ]) $_SESSION [ 'account_temp' ] -> smb_smbhome = stripslashes ( $_POST [ 'f_smb_smbhome' ]);
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> smb_smbhome = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_profilePath' ]) $_SESSION [ 'account_temp' ] -> smb_profilePath = stripslashes ( $_POST [ 'f_smb_profilePath' ]);
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> smb_profilePath = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_domain' ]) $_SESSION [ 'account_temp' ] -> smb_domain = $_POST [ 'f_smb_domain' ];
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> smb_domain = false ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_flagsW' ]) $_SESSION [ 'account_temp' ] -> smb_flagsW = $_POST [ 'f_smb_flagsW' ];
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> smb_flagsW = false ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_flagsD' ]) $_SESSION [ 'account_temp' ] -> smb_flagsD = $_POST [ 'f_smb_flagsD' ];
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> smb_flagsD = false ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_smb_flagsX' ]) $_SESSION [ 'account_temp' ] -> smb_flagsX = $_POST [ 'f_smb_flagsX' ];
2003-04-21 14:03:30 +00:00
else $_SESSION [ 'account_temp' ] -> smb_flagsX = false ;
// Check Values
$error = checksamba (); // account.inc
// Check which part Site should be displayd
2003-05-14 21:12:17 +00:00
if ( $_POST [ 'back' ]) $select_local = 'unix' ;
if ( $_POST [ 'next' ]) {
if ( $error == " 0 " )
switch ( $_SESSION [ 'type2' ]) {
case 'user' : $select_local = 'quota' ; break ;
case 'host' : $select_local = 'final' ; break ;
}
else $select_local = 'samba' ;
}
2003-04-21 14:03:30 +00:00
break ;
case 'quota' :
2003-05-07 16:53:03 +00:00
$i = 0 ;
while ( $_SESSION [ 'account' ] -> quota [ $i ][ 0 ]) {
$_SESSION [ 'account_temp' ] -> quota [ $i ][ 2 ] = $_POST [ 'f_quota_' . $i . '_2' ];
$_SESSION [ 'account_temp' ] -> quota [ $i ][ 3 ] = $_POST [ 'f_quota_' . $i . '_3' ];
$_SESSION [ 'account_temp' ] -> quota [ $i ][ 6 ] = $_POST [ 'f_quota_' . $i . '_6' ];
$_SESSION [ 'account_temp' ] -> quota [ $i ][ 7 ] = $_POST [ 'f_quota_' . $i . '_7' ];
$i ++ ;
}
$error = checkquota ();
2003-04-21 14:03:30 +00:00
// Check which part Site should be displayd
2003-05-14 21:12:17 +00:00
if ( $_POST [ 'back' ])
2003-04-23 15:47:00 +00:00
switch ( $_SESSION [ 'type2' ]) {
2003-05-02 12:52:42 +00:00
case 'user' : $select_local = 'samba' ; break ;
case 'group' : $select_local = 'general' ; break ;
2003-04-23 15:47:00 +00:00
}
2003-05-14 21:12:17 +00:00
if ( $_POST [ 'next' ]) {
if ( $error == " 0 " )
switch ( $_SESSION [ 'type2' ]) {
case 'user' : $select_local = 'personal' ; break ;
case 'group' : $select_local = 'final' ; break ;
}
else $select_local = 'quota' ;
}
2003-04-21 14:03:30 +00:00
break ;
case 'personal' :
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_personal_title' ]) $_SESSION [ 'account_temp' ] -> personal_title = $_POST [ 'f_personal_title' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> personal_title = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_personal_mail' ]) $_SESSION [ 'account_temp' ] -> personal_mail = $_POST [ 'f_personal_mail' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> personal_mail = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_personal_telephoneNumber' ]) $_SESSION [ 'account_temp' ] -> personal_telephoneNumber = $_POST [ 'f_personal_telephoneNumber' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> personal_telephoneNumber = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_personal_mobileTelephoneNumber' ]) $_SESSION [ 'account_temp' ] -> personal_mobileTelephoneNumber = $_POST [ 'f_personal_mobileTelephoneNumber' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> personal_mobileTelephoneNumber = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_personal_facsimileTelephoneNumber' ]) $_SESSION [ 'account_temp' ] -> personal_facsimileTelephoneNumber = $_POST [ 'f_personal_facsimileTelephoneNumber' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> personal_facsimileTelephoneNumber = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_personal_street' ]) $_SESSION [ 'account_temp' ] -> personal_street = $_POST [ 'f_personal_street' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> personal_street = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_personal_postalCode' ]) $_SESSION [ 'account_temp' ] -> personal_postalCode = $_POST [ 'f_personal_postalCode' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> personal_postalCode = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_personal_postalAddress' ]) $_SESSION [ 'account_temp' ] -> personal_postalAddress = $_POST [ 'f_personal_postalAddress' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> personal_postalAddress = " " ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'f_personal_employeeType' ]) $_SESSION [ 'account_temp' ] -> personal_employeeType = $_POST [ 'f_personal_employeeType' ];
2003-04-23 15:47:00 +00:00
else $_SESSION [ 'account_temp' ] -> personal_employeeType = " " ;
2003-04-21 14:03:30 +00:00
// Check which part Site should be displayd
2003-04-23 15:47:00 +00:00
$error = checkpersonal (); // account.inc
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'back' ] && ( $error == " 0 " )) $select_local = 'quota' ;
if ( $_POST [ 'next' ] && ( $error == " 0 " )) $select_local = 'final' ;
2003-04-23 15:47:00 +00:00
break ;
case 'final' :
2003-05-15 20:59:26 +00:00
if ( $_POST [ 'f_final_changegids' ]) $_SESSION [ 'final_changegids' ] = $_POST [ 'f_final_changegids' ] ;
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'back' ] && ( $error == " 0 " ))
2003-04-23 15:47:00 +00:00
switch ( $_SESSION [ 'type2' ]) {
2003-05-02 12:52:42 +00:00
case 'user' : $select_local = 'personal' ; break ;
case 'group' : $select_local = 'quota' ; break ;
case 'host' : $select_local = 'samba' ; break ;
2003-04-23 15:47:00 +00:00
}
2003-04-21 14:03:30 +00:00
break ;
}
2003-04-23 15:47:00 +00:00
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'create' ] ) { // Create-Button was pressed
2003-04-21 14:03:30 +00:00
switch ( $_SESSION [ 'type2' ]) {
case 'user' :
2003-05-20 21:12:15 +00:00
if ( $_SESSION [ 'modify' ] == 1 ) $result = modifyuser ();
else $result = createuser (); // account.inc
2003-05-02 12:52:42 +00:00
if ( $result == 1 || $result == 3 ) $select_local = 'finish' ;
2003-04-21 14:03:30 +00:00
break ;
case 'group' :
2003-05-21 11:10:28 +00:00
if ( $_SESSION [ 'modify' ] == 1 ) $result = modifygroup ();
else $result = creategroup (); // account.inc
2003-05-02 12:52:42 +00:00
if ( $result == 1 || $result == 3 ) $select_local = 'finish' ;
2003-04-21 14:03:30 +00:00
break ;
case 'host' :
2003-05-21 11:10:28 +00:00
if ( $_SESSION [ 'modify' ] == 1 ) $result = modifyhost ();
else $result = createhost (); // account.inc
2003-05-02 12:52:42 +00:00
if ( $result == 1 || $result == 3 ) $select_local = 'finish' ;
2003-04-21 14:03:30 +00:00
break ;
}
}
2003-05-14 21:12:17 +00:00
2003-04-21 14:03:30 +00:00
// Write HTML-Header and part of Table
echo '<html><head><title>' ;
echo _ ( 'Create new Account' );
2003-04-23 15:47:00 +00:00
echo ' </ title >
2003-05-02 12:52:42 +00:00
< link rel = " stylesheet " type = " text/css " href = " ../style/layout.css " >
2003-04-21 14:03:30 +00:00
< meta http - equiv = " pragma " content = " no-cache " >
2003-05-23 14:03:25 +00:00
< meta http - equiv = " cache-control " content = " no-cache " >
2003-05-23 07:11:01 +00:00
</ head >< body >
2003-05-23 14:03:25 +00:00
< form action = " account.php " method = " post " > ' ;
2003-05-03 19:15:23 +00:00
if ( $error != " 0 " ) StatusMessage ( 'ERROR' , _ ( 'Invalid Value!' ), $error );
echo ' < table rules = " all " class = " account " width = " 100% " >
< tr >< td ></ td ></ tr > ' ;
2003-04-24 17:29:58 +00:00
2003-05-02 12:52:42 +00:00
if ( ! $select_local ) $select_local = 'general' ;
if ( $_POST [ 'createagain' ]) {
$select_local = 'general' ;
2003-04-25 11:07:28 +00:00
$_SESSION [ 'account' ] = " " ;
$_SESSION [ 'account_temp' ] = " " ;
$_SESSION [ 'account_old' ] = " " ;
}
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'backmain' ]) {
$select_local = 'backmain' ;
2003-04-25 11:07:28 +00:00
$_SESSION [ 'account' ] = " " ;
$_SESSION [ 'account_temp' ] = " " ;
$_SESSION [ 'account_old' ] = " " ;
}
2003-05-02 12:52:42 +00:00
if ( $_POST [ 'load' ]) $select_local = 'load' ;
if ( $_POST [ 'save' ]) $select_local = 'save' ;
2003-04-25 11:07:28 +00:00
2003-05-16 20:00:45 +00:00
2003-05-02 12:52:42 +00:00
switch ( $select_local ) {
2003-04-21 14:03:30 +00:00
case 'general' :
// General Account Settings
$groups = findgroups ();
echo '
< input name = " select " type = " hidden " value = " general " >
< tr >< td > ' ;
echo _ ( 'General Properties' );
echo '</td></tr>' ;
switch ( $_SESSION [ 'type2' ] ) {
case 'user' :
2003-05-01 17:02:57 +00:00
$profilelist = getUserProfiles ();
2003-04-21 14:03:30 +00:00
echo '<tr><td>' ;
echo _ ( 'Username' );
echo ' </ td >< td >
< input name = " f_general_username " type = " text " size = " 20 " maxlength = " 20 " value = " ' . $_SESSION['account'] ->general_username . ' " >
</ td ></ tr >< tr >< td > ' ;
2003-04-23 15:47:00 +00:00
echo _ ( 'UID Number' );
2003-04-21 14:03:30 +00:00
echo ' </ td >< td >
2003-04-23 15:47:00 +00:00
< input name = " f_general_uidNumber " type = " text " size = " 6 " maxlength = " 6 " value = " ' . $_SESSION['account'] ->general_uidNumber . ' " >
</ td >< td > ' ;
echo _ ( 'If empty UID Number will be generated automaticly.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Surname' );
echo ' </ td >< td >
< input name = " f_general_surname " type = " text " size = " 20 " maxlength = " 20 " value = " ' . $_SESSION['account'] ->general_surname . ' " >
2003-05-20 21:13:00 +00:00
</ td ></ tr >< tr >< td > ' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Given name' );
echo ' </ td >< td >
< input name = " f_general_givenname " type = " text " size = " 20 " maxlength = " 20 " value = " ' . $_SESSION['account'] ->general_givenname . ' " >
2003-05-20 21:13:00 +00:00
</ td ></ tr >< tr >< td > ' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Primary Group' );
echo '</td><td><select name="f_general_group">' ;
foreach ( $groups as $group ) {
if ( $_SESSION [ 'account' ] -> general_group == $group ) echo '<option selected>' . $group ;
2003-04-23 15:47:00 +00:00
else echo '<option>' . $group ;
2003-04-21 14:03:30 +00:00
}
echo '</td></tr><tr><td>' ;
echo _ ( 'Additional Groupmembership' );
echo '</td><td><select name="f_general_groupadd[]" size="3" multiple>' ;
foreach ( $groups as $group ) {
if ( $_SESSION [ 'account' ] -> general_groupadd ) {
if ( in_array ( $group , $_SESSION [ 'account' ] -> general_groupadd )) echo '<option selected>' . $group ;
else echo '<option>' . $group ;
}
else echo '<option>' . $group ;
}
2003-04-23 15:47:00 +00:00
echo '</select></td><td>' ;
echo _ ( 'Can be left empty. Hold the CTRL-key to select multiple groups.' );
echo '</td></tr><tr><td>' ;
echo _ ( 'Home Directory' );
2003-04-21 14:03:30 +00:00
echo '</td><td><input name="f_general_homedir" type="text" size="30" value="' . $_SESSION [ 'account' ] -> general_homedir . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( '$user and $group are replaced with username or primary groupname.' );
echo '</td></tr><tr><td>' ;
echo _ ( 'Gecos' );
2003-04-21 14:03:30 +00:00
echo '</td><td><input name="f_general_gecos" type="text" size="30" value="' . $_SESSION [ 'account' ] -> general_gecos . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'User descriptopn. If left empty sur- and givename will be used.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Login Shell' );
echo '</td><td><select name="f_general_shell" >' ;
2003-05-01 17:02:57 +00:00
foreach ( $_SESSION [ 'shelllist' ] as $shell )
2003-05-14 21:12:17 +00:00
if ( $_SESSION [ 'account' ] -> general_shell == trim ( $shell )) echo '<option selected>' . $shell ;
else echo '<option>' . $shell ;
2003-04-23 15:47:00 +00:00
echo '</select></td><td>' ;
echo _ ( 'To disable login use /bin/false.' );
2003-05-01 17:02:57 +00:00
echo '</td></tr><tr><td><select name="f_general_selectprofile">' ;
foreach ( $profilelist as $profile ) echo '<option>' . $profile ;
echo ' </ select >
2003-04-29 18:03:42 +00:00
< input name = " load " type = " submit " value = " '; echo _('Load Profile'); echo ' " >
</ td >< td > ' ;
2003-04-21 14:03:30 +00:00
break ;
case 'group' :
2003-05-14 21:12:17 +00:00
$profilelist = getGroupProfiles ();
2003-04-21 14:03:30 +00:00
echo '<tr><td>' ;
echo _ ( 'Groupname' );
echo ' </ td >< td >
2003-04-23 15:47:00 +00:00
< input name = " f_general_username " type = " text " size = " 20 " maxlength = " 20 " value = " ' . $_SESSION['account'] ->general_username . ' " >
</ td ></ tr >< tr >< td > ' ;
echo _ ( 'GID Number' );
2003-04-21 14:03:30 +00:00
echo ' </ td >< td >
2003-04-23 15:47:00 +00:00
< input name = " f_general_uidNumber " type = " text " size = " 6 " maxlength = " 6 " value = " ' . $_SESSION['account'] ->general_uidNumber . ' " >
</ td >< td > ' ;
echo _ ( 'If empty GID Number will be generated automaticly.' );
echo '</td></tr><tr><td>' ;
echo _ ( 'Gecos' );
2003-04-21 14:03:30 +00:00
echo '</td><td><input name="f_general_gecos" type="text" size="30" value="' . $_SESSION [ 'account' ] -> general_gecos . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'User descriptopn. If left empty groupname will be used.' );
2003-05-14 21:12:17 +00:00
echo '</td></tr><tr><td><select name="f_general_selectprofile">' ;
foreach ( $profilelist as $profile ) echo '<option>' . $profile ;
echo ' </ select >
< input name = " load " type = " submit " value = " '; echo _('Load Profile'); echo ' " >
</ td >< td > ' ;
2003-04-21 14:03:30 +00:00
break ;
case 'host' :
2003-05-01 17:02:57 +00:00
$profilelist = getHostProfiles ();
2003-04-21 14:03:30 +00:00
echo '<tr><td>' ;
echo _ ( 'Hostname' );
echo ' </ td >< td >
2003-04-23 15:47:00 +00:00
< input name = " f_general_username " type = " text " size = " 20 " maxlength = " 20 " value = " ' . $_SESSION['account'] ->general_username . ' " >
</ td ></ tr >< tr >< td > ' ;
echo _ ( 'UID Number' );
2003-04-21 14:03:30 +00:00
echo ' </ td >< td >
2003-04-23 15:47:00 +00:00
< input name = " f_general_uidNumber " type = " text " size = " 6 " maxlength = " 6 " value = " ' . $_SESSION['account'] ->general_uidNumber . ' " >
</ td >< td > ' ;
echo _ ( 'If empty UID Number will be generated automaticly.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Primary Group' );
echo '</td><td><select name="f_general_group">' ;
foreach ( $groups as $group ) {
if ( $_SESSION [ 'account' ] -> general_group == $group ) echo '<option selected>' . $group ;
2003-04-23 15:47:00 +00:00
else echo '<option>' . $group ;
2003-04-21 14:03:30 +00:00
}
echo '</td></tr><tr><td>' ;
echo _ ( 'Additional Groupmembership' );
echo '</td><td><select name="f_general_groupadd[]" size="3" multiple>' ;
foreach ( $groups as $group ) {
if ( $_SESSION [ 'account' ] -> general_groupadd ) {
if ( in_array ( $group , $_SESSION [ 'account' ] -> general_groupadd )) echo '<option selected>' . $group ;
else echo '<option>' . $group ;
}
else echo '<option>' . $group ;
}
2003-04-23 15:47:00 +00:00
echo '</select></td><td>' ;
echo _ ( 'Can be left empty. Hold the CTRL-key to select multiple groups.' );
2003-04-21 14:03:30 +00:00
echo '</td></tr><tr><td>' ;
2003-04-23 15:47:00 +00:00
echo _ ( 'Gecos' );
2003-04-21 14:03:30 +00:00
echo '</td><td><input name="f_general_gecos" type="text" size="30" value="' . $_SESSION [ 'account' ] -> general_gecos . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'Host descriptopn. If left empty hostname will be used.' );
2003-05-01 17:02:57 +00:00
echo '</td></tr><tr><td><select name="f_general_selectprofile">' ;
foreach ( $profilelist as $profile ) echo '<option>' . $profile ;
echo ' </ select >
2003-04-29 18:03:42 +00:00
< input name = " load " type = " submit " value = " '; echo _('Load Profile'); echo ' " >
</ td >< td > ' ;
2003-04-21 14:03:30 +00:00
break ;
}
2003-04-29 18:03:42 +00:00
echo ' </ td >< td >
2003-04-21 14:03:30 +00:00
< input name = " next " type = " submit " value = " '; echo _('next'); echo ' " >
</ td ></ tr > ' ;
break ;
case 'unix' :
// Unix Password Settings
echo '<input name="select" type="hidden" value="unix">' ;
echo '<tr><td>Unix Properties</td></tr>' ;
switch ( $_SESSION [ 'type2' ] ) {
case 'user' :
echo '<tr><td>' ;
echo _ ( 'Password' );
echo ' </ td >< td >
2003-04-23 15:47:00 +00:00
< input name = " f_unix_password " type = " text " size = " 20 " maxlength = " 20 " value = " ' . $_SESSION['account'] ->unix_password . ' " >
</ td >< td >
< input name = " genpass " type = " submit " value = " ';
2003-04-21 14:03:30 +00:00
echo _ ( 'Generate Password' ); echo ' " >
2003-04-23 15:47:00 +00:00
</ td ></ tr >< tr >< td > ' ;
2003-04-24 11:59:26 +00:00
echo _ ( 'Use no Password.' );
echo '</td><td><input name="f_unix_password_no" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> unix_password_no ) echo ' checked ' ;
echo '></td></tr><tr><td>' ;
2003-04-23 15:47:00 +00:00
echo _ ( 'Password Warn' );
2003-04-21 14:03:30 +00:00
echo '</td><td><input name="f_unix_pwdwarn" type="text" size="4" maxlength="4" value="' . $_SESSION [ 'account' ] -> unix_pwdwarn . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'Number of days a user will be warned when password will expire. Value must be 0<.' );
echo '</td></tr><tr><td>' ;
echo _ ( 'Password Expire' );
2003-04-21 14:03:30 +00:00
echo '</td><td><input name="f_unix_pwdallowlogin" type="text" size="4" maxlength="4" value="' . $_SESSION [ 'account' ] -> unix_pwdallowlogin . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'Number of days a user can login even his password has expired. -1=always' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Maximum Passwordage' );
echo '</td><td><input name="f_unix_pwdmaxage" type="text" size="5" maxlength="5" value="' . $_SESSION [ 'account' ] -> unix_pwdmaxage . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'Number of days after a user has to change his password again Value must be 0<.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Minimum Passwordage' );
echo '</td><td><input name="f_unix_pwdminage" type="text" size="4" maxlength="4" value="' . $_SESSION [ 'account' ] -> unix_pwdminage . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'Number of days a user has to wait until he\'s allowed to change his password again. Value must be 0<.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Expire Date' );
echo '</td><td><select name="f_unix_pwdexpire_day">' ;
for ( $i = 1 ; $i <= 31 ; $i ++ ) {
if ( $_SESSION [ 'account' ] -> unix_pwdexpire_day == $i ) echo " <option selected> $i " ;
else echo " <option> $i " ;
}
echo '</select><select name="f_unix_pwdexpire_mon">' ;
for ( $i = 1 ; $i <= 12 ; $i ++ ) {
if ( $_SESSION [ 'account' ] -> unix_pwdexpire_mon == $i ) echo " <option selected> $i " ;
else echo " <option> $i " ;
}
echo '</select><select name="f_unix_pwdexpire_yea">' ;
for ( $i = 2003 ; $i <= 2030 ; $i ++ ) {
if ( $_SESSION [ 'account' ] -> unix_pwdexpire_yea == $i ) echo " <option selected> $i " ;
else echo " <option> $i " ;
}
2003-04-23 15:47:00 +00:00
echo '</select></td><td>' ;
echo _ ( 'Account expire date.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Account deactivated' );
echo '</td><td><input name="f_unix_deactivated" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> unix_deactivated ) echo ' checked ' ;
echo '></td></tr>' ;
break ;
case 'host' :
2003-05-17 11:19:03 +00:00
echo '<input name="f_unix_password_no" type="hidden" value="' . $_SESSION [ 'account' ] -> unix_password_no . '">' ;
2003-04-21 14:03:30 +00:00
echo '<tr><td>' ;
echo _ ( 'Password' );
2003-05-17 11:19:03 +00:00
echo '</td><td></td><td>' ;
if ( $_SESSION [ 'modify' ] == 1 ) {
echo '<input name="respass" type="submit" value="' ;
echo _ ( 'Reset Password' ); echo '">' ;
}
echo '</td></tr><tr><td>' ;
2003-04-23 15:47:00 +00:00
echo _ ( 'Password Warn' );
2003-04-21 14:03:30 +00:00
echo '</td><td><input name="f_unix_pwdwarn" type="text" size="4" maxlength="4" value="' . $_SESSION [ 'account' ] -> unix_pwdwarn . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
2003-05-17 11:19:03 +00:00
echo _ ( 'Number of host a user will be warned when password will expire. Value must be 0<.' );
2003-04-23 15:47:00 +00:00
echo '</td></tr><tr><td>' ;
echo _ ( 'Password Expire' );
2003-04-21 14:03:30 +00:00
echo '</td><td><input name="f_unix_pwdallowlogin" type="text" size="4" maxlength="4" value="' . $_SESSION [ 'account' ] -> unix_pwdallowlogin . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
2003-05-17 11:19:03 +00:00
echo _ ( 'Number of days a host can login even his password has expired. -1=always' );
2003-04-23 15:47:00 +00:00
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Maximum Passwordage' );
echo '</td><td><input name="f_unix_pwdmaxage" type="text" size="5" maxlength="5" value="' . $_SESSION [ 'account' ] -> unix_pwdmaxage . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
2003-05-17 11:19:03 +00:00
echo _ ( 'Number of days after a host has to change his password again Value must be 0< and should be higher as the value on client-side.' );
2003-04-23 15:47:00 +00:00
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Minimum Passwordage' );
echo '</td><td><input name="f_unix_pwdminage" type="text" size="4" maxlength="4" value="' . $_SESSION [ 'account' ] -> unix_pwdminage . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'Number of days a user has to wait until he\'s allowed to change his password again. Value must be 0<.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Expire Date' );
echo '</td><td><select name="f_unix_pwdexpire_day">' ;
for ( $i = 1 ; $i <= 31 ; $i ++ ) {
if ( $_SESSION [ 'account' ] -> unix_pwdexpire_day == $i ) echo " <option selected> $i " ;
else echo " <option> $i " ;
}
echo '</select><select name="f_unix_pwdexpire_mon">' ;
for ( $i = 1 ; $i <= 12 ; $i ++ ) {
2003-04-23 15:47:00 +00:00
if ( $_SESSION [ 'account' ] -> unix_pwdexpire_mon == $i ) echo " <option selected> $i " ;
2003-04-21 14:03:30 +00:00
else echo " <option> $i " ;
}
echo '</select><select name="f_unix_pwdexpire_yea">' ;
for ( $i = 2003 ; $i <= 2030 ; $i ++ ) {
if ( $_SESSION [ 'account' ] -> unix_pwdexpire_yea == $i ) echo " <option selected> $i " ;
else echo " <option> $i " ;
}
2003-04-23 15:47:00 +00:00
echo '</select></td><td>' ;
echo _ ( 'Account expire date.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Account deactivated' );
echo '</td><td><input name="f_unix_deactivated" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> unix_deactivated ) echo ' checked ' ;
echo '></td></tr>' ;
break ;
}
echo ' < tr >< td >
< input name = " back " type = " submit " value = " '; echo _('back'); echo ' " >
2003-04-23 15:47:00 +00:00
</ td >< td ></ td >< td >
2003-04-21 14:03:30 +00:00
< input name = " next " type = " submit " value = " '; echo _('next'); echo ' " >
</ td ></ tr > ' ;
break ;
case 'samba' :
// Samba Settings
echo '<input name="select" type="hidden" value="samba">' ;
echo '<tr><td>' ; echo _ ( 'Samba Properties' ); echo '</td></tr>' ;
switch ( $_SESSION [ 'type2' ] ) {
case 'user' :
echo '<tr><td>' ;
echo _ ( 'Samba Password' );
echo '</td><td><input name="f_smb_password" type="text" size="20" maxlength="20" value="' . $_SESSION [ 'account' ] -> smb_password . ' " >
</ td >< td >< input name = " f_smb_useunixpwd " type = " checkbox " ' ;
if ( $_SESSION [ 'account' ] -> smb_useunixpwd ) echo ' checked ' ;
echo '>' ;
echo _ ( 'Use Unix-Password' );
echo '</td></tr><tr><td>' ;
2003-04-24 11:59:26 +00:00
echo _ ( 'Use no Password.' );
echo '</td><td><input name="f_smb_password_no" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> smb_password_no ) echo ' checked ' ;
echo '></td></tr><tr><td>' ;
echo _ ( 'Password doesn\'t expire.' );
echo '</td><td><input name="f_smb_flagsX" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> smb_flagsX ) echo ' checked ' ;
echo '></td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'User can change Password' );
echo '</td><td><input name="f_smb_pwdcanchange" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> smb_pwdcanchange ) echo ' checked ' ;
echo '></td></tr><tr><td>' ;
echo _ ( 'User must change Password' );
echo '</td><td><input name="f_smb_pwdmustchange" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> smb_pwdmustchange ) echo ' checked ' ;
echo '></td></tr><tr><td>' ;
echo _ ( 'Accout is deactivated' );
echo '</td><td><input name="f_smb_flagsD" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> smb_flagsD ) echo ' checked ' ;
echo '></td></tr><tr><td>' ;
$_SESSION [ 'account' ] -> smb_flagsW = 0 ;
echo _ ( 'Home Drive' );
echo '</td><td><select name="f_smb_homedrive" >' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'D:' ) echo '<option selected> D:' ; else echo '<option> D:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'E:' ) echo '<option selected> E:' ; else echo '<option> E:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'F:' ) echo '<option selected> F:' ; else echo '<option> F:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'G:' ) echo '<option selected> G:' ; else echo '<option> G:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'H:' ) echo '<option selected> H:' ; else echo '<option> H:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'I:' ) echo '<option selected> I:' ; else echo '<option> I:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'J:' ) echo '<option selected> J:' ; else echo '<option> J:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'K:' ) echo '<option selected> K:' ; else echo '<option> K:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'L:' ) echo '<option selected> L:' ; else echo '<option> L:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'M:' ) echo '<option selected> M:' ; else echo '<option> M:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'N:' ) echo '<option selected> N:' ; else echo '<option> N:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'O:' ) echo '<option selected> O:' ; else echo '<option> O:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'P:' ) echo '<option selected> P:' ; else echo '<option> P:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'Q:' ) echo '<option selected> Q:' ; else echo '<option> Q:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'R:' ) echo '<option selected> R:' ; else echo '<option> R:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'S:' ) echo '<option selected> S:' ; else echo '<option> S:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'T:' ) echo '<option selected> T:' ; else echo '<option> T:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'U:' ) echo '<option selected> U:' ; else echo '<option> U:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'V:' ) echo '<option selected> V:' ; else echo '<option> V:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'W:' ) echo '<option selected> W:' ; else echo '<option> W:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'X:' ) echo '<option selected> X:' ; else echo '<option> X:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'Y:' ) echo '<option selected> Y:' ; else echo '<option> Y:' ;
if ( $_SESSION [ 'account' ] -> smb_homedrive == 'Z:' ) echo '<option selected> Z:' ; else echo '<option> Z:' ;
2003-04-23 15:47:00 +00:00
echo '</select></td><td>' ;
echo _ ( 'Driveletter assigned on Windows-Workstations as Homedirectory.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Script Path' );
echo '</td><td><input name="f_smb_scriptpath" type="text" size="20" maxlength="20" value="' . $_SESSION [ 'account' ] -> smb_scriptpath . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'Filename and -path relative to netlogon-share which should be executed on logon. $user and $group are replaced with user- and groupname. Can be left empty.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Profile Path' );
echo '</td><td><input name="f_smb_profilePath" type="text" size="20" maxlength="20" value="' . $_SESSION [ 'account' ] -> smb_profilePath . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'Path of the userprofile. Can be a local absolute path or a UNC-path (\\\\server\share). $user and $group are replaced with user- and groupname. Can be left empty.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'User Workstations' );
echo '</td><td><input name="f_smb_smbuserworkstations" type="text" size="20" maxlength="20" value="' . $_SESSION [ 'account' ] -> smb_smbuserworkstations . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
2003-05-16 20:00:45 +00:00
echo _ ( 'Komma-separated list of workstations the user is allowed to login. Empty means every workstation. Can be left empty.' );
2003-04-23 15:47:00 +00:00
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'smb Home' );
echo '</td><td><input name="f_smb_smbhome" type="text" size="20" maxlength="20" value="' . $_SESSION [ 'account' ] -> smb_smbhome . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'UNC-path (\\\\server\share) of homedirectory. $user and $group are replaced with user- and groupname. Can be left empty.' );
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Domain' );
echo '</td><td><input name="f_smb_domain" type="text" size="20" maxlength="20" value="' . $_SESSION [ 'account' ] -> smb_domain . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'Windows-Domain of user. Can be left empty.' );
echo '</td></tr>' ;
2003-04-21 14:03:30 +00:00
break ;
case 'host' :
2003-05-17 11:19:03 +00:00
echo '<input name="f_smb_password_no" type="hidden" value="' . $_SESSION [ 'account' ] -> unix_password_no . '">' ;
2003-04-21 14:03:30 +00:00
echo '<tr><td>' ;
2003-04-24 11:59:26 +00:00
echo _ ( 'Password doesn\'t expire.' );
echo '</td><td><input name="f_smb_flagsX" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> smb_flagsX ) echo ' checked ' ;
echo '></td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Host can change Password' );
echo '</td><td><input name="f_smb_pwdcanchange" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> smb_pwdcanchange ) echo ' checked ' ;
echo '></td></tr><tr><td>' ;
echo _ ( 'Host must change Password' );
echo '</td><td><input name="f_smb_pwdmustchange" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> smb_pwdmustchange ) echo ' checked ' ;
echo '></td></tr><tr><td>' ;
echo _ ( 'Accout is deactivated' );
echo '</td><td><input name="f_smb_flagsD" type="checkbox"' ;
if ( $_SESSION [ 'account' ] -> smb_flagsD ) echo ' checked ' ;
echo '></td></tr><tr><td>' ;
$_SESSION [ 'account' ] -> smb_flagsW = 1 ;
2003-04-23 15:47:00 +00:00
echo '</td></tr><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Domain' );
echo '</td><td><input name="f_smb_domain" type="text" size="20" maxlength="20" value="' . $_SESSION [ 'account' ] -> smb_domain . ' " >
2003-04-23 15:47:00 +00:00
</ td >< td > ' ;
echo _ ( 'Windows-Domain of user. Can be left empty.' );
echo '</td></tr>' ;
2003-04-21 14:03:30 +00:00
break ;
}
echo ' < tr >< td >
< input name = " back " type = " submit " value = " '; echo _('back'); echo ' " >
2003-04-23 15:47:00 +00:00
</ td >< td ></ td >< td >
2003-04-21 14:03:30 +00:00
< input name = " next " type = " submit " value = " '; echo _('next'); echo ' " >
</ td ></ tr > ' ;
break ;
case 'quota' :
// Quota Settings
2003-05-07 16:53:03 +00:00
echo '<input name="select" type="hidden" value="quota"><tr><td>' ;
2003-04-21 14:03:30 +00:00
echo _ ( 'Quota Properties' );
2003-05-07 16:53:03 +00:00
echo '</td></tr><tr><td>' ; echo _ ( 'Mointpoint' ); echo '</td><td>' ; echo _ ( 'used blocks' ); echo '</td><td>' ;
echo _ ( 'soft block limit' ); echo '</td><td>' ; echo _ ( 'hard block limit' ); echo '</td><td>' ; echo _ ( 'grace block period' );
echo '</td><td>' ; echo _ ( 'used inodes' ); echo '</td><td>' ; echo _ ( 'soft inode limit' ); echo '</td><td>' ;
echo _ ( 'hard inode limit' ); echo '</td><td>' ; echo _ ( 'grace inode period' ); echo '</td></tr>' ;
$i = 0 ;
while ( $_SESSION [ 'account' ] -> quota [ $i ][ 0 ]) {
echo '<tr><td>' . $_SESSION [ 'account' ] -> quota [ $i ][ 0 ] . '</td><td>' . $_SESSION [ 'account' ] -> quota [ $i ][ 1 ] . '</td>' ; // used blocks
echo '<td><input name="f_quota_' . $i . '_2" type="text" size="12" maxlength="20" value="' . $_SESSION [ 'account' ] -> quota [ $i ][ 2 ] . '"></td>' ; // blocks soft limit
echo '<td><input name="f_quota_' . $i . '_3" type="text" size="12" maxlength="20" value="' . $_SESSION [ 'account' ] -> quota [ $i ][ 3 ] . '"></td>' ; // blocks hard limit
echo '<td>' . $_SESSION [ 'account' ] -> quota [ $i ][ 4 ] . '</td>' ; // block grace period
echo '<td>' . $_SESSION [ 'account' ] -> quota [ $i ][ 5 ] . '</td>' ; // used inodes
echo '<td><input name="f_quota_' . $i . '_6" type="text" size="12" maxlength="20" value="' . $_SESSION [ 'account' ] -> quota [ $i ][ 6 ] . '"></td>' ; // inodes soft limit
echo '<td><input name="f_quota_' . $i . '_7" type="text" size="12" maxlength="20" value="' . $_SESSION [ 'account' ] -> quota [ $i ][ 7 ] . '"></td>' ; // inodes hard limit
echo '<td>' . $_SESSION [ 'account' ] -> quota [ $i ][ 8 ] . '</td></tr>' ; // inodes grace period
$i ++ ;
}
echo ' < tr >< td >
2003-04-21 14:03:30 +00:00
< input name = " back " type = " submit " value = " '; echo _('back'); echo ' " >
2003-05-07 16:53:03 +00:00
</ td >< td ></ td >< td ></ td >< td ></ td >< td ></ td >< td ></ td >< td ></ td >< td ></ td >< td >
2003-04-21 14:03:30 +00:00
< input name = " next " type = " submit " value = " '; echo _('next'); echo ' " >
</ td ></ tr > ' ;
break ;
case 'personal' :
// Personal Settings
echo ' < input name = " select " type = " hidden " value = " personal " >
< tr >< td > ' ;
echo _ ( 'Personal Properties' );
2003-04-23 15:47:00 +00:00
echo '</td></tr><tr><td>' ;
echo _ ( 'Title' );
echo ' </ td >< td >
< input name = " f_personal_title " type = " text " size = " 10 " maxlength = " 10 " value = " ' . $_SESSION['account'] ->personal_title . ' " > ' ;
echo $_SESSION [ 'account' ] -> general_surname . ' ' . $_SESSION [ 'account' ] -> general_givenname . '</td><td>' ;
echo _ ( 'Every value on this page can be left empty.' );
echo '</td></tr><tr><td>' ;
echo _ ( 'Employee Type' );
echo ' </ td >< td >
< input name = " f_personal_employeeType " type = " text " size = " 30 " maxlength = " 30 " value = " ' . $_SESSION['account'] ->personal_employeeType . ' " >
</ td ></ tr >< tr >< td > ' ;
echo _ ( 'Street' );
echo ' </ td >< td >
< input name = " f_personal_street " type = " text " size = " 30 " maxlength = " 30 " value = " ' . $_SESSION['account'] ->personal_street . ' " >
</ td ></ tr >< tr >< td > ' ;
echo _ ( 'Postal code' );
echo ' </ td >< td >
< input name = " f_personal_postalCode " type = " text " size = " 5 " maxlength = " 5 " value = " ' . $_SESSION['account'] ->personal_postalCode . ' " >
</ td ></ tr >< tr >< td > ' ;
echo _ ( 'Postal address' );
echo ' </ td >< td >
< input name = " f_personal_postalAddress " type = " text " size = " 30 " maxlength = " 30 " value = " ' . $_SESSION['account'] ->personal_postalAddress . ' " >
</ td ></ tr >< tr >< td > ' ;
echo _ ( 'Telephone Number' );
echo ' </ td >< td >
< input name = " f_personal_telephoneNumber " type = " text " size = " 30 " maxlength = " 30 " value = " ' . $_SESSION['account'] ->personal_telephoneNumber . ' " >
</ td ></ tr >< tr >< td > ' ;
echo _ ( 'Mobile Phonenumber' );
echo ' </ td >< td >
< input name = " f_personal_mobileTelephoneNumber " type = " text " size = " 30 " maxlength = " 30 " value = " ' . $_SESSION['account'] ->personal_mobileTelephoneNumber . ' " >
</ td ></ tr >< tr >< td > ' ;
echo _ ( 'Facsimile Number' );
echo ' </ td >< td >
< input name = " f_personal_facsimileTelephoneNumber " type = " text " size = " 30 " maxlength = " 30 " value = " ' . $_SESSION['account'] ->personal_facsimileTelephoneNumber . ' " >
</ td ></ tr >< tr >< td > ' ;
echo _ ( 'eMail Address' );
echo ' </ td >< td >
< input name = " f_personal_mail " type = " text " size = " 30 " maxlength = " 30 " value = " ' . $_SESSION['account'] ->personal_mail . ' " >
</ td ></ tr >< tr >< td >
2003-04-21 14:03:30 +00:00
< input name = " back " type = " submit " value = " '; echo _('back'); echo ' " >
2003-04-23 15:47:00 +00:00
</ td >< td ></ td >< td >
< input name = " next " type = " submit " value = " '; echo _('next'); echo ' " >
</ td ></ tr > ' ;
break ;
case 'final' :
// Final Settings
echo ' < input name = " select " type = " hidden " value = " final " >
< tr >< td > ' ;
2003-05-15 20:59:26 +00:00
if ( $_SESSION [ 'modify' ] == 1 ) echo _ ( 'Modify' );
else echo _ ( 'Create' );
2003-04-23 15:47:00 +00:00
echo '</td></tr>' ;
switch ( $_SESSION [ 'type2' ] ) {
case 'user' :
if (( $_SESSION [ 'modify' ] == 1 ) && ( $_SESSION [ 'account' ] -> general_uidNumber != $_SESSION [ 'account_old' ] -> general_uidNumber )) {
2003-05-03 19:15:23 +00:00
echo '<tr>' ;
StatusMessage ( 'INFO' , _ ( 'UID-number has changed. You have to run the following command as root in order to change existing file-permissions:' ),
'find / -gid ' . $_SESSION [ 'account_old' ] -> general_uidNumber . ' -exec chown ' . $_SESSION [ 'account' ] -> general_uidNumber . ' {} \;' );
echo '</tr>' ;
2003-04-23 15:47:00 +00:00
}
if (( $_SESSION [ 'modify' ] == 1 ) && ( $_SESSION [ 'account' ] -> general_homedir != $_SESSION [ 'account_old' ] -> general_homedir )) {
2003-05-03 19:15:23 +00:00
echo '<tr>' ;
StatusMessage ( 'INFO' , _ ( 'Home Directory has changed. You have to run the following command as root in order to change the existing homedirectory:' ),
'mv ' . $_SESSION [ 'account_old' ] -> general_homedir . ' ' . $_SESSION [ 'account' ] -> general_homedir );
echo '</tr>' ;
2003-04-23 15:47:00 +00:00
}
break ;
case 'group' :
if (( $_SESSION [ 'modify' ] == 1 ) && ( $_SESSION [ 'account' ] -> general_uidNumber != $_SESSION [ 'account_old' ] -> general_uidNumber )) {
2003-05-03 19:15:23 +00:00
echo '<tr>' ;
2003-05-15 20:59:26 +00:00
StatusMessage ( 'INFO' , _ ( 'GID-number has changed. You have to run the following command as root in order to change existing file-permissions:' ),
2003-05-03 19:15:23 +00:00
'find / -gid ' . $_SESSION [ 'account_old' ] -> general_uidNumber . ' -exec chgrp ' . $_SESSION [ 'account' ] -> general_uidNumber . ' {} \;' );
echo '</tr>' ;
2003-04-23 15:47:00 +00:00
echo '<tr><td>' ;
echo '<input name="f_final_changegids" type="checkbox"' ;
2003-05-15 20:59:26 +00:00
if ( $_SESSION [ 'final_changegids' ]) echo ' checked ' ;
2003-04-23 15:47:00 +00:00
echo ' >' ;
echo _ ( 'Change GID-Number of all users in group to new value' );
echo '</td></tr>' ;
}
break ;
2003-05-07 16:53:03 +00:00
case 'host' :
if (( $_SESSION [ 'modify' ] == 1 ) && ( $_SESSION [ 'account' ] -> general_uidNumber != $_SESSION [ 'account_old' ] -> general_uidNumber )) {
echo '<tr>' ;
StatusMessage ( 'INFO' , _ ( 'UID-number has changed. You have to run the following command as root in order to change existing file-permissions:' ),
'find / -gid ' . $_SESSION [ 'account_old' ] -> general_uidNumber . ' -exec chown ' . $_SESSION [ 'account' ] -> general_uidNumber . ' {} \;' );
echo '</tr>' ;
}
break ;
2003-04-23 15:47:00 +00:00
}
echo '<tr><td>' ;
echo '<input name="back" type="submit" value="' ; echo _ ( 'back' ); echo ' " >
2003-04-29 18:03:42 +00:00
</ td >< td > ' ;
if (( $_SESSION [ 'type2' ] == 'user' ) || ( $_SESSION [ 'type2' ] == 'host' )) {
2003-05-01 17:02:57 +00:00
echo ' </ td >< td >< input name = " f_finish_safeProfile " type = " text " size = " 30 " maxlength = " 30 " >
< input name = " save " type = " submit " value = " ';
2003-04-29 18:03:42 +00:00
echo _ ( 'Save Profile' );
echo '">' ;
}
echo ' </ td >< td >
2003-05-15 20:59:26 +00:00
< input name = " create " type = " submit " value = " ';
if ( $_SESSION [ 'modify' ] == 1 ) echo _ ( 'Modify Account' );
else echo _ ( 'Create Account' );
echo ' " >
2003-04-21 14:03:30 +00:00
</ td ></ tr > ' ;
break ;
2003-04-24 14:27:41 +00:00
case 'finish' :
// Final Settings
echo ' < input name = " select " type = " hidden " value = " final " >
< tr >< td > ' ;
echo _ ( 'Success' );
echo '</td></tr>' ;
switch ( $_SESSION [ 'type2' ] ) {
case 'user' :
echo '<tr><td>' ;
echo _ ( 'User ' );
echo $_SESSION [ 'account' ] -> general_username ;
2003-05-15 20:59:26 +00:00
if ( $_SESSION [ 'modify' ] == 1 ) echo _ ( 'has been modified' );
else echo _ ( 'has been created' );
2003-04-24 14:27:41 +00:00
echo '</td></tr>' ;
2003-04-25 11:07:28 +00:00
foreach ( file ( '../config/print.html' ) as $line ) eval ( " ? " . " > " . $line . " < " . " ? " );
2003-05-15 20:59:26 +00:00
echo '<tr><td>' ;
if ( $_SESSION [ 'modify' ] != 1 )
{ echo '<input name="createagain" type="submit" value="' ; echo _ ( 'Create another user' ); echo '">' ; }
echo ' </ td >< td >
2003-04-24 14:27:41 +00:00
< a href = " javascript:self.print(); " > ' ;
echo _ ( 'Print' );
echo ' </ a ></ td >< td >
< input name = " backmain " type = " submit " value = " '; echo _('Back to userlist'); echo ' " >
</ td ></ tr > ' ;
break ;
case 'group' :
echo '<tr><td>' ;
echo _ ( 'Group ' );
echo $_SESSION [ 'account' ] -> general_username ;
2003-05-15 20:59:26 +00:00
if ( $_SESSION [ 'modify' ] == 1 ) echo _ ( 'has been modified' );
else echo _ ( 'has been created' );
echo '</td></tr><tr><td>' ;
if ( $_SESSION [ 'modify' ] != 1 )
{ echo ' <input name="createagain" type="submit" value="' ; echo _ ( 'Create another group' ); echo '">' ; }
echo ' </ td >< td ></ td >< td >
2003-04-24 14:27:41 +00:00
< input name = " backmain " type = " submit " value = " '; echo _('Back to grouplist'); echo ' " >
</ td ></ tr > ' ;
break ;
case 'host' :
echo '<tr><td>' ;
echo _ ( 'Host ' );
echo $_SESSION [ 'account' ] -> general_username ;
2003-05-15 20:59:26 +00:00
if ( $_SESSION [ 'modify' ] == 1 ) echo _ ( 'has been modified' );
else echo _ ( 'has been created' );
echo '</td></tr><tr><td>' ;
if ( $_SESSION [ 'modify' ] != 1 )
{ echo '<input name="createagain" type="submit" value="' ; echo _ ( 'Create another host' ); echo '">' ; }
echo ' </ td >< td ></ td >< td >
2003-04-24 14:27:41 +00:00
< input name = " backmain " type = " submit " value = " '; echo _('Back to hostlist'); echo ' " >
</ td ></ tr > ' ;
break ;
}
break ;
case 'backmain' :
switch ( $_SESSION [ 'type2' ] ) {
case 'user' :
echo '<meta http-equiv="refresh" content="0; URL=lists/listusers.php">' ;
break ;
case 'group' :
echo '<meta http-equiv="refresh" content="0; URL=lists/listgroups.php">' ;
break ;
case 'host' :
echo '<meta http-equiv="refresh" content="0; URL=lists/listhosts.php">' ;
break ;
}
break ;
2003-04-29 18:03:42 +00:00
case 'load' :
switch ( $_SESSION [ 'type2' ] ) {
case 'user' :
2003-05-14 21:12:17 +00:00
$_SESSION [ 'account' ] = loadUserProfile ( $_POST [ 'f_general_selectprofile' ]);
if ( $_SESSION [ 'config' ] -> scriptServer ) getquotas ();
2003-05-01 17:02:57 +00:00
break ;
2003-04-29 18:03:42 +00:00
case 'host' :
2003-05-14 21:12:17 +00:00
$_SESSION [ 'account' ] = loadHostProfile ( $_POST [ 'f_general_selectprofile' ]);
break ;
case 'group' :
$_SESSION [ 'account' ] = loadGroupProfile ( $_POST [ 'f_general_selectprofile' ]);
if ( $_SESSION [ 'config' ] -> scriptServer ) getquotas ();
2003-05-01 17:02:57 +00:00
break ;
2003-04-29 18:03:42 +00:00
}
2003-05-14 21:12:17 +00:00
echo '<meta http-equiv="refresh" content="0; URL=account.php">' ;
2003-04-29 18:03:42 +00:00
break ;
case 'save' :
switch ( $_SESSION [ 'type2' ] ) {
case 'user' :
2003-05-01 17:02:57 +00:00
saveUserProfile ( $_SESSION [ 'account' ], $f_finish_safeProfile );
2003-04-29 18:03:42 +00:00
break ;
case 'host' :
2003-05-01 17:02:57 +00:00
saveHostProfile ( $_SESSION [ 'account' ], $f_finish_safeProfile );
2003-04-29 18:03:42 +00:00
break ;
}
2003-05-01 17:02:57 +00:00
echo '<meta http-equiv="refresh" content="0; URL=account.php?select=final">' ;
2003-04-29 18:03:42 +00:00
break ;
2003-04-21 14:03:30 +00:00
}
// Print end of HTML-Page
echo '</form></body></html>' ;
?>