diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 682af27ed..d847e5f33 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -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."]"; diff --git a/e107_handlers/login.php b/e107_handlers/login.php index ccdb00b61..c9946db6b 100644 --- a/e107_handlers/login.php +++ b/e107_handlers/login.php @@ -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)); } diff --git a/e107_languages/English/lan_login.php b/e107_languages/English/lan_login.php index 9152490ff..d4cf10973 100644 --- a/e107_languages/English/lan_login.php +++ b/e107_languages/English/lan_login.php @@ -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");