php change logged admin as user and back
I have php application with admin and user access. What i want to do is this;
while logged in as admin, I need to click on a button and login as a user
without login off from admin panel. Form the user control panel i want to
be able to click for example "Back to Admin" button and login as admin. I
need to remain loged all the time only to swap between user and admin
control panel . I have my sessions set as folowing:
Session::init();
Session::set('role', $data['role']);
Session::set('userid', $data['userid']);
Session::set('language', $data['language']);
Session::set('loggedIn', TRUE);
if ($data['role'] == "admin") {
header('location: ' . URL . 'spadmincp');
} elseif ($data['role'] == "owner") {
header('location: ' . URL . 'dashboard');
} elseif ($data['role'] == "default") {
header('location: ' . URL . 'userservices');
} elseif ($data['role'] == "reseller") {
header('location: ' . URL . 'reseller');
}
} else {
header('location:' . URL . 'login ');
}
I will appreciate any help
Thanks
No comments:
Post a Comment