Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
01e6e122
Commit
01e6e122
authored
11 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
Redirect to originally-requested page on login
Instead of always showing the tickets page
parent
e145ede0
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
include/client/login.inc.php
+3
-3
3 additions, 3 deletions
include/client/login.inc.php
login.php
+5
-4
5 additions, 4 deletions
login.php
open.php
+8
-5
8 additions, 5 deletions
open.php
secure.inc.php
+3
-1
3 additions, 1 deletion
secure.inc.php
view.php
+3
-0
3 additions, 0 deletions
view.php
with
22 additions
and
13 deletions
include/client/login.inc.php
+
3
−
3
View file @
01e6e122
...
@@ -12,7 +12,7 @@ $content = Page::lookup(Page::getIdByType('registration-policy'));
...
@@ -12,7 +12,7 @@ $content = Page::lookup(Page::getIdByType('registration-policy'));
<form
action=
"login.php"
method=
"post"
id=
"clientLogin"
>
<form
action=
"login.php"
method=
"post"
id=
"clientLogin"
>
<?php
csrf_token
();
?>
<?php
csrf_token
();
?>
<div
style=
"display:table-row"
>
<div
style=
"display:table-row"
>
<div
style=
"width:40%;display:table-cell"
>
<div
style=
"width:40%;display:table-cell
;box-shadow: 12px 0 15px -15px rgba(0,0,0,0.4);padding-left: 2em;
"
>
<strong>
<?php
echo
Format
::
htmlchars
(
$errors
[
'login'
]);
?>
</strong>
<strong>
<?php
echo
Format
::
htmlchars
(
$errors
[
'login'
]);
?>
</strong>
<br>
<br>
<div>
<div>
...
@@ -27,11 +27,11 @@ $content = Page::lookup(Page::getIdByType('registration-policy'));
...
@@ -27,11 +27,11 @@ $content = Page::lookup(Page::getIdByType('registration-policy'));
<input
class=
"btn"
type=
"submit"
value=
"Sign In"
>
<input
class=
"btn"
type=
"submit"
value=
"Sign In"
>
</p>
</p>
</div>
</div>
<div
style=
"display:table-cell;padding-left: 2em;"
>
<?php
if
(
$cfg
&&
$cfg
->
isClientRegistrationEnabled
())
{
?>
<?php
if
(
$cfg
&&
$cfg
->
isClientRegistrationEnabled
())
{
?>
<div
style=
"display:table-cell;box-shadow: -9px 0 15px -12px rgba(0,0,0,0.3);padding-left: 2em;"
>
Not yet registered?
<a
href=
"account.php?do=create"
>
Create an account
</a>
Not yet registered?
<a
href=
"account.php?do=create"
>
Create an account
</a>
</div>
<?php
}
?>
<?php
}
?>
</div>
</div>
</div>
</form>
</form>
<br>
<br>
...
...
This diff is collapsed.
Click to expand it.
login.php
+
5
−
4
View file @
01e6e122
...
@@ -30,15 +30,16 @@ if ($_POST) {
...
@@ -30,15 +30,16 @@ if ($_POST) {
$errors
[
'err'
]
=
'Valid username or email address is required'
;
$errors
[
'err'
]
=
'Valid username or email address is required'
;
elseif
((
$user
=
UserAuthenticationBackend
::
process
(
$_POST
[
'luser'
],
elseif
((
$user
=
UserAuthenticationBackend
::
process
(
$_POST
[
'luser'
],
$_POST
[
'lpasswd'
],
$errors
)))
{
$_POST
[
'lpasswd'
],
$errors
)))
{
Http
::
redirect
(
'tickets.php'
);
Http
::
redirect
(
$_SESSION
[
'_client'
][
'auth'
][
'dest'
]
?:
'tickets.php'
);
$_POST
=
null
;
}
elseif
(
!
$errors
[
'err'
])
{
}
elseif
(
!
$errors
[
'err'
])
{
$errors
[
'err'
]
=
'Invalid email or ticket number - try again!'
;
$errors
[
'err'
]
=
'Invalid email or ticket number - try again!'
;
}
}
}
}
$nav
=
new
UserNav
();
if
(
!
$nav
)
{
$nav
->
setActiveNav
(
'status'
);
$nav
=
new
UserNav
();
$nav
->
setActiveNav
(
'status'
);
}
require
CLIENTINC_DIR
.
'header.inc.php'
;
require
CLIENTINC_DIR
.
'header.inc.php'
;
require
CLIENTINC_DIR
.
$inc
;
require
CLIENTINC_DIR
.
$inc
;
require
CLIENTINC_DIR
.
'footer.inc.php'
;
require
CLIENTINC_DIR
.
'footer.inc.php'
;
...
...
This diff is collapsed.
Click to expand it.
open.php
+
8
−
5
View file @
01e6e122
...
@@ -17,7 +17,7 @@ require('client.inc.php');
...
@@ -17,7 +17,7 @@ require('client.inc.php');
define
(
'SOURCE'
,
'Web'
);
//Ticket source.
define
(
'SOURCE'
,
'Web'
);
//Ticket source.
$ticket
=
null
;
$ticket
=
null
;
$errors
=
array
();
$errors
=
array
();
if
(
$_POST
)
:
if
(
$_POST
)
{
$vars
=
$_POST
;
$vars
=
$_POST
;
$vars
[
'deptId'
]
=
$vars
[
'emailId'
]
=
0
;
//Just Making sure we don't accept crap...only topicId is expected.
$vars
[
'deptId'
]
=
$vars
[
'emailId'
]
=
0
;
//Just Making sure we don't accept crap...only topicId is expected.
if
(
$thisclient
)
{
if
(
$thisclient
)
{
...
@@ -60,10 +60,14 @@ if($_POST):
...
@@ -60,10 +60,14 @@ if($_POST):
}
else
{
}
else
{
$errors
[
'err'
]
=
$errors
[
'err'
]
?
$errors
[
'err'
]
:
'Unable to create a ticket. Please correct errors below and try again!'
;
$errors
[
'err'
]
=
$errors
[
'err'
]
?
$errors
[
'err'
]
:
'Unable to create a ticket. Please correct errors below and try again!'
;
}
}
endif
;
}
//page
//page
$nav
->
setActiveNav
(
'new'
);
$nav
->
setActiveNav
(
'new'
);
if
(
$cfg
->
isClientLoginRequired
()
&&
!
$thisclient
)
{
require_once
'secure.inc.php'
;
}
require
(
CLIENTINC_DIR
.
'header.inc.php'
);
require
(
CLIENTINC_DIR
.
'header.inc.php'
);
if
(
$ticket
if
(
$ticket
&&
(
&&
(
...
@@ -76,9 +80,8 @@ if($ticket
...
@@ -76,9 +80,8 @@ if($ticket
array_fill
(
0
,
3
,
'XXXXXX'
),
array_fill
(
0
,
3
,
'XXXXXX'
),
$page
->
getBody
()
$page
->
getBody
()
)));
)));
}
elseif
(
$cfg
->
isClientLoginRequired
()
&&
!
$thisclient
)
{
}
require
(
CLIENTINC_DIR
.
'login.inc.php'
);
else
{
}
else
{
require
(
CLIENTINC_DIR
.
'open.inc.php'
);
require
(
CLIENTINC_DIR
.
'open.inc.php'
);
}
}
require
(
CLIENTINC_DIR
.
'footer.inc.php'
);
require
(
CLIENTINC_DIR
.
'footer.inc.php'
);
...
...
This diff is collapsed.
Click to expand it.
secure.inc.php
+
3
−
1
View file @
01e6e122
...
@@ -20,7 +20,9 @@ require_once('client.inc.php');
...
@@ -20,7 +20,9 @@ require_once('client.inc.php');
//Client Login page: Ajax interface can pre-declare the function to trap logins.
//Client Login page: Ajax interface can pre-declare the function to trap logins.
if
(
!
function_exists
(
'clientLoginPage'
))
{
if
(
!
function_exists
(
'clientLoginPage'
))
{
function
clientLoginPage
(
$msg
=
''
)
{
function
clientLoginPage
(
$msg
=
''
)
{
global
$ost
;
global
$ost
,
$cfg
,
$nav
;
$_SESSION
[
'_client'
][
'auth'
][
'dest'
]
=
'/'
.
ltrim
(
$_SERVER
[
'REQUEST_URI'
],
'/'
);
require
(
'./login.php'
);
require
(
'./login.php'
);
exit
;
exit
;
}
}
...
...
This diff is collapsed.
Click to expand it.
view.php
+
3
−
0
View file @
01e6e122
...
@@ -23,6 +23,9 @@ $user = UserAuthenticationBackend::processSignOn($errors);
...
@@ -23,6 +23,9 @@ $user = UserAuthenticationBackend::processSignOn($errors);
if
(
$user
&&
$user
->
getTicketId
())
if
(
$user
&&
$user
->
getTicketId
())
Http
::
redirect
(
'tickets.php?id='
.
$user
->
getTicketId
());
Http
::
redirect
(
'tickets.php?id='
.
$user
->
getTicketId
());
$nav
=
new
UserNav
();
$nav
->
setActiveNav
(
'status'
);
//Simply redirecting to tickets.php until multiview is implemented.
//Simply redirecting to tickets.php until multiview is implemented.
require
(
'tickets.php'
);
require
(
'tickets.php'
);
?>
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment