2011-04-17 18:22:21 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2011-04-17 22:48:09 +01:00
|
|
|
* StatusNet - the distributed open-source microblogging tool
|
|
|
|
* Copyright (C) 2011, StatusNet, Inc.
|
2011-04-17 18:22:21 +01:00
|
|
|
*
|
2011-04-17 22:48:09 +01:00
|
|
|
* Register a user by their email address
|
2011-04-19 00:13:28 +01:00
|
|
|
*
|
2011-04-17 18:22:21 +01:00
|
|
|
* PHP version 5
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2011-04-17 22:48:09 +01:00
|
|
|
*
|
|
|
|
* @category Email registration
|
|
|
|
* @package StatusNet
|
|
|
|
* @author Evan Prodromou <evan@status.net>
|
|
|
|
* @copyright 2011 StatusNet, Inc.
|
|
|
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
|
|
|
* @link http://status.net/
|
2011-04-17 18:22:21 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
if (!defined('STATUSNET')) {
|
2011-04-17 22:48:09 +01:00
|
|
|
// This check helps protect against security problems;
|
|
|
|
// your code file can't be executed directly from the web.
|
2011-04-17 18:22:21 +01:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2011-04-17 22:48:09 +01:00
|
|
|
* Email registration
|
2011-04-17 18:22:21 +01:00
|
|
|
*
|
2011-04-17 22:48:09 +01:00
|
|
|
* There are four cases where we're called:
|
2011-04-17 18:22:21 +01:00
|
|
|
*
|
2011-04-19 00:13:28 +01:00
|
|
|
* 1. GET, no arguments. Initial registration; ask for an email address.
|
2011-04-17 22:48:09 +01:00
|
|
|
* 2. POST, email address argument. Initial registration; send an email to confirm.
|
|
|
|
* 3. GET, code argument. Confirming an invitation or a registration; look them up,
|
2011-04-19 00:13:28 +01:00
|
|
|
* create the relevant user if possible, login as that user, and
|
2011-04-17 22:48:09 +01:00
|
|
|
* show a password-entry form.
|
|
|
|
* 4. POST, password argument. After confirmation, set the password for the new
|
|
|
|
* user, and redirect to a registration complete action with some instructions.
|
2011-04-17 18:22:21 +01:00
|
|
|
*
|
2011-04-17 22:48:09 +01:00
|
|
|
* @category Action
|
|
|
|
* @package StatusNet
|
|
|
|
* @author Evan Prodromou <evan@status.net>
|
|
|
|
* @copyright 2011 StatusNet, Inc.
|
|
|
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
|
|
|
* @link http://status.net/
|
2011-04-17 18:22:21 +01:00
|
|
|
*/
|
2011-04-17 22:48:09 +01:00
|
|
|
class EmailregisterAction extends Action
|
2011-04-17 18:22:21 +01:00
|
|
|
{
|
2011-04-17 22:48:09 +01:00
|
|
|
const NEWEMAIL = 1;
|
|
|
|
const SETPASSWORD = 2;
|
|
|
|
const NEWREGISTER = 3;
|
|
|
|
const CONFIRMINVITE = 4;
|
|
|
|
const CONFIRMREGISTER = 5;
|
2011-04-17 18:22:21 +01:00
|
|
|
|
2011-04-17 22:48:09 +01:00
|
|
|
const CONFIRMTYPE = 'register';
|
|
|
|
|
|
|
|
protected $user;
|
|
|
|
protected $email;
|
|
|
|
protected $code;
|
|
|
|
protected $invitation;
|
|
|
|
protected $confirmation;
|
|
|
|
protected $password1;
|
|
|
|
protected $password2;
|
|
|
|
protected $state;
|
|
|
|
protected $error;
|
2011-04-18 11:07:32 +01:00
|
|
|
protected $complete;
|
2011-04-17 22:48:09 +01:00
|
|
|
|
2019-04-26 00:34:17 +01:00
|
|
|
function prepare(array $args = [])
|
2011-04-17 18:22:21 +01:00
|
|
|
{
|
2019-04-26 00:34:17 +01:00
|
|
|
parent::prepare($args);
|
2011-04-17 22:48:09 +01:00
|
|
|
|
2011-05-03 03:12:29 +01:00
|
|
|
if (common_config('site', 'closed')) {
|
2011-06-05 10:06:08 +01:00
|
|
|
// TRANS: Client exception trown when registration by e-mail is not allowed.
|
|
|
|
throw new ClientException(_m('Registration not allowed.'), 403);
|
2011-05-03 03:12:29 +01:00
|
|
|
}
|
|
|
|
|
2011-04-17 22:48:09 +01:00
|
|
|
if ($this->isPost()) {
|
|
|
|
|
|
|
|
$this->checkSessionToken();
|
|
|
|
|
|
|
|
$this->email = $this->trimmed('email');
|
2011-04-17 18:22:21 +01:00
|
|
|
|
2011-04-17 22:48:09 +01:00
|
|
|
if (!empty($this->email)) {
|
2011-05-03 03:12:29 +01:00
|
|
|
if (common_config('site', 'inviteonly')) {
|
2011-06-05 10:06:08 +01:00
|
|
|
// TRANS: Client exception trown when trying to register without an invitation.
|
|
|
|
throw new ClientException(_m('Sorry, only invited people can register.'), 403);
|
2011-05-03 03:12:29 +01:00
|
|
|
}
|
2011-04-17 22:48:09 +01:00
|
|
|
$this->email = common_canonical_email($this->email);
|
|
|
|
$this->state = self::NEWEMAIL;
|
|
|
|
} else {
|
|
|
|
$this->state = self::SETPASSWORD;
|
2011-04-17 18:22:21 +01:00
|
|
|
|
2011-04-17 22:48:09 +01:00
|
|
|
$this->code = $this->trimmed('code');
|
|
|
|
|
|
|
|
if (empty($this->code)) {
|
2011-04-19 00:13:28 +01:00
|
|
|
// TRANS: Client exception thrown when no confirmation code was provided.
|
|
|
|
throw new ClientException(_m('No confirmation code.'));
|
2011-04-17 22:48:09 +01:00
|
|
|
}
|
|
|
|
|
2013-08-18 12:04:58 +01:00
|
|
|
$this->invitation = Invitation::getKV('code', $this->code);
|
2011-04-17 22:48:09 +01:00
|
|
|
|
2011-05-23 22:45:41 +01:00
|
|
|
if (!empty($this->invitation)) {
|
|
|
|
if (!empty($this->invitation->registered_user_id)) {
|
2011-06-05 10:06:08 +01:00
|
|
|
// TRANS: Client exception trown when using an invitation multiple times.
|
2011-05-23 22:45:41 +01:00
|
|
|
throw new ClientException(_m('Invitation already used.'), 403);
|
|
|
|
}
|
|
|
|
} else {
|
2011-04-18 11:07:32 +01:00
|
|
|
|
2013-08-18 12:04:58 +01:00
|
|
|
$this->confirmation = Confirm_address::getKV('code', $this->code);
|
2011-04-17 22:48:09 +01:00
|
|
|
|
|
|
|
if (empty($this->confirmation)) {
|
2011-04-19 00:13:28 +01:00
|
|
|
// TRANS: Client exception thrown when given confirmation code was not issued.
|
|
|
|
throw new ClientException(_m('No such confirmation code.'), 403);
|
2011-04-17 22:48:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-01 11:31:52 +00:00
|
|
|
$this->nickname = Nickname::normalize($this->trimmed('nickname'));
|
2011-04-17 22:48:09 +01:00
|
|
|
$this->password1 = $this->trimmed('password1');
|
|
|
|
$this->password2 = $this->trimmed('password2');
|
2011-04-19 00:13:28 +01:00
|
|
|
|
2011-04-17 22:48:09 +01:00
|
|
|
$this->tos = $this->boolean('tos');
|
|
|
|
}
|
|
|
|
} else { // GET
|
|
|
|
$this->code = $this->trimmed('code');
|
|
|
|
|
|
|
|
if (empty($this->code)) {
|
2011-05-03 03:12:29 +01:00
|
|
|
if (common_config('site', 'inviteonly')) {
|
2011-06-05 10:06:08 +01:00
|
|
|
// TRANS: Client exception trown when trying to register without an invitation.
|
|
|
|
throw new ClientException(_m('Sorry, only invited people can register.'), 403);
|
2011-05-03 03:12:29 +01:00
|
|
|
}
|
2011-04-17 22:48:09 +01:00
|
|
|
$this->state = self::NEWREGISTER;
|
|
|
|
} else {
|
2013-08-18 12:04:58 +01:00
|
|
|
$this->invitation = Invitation::getKV('code', $this->code);
|
2011-04-17 22:48:09 +01:00
|
|
|
if (!empty($this->invitation)) {
|
2011-05-23 22:45:41 +01:00
|
|
|
if (!empty($this->invitation->registered_user_id)) {
|
2011-06-05 10:06:08 +01:00
|
|
|
// TRANS: Client exception trown when using an invitation multiple times.
|
2011-05-23 22:45:41 +01:00
|
|
|
throw new ClientException(_m('Invitation already used.'), 403);
|
|
|
|
}
|
2011-04-17 22:48:09 +01:00
|
|
|
$this->state = self::CONFIRMINVITE;
|
|
|
|
} else {
|
|
|
|
$this->state = self::CONFIRMREGISTER;
|
2013-08-18 12:04:58 +01:00
|
|
|
$this->confirmation = Confirm_address::getKV('code', $this->code);
|
2011-04-17 22:48:09 +01:00
|
|
|
|
|
|
|
if (empty($this->confirmation)) {
|
2011-04-19 00:13:28 +01:00
|
|
|
// TRANS: Client exception thrown when given confirmation code was not issued.
|
|
|
|
throw new ClientException(_m('No such confirmation code.'), 405);
|
2011-04-17 22:48:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-04-17 18:22:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-04-17 22:48:09 +01:00
|
|
|
function title()
|
|
|
|
{
|
|
|
|
switch ($this->state) {
|
2019-04-26 00:34:17 +01:00
|
|
|
case self::NEWREGISTER:
|
|
|
|
case self::NEWEMAIL:
|
|
|
|
// TRANS: Title for registration page.
|
|
|
|
return _m('TITLE', 'Register');
|
|
|
|
break;
|
|
|
|
case self::SETPASSWORD:
|
|
|
|
case self::CONFIRMINVITE:
|
|
|
|
case self::CONFIRMREGISTER:
|
|
|
|
// TRANS: Title for page where to register with a confirmation code.
|
|
|
|
return _m('TITLE', 'Complete registration');
|
|
|
|
break;
|
2011-04-17 22:48:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-17 18:22:21 +01:00
|
|
|
/**
|
2011-04-17 22:48:09 +01:00
|
|
|
* Handler method
|
2011-04-17 18:22:21 +01:00
|
|
|
*
|
|
|
|
* @return void
|
2019-04-26 00:34:17 +01:00
|
|
|
* @throws Exception
|
2011-04-17 18:22:21 +01:00
|
|
|
*/
|
2019-04-26 00:34:17 +01:00
|
|
|
function handle()
|
2011-04-17 22:48:09 +01:00
|
|
|
{
|
2011-04-18 15:13:54 +01:00
|
|
|
$cur = common_current_user();
|
|
|
|
|
|
|
|
if (!empty($cur)) {
|
|
|
|
common_redirect(common_local_url('all', array('nickname' => $cur->nickname)));
|
|
|
|
}
|
|
|
|
|
2011-04-17 22:48:09 +01:00
|
|
|
switch ($this->state) {
|
2019-04-26 00:34:17 +01:00
|
|
|
case self::NEWREGISTER:
|
|
|
|
$this->showRegistrationForm();
|
|
|
|
break;
|
|
|
|
case self::NEWEMAIL:
|
|
|
|
$this->registerUser();
|
|
|
|
break;
|
|
|
|
case self::CONFIRMINVITE:
|
|
|
|
$this->confirmRegistration();
|
|
|
|
break;
|
|
|
|
case self::CONFIRMREGISTER:
|
|
|
|
$this->confirmRegistration();
|
|
|
|
break;
|
|
|
|
case self::SETPASSWORD:
|
|
|
|
$this->setPassword();
|
|
|
|
break;
|
2011-04-17 22:48:09 +01:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
function showRegistrationForm()
|
2011-04-17 18:22:21 +01:00
|
|
|
{
|
2011-04-17 22:48:09 +01:00
|
|
|
$this->form = new EmailRegistrationForm($this, $this->email);
|
|
|
|
$this->showPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
function registerUser()
|
|
|
|
{
|
2011-04-18 15:44:55 +01:00
|
|
|
try {
|
2011-04-21 15:15:51 +01:00
|
|
|
$confirm = EmailRegistrationPlugin::registerEmail($this->email);
|
|
|
|
} catch (ClientException $ce) {
|
|
|
|
$this->error = $ce->getMessage();
|
2011-04-17 22:48:09 +01:00
|
|
|
$this->showRegistrationForm();
|
2011-04-17 23:30:25 +01:00
|
|
|
return;
|
2011-04-17 22:48:09 +01:00
|
|
|
}
|
|
|
|
|
2011-04-21 15:15:51 +01:00
|
|
|
EmailRegistrationPlugin::sendConfirmEmail($confirm);
|
2011-04-17 18:22:21 +01:00
|
|
|
|
2011-04-21 15:15:51 +01:00
|
|
|
// TRANS: Confirmation text after initial registration.
|
|
|
|
// TRANS: %s an e-mail address.
|
|
|
|
$prompt = sprintf(_m('An email was sent to %s to confirm that address. Check your email inbox for instructions.'),
|
2019-04-26 00:34:17 +01:00
|
|
|
$this->email);
|
2011-04-17 22:48:09 +01:00
|
|
|
|
|
|
|
$this->complete = $prompt;
|
2011-04-19 00:13:28 +01:00
|
|
|
|
2011-04-17 18:22:21 +01:00
|
|
|
$this->showPage();
|
|
|
|
}
|
|
|
|
|
2011-04-18 00:24:33 +01:00
|
|
|
function confirmRegistration()
|
2011-04-17 22:48:09 +01:00
|
|
|
{
|
2011-04-18 00:28:22 +01:00
|
|
|
if (!empty($this->invitation)) {
|
|
|
|
$email = $this->invitation->address;
|
|
|
|
} else if (!empty($this->confirmation)) {
|
|
|
|
$email = $this->confirmation->address;
|
|
|
|
}
|
2011-04-19 00:13:28 +01:00
|
|
|
|
2011-04-18 00:28:22 +01:00
|
|
|
$nickname = $this->nicknameFromEmail($email);
|
2011-04-17 22:48:09 +01:00
|
|
|
|
2011-04-18 00:24:33 +01:00
|
|
|
$this->form = new ConfirmRegistrationForm($this,
|
2019-04-26 00:34:17 +01:00
|
|
|
$nickname,
|
|
|
|
$email,
|
|
|
|
$this->code);
|
2011-04-17 22:48:09 +01:00
|
|
|
$this->showPage();
|
|
|
|
}
|
|
|
|
|
2019-04-26 00:34:17 +01:00
|
|
|
function nicknameFromEmail($email)
|
|
|
|
{
|
|
|
|
return EmailRegistrationPlugin::nicknameFromEmail($email);
|
|
|
|
}
|
|
|
|
|
2011-04-17 22:48:09 +01:00
|
|
|
function setPassword()
|
2011-04-17 18:22:21 +01:00
|
|
|
{
|
2011-04-28 23:53:17 +01:00
|
|
|
if (Event::handle('StartRegistrationTry', array($this))) {
|
|
|
|
if (!empty($this->invitation)) {
|
|
|
|
$email = trim($this->invitation->address);
|
|
|
|
} else if (!empty($this->confirmation)) {
|
|
|
|
$email = trim($this->confirmation->address);
|
|
|
|
} else {
|
2011-06-05 10:06:08 +01:00
|
|
|
// TRANS: Client exception trown when trying to set password with an invalid confirmation code.
|
|
|
|
throw new Exception(_m('No confirmation thing.'));
|
2011-04-28 23:53:17 +01:00
|
|
|
}
|
2011-04-18 16:01:58 +01:00
|
|
|
|
2011-04-28 23:53:17 +01:00
|
|
|
if (!$this->tos) {
|
|
|
|
// TRANS: Error text when trying to register without agreeing to the terms.
|
|
|
|
$this->error = _m('You must accept the terms of service and privacy policy to register.');
|
|
|
|
} else if (empty($this->password1)) {
|
|
|
|
// TRANS: Error text when trying to register without a password.
|
|
|
|
$this->error = _m('You must set a password');
|
|
|
|
} else if (strlen($this->password1) < 6) {
|
|
|
|
// TRANS: Error text when trying to register with too short a password.
|
|
|
|
$this->error = _m('Password must be 6 or more characters.');
|
|
|
|
} else if ($this->password1 != $this->password2) {
|
|
|
|
// TRANS: Error text when trying to register without providing the same password twice.
|
|
|
|
$this->error = _m('Passwords do not match.');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!empty($this->error)) {
|
2015-03-01 11:31:52 +00:00
|
|
|
$this->form = new ConfirmRegistrationForm($this, $this->nickname, $email, $this->code);
|
2011-04-28 23:53:17 +01:00
|
|
|
$this->showPage();
|
|
|
|
return;
|
|
|
|
}
|
2011-04-17 22:48:09 +01:00
|
|
|
|
2011-04-28 23:53:17 +01:00
|
|
|
try {
|
2015-03-01 11:31:52 +00:00
|
|
|
$fields = array('nickname' => $this->nickname,
|
2019-04-26 00:34:17 +01:00
|
|
|
'email' => $email,
|
|
|
|
'password' => $this->password1,
|
|
|
|
'email_confirmed' => true);
|
2011-05-23 22:45:41 +01:00
|
|
|
|
|
|
|
if (!empty($this->invitation)) {
|
|
|
|
$fields['code'] = $this->invitation->code;
|
|
|
|
}
|
|
|
|
$this->user = User::register($fields);
|
2011-04-28 23:53:17 +01:00
|
|
|
} catch (ClientException $e) {
|
|
|
|
$this->error = $e->getMessage();
|
2015-03-01 11:31:52 +00:00
|
|
|
$this->form = new ConfirmRegistrationForm($this, $this->nickname, $email, $this->code);
|
2011-04-28 23:53:17 +01:00
|
|
|
$this->showPage();
|
|
|
|
return;
|
|
|
|
}
|
2011-04-19 00:33:12 +01:00
|
|
|
|
2011-04-28 23:53:17 +01:00
|
|
|
if (empty($this->user)) {
|
2011-06-05 10:06:08 +01:00
|
|
|
// TRANS: Exception trown when using an invitation multiple times.
|
|
|
|
throw new Exception(_m('Failed to register user.'));
|
2011-04-28 23:53:17 +01:00
|
|
|
}
|
2011-04-18 11:46:16 +01:00
|
|
|
|
2011-04-28 23:53:17 +01:00
|
|
|
common_set_user($this->user);
|
|
|
|
// this is a real login
|
|
|
|
common_real_login(true);
|
2011-04-17 22:48:09 +01:00
|
|
|
|
2011-04-28 23:53:17 +01:00
|
|
|
// Re-init language env in case it changed (not yet, but soon)
|
|
|
|
common_init_language();
|
2011-04-17 22:48:09 +01:00
|
|
|
|
2011-05-23 22:45:41 +01:00
|
|
|
if (!empty($this->confirmation)) {
|
2016-03-02 14:37:47 +00:00
|
|
|
try {
|
|
|
|
$this->confirmation->delete();
|
|
|
|
} catch (ServerException $e) {
|
|
|
|
common_log(LOG_ERR, $e->getMessage());
|
|
|
|
}
|
2011-04-17 22:48:09 +01:00
|
|
|
}
|
|
|
|
|
2011-04-28 23:53:17 +01:00
|
|
|
Event::handle('EndRegistrationTry', array($this));
|
2011-04-17 18:22:21 +01:00
|
|
|
}
|
2011-04-17 22:48:09 +01:00
|
|
|
|
2011-04-28 23:53:17 +01:00
|
|
|
if (Event::handle('StartRegisterSuccess', array($this))) {
|
|
|
|
Event::handle('EndRegisterSuccess', array($this));
|
2014-03-09 22:22:05 +00:00
|
|
|
common_redirect(common_local_url('doc', array('title' => 'welcome')), 303);
|
|
|
|
// common_redirect exits, so we can't run the event _after_ it of course.
|
2011-04-28 23:53:17 +01:00
|
|
|
}
|
2011-04-17 22:48:09 +01:00
|
|
|
}
|
|
|
|
|
2011-04-17 23:48:58 +01:00
|
|
|
function sendConfirmEmail($confirm)
|
2011-04-17 22:48:09 +01:00
|
|
|
{
|
|
|
|
$sitename = common_config('site', 'name');
|
|
|
|
|
|
|
|
$recipients = array($confirm->address);
|
|
|
|
|
|
|
|
$headers['From'] = mail_notify_from();
|
|
|
|
$headers['To'] = trim($confirm->address);
|
2019-04-26 00:34:17 +01:00
|
|
|
// TRANS: Subject for confirmation e-mail.
|
|
|
|
// TRANS: %s is the StatusNet sitename.
|
2011-04-19 00:13:28 +01:00
|
|
|
$headers['Subject'] = sprintf(_m('Confirm your registration on %s'), $sitename);
|
2011-04-17 22:48:09 +01:00
|
|
|
|
2011-04-18 11:07:32 +01:00
|
|
|
$confirmUrl = common_local_url('register', array('code' => $confirm->code));
|
|
|
|
|
2011-06-05 10:06:08 +01:00
|
|
|
// TRANS: Body for confirmation e-mail.
|
|
|
|
// TRANS: %1$s is the StatusNet sitename, %2$s is the confirmation URL.
|
2019-04-26 00:34:17 +01:00
|
|
|
$body = sprintf(_m('Someone (probably you) has requested an account on %1$s using this email address.' .
|
|
|
|
"\n" .
|
|
|
|
'To confirm the address, click the following URL or copy it into the address bar of your browser.' .
|
|
|
|
"\n" .
|
|
|
|
'%2$s' .
|
|
|
|
"\n" .
|
|
|
|
'If it was not you, you can safely ignore this message.'),
|
|
|
|
$sitename,
|
|
|
|
$confirmUrl);
|
2011-04-17 22:48:09 +01:00
|
|
|
|
|
|
|
mail_send($recipients, $headers, $body);
|
2011-04-17 18:22:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function showContent()
|
|
|
|
{
|
2011-04-17 22:48:09 +01:00
|
|
|
if ($this->complete) {
|
|
|
|
$this->elementStart('p', 'success');
|
|
|
|
$this->raw($this->complete);
|
|
|
|
$this->elementEnd('p');
|
2011-04-17 18:22:21 +01:00
|
|
|
} else {
|
2011-04-17 22:48:09 +01:00
|
|
|
if ($this->error) {
|
|
|
|
$this->elementStart('p', 'error');
|
|
|
|
$this->raw($this->error);
|
|
|
|
$this->elementEnd('p');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!empty($this->form)) {
|
|
|
|
$this->form->show();
|
|
|
|
}
|
2011-04-17 18:22:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return true if read only.
|
|
|
|
*
|
2011-04-17 22:48:09 +01:00
|
|
|
* MAY override
|
2011-04-17 18:22:21 +01:00
|
|
|
*
|
2011-04-17 22:48:09 +01:00
|
|
|
* @param array $args other arguments
|
2011-04-17 18:22:21 +01:00
|
|
|
*
|
|
|
|
* @return boolean is read only action?
|
|
|
|
*/
|
|
|
|
function isReadOnly($args)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2011-04-18 00:24:33 +01:00
|
|
|
|
2011-04-18 14:22:51 +01:00
|
|
|
/**
|
|
|
|
* A local menu
|
|
|
|
*
|
|
|
|
* Shows different login/register actions.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function showLocalNav()
|
|
|
|
{
|
|
|
|
$nav = new LoginGroupNav($this);
|
|
|
|
$nav->show();
|
|
|
|
}
|
2011-04-17 18:22:21 +01:00
|
|
|
}
|