1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Updated failed-login message to include variable.

This commit is contained in:
Cameron 2015-04-12 22:45:13 -07:00
parent bcfe20dd2b
commit 0d86f9a42f
3 changed files with 11 additions and 6 deletions

View File

@ -2714,16 +2714,20 @@ class e_parser
}
/**
* Generic variable translator for LAN definitions.
* Generic variable translator for LAN definitions.
* @param $lan - string LAN
* @param $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"));
* @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"));
* @return string
*/
function lanVars($lan, $vals, $bold=false)
{
$array = (!is_array($vals)) ? array('x'=>$vals) : $vals;
$search = array();
$replace = array();
foreach($array as $k=>$v)
{
$search[] = "[".$k."]";

View File

@ -545,7 +545,8 @@ class userlogin
if($fails >= $failLimit)
{
$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::getEvent()->trigger('user_ban_failed_login', array('time'=>$time, 'ip'=>$this->userIP, 'other'=>$extra_text));
}

View File

@ -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_16', 'User attempted to login with username/password combination that was already in use');
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_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");