Skip to content
Snippets Groups Projects
Commit 17725ca5 authored by Jared Hancock's avatar Jared Hancock
Browse files

client: Don't show all tickets if already logged in

If a client is already logged into the system and follows a second ticket
link, show the ticket instead of the list of tickets.
parent c4bfb69f
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,8 @@ if($_POST) { ...@@ -29,7 +29,8 @@ if($_POST) {
$username = trim($_POST['userid']); $username = trim($_POST['userid']);
if ($user = StaffAuthenticationBackend::process($username, if ($user = StaffAuthenticationBackend::process($username,
$_POST['passwd'], $errors)) { $_POST['passwd'], $errors)) {
@header("Location: $dest"); session_write_close();
Http::redirect($dest);
require_once('index.php'); //Just incase header is messed up. require_once('index.php'); //Just incase header is messed up.
exit; exit;
} }
......
...@@ -16,16 +16,13 @@ ...@@ -16,16 +16,13 @@
**********************************************************************/ **********************************************************************/
require_once('client.inc.php'); require_once('client.inc.php');
// Try autologin the user
// Authenticated user can be of type ticket owner or collaborator
$errors = array();
$user = UserAuthenticationBackend::processSignOn($errors);
if ($user && $user->getTicketId())
Http::redirect('tickets.php?id='.$user->getTicketId());
//If the user is NOT logged in - try auto-login (if params exists).
if (!$thisclient || !$thisclient->isValid()) {
// Try autologin the user
// Authenticated user can be of type ticket owner or collaborator
$errors = array();
$user = UserAuthenticationBackend::processSignOn($errors);
if ($user && $user->getTicketId())
@header('Location: tickets.php?id='.$user->getTicketId());
}
//Simply redirecting to tickets.php until multiview is implemented. //Simply redirecting to tickets.php until multiview is implemented.
require('tickets.php'); require('tickets.php');
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment