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:
Flavio Copes
2016-04-07 13:09:22 +02:00
parent 1702821915
commit f81f21e0ae
4 changed files with 14 additions and 8 deletions

View File

@@ -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');