mirror of
https://github.com/e107inc/e107.git
synced 2025-04-20 20:51:53 +02:00
Issue #4356 Admin login issue.
This commit is contained in:
parent
4098a03698
commit
94f3162d94
@ -137,17 +137,20 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
if(!$result = e107::getUser()->login($_POST['authname'], $_POST['authpass'], false, varset($_POST['hashchallenge']), true))
|
||||
if(e107::getUser()->login($_POST['authname'], $_POST['authpass'], false, varset($_POST['hashchallenge']), true)!==false)
|
||||
{
|
||||
e107::coreLan('log_messages', true);
|
||||
e107::getLog()->addEvent(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", LAN_ROLL_LOG_11, "U: ".$tp->toDB($_POST['authname']), FALSE, LOG_TO_ROLLING);
|
||||
echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
|
||||
e107::getRedirect()->go('admin');
|
||||
// var_dump($_COOKIE);
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::coreLan('log_messages', true);
|
||||
e107::getLog()->addEvent(4, __FILE__."|".__FUNCTION__."@".__LINE__, "LOGIN", LAN_ROLL_LOG_11, "U: ".$tp->toDB($_POST['authname']), FALSE, LOG_TO_ROLLING);
|
||||
echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
|
||||
e107::getRedirect()->redirect('admin.php?failed');
|
||||
|
||||
e107::getRedirect()->redirect('admin.php?failed');
|
||||
exit;
|
||||
}
|
||||
|
||||
e107::getRedirect()->go('admin');
|
||||
exit;
|
||||
|
||||
}
|
||||
|
@ -712,7 +712,7 @@ class UserHandler
|
||||
}
|
||||
|
||||
$cookieval = $lode['user_id'].'.'.md5($lode['user_password']); // (Use extra md5 on cookie value to obscure hashed value for password)
|
||||
if (e107::getPref('user_tracking') == 'session'|| e_ADMIN_AREA)
|
||||
if (e107::getPref('user_tracking','session') == 'session')
|
||||
{
|
||||
$_SESSION[e107::getPref('cookie_name')] = $cookieval;
|
||||
}
|
||||
|
@ -1779,14 +1779,21 @@ class e_user extends e_user_model
|
||||
*/
|
||||
final public function login($uname, $upass_plain, $uauto = false, $uchallange = false, $noredirect = true)
|
||||
{
|
||||
if($this->isUser()) return false;
|
||||
if($this->isUser())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$userlogin = new userlogin();
|
||||
$loginSuccess = $userlogin->login($uname, $upass_plain, $uauto, $uchallange, $noredirect);
|
||||
|
||||
$userdata = $userlogin->getUserData();
|
||||
$this->setSessionData(true)->setData($userdata);
|
||||
if ($loginSuccess === false) return false;
|
||||
|
||||
if ($loginSuccess === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
e107::getEvent()->trigger('user_login', $userdata);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user