Allow changing nick on EmailRegistration
Nothing said that the EmailRegistration plugin was meant to restrict the nickname to the local part of the email address. Let users change it before they actually register the user.
This commit is contained in:
parent
746e658f3e
commit
7fdf2f50f4
|
@ -124,6 +124,7 @@ class EmailregisterAction extends Action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->nickname = Nickname::normalize($this->trimmed('nickname'));
|
||||||
$this->password1 = $this->trimmed('password1');
|
$this->password1 = $this->trimmed('password1');
|
||||||
$this->password2 = $this->trimmed('password2');
|
$this->password2 = $this->trimmed('password2');
|
||||||
|
|
||||||
|
@ -285,16 +286,13 @@ class EmailregisterAction extends Action
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($this->error)) {
|
if (!empty($this->error)) {
|
||||||
$nickname = $this->nicknameFromEmail($email);
|
$this->form = new ConfirmRegistrationForm($this, $this->nickname, $email, $this->code);
|
||||||
$this->form = new ConfirmRegistrationForm($this, $nickname, $email, $this->code);
|
|
||||||
$this->showPage();
|
$this->showPage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$nickname = $this->nicknameFromEmail($email);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$fields = array('nickname' => $nickname,
|
$fields = array('nickname' => $this->nickname,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
'password' => $this->password1,
|
'password' => $this->password1,
|
||||||
'email_confirmed' => true);
|
'email_confirmed' => true);
|
||||||
|
@ -305,8 +303,7 @@ class EmailregisterAction extends Action
|
||||||
$this->user = User::register($fields);
|
$this->user = User::register($fields);
|
||||||
} catch (ClientException $e) {
|
} catch (ClientException $e) {
|
||||||
$this->error = $e->getMessage();
|
$this->error = $e->getMessage();
|
||||||
$nickname = $this->nicknameFromEmail($email);
|
$this->form = new ConfirmRegistrationForm($this, $this->nickname, $email, $this->code);
|
||||||
$this->form = new ConfirmRegistrationForm($this, $nickname, $email, $this->code);
|
|
||||||
$this->showPage();
|
$this->showPage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,12 +71,11 @@ class ConfirmRegistrationForm extends Form
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
|
|
||||||
// TRANS: Field label in e-mail registration form.
|
// TRANS: Field label in e-mail registration form.
|
||||||
$this->element('label', array('for' => 'nickname-ignore'), _m('LABEL','User name'));
|
$this->element('label', array('for' => 'nickname'), _m('LABEL','User name'));
|
||||||
|
|
||||||
$this->element('input', array('name' => 'nickname-ignore',
|
$this->element('input', array('name' => 'nickname',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'id' => 'nickname-ignore',
|
'id' => 'nickname',
|
||||||
'disabled' => 'true',
|
|
||||||
'value' => $this->nickname));
|
'value' => $this->nickname));
|
||||||
|
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user