mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Updated failed-login message to include variable.
This commit is contained in:
@@ -2714,16 +2714,20 @@ class e_parser
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic variable translator for LAN definitions.
|
* Generic variable translator for LAN definitions.
|
||||||
* @param $lan - string LAN
|
* @param $lan - string LAN
|
||||||
* @param $vals - either a single value, which will replace '[x]' or an array with key=>value pairs.
|
* @param string | array $vals - either a single value, which will replace '[x]' or an array with key=>value pairs.
|
||||||
* @example $tp->lanVars("My name is [x] and I own a [y]", array('x'=>"John", 'y'=>"Cat"));
|
* @example $tp->lanVars("My name is [x] and I own a [y]", array('x'=>"John", 'y'=>"Cat"));
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
function lanVars($lan, $vals, $bold=false)
|
function lanVars($lan, $vals, $bold=false)
|
||||||
{
|
{
|
||||||
|
|
||||||
$array = (!is_array($vals)) ? array('x'=>$vals) : $vals;
|
$array = (!is_array($vals)) ? array('x'=>$vals) : $vals;
|
||||||
|
|
||||||
|
$search = array();
|
||||||
|
$replace = array();
|
||||||
|
|
||||||
foreach($array as $k=>$v)
|
foreach($array as $k=>$v)
|
||||||
{
|
{
|
||||||
$search[] = "[".$k."]";
|
$search[] = "[".$k."]";
|
||||||
|
@@ -545,7 +545,8 @@ class userlogin
|
|||||||
if($fails >= $failLimit)
|
if($fails >= $failLimit)
|
||||||
{
|
{
|
||||||
$time = time();
|
$time = time();
|
||||||
e107::getIPHandler()->add_ban(4,LAN_LOGIN_18,$this->userIP,1);
|
$description = e107::getParser()->lanVars(LAN_LOGIN_18,$failLimit);
|
||||||
|
e107::getIPHandler()->add_ban(4, $description, $this->userIP, 1);
|
||||||
e107::getDb()->insert("generic", "0, 'auto_banned', '".$time."', 0, '{$this->userIP}', '{$extra_text}', '".LAN_LOGIN_20.": ".e107::getParser()->toDB($username).", ".LAN_LOGIN_17.": ".md5($ouserpass)."' ");
|
e107::getDb()->insert("generic", "0, 'auto_banned', '".$time."', 0, '{$this->userIP}', '{$extra_text}', '".LAN_LOGIN_20.": ".e107::getParser()->toDB($username).", ".LAN_LOGIN_17.": ".md5($ouserpass)."' ");
|
||||||
e107::getEvent()->trigger('user_ban_failed_login', array('time'=>$time, 'ip'=>$this->userIP, 'other'=>$extra_text));
|
e107::getEvent()->trigger('user_ban_failed_login', array('time'=>$time, 'ip'=>$this->userIP, 'other'=>$extra_text));
|
||||||
}
|
}
|
||||||
|
@@ -26,7 +26,7 @@ define('LAN_LOGIN_14', 'User attempted to login with unrecognised user name');
|
|||||||
define('LAN_LOGIN_15', 'User attempted to login with incorrect password');
|
define('LAN_LOGIN_15', 'User attempted to login with incorrect password');
|
||||||
define('LAN_LOGIN_16', 'User attempted to login with username/password combination that was already in use');
|
define('LAN_LOGIN_16', 'User attempted to login with username/password combination that was already in use');
|
||||||
define('LAN_LOGIN_17', 'User password (hashed)');
|
define('LAN_LOGIN_17', 'User password (hashed)');
|
||||||
define('LAN_LOGIN_18', 'Auto-ban: More than 10 failed login attempts');
|
define('LAN_LOGIN_18', 'Auto-ban: More than [x] failed login attempts');
|
||||||
define('LAN_LOGIN_19', '> 10 failed login attempts');
|
define('LAN_LOGIN_19', '> 10 failed login attempts');
|
||||||
define('LAN_LOGIN_20', 'You left required field(s) blank');
|
define('LAN_LOGIN_20', 'You left required field(s) blank');
|
||||||
define('LAN_LOGIN_21', "Incorrect login. The entered data doesn't match to a registered user. Check if you have the CAPS-LOCK key activated as logins on this site are case sensitive");
|
define('LAN_LOGIN_21', "Incorrect login. The entered data doesn't match to a registered user. Check if you have the CAPS-LOCK key activated as logins on this site are case sensitive");
|
||||||
|
Reference in New Issue
Block a user