From d26eacbeeadd1f9f553b5b57dd2f551997b83993 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Mon, 26 Jan 2004 03:22:15 +0000 Subject: [PATCH] move check for auth object --- phpgwapi/inc/class.accounts_sql.inc.php | 6 +----- phpgwapi/inc/class.common.inc.php | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/phpgwapi/inc/class.accounts_sql.inc.php b/phpgwapi/inc/class.accounts_sql.inc.php index 29bcc2a09a..0322dee5c1 100644 --- a/phpgwapi/inc/class.accounts_sql.inc.php +++ b/phpgwapi/inc/class.accounts_sql.inc.php @@ -344,15 +344,11 @@ function create($account_info,$default_prefs=True) { - if(!@is_object($GLOBALS['phpgw']->auth)) - { - $GLOBALS['phpgw']->auth = CreateObject('phpgwapi.auth'); - } $this->db->query('INSERT INTO phpgw_accounts (account_lid,account_type,account_pwd,' . 'account_firstname,account_lastname,account_status,account_expires,person_id,' . "account_primary_group) VALUES ('".$this->db->db_addslashes($account_info['account_lid']) . "','" . $this->db->db_addslashes($account_info['account_type']) - . "','" . $GLOBALS['phpgw']->auth->encrypt_password($account_info['account_passwd'], True) + . "','" . $GLOBALS['phpgw']->common->encrypt_password($account_info['account_passwd'], True) . "', '" . $this->db->db_addslashes($account_info['account_firstname']) . "','" . $this->db->db_addslashes($account_info['account_lastname']) . "','" . $this->db->db_addslashes($account_info['account_status']) diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index ce6edf0c76..6daf8758bb 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -1306,6 +1306,10 @@ */ function encrypt_password($password) { + if(!@is_object($GLOBALS['phpgw']->auth)) + { + $GLOBALS['phpgw']->auth = CreateObject('phpgwapi.auth'); + } return $GLOBALS['phpgw']->auth->encrypt_password($password); }