diff --git a/admin/inc/class.soaccounts.inc.php b/admin/inc/class.soaccounts.inc.php index 61a9bc658e..e0de32bc68 100755 --- a/admin/inc/class.soaccounts.inc.php +++ b/admin/inc/class.soaccounts.inc.php @@ -27,10 +27,10 @@ $userData['account_email'] = $userData['email']; } - $GLOBALS['egw']->accounts->create($userData); - - $userData['account_id'] = $GLOBALS['egw']->accounts->name2id($userData['account_lid']); - + if (!($userData['account_id'] = $GLOBALS['egw']->accounts->create($userData))) + { + return false; + } $apps =& CreateObject('phpgwapi.applications',$userData['account_id']); $apps->read_installed_apps(); // Read Group Apps diff --git a/admin/inc/class.uiaccounts.inc.php b/admin/inc/class.uiaccounts.inc.php index eb24fde717..418a1b99e7 100755 --- a/admin/inc/class.uiaccounts.inc.php +++ b/admin/inc/class.uiaccounts.inc.php @@ -1063,7 +1063,7 @@ $theme = $GLOBALS['egw_info']['user']['preferences']['common']['theme']; $t->set_var('icon_create_edit', ''); - print_debug('Type : '.gettype($_userData).'
_userData(size) = "'.$_userData.'"('.strlen($_userData).')'); + //print_debug('Type : '.gettype($_userData).'
_userData(size) = "'.$_userData.'"('.strlen($_userData).')'); if (is_array($_userData)) { $userData = Array(); @@ -1190,7 +1190,7 @@ $var = Array( 'input_expires' => $jscal->input('expires',$userData['expires']<0?'':($userData['expires']?$userData['expires']:time()+(60*60*24*7))), 'lang_never' => lang('Never'), - 'account_lid' => $accountPrefix.'', + 'account_lid' => $accountPrefix.'', 'lang_homedir' => $lang_homedir, 'lang_shell' => $lang_shell, 'homedirectory' => $homedirectory, @@ -1198,9 +1198,9 @@ 'anonymous' => '', 'changepassword' => '', 'account_status' => '', - 'account_firstname' => '', - 'account_lastname' => '', - 'account_email' => '', + 'account_firstname' => '', + 'account_lastname' => '', + 'account_email' => '', 'account_passwd' => $userData['account_passwd'], 'account_passwd_2' => $userData['account_passwd_2'], 'account_file_space' => $account_file_space, diff --git a/phpgwapi/inc/class.accounts_sql.inc.php b/phpgwapi/inc/class.accounts_sql.inc.php index 0718c9ec0b..1ec98805ae 100644 --- a/phpgwapi/inc/class.accounts_sql.inc.php +++ b/phpgwapi/inc/class.accounts_sql.inc.php @@ -313,8 +313,10 @@ // only use account_id, if it's not already used $account_data['account_id'] = abs($account_info['account_id']); } - $this->db->insert($this->table,$account_data,False,__LINE__,__FILE__); - + if (!$this->db->insert($this->table,$account_data,False,__LINE__,__FILE__)) + { + return false; + } $id = $account_data['account_id'] ? $account_data['account_id'] : $this->db->get_last_insert_id($this->table,'account_id'); if ($account_info['account_type'] == 'g' && $id > 0) // create negative id for groups