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
7e7ab77c
Commit
7e7ab77c
authored
Jan 03, 2018
by
pupi1985
Committed by
Scott
Jan 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace fatal errors with the appropriate exception
parent
4559829f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
UsersList.php
qa-src/Controllers/User/UsersList.php
+9
-12
No files found.
qa-src/Controllers/User/UsersList.php
View file @
7e7ab77c
...
...
@@ -18,6 +18,8 @@
namespace
Q2A\Controllers\User
;
use
Q2A\Middleware\Auth\InternalUsersOnly
;
require_once
QA_INCLUDE_DIR
.
'db/users.php'
;
require_once
QA_INCLUDE_DIR
.
'db/selects.php'
;
require_once
QA_INCLUDE_DIR
.
'app/users.php'
;
...
...
@@ -25,6 +27,13 @@ require_once QA_INCLUDE_DIR . 'app/format.php';
class
UsersList
extends
\Q2A\Controllers\BaseController
{
public
function
__construct
()
{
parent
::
__construct
();
$this
->
addMiddleware
(
new
InternalUsersOnly
(),
array
(
'newest'
,
'special'
,
'blocked'
));
}
/**
* Display top users page (ordered by points)
* @return array $qa_content
...
...
@@ -59,10 +68,6 @@ class UsersList extends \Q2A\Controllers\BaseController
*/
public
function
newest
()
{
// check we're not using single-sign on integration
if
(
QA_FINAL_EXTERNAL_USERS
)
qa_fatal_error
(
'User accounts are handled by external code'
);
// check we have permission to view this page (moderator or above)
if
(
qa_user_permit_error
(
'permit_view_new_users_page'
))
{
$qa_content
=
qa_content_prepare
();
...
...
@@ -99,10 +104,6 @@ class UsersList extends \Q2A\Controllers\BaseController
*/
public
function
special
()
{
// check we're not using single-sign on integration
if
(
QA_FINAL_EXTERNAL_USERS
)
qa_fatal_error
(
'User accounts are handled by external code'
);
// check we have permission to view this page (moderator or above)
if
(
qa_user_permit_error
(
'permit_view_special_users_page'
))
{
$qa_content
=
qa_content_prepare
();
...
...
@@ -135,10 +136,6 @@ class UsersList extends \Q2A\Controllers\BaseController
*/
public
function
blocked
()
{
// check we're not using single-sign on integration
if
(
QA_FINAL_EXTERNAL_USERS
)
qa_fatal_error
(
'User accounts are handled by external code'
);
// check we have permission to view this page (moderator or above)
if
(
qa_get_logged_in_level
()
<
QA_USER_LEVEL_MODERATOR
)
{
$qa_content
=
qa_content_prepare
();
...
...
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