mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
emiting a notice from include/auth does not work. emit it from mod login if the login failed.
This commit is contained in:
@@ -5,10 +5,17 @@ namespace Zotlabs\Module;
|
|||||||
class Login extends \Zotlabs\Web\Controller {
|
class Login extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
function get() {
|
function get() {
|
||||||
if(local_channel())
|
if (local_channel()) {
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
if(remote_channel() && $_SESSION['atoken'])
|
}
|
||||||
|
|
||||||
|
if (remote_channel() && $_SESSION['atoken']) {
|
||||||
goaway(z_root());
|
goaway(z_root());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($_GET['retry'])) {
|
||||||
|
notice( t('Login failed.') . EOL );
|
||||||
|
}
|
||||||
|
|
||||||
$o = '<div class="generic-content-wrapper">';
|
$o = '<div class="generic-content-wrapper">';
|
||||||
$o .= '<div class="section-title-wrapper">';
|
$o .= '<div class="section-title-wrapper">';
|
||||||
|
|||||||
@@ -353,9 +353,6 @@ else {
|
|||||||
elseif($atoken) {
|
elseif($atoken) {
|
||||||
atoken_login($atoken);
|
atoken_login($atoken);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
notice( t('Failed authentication') . EOL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(! ($account || $atoken)) {
|
if(! ($account || $atoken)) {
|
||||||
$error = 'authenticate: failed login attempt: ' . notags(trim($username)) . ' from IP ' . $_SERVER['REMOTE_ADDR'];
|
$error = 'authenticate: failed login attempt: ' . notags(trim($username)) . ' from IP ' . $_SERVER['REMOTE_ADDR'];
|
||||||
@@ -364,8 +361,8 @@ else {
|
|||||||
$authlog = Config::Get('system', 'authlog');
|
$authlog = Config::Get('system', 'authlog');
|
||||||
if ($authlog)
|
if ($authlog)
|
||||||
@file_put_contents($authlog, datetime_convert() . ':' . session_id() . ' ' . $error . "\n", FILE_APPEND);
|
@file_put_contents($authlog, datetime_convert() . ':' . session_id() . ' ' . $error . "\n", FILE_APPEND);
|
||||||
notice( t('Login failed.') . EOL );
|
|
||||||
goaway(z_root() . '/login');
|
goaway(z_root() . '/login?retry=1');
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the user specified to remember the authentication, then change the cookie
|
// If the user specified to remember the authentication, then change the cookie
|
||||||
|
|||||||
@@ -88,6 +88,7 @@
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!document.hidden) {
|
if (!document.hidden) {
|
||||||
|
sse_fallback();
|
||||||
sse_fallback_interval = setInterval(sse_fallback, updateInterval);
|
sse_fallback_interval = setInterval(sse_fallback, updateInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user