more progress with the registration

This commit is contained in:
Andy Miller
2015-12-09 21:37:34 -07:00
parent 03fd601a49
commit c1311567b4
4 changed files with 23 additions and 13 deletions

View File

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

View File

@@ -220,6 +220,13 @@ class AdminController
return true;
}
protected function taskRegister()
{
$data = $this->post;
$this->admin->setMessage('Registration Failed', 'error');
return true;
}
/**
* Handle logout.
*

View File

@@ -173,6 +173,7 @@ en:
USERNAME: "Username"
EMAIL: "Email"
PASSWORD: "Password"
PASSWORD_CONFIRM: "Confirm Password"
TITLE: "Title"
LANGUAGE: "Language"
ACCOUNT: "Account"

View File

@@ -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: