fixed a new problem; could not create any user

When creating new group all settings 4 memberUid were ignored. Fixed
This commit is contained in:
katagia 2003-10-07 17:52:51 +00:00
parent 01893985c3
commit af872d4fea
4 changed files with 46 additions and 53 deletions

View File

@ -1604,6 +1604,8 @@ function creategroup($values) { // Will create the LDAP-Group
$attr['sambaGroupType'] = '2';
if ($values->smb_displayName) $attr['displayName'] = utf8_encode($values->smb_displayName);
}
foreach ($values->unix_memberUid as $user)
$attr['memberUid'][] = $user;
$success = ldap_add($_SESSION['ldap']->server(),$values->general_dn, $attr);
if ($_SESSION['config']->scriptServer) setquotas($values,'group');
if ($success) {

View File

@ -38,13 +38,12 @@ if (!isset($_POST['varkey'])) $varkey = session_id().time();
else $varkey = $_POST['varkey'];
if (!isset($_SESSION['account_'.$varkey.'_account_new'])) $_SESSION['account_'.$varkey.'_account_new'] = new account();
if (!isset($_SESSION['account_'.$varkey.'_account_old'])) $_SESSION['account_'.$varkey.'_account_old'] = new account();
if (!isset($_SESSION['account_'.$varkey.'_final_changegids'])) $_SESSION['account_'.$varkey.'_final_changegids'] = '';
// Register Session-Variables with references so we don't net to change to complete code if names changes
$account_new =& $_SESSION['account_'.$varkey.'_account_new'];
$final_changegids =& $_SESSION['account_'.$varkey.'_final_changegids'];
if (isset($_SESSION['account_'.$varkey.'_account_old'])) $account_old =& $_SESSION['account_'.$varkey.'_account_old'];
if (is_object($_SESSION['account_'.$varkey.'_account_old'])) $account_old =& $_SESSION['account_'.$varkey.'_account_old'];
$ldap_intern =& $_SESSION['ldap'];
$config_intern =& $_SESSION['config'];
@ -55,21 +54,20 @@ $userDN_intern =& $_SESSION['userDN'];
if (isset($_POST['select'])) $select =& $_POST['select'];
if (isset($_POST['load'])) $load =& $_POST['load'];
if (isset($_GET['DN'])) {
if (isset($_GET['DN']) && $_GET['DN']!='') {
if (isset($_SESSION['account_'.$varkey.'_account_old'])) {
unset($account_old);
unset($_SESSION['account_'.$varkey.'_account_old']);
$_SESSION['account_'.$varkey.'_account_old'] = new account();
$account_old =& $_SESSION['account_'.$varkey.'_account_old'];
}
$DN = str_replace("\'", '',$_GET['DN']);
$account_new = loadgroup($DN);
$account_old = $account_new;
$account_new->general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1);
$final_changegids = '';
if (isset($_GET['DN']) && $_GET['DN']!='') {
if (isset($_SESSION['account_'.$varkey.'_account_old'])) {
unset($account_old);
unset($_SESSION['account_'.$varkey.'_account_old']);
}
$_SESSION['account_'.$varkey.'_account_old'] = new account();
$account_old =& $_SESSION['account_'.$varkey.'_account_old'];
$DN = str_replace("\'", '',$_GET['DN']);
$account_new = loadgroup($DN);
$account_old = $account_new;
$account_new->general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1);
$final_changegids = '';
}
else if (count($_POST)==0) { // Startcondition. groupedit.php was called from outside
$account_new = loadGroupProfile('default');
$account_new ->type = 'group';

View File

@ -36,13 +36,11 @@ setlanguage();
if (!isset($_POST['varkey'])) $varkey = session_id().time();
else $varkey = $_POST['varkey'];
if (!isset($_SESSION['account_'.$varkey.'_account_new'])) $_SESSION['account_'.$varkey.'_account_new'] = new account();
if (!isset($_SESSION['account_'.$varkey.'_account_old'])) $_SESSION['account_'.$varkey.'_account_old'] = new account();
// Register Session-Variables with references so we don't net to change to complete code if names changes
$account_new =& $_SESSION['account_'.$varkey.'_account_new'];
if (isset($_SESSION['account_'.$varkey.'_account_old'])) $account_old =& $_SESSION['account_'.$varkey.'_account_old'];
if (is_object($_SESSION['account_'.$varkey.'_account_old'])) $account_old =& $_SESSION['account_'.$varkey.'_account_old'];
$ldap_intern =& $_SESSION['ldap'];
$config_intern =& $_SESSION['config'];
@ -51,23 +49,21 @@ $header_intern =& $_SESSION['header'];
if (isset($_GET['DN'])) {
if (isset($_GET['DN']) && $_GET['DN']!='') {
if (isset($_SESSION['account_'.$varkey.'_account_old'])) {
unset($account_old);
unset($_SESSION['account_'.$varkey.'_account_old']);
$_SESSION['account_'.$varkey.'_account_old'] = new account();
$account_old =& $_SESSION['account_'.$varkey.'_account_old'];
}
$DN = str_replace("\'", '',$_GET['DN']);
$account_new = loadhost($DN);
$account_new->smb_flagsW = 1;
$account_new->smb_flagsX = 1;
$account_old = $account_new;
// Store only DN without uid=$name
$account_new->general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1);
$_SESSION['final_changegids'] = '';
if (isset($_GET['DN']) && $_GET['DN']!='') {
if (isset($_SESSION['account_'.$varkey.'_account_old'])) {
unset($account_old);
unset($_SESSION['account_'.$varkey.'_account_old']);
}
$_SESSION['account_'.$varkey.'_account_old'] = new account();
$account_old =& $_SESSION['account_'.$varkey.'_account_old'];
$DN = str_replace("\'", '',$_GET['DN']);
$account_new = loadhost($DN);
$account_new->smb_flagsW = 1;
$account_new->smb_flagsX = 1;
$account_old = $account_new;
// Store only DN without uid=$name
$account_new->general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1);
$_SESSION['final_changegids'] = '';
}
else if (count($_POST)==0) { // Startcondition. hostedit.php was called from outside
$account_new = loadHostProfile('default');

View File

@ -38,7 +38,6 @@ if (!isset($_POST['varkey'])) $varkey = session_id().time();
else $varkey = $_POST['varkey'];
if (!isset($_SESSION['account_'.$varkey.'_account_new'])) $_SESSION['account_'.$varkey.'_account_new'] = new account();
if (!isset($_SESSION['account_'.$varkey.'_account_old'])) $_SESSION['account_'.$varkey.'_account_old'] = new account();
if (!isset($_SESSION['account_'.$varkey.'_final_changegids'])) $_SESSION['account_'.$varkey.'_final_changegids'] = '';
if (!isset($_SESSION['account_'.$varkey.'_shelllist'])) $_SESSION['account_'.$varkey.'_shelllist'] = getshells();
@ -46,7 +45,7 @@ if (!isset($_SESSION['account_'.$varkey.'_shelllist'])) $_SESSION['account_'.$va
$account_new =& $_SESSION['account_'.$varkey.'_account_new'];
$shelllist =& $_SESSION['account_'.$varkey.'_shelllist'];
$final_changegids =& $_SESSION['account_'.$varkey.'_final_changegids'];
if (isset($_SESSION['account_'.$varkey.'_account_old'])) $account_old =& $_SESSION['account_'.$varkey.'_account_old'];
if (is_object($_SESSION['account_'.$varkey.'_account_old'])) $account_old =& $_SESSION['account_'.$varkey.'_account_old'];
$ldap_intern =& $_SESSION['ldap'];
$config_intern =& $_SESSION['config'];
@ -56,24 +55,22 @@ $hostDN_intern =& $_SESSION['hostDN'];
if (isset($_GET['DN'])) {
if (isset($_GET['DN']) && $_GET['DN']!='') {
if (isset($_SESSION['account_'.$varkey.'_account_old'])) {
unset($account_old);
unset($_SESSION['account_'.$varkey.'_account_old']);
$_SESSION['account_'.$varkey.'_account_old'] = new account();
$account_old =& $_SESSION['account_'.$varkey.'_account_old'];
}
$DN = str_replace("\'", '',$_GET['DN']);
$account_new = loaduser($DN);
$account_new ->type = 'user';
$account_old = $account_new;
$account_new->unix_password='';
$account_new->smb_password='';
$account_new->smb_flagsW = 0;
$account_new->general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1);
$final_changegids = '';
if (isset($_GET['DN']) && $_GET['DN']!='') {
if (isset($_SESSION['account_'.$varkey.'_account_old'])) {
unset($account_old);
unset($_SESSION['account_'.$varkey.'_account_old']);
}
$_SESSION['account_'.$varkey.'_account_old'] = new account();
$account_old =& $_SESSION['account_'.$varkey.'_account_old'];
$DN = str_replace("\'", '',$_GET['DN']);
$account_new = loaduser($DN);
$account_new ->type = 'user';
$account_old = $account_new;
$account_new->unix_password='';
$account_new->smb_password='';
$account_new->smb_flagsW = 0;
$account_new->general_dn = substr($account_new->general_dn, strpos($account_new->general_dn, ',')+1);
$final_changegids = '';
}
else if (count($_POST)==0) { // Startcondition. useredit.php was called from outside