mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +01:00
GNU Patch #127 - create_defaults being called twice.
This commit is contained in:
parent
49764fd5b1
commit
27d6f340bf
@ -556,7 +556,7 @@
|
||||
return $in;
|
||||
}
|
||||
|
||||
function create($account_info)
|
||||
function create($account_info,$default_prefs=True)
|
||||
{
|
||||
/* echo '<br>in create for account_lid: "'.$account_lid.'"'; */
|
||||
if(empty($account_info['account_id']) || !$account_info['account_id'])
|
||||
@ -688,11 +688,11 @@
|
||||
}
|
||||
/* print ldap_error($this->ds); */
|
||||
|
||||
if($account_id && is_object($GLOBALS['phpgw']->preferences))
|
||||
if($account_id && is_object($GLOBALS['phpgw']->preferences) && $default_prefs)
|
||||
{
|
||||
$GLOBALS['phpgw']->preferences->create_defaults($account_id);
|
||||
return $account_id;
|
||||
}
|
||||
return $account_id;
|
||||
}
|
||||
|
||||
function auto_add($accountname, $passwd, $default_prefs = False, $default_acls = False, $expiredate = 0, $account_status = 'A')
|
||||
@ -734,15 +734,10 @@
|
||||
'account_status' => $account_status,
|
||||
'account_expires' => $expires
|
||||
);
|
||||
$this->create($acct_info);
|
||||
$this->create($acct_info,$default_prefs);
|
||||
$accountid = $this->name2id($accountname);
|
||||
|
||||
$this->db->transaction_begin();
|
||||
if($default_prefs)
|
||||
{
|
||||
$GLOBALS['phpgw']->preferences->create_defaults($accountid);
|
||||
}
|
||||
|
||||
if($default_acls == False)
|
||||
{
|
||||
$default_group_lid = $GLOBALS['phpgw_info']['server']['default_group_lid'];
|
||||
|
@ -282,7 +282,7 @@
|
||||
return $ret_val;
|
||||
}
|
||||
|
||||
function create($account_info)
|
||||
function create($account_info,$default_prefs=True)
|
||||
{
|
||||
$this->db->query("insert into phpgw_accounts (account_lid, account_type, account_pwd, "
|
||||
. "account_firstname, account_lastname, account_status, account_expires) values ('"
|
||||
@ -292,11 +292,11 @@
|
||||
. "'," . $account_info['account_expires'] . ")",__LINE__,__FILE__);
|
||||
|
||||
$accountid = $this->db->get_last_insert_id('phpgw_accounts','account_id');
|
||||
if($accountid && is_object($GLOBALS['phpgw']->preferences))
|
||||
if($accountid && is_object($GLOBALS['phpgw']->preferences) && $default_prefs)
|
||||
{
|
||||
$GLOBALS['phpgw']->preferences->create_defaults($accountid);
|
||||
return $accountid;
|
||||
}
|
||||
return $accountid;
|
||||
}
|
||||
|
||||
function auto_add($accountname, $passwd, $default_prefs = False, $default_acls = False, $expiredate = 0, $account_status = 'A')
|
||||
@ -338,14 +338,9 @@
|
||||
);
|
||||
|
||||
$this->db->transaction_begin();
|
||||
$this->create($acct_info);
|
||||
$this->create($acct_info,$default_prefs);
|
||||
$accountid = $this->name2id($accountname);
|
||||
|
||||
if($default_prefs)
|
||||
{
|
||||
$GLOBALS['phpgw']->preferences->create_defaults($accountid);
|
||||
}
|
||||
|
||||
if ($default_acls == False)
|
||||
{
|
||||
$default_group_lid = $GLOBALS['phpgw_info']['server']['default_group_lid'];
|
||||
|
Loading…
Reference in New Issue
Block a user