Move user registration to the backend and remove mail veification and captures.
This commit is contained in:
@@ -32,4 +32,25 @@ class AdminController extends Controller
|
||||
|
||||
Redirect::to("admin");
|
||||
}
|
||||
|
||||
public function registerUser()
|
||||
{
|
||||
// Ensure the user is logged in and is an admin
|
||||
if (!LoginModel::isUserLoggedIn() || !LoginModel::isAdmin()) {
|
||||
Session::add('feedback_negative', Text::get('FEEDBACK_ADMIN_ONLY'));
|
||||
Redirect::to('admin/index');
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate and register the new user
|
||||
$registration_successful = RegistrationModel::registerNewUser(true);
|
||||
|
||||
if ($registration_successful) {
|
||||
Session::add('feedback_positive', Text::get('FEEDBACK_USER_REGISTERED_SUCCESSFULLY'));
|
||||
} else {
|
||||
Session::add('feedback_negative', Text::get('FEEDBACK_USER_REGISTRATION_FAILED'));
|
||||
}
|
||||
|
||||
Redirect::to('admin/index');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user