Skip to content

Commit

Permalink
client: Don't show all tickets if already logged in
Browse files Browse the repository at this point in the history
If a client is already logged into the system and follows a second ticket
link, show the ticket instead of the list of tickets.
  • Loading branch information
Jared Hancock committed Mar 6, 2014
1 parent c4bfb69 commit 17725ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
3 changes: 2 additions & 1 deletion scp/login.php
Expand Up @@ -29,7 +29,8 @@
$username = trim($_POST['userid']);
if ($user = StaffAuthenticationBackend::process($username,
$_POST['passwd'], $errors)) {
@header("Location: $dest");
session_write_close();
Http::redirect($dest);
require_once('index.php'); //Just incase header is messed up.
exit;
}
Expand Down
15 changes: 6 additions & 9 deletions view.php
Expand Up @@ -16,16 +16,13 @@
**********************************************************************/
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.
require('tickets.php');
?>

0 comments on commit 17725ca

Please sign in to comment.