";
- if(e_QUERY === 'failed')
- {
- e107::lan('core', 'login');
- $text .= e107::getMessage()->render(); // see e107_handlers/login.php L622
- $text .= "";
-
- }
-
-
+ e107::lan('core', 'login');
+ $text .= e107::getMessage()->render(); // see e107_handlers/login.php L622
+ $text .= "";
$text .= "
diff --git a/e107_handlers/login.php b/e107_handlers/login.php
index 6ca0365f1..adb34e97f 100644
--- a/e107_handlers/login.php
+++ b/e107_handlers/login.php
@@ -649,7 +649,7 @@ class userlogin
$this->logNote('LAN_ROLL_LOG_10', $username);
}
- e107::getMessage()->reset()->addError($message, 'default', true); // prevent duplicates, session=true needed for admin-area login.
+ e107::getMessage()->reset()->addError($message); // prevent duplicates
if($this->testMode === true)
{
diff --git a/e107_tests/tests/acceptance/0001_AdminLoginCest.php b/e107_tests/tests/acceptance/0001_AdminLoginCest.php
index 8575c3e25..991e68ac9 100644
--- a/e107_tests/tests/acceptance/0001_AdminLoginCest.php
+++ b/e107_tests/tests/acceptance/0001_AdminLoginCest.php
@@ -11,7 +11,19 @@ class AdminLoginCest
{
}
- // tests
+ /**
+ * @see https://github.com/e107inc/e107/issues/4779
+ */
+ public function testAdminFailedLogin(AcceptanceTester $I)
+ {
+ $I->wantTo("See a login failure message in the admin area if I put in the wrong credentials");
+ $I->amOnPage("/e107_admin/admin.php");
+ $I->fillField('authname', 'e107');
+ $I->fillField('authpass', 'wrong password');
+ $I->click('authsubmit');
+ $I->see("Your login details don't match any registered user");
+ }
+
public function testAdminLogin(AcceptanceTester $I)
{
@@ -27,7 +39,6 @@ class AdminLoginCest
}
-
private function e107Login(AcceptanceTester $I)
{
$I->amOnPage('/e107_admin/admin.php');