mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-13 08:50:45 +01:00
using GLOBALS
This commit is contained in:
parent
9b6465af7a
commit
cb560611b1
@ -30,8 +30,7 @@
|
|||||||
|
|
||||||
function authenticate($username, $passwd)
|
function authenticate($username, $passwd)
|
||||||
{
|
{
|
||||||
global $phpgw_info, $phpgw;
|
$db = $GLOBALS['phpgw']->db;
|
||||||
$db = $phpgw->db;
|
|
||||||
|
|
||||||
$db->query("SELECT * FROM phpgw_accounts WHERE account_lid = '$username' AND "
|
$db->query("SELECT * FROM phpgw_accounts WHERE account_lid = '$username' AND "
|
||||||
. "account_pwd='" . md5($passwd) . "' AND account_status ='A'",__LINE__,__FILE__);
|
. "account_pwd='" . md5($passwd) . "' AND account_status ='A'",__LINE__,__FILE__);
|
||||||
@ -50,28 +49,24 @@
|
|||||||
|
|
||||||
function change_password($old_passwd, $new_passwd, $account_id = '')
|
function change_password($old_passwd, $new_passwd, $account_id = '')
|
||||||
{
|
{
|
||||||
global $phpgw_info, $phpgw;
|
|
||||||
|
|
||||||
if (! $account_id)
|
if (! $account_id)
|
||||||
{
|
{
|
||||||
$account_id = $phpgw_info['user']['account_id'];
|
$account_id = $GLOBALS['phpgw_info']['user']['account_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$encrypted_passwd = md5($new_passwd);
|
$encrypted_passwd = md5($new_passwd);
|
||||||
|
|
||||||
$phpgw->db->query("update phpgw_accounts set account_pwd='" . md5($new_passwd) . "',"
|
$GLOBALS['phpgw']->db->query("update phpgw_accounts set account_pwd='" . md5($new_passwd) . "',"
|
||||||
. "account_lastpwd_change='" . time() . "' where account_id='" . $account_id . "'",__LINE__,__FILE__);
|
. "account_lastpwd_change='" . time() . "' where account_id='" . $account_id . "'",__LINE__,__FILE__);
|
||||||
|
|
||||||
$phpgw->session->appsession('password','phpgwapi',$new_passwd);
|
$GLOBALS['phpgw']->session->appsession('password','phpgwapi',$new_passwd);
|
||||||
|
|
||||||
return $encrypted_passwd;
|
return $encrypted_passwd;
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_lastlogin($account_id, $ip)
|
function update_lastlogin($account_id, $ip)
|
||||||
{
|
{
|
||||||
global $phpgw;
|
$GLOBALS['phpgw']->db->query("update phpgw_accounts set account_lastloginfrom='"
|
||||||
|
|
||||||
$phpgw->db->query("update phpgw_accounts set account_lastloginfrom='"
|
|
||||||
. "$ip', account_lastlogin='" . time()
|
. "$ip', account_lastlogin='" . time()
|
||||||
. "' where account_id='$account_id'",__LINE__,__FILE__);
|
. "' where account_id='$account_id'",__LINE__,__FILE__);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user