Source of file RegistrationPage.php
Size: 1,321 Bytes - Last Modified: 2021-12-23T10:19:24+00:00
/var/www/docs.ssmods.com/process/src/code/Modules/Registration/code/RegistrationPage.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | <?php /** * Class RegistrationPage */ class RegistrationPage extends Page { /** * @var string */ private static $icon = 'boilerplate/code/Modules/Registration/images/user--plus.png'; /** * @var string */ private static $description = 'Registration content page'; } /** * Class RegistrationPage_Controller */ class RegistrationPage_Controller extends Page_Controller { /** * @var array */ private static $allowed_actions = array('Form'); /** * @return RegistrationForm */ public function Form() { /** ========================================= * @var Member $member ===========================================*/ /** If the user is logged in, redirect to the Homepage with an alert message prompting logout. */ if ($member = Member::currentUser()) { return '<div class="alert--warning">You\'re currently logged in as <strong>' . $member->Email . '</strong>. To register as a different user <a href="' . Director::absoluteBaseURL() . 'Security/logout?BackURL=' . $this->Link() . '">log out.</a></div>'; } else { $form = RegistrationForm::create($this, 'Form'); $this->extend('updateRegistrationForm', $form); return $form; } } } |