From d61dadfa7215cd04f152f4a61d2765cb4df809d6 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Thu, 3 Jan 2002 18:02:10 +0000 Subject: [PATCH] Add default prefs creation for a new user in create() - will need to do this either here or in admin. --- phpgwapi/inc/class.accounts_ldap.inc.php | 6 ++++++ phpgwapi/inc/class.accounts_sql.inc.php | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/phpgwapi/inc/class.accounts_ldap.inc.php b/phpgwapi/inc/class.accounts_ldap.inc.php index c99529c7f5..8351ce06fe 100644 --- a/phpgwapi/inc/class.accounts_ldap.inc.php +++ b/phpgwapi/inc/class.accounts_ldap.inc.php @@ -688,6 +688,12 @@ ldap_add($this->ds, $dn, $entry); } /* print ldap_error($this->ds); */ + + if($account_id) + { + $GLOBALS['phpgw']->preferences->create_defaults($account_id); + return $account_id; + } } function auto_add($accountname, $passwd, $default_prefs = False, $default_acls = False, $expiredate = 0, $account_status = 'A') diff --git a/phpgwapi/inc/class.accounts_sql.inc.php b/phpgwapi/inc/class.accounts_sql.inc.php index 68634c61f6..1c8c87425f 100644 --- a/phpgwapi/inc/class.accounts_sql.inc.php +++ b/phpgwapi/inc/class.accounts_sql.inc.php @@ -288,6 +288,13 @@ . md5($account_info['account_passwd']) . "', '" . $account_info['account_firstname'] . "','" . $account_info['account_lastname'] . "','" . $account_info['account_status'] . "','" . $account_info['account_expires'] . "')",__LINE__,__FILE__); + + $accountid = $this->db->get_last_insert_id('phpgw_accounts','account_id'); + if($account_id) + { + $GLOBALS['phpgw']->preferences->create_defaults($accountid); + return $accountid; + } } function auto_add($accountname, $passwd, $default_prefs = False, $default_acls = False, $expiredate = 0, $account_status = 'A')