Registration coding cleanup
Mainly there was an Undefined variable: code in apiaccountregister.php
This commit is contained in:
parent
98afab74e2
commit
305c9f33a7
|
@ -163,8 +163,8 @@ class ApiAccountRegisterAction extends ApiAction
|
||||||
'homepage' => $homepage,
|
'homepage' => $homepage,
|
||||||
'bio' => $bio,
|
'bio' => $bio,
|
||||||
'location' => $location,
|
'location' => $location,
|
||||||
'code' => $code))) {
|
'code' => $this->code))) {
|
||||||
if (!$user) {
|
if (!$user instanceof User) {
|
||||||
// TRANS: Form validation error displayed when trying to register with an invalid username or password.
|
// TRANS: Form validation error displayed when trying to register with an invalid username or password.
|
||||||
$this->clientError(_('Invalid username or password.'), 400);
|
$this->clientError(_('Invalid username or password.'), 400);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ class RegisterAction extends Action
|
||||||
* @param $args
|
* @param $args
|
||||||
* @return string title
|
* @return string title
|
||||||
*/
|
*/
|
||||||
function prepare($args)
|
protected function prepare(array $args=array())
|
||||||
{
|
{
|
||||||
parent::prepare($args);
|
parent::prepare($args);
|
||||||
$this->code = $this->trimmed('code');
|
$this->code = $this->trimmed('code');
|
||||||
|
@ -83,7 +83,7 @@ class RegisterAction extends Action
|
||||||
|
|
||||||
if (!empty($this->code)) {
|
if (!empty($this->code)) {
|
||||||
$this->invite = Invitation::getKV('code', $this->code);
|
$this->invite = Invitation::getKV('code', $this->code);
|
||||||
if (empty($this->invite)) {
|
if (!$this->invite instanceof Invitation) {
|
||||||
// TRANS: Client error displayed when trying to register to an invite-only site without a valid invitation.
|
// TRANS: Client error displayed when trying to register to an invite-only site without a valid invitation.
|
||||||
$this->clientError(_('Sorry, invalid invitation code.'));
|
$this->clientError(_('Sorry, invalid invitation code.'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -276,7 +276,7 @@ class User extends Managed_DataObject
|
||||||
|
|
||||||
if (!empty($code)) {
|
if (!empty($code)) {
|
||||||
$invite = Invitation::getKV($code);
|
$invite = Invitation::getKV($code);
|
||||||
if ($invite && $invite->address && $invite->address_type == 'email' && $invite->address == $email) {
|
if ($invite instanceof Invitation && $invite->address && $invite->address_type == 'email' && $invite->address == $email) {
|
||||||
$user->email = $invite->address;
|
$user->email = $invite->address;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user