mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-06 00:46:54 +02:00
Use scope also in admin registration / login form
BC issue: if using Admin `develop/ 1.1` with Form != latest develop, the Admin-side registration form (the one that pops up when Admin is installed but no accounts are found) will not work. Not something users would stumble upon: only appears when Admin 1.1 it'll be possible to use config-title@: theme.antimatter.some_config to set the title dynamically based on a theme config option is installed but it's not yet configured, and Form is not up to date. When 1.1 will be released, also the Form plugin will have a newer update that will be installed automatically.
This commit is contained in:
@@ -87,6 +87,9 @@ class AdminController
|
||||
if (isset($post['data'])) {
|
||||
$this->data = $this->getPost($post['data']);
|
||||
unset($post['data']);
|
||||
} else {
|
||||
// Backwards compatibility for Form plugin <= 1.2
|
||||
$this->data = $this->getPost($post);
|
||||
}
|
||||
$this->post = $this->getPost($post);
|
||||
$this->route = $route;
|
||||
@@ -248,8 +251,8 @@ class AdminController
|
||||
*/
|
||||
protected function taskLogin()
|
||||
{
|
||||
$this->post['username'] = strtolower($this->post['username']);
|
||||
if ($this->admin->authenticate($this->post)) {
|
||||
$this->data['username'] = strtolower($this->data['username']);
|
||||
if ($this->admin->authenticate($this->data, $this->post)) {
|
||||
// should never reach here, redirects first
|
||||
} else {
|
||||
$this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.LOGIN_FAILED'), 'error');
|
||||
|
||||
Reference in New Issue
Block a user