The entire website requires the user to log in before viewing the page. If the user is not logged in, he will be redirected to the login / registration page.
Problem: When a user who is not registered in types in the URL, for example http://www.domain.com/listings/1234, is shown this page, but with a darkened page that prevents the user from interacting with the page (jQuery, no problem here) and a pop-up modal field with a link to the login page (Tank Auth) http://www.domain.com/login.
After entering the login page, the user will be redirected back to the normal page after entering the system, that is:, http://www.domain.combut a variable is passed to this page 1234.
In short : I want the user to not log in and enter the website in http://www.domain.com/listings/1234so as NOT to redirect to http://www.domain.com/login, but instead stayed on http://www.domain.com/listings/1234and there was a modal box shown with a link to the login page http://www.domain.com/login, where if he logs in, he will be redirected back to http://www.domain.com/instead of the regular page that it will receive after logging in, and pass the variable 1234.
How can this be done with Codeigniter?
This is what I have now:
Controller list
function index(listing_id) {
$this->load->module('auth');
if(!$this->auth->tank_auth->is_logged_in()) {
redirect('login');
}
$this->load->view('listings', $data);
}
source
share