Version 0.9.5 beta - added the user_id to the session, also renamed the session_id in order to make sense
This commit is contained in:
@@ -52,14 +52,19 @@ class Auth extends Controller implements IAuth
|
|||||||
|
|
||||||
if(!array_key_exists('auth', $_SESSION))
|
if(!array_key_exists('auth', $_SESSION))
|
||||||
{
|
{
|
||||||
$user_password = Pdo::query("SELECT user_account_active, DES_DECRYPT(user_pass, '".Config::getInstance()->getConfig()[IView::NIBIRU_SECURITY]["password_hash"]."') AS pass FROM user WHERE user_login = '".$login."';");
|
$user_password = Pdo::query("SELECT user_account_active, DES_DECRYPT(user_pass, '".Config::getInstance()->getConfig()[IView::NIBIRU_SECURITY]["password_hash"]."') AS pass, user_id FROM user WHERE user_login = '".$login."';");
|
||||||
if( $user_password["pass"] == $password && $user_password['user_account_active'] )
|
if( $user_password["pass"] == $password && $user_password['user_account_active'] == 1 )
|
||||||
{
|
{
|
||||||
$session_id = session_id();
|
$session_id = session_id();
|
||||||
$_SESSION['auth']['id'] = $session_id;
|
$_SESSION = [
|
||||||
$_SESSION['auth']['login'] = $login;
|
'auth' => [
|
||||||
return true;
|
'session_id' => $session_id,
|
||||||
}
|
'user_id' => $user_password['user_id'],
|
||||||
|
'login' => $login
|
||||||
|
]
|
||||||
|
];
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user