Move user registration to the backend and remove mail veification and captures.
This commit is contained in:
@@ -22,11 +22,13 @@ class RegisterController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if (LoginModel::isUserLoggedIn()) {
|
||||
Redirect::home();
|
||||
} else {
|
||||
$this->View->render('register/index');
|
||||
// Redirect non-logged-in users to the login page
|
||||
if (!LoginModel::isUserLoggedIn()) {
|
||||
Redirect::to('login/index');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->View->render('register/index');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,6 +37,13 @@ class RegisterController extends Controller
|
||||
*/
|
||||
public function register_action()
|
||||
{
|
||||
// Restrict registration to admins only
|
||||
if (!LoginModel::isAdmin()) {
|
||||
Session::add('feedback_negative', Text::get('FEEDBACK_ADMIN_ONLY'));
|
||||
Redirect::to('login/index');
|
||||
return;
|
||||
}
|
||||
|
||||
$registration_successful = RegistrationModel::registerNewUser();
|
||||
|
||||
if ($registration_successful) {
|
||||
@@ -62,13 +71,12 @@ class RegisterController extends Controller
|
||||
/**
|
||||
* Generate a captcha, write the characters into $_SESSION['captcha'] and returns a real image which will be used
|
||||
* like this: <img src="......./login/showCaptcha" />
|
||||
* IMPORTANT: As this action is called via <img ...> AFTER the real application has finished executing (!), the
|
||||
* SESSION["captcha"] has no content when the application is loaded. The SESSION["captcha"] gets filled at the
|
||||
* moment the end-user requests the <img .. >
|
||||
* Maybe refactor this sometime.
|
||||
*
|
||||
* This method is now deprecated as Captcha is no longer used in the registration process.
|
||||
*/
|
||||
public function showCaptcha()
|
||||
{
|
||||
CaptchaModel::generateAndShowCaptcha();
|
||||
Session::add('feedback_negative', Text::get('FEEDBACK_CAPTCHA_NOT_USED'));
|
||||
Redirect::to('register/index');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user