-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error redirect for separate admin login from user login #873
Comments
Hi, You have two options already built in the framework; First OptionRedirect::to("admin/login"); Second Option
Either should work. Ensure you put an admin check in the admincontroller for the login function/page and all other pages you want admin locked down, otherwise someone could just go directly to the admin/login page skipping your admin redirect check Hope that makes sense |
Hi, I change Admincontroller to this:
And Edit Auth.php in core folder to:
This worked now But I have two Question: One: This Method is true and safe? Two: For each page authurize I need to Add |
I'm wondering if you meant AND.. (Session::userIsLoggedIn() && Session::get("user_account_type") == 7) At the moment you have an OR statement Add exit(); after the render statement just for safety, so my original posting. Otherwise looks as strong as I would be able to write lol testing is the only way to be sure, try something like Netsparker Community Edition |
You right For OR / AND But I Move This Code From |
For Question Two... The controller as part of building the page will run the public function __construct everytime, so whatever is in the Auth::checkAdminAuthentication function will run each page load.
So it depends what changes you make to that function Cheers |
I add login page for separate admin login page from user login page. I edit Auth class line 60:
header('location: ' . Config::get('URL') . 'login');
to
header('location: ' . Config::get('URL') . 'admin/login/');
But in output i see this error:
How do fix this problem?!
The text was updated successfully, but these errors were encountered: