Added recaptcha
This commit is contained in:
@@ -22,23 +22,25 @@ class RegisterController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// only admins can access registration; reuse existing admin auth check
|
||||
Auth::checkAdminAuthentication();
|
||||
if (Session::userIsLoggedIn()) {
|
||||
Redirect::to('index');
|
||||
return;
|
||||
}
|
||||
$this->View->render('register/index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register page action
|
||||
* POST-request after form submit
|
||||
*/
|
||||
public function register_action()
|
||||
{
|
||||
// enforce admin-only for registration
|
||||
Auth::checkAdminAuthentication();
|
||||
if (Session::userIsLoggedIn()) {
|
||||
Redirect::to('index');
|
||||
return;
|
||||
}
|
||||
|
||||
RegistrationModel::registerNewUser();
|
||||
|
||||
Redirect::to('admin/index');
|
||||
if (RegistrationModel::registerNewUser()) {
|
||||
Redirect::to('login');
|
||||
} else {
|
||||
Redirect::to('register');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user