Fixed admin panel user registration.
Now including start.sh to start a php server using the router.php so no webserver is needed.
This commit is contained in:
@@ -22,12 +22,8 @@ class RegisterController extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// Redirect non-logged-in users to the login page
|
||||
if (!LoginModel::isUserLoggedIn()) {
|
||||
Redirect::to('login/index');
|
||||
return;
|
||||
}
|
||||
|
||||
// only admins can access registration; reuse existing admin auth check
|
||||
Auth::checkAdminAuthentication();
|
||||
$this->View->render('register/index');
|
||||
}
|
||||
|
||||
@@ -37,20 +33,12 @@ 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;
|
||||
}
|
||||
// enforce admin-only for registration
|
||||
Auth::checkAdminAuthentication();
|
||||
|
||||
$registration_successful = RegistrationModel::registerNewUser();
|
||||
RegistrationModel::registerNewUser();
|
||||
|
||||
if ($registration_successful) {
|
||||
Redirect::to('login/index');
|
||||
} else {
|
||||
Redirect::to('register/index');
|
||||
}
|
||||
Redirect::to('admin/index');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,7 +64,7 @@ class RegisterController extends Controller
|
||||
*/
|
||||
public function showCaptcha()
|
||||
{
|
||||
Session::add('feedback_negative', Text::get('FEEDBACK_CAPTCHA_NOT_USED'));
|
||||
// Captcha no longer used
|
||||
Redirect::to('register/index');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user