fixed wrong sid if gid has changed

This commit is contained in:
katagia 2003-09-16 16:37:51 +00:00
parent e207d03bd0
commit 29f1acf96f
1 changed files with 10 additions and 0 deletions

View File

@ -94,6 +94,16 @@ switch ($_POST['select']) { // Select which part of page should be loaded and ch
case 'general': case 'general':
// Write all general values into $_SESSION['account'] if no profile should be loaded // Write all general values into $_SESSION['account'] if no profile should be loaded
if (!$_POST['load']) { if (!$_POST['load']) {
// Set correct SID if GIS has changed
if (isset($_SESSION['account_old']->general_uidNumber) && ($_SESSION['account']->general_uidNumber != $_POST['f_general_uidNumber'])
&& ($_SESSION['config']->samba3 == 'yes')) {
$temp = explode('-', $_SESSION['account']->smb_mapgroup);
$SID = $temp[0].'-'.$temp[1].'-'.$temp[2].'-'.$temp[3].'-'.$temp[4].'-'.$temp[5].'-'.$temp[6];
if ( $temp[7]!='512' && $temp[7]!='513' && $temp[7]!='514' )
$_SESSION['account']->smb_mapgroup = $_SESSION['account']->smb_domain->SID . "-".
(2 * $_POST['f_general_uidNumber'] + $_SESSION['account']->smb_domain->RIDbase +1);
}
$_SESSION['account']->general_dn = $_POST['f_general_suffix']; $_SESSION['account']->general_dn = $_POST['f_general_suffix'];
$_SESSION['account']->general_username = $_POST['f_general_username']; $_SESSION['account']->general_username = $_POST['f_general_username'];
$_SESSION['account']->general_uidNumber = $_POST['f_general_uidNumber']; $_SESSION['account']->general_uidNumber = $_POST['f_general_uidNumber'];