Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
268cd3fb
Commit
268cd3fb
authored
Sep 09, 2016
by
Larry Lewis
Committed by
Scott
Nov 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #447 handle login, logout & register page calls when external auth is enabled
parent
fb15e16f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
12 deletions
+28
-12
login.php
qa-include/pages/login.php
+10
-5
logout.php
qa-include/pages/logout.php
+8
-2
register.php
qa-include/pages/register.php
+10
-5
No files found.
qa-include/pages/login.php
View file @
268cd3fb
...
@@ -26,14 +26,19 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
...
@@ -26,14 +26,19 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
}
}
// Check we're not using Q2A's single-sign on integration and that we're not logged in
if
(
QA_FINAL_EXTERNAL_USERS
)
qa_fatal_error
(
'User login is handled by external code'
);
if
(
qa_is_logged_in
())
if
(
qa_is_logged_in
())
qa_redirect
(
''
);
qa_redirect
(
''
);
// Check we're not using Q2A's single-sign on integration and that we're not logged in
if
(
QA_FINAL_EXTERNAL_USERS
)
{
$request
=
qa_request
();
$topath
=
qa_get
(
'to'
);
// lets user switch between login and register without losing destination page
$userlinks
=
qa_get_login_links
(
qa_path_to_root
(),
isset
(
$topath
)
?
$topath
:
qa_path
(
$request
,
$_GET
,
''
));
if
(
!
empty
(
$userlinks
[
'login'
]))
qa_redirect_raw
(
$userlinks
[
'login'
]);
qa_fatal_error
(
'User login should be handled by external code'
);
}
// Process submitted form after checking we haven't reached rate limit
// Process submitted form after checking we haven't reached rate limit
...
...
qa-include/pages/logout.php
View file @
268cd3fb
...
@@ -26,8 +26,14 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
...
@@ -26,8 +26,14 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
}
}
if
(
QA_FINAL_EXTERNAL_USERS
)
if
(
QA_FINAL_EXTERNAL_USERS
)
{
qa_fatal_error
(
'User logout is handled by external code'
);
$request
=
qa_request
();
$topath
=
qa_get
(
'to'
);
// lets user switch between login and register without losing destination page
$userlinks
=
qa_get_login_links
(
qa_path_to_root
(),
isset
(
$topath
)
?
$topath
:
qa_path
(
$request
,
$_GET
,
''
));
if
(
!
empty
(
$userlinks
[
'logout'
]))
qa_redirect_raw
(
$userlinks
[
'logout'
]);
qa_fatal_error
(
'User logout should be handled by external code'
);
}
if
(
qa_is_logged_in
())
if
(
qa_is_logged_in
())
qa_set_logged_in_user
(
null
);
qa_set_logged_in_user
(
null
);
...
...
qa-include/pages/register.php
View file @
268cd3fb
...
@@ -29,14 +29,19 @@ require_once QA_INCLUDE_DIR . 'app/captcha.php';
...
@@ -29,14 +29,19 @@ require_once QA_INCLUDE_DIR . 'app/captcha.php';
require_once
QA_INCLUDE_DIR
.
'db/users.php'
;
require_once
QA_INCLUDE_DIR
.
'db/users.php'
;
// Check we're not using single-sign on integration, that we're not logged in, and we're not blocked
if
(
QA_FINAL_EXTERNAL_USERS
)
qa_fatal_error
(
'User registration is handled by external code'
);
if
(
qa_is_logged_in
())
if
(
qa_is_logged_in
())
qa_redirect
(
''
);
qa_redirect
(
''
);
// Check we're not using single-sign on integration, that we're not logged in, and we're not blocked
if
(
QA_FINAL_EXTERNAL_USERS
)
{
$request
=
qa_request
();
$topath
=
qa_get
(
'to'
);
// lets user switch between login and register without losing destination page
$userlinks
=
qa_get_login_links
(
qa_path_to_root
(),
isset
(
$topath
)
?
$topath
:
qa_path
(
$request
,
$_GET
,
''
));
if
(
!
empty
(
$userlinks
[
'register'
]))
qa_redirect_raw
(
$userlinks
[
'register'
]);
qa_fatal_error
(
'User registration should be handled by external code'
);
}
// Get information about possible additional fields
// Get information about possible additional fields
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment