diff --git a/admin.php b/admin.php index 2cf79a4c..7299041a 100644 --- a/admin.php +++ b/admin.php @@ -185,6 +185,9 @@ class AdminPlugin extends Plugin $self = $this; + // make sure page is not frozen! + unset($this->grav['page']); + // Replace page service with admin. $this->grav['page'] = function () use ($self) { $page = new Page; diff --git a/classes/controller.php b/classes/controller.php index 34da6c16..9c03333e 100644 --- a/classes/controller.php +++ b/classes/controller.php @@ -220,6 +220,13 @@ class AdminController return true; } + protected function taskRegister() + { + $data = $this->post; + $this->admin->setMessage('Registration Failed', 'error'); + return true; + } + /** * Handle logout. * diff --git a/languages.yaml b/languages.yaml index 31870a70..91e97e08 100644 --- a/languages.yaml +++ b/languages.yaml @@ -173,6 +173,7 @@ en: USERNAME: "Username" EMAIL: "Email" PASSWORD: "Password" + PASSWORD_CONFIRM: "Confirm Password" TITLE: "Title" LANGUAGE: "Language" ACCOUNT: "Account" diff --git a/pages/admin/register.md b/pages/admin/register.md index 77704512..9aeef7aa 100644 --- a/pages/admin/register.md +++ b/pages/admin/register.md @@ -7,27 +7,33 @@ form: - name: username type: text - placeholder: "Choose a username" + placeholder: PLUGIN_ADMIN.USERNAME validate: required: true - name: email type: text - placeholder: "Enter your email" + placeholder: PLUGIN_ADMIN.EMAIL validate: + type: email + message: PLUGIN_ADMIN.EMAIL_VALIDATION_MESSAGE required: true - name: password1 type: password - placeholder: Enter password + placeholder: PLUGIN_ADMIN.PASSWORD validate: required: true + message: PLUGIN_ADMIN.PASSWORD_VALIDATION_MESSAGE + pattern: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}' - name: password2 type: password - placeholder: Confirm password + placeholder: PLUGIN_ADMIN.PASSWORD_CONFIRM validate: required: true + message: PLUGIN_ADMIN.PASSWORD_VALIDATION_MESSAGE + pattern: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}' - name: spacer title: Optional @@ -35,18 +41,11 @@ form: - name: fullname type: text - placeholder: "Enter your full name" + placeholder: PLUGIN_ADMIN.FULL_NAME - name: title type: text - placeholder: "Enter a title" - - - buttons: - - type: submit - value: Submit - - type: reset - value: Reset + placeholder: PLUGIN_ADMIN.TITLE process: register_user: