diff --git a/lam/config/profiles/users/samba.pru b/lam/config/profiles/users/samba.pru index bf1c9659..2b07d625 100644 --- a/lam/config/profiles/users/samba.pru +++ b/lam/config/profiles/users/samba.pru @@ -8,4 +8,3 @@ unix_pwdmaxage: 180 smb_useunixpwd: 1 smb_pwdcanchange: 1 smb_homedrive: U: -smb_smbuserworkstations: * diff --git a/lam/lib/account.inc b/lam/lib/account.inc index c55bc7ad..8c657329 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -439,9 +439,11 @@ function getgid($groupname) { // Will return the the gid to an existing Groupnam // Check if group already exists $result = ldap_search($_SESSION['ldap']->server(), $_SESSION['config']->get_GroupSuffix(), 'cn=' . $groupname, array('gidNumber'), 0); $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); - $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); - if ($attr['gidNumber'][0]) return $attr['gidNumber'][0]; - else return -1; + if ($entry) { + $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); + if ($attr['gidNumber'][0]) return $attr['gidNumber'][0]; + } + else return -1; } @@ -527,6 +529,7 @@ function loaduser($dn) { // Will load all needed values from an existing account $return = new account(); $result = ldap_search($_SESSION['ldap']->server(), $dn, "objectclass=PosixAccount"); $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $return->general_dn = (ldap_get_dn($_SESSION['ldap']->server(), $entry)); $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); if ($attr['uid'][0]) { $return->general_username = $attr['uid'][0]; @@ -598,6 +601,7 @@ function loadhost($dn) { // Will load all needed values from an existing account $return = new account(); $result = ldap_search($_SESSION['ldap']->server(), $dn, "objectclass=PosixAccount"); $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $return->general_dn = (ldap_get_dn($_SESSION['ldap']->server(), $entry)); $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); if ($attr['uid'][0]) $return->general_username = $attr['uid'][0]; if ($attr['uidNumber'][0]) $return->general_uidNumber = $attr['uidNumber'][0]; @@ -649,6 +653,7 @@ function loadgroup($dn) { // Will load all needed values from an existing group $return = new account(); $result = ldap_search($_SESSION['ldap']->server(), $dn, "objectclass=PosixGroup"); $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); + $return->general_dn = (ldap_get_dn($_SESSION['ldap']->server(), $entry)); $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); if ($attr['gidNumber'][0]) { $return->general_uidNumber = $attr['gidNumber'][0]; @@ -938,7 +943,7 @@ function modifyuser($values,$values_old) { // Will modify the LDAP-Account } $entry = ldap_next_entry($_SESSION['ldap']->server(), $entry); } - if ($_SESSION['config']->scriptServer) setquotas($values->general_username); + if ($_SESSION['config']->scriptServer) setquotas($values->general_username,'user',$values_old->general_username); return 3; } @@ -1167,7 +1172,7 @@ function creategroup($values) { // Will create the LDAP-Group $attr['description'] = $values->general_gecos; if ($values->general_memeberUid) $attr['memberUid'] = $values->general_memberUid; $success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr); - if ($_SESSION['config']->scriptServer) setquotas($attr['uid'][0]); + if ($_SESSION['config']->scriptServer) setquotas($attr['uid'][0],'group'); if ($success) return 1; else return 4; } @@ -1201,7 +1206,7 @@ function modifygroup($values,$values_old) { // Will modify the LDAP-Group $entry = ldap_next_entry($_SESSION['ldap']->server(), $entry); } } - if ($_SESSION['config']->scriptServer) setquotas($attr['uid'][0]); + if ($_SESSION['config']->scriptServer) setquotas($attr['uid'][0],'group'); return 3; } diff --git a/lam/templates/account.php b/lam/templates/account.php index ed14c3ea..9052b597 100644 --- a/lam/templates/account.php +++ b/lam/templates/account.php @@ -272,7 +272,6 @@ if ($_POST['load']) $select_local='load'; if ($_POST['save']) $select_local='save'; - switch ($select_local) { case 'general': // General Account Settings diff --git a/lam/templates/masscreate.php b/lam/templates/masscreate.php index 17c59dfb..1ffca40d 100644 --- a/lam/templates/masscreate.php +++ b/lam/templates/masscreate.php @@ -33,7 +33,6 @@ include_once('../lib/pdf.inc'); // Return a pdf-file session_save_path('../sess'); @session_start(); -print_r($_FILES['userfile']); if ($_POST['tolist'] && ($_FILES['userfile']['size']>0)) $select = 'list'; if ($_POST['back']) $select = 'main'; if ($_POST['cancel']) $select = 'cancel'; @@ -56,7 +55,8 @@ echo ' switch ($select) { case 'main': - // if session was started previos, the existing session will be continued + if ( session_is_registered("accounts")) session_unregister("accounts"); + session_register("accounts"); $profilelist = getUserProfiles(); echo ''; echo '