X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fcurrent_user.inc;h=7c99f233a3fbb9a1e464955ba9ae6af2ec0b77cf;hb=aeef2bf17512535dcdc1b37dc41bee9d7e517da5;hp=27d69e3dd1fe5e32b45ff3b02205bc0df8731111;hpb=e7e5de3900498c8447d730d9087986e707350107;p=fa-stable.git diff --git a/includes/current_user.inc b/includes/current_user.inc index 27d69e3d..7c99f233 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -63,11 +63,19 @@ class current_user $this->set_company($company); $this->logged = false; - $Auth_Result = get_user_for_login($loginname, $password); + set_global_connection(); - if (db_num_rows($Auth_Result) > 0) + // Use external authentication source if any. + // Keep in mind you need to have user data set for $loginname + // in FA users table anyway to successfully log in. + $Auth_Result = hook_authenticate($loginname, $password); + + if (!isset($Auth_Result)) // if not used: standard method + $Auth_Result = get_user_auth($loginname, md5($password)); + + if ($Auth_Result) { - $myrow = db_fetch($Auth_Result); + $myrow = get_user_by_login($loginname); $this->old_db = isset($myrow["full_access"]); if (! @$myrow["inactive"]) { if ($this->old_db) {