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
8ff4bddf
Commit
8ff4bddf
authored
Nov 09, 2016
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add permission to define what users can see the special users page
parent
f22e8abb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
13 deletions
+31
-13
format.php
qa-include/app/format.php
+21
-10
options.php
qa-include/app/options.php
+3
-0
qa-lang-profile.php
qa-include/lang/qa-lang-profile.php
+1
-0
admin-default.php
qa-include/pages/admin/admin-default.php
+5
-1
users-special.php
qa-include/pages/users-special.php
+1
-2
No files found.
qa-include/app/format.php
View file @
8ff4bddf
...
@@ -1299,26 +1299,37 @@
...
@@ -1299,26 +1299,37 @@
Return the sub navigation structure for user listing pages
Return the sub navigation structure for user listing pages
*/
*/
{
{
if
((
!
QA_FINAL_EXTERNAL_USERS
)
&&
(
qa_get_logged_in_level
()
>=
QA_USER_LEVEL_MODERATOR
))
{
if
(
QA_FINAL_EXTERNAL_USERS
)
{
return
array
(
return
null
;
'users$'
=>
array
(
}
$menuItems
=
array
();
$moderatorPlus
=
qa_get_logged_in_level
()
>=
QA_USER_LEVEL_MODERATOR
;
$showSpecialUsersPage
=
!
qa_user_permit_error
(
'permit_view_special_users_page'
);
if
(
$moderatorPlus
||
$showSpecialUsersPage
)
{
// We want to show this item when more than one item should be displayed
$menuItems
[
'users$'
]
=
array
(
'url'
=>
qa_path_html
(
'users'
),
'url'
=>
qa_path_html
(
'users'
),
'label'
=>
qa_lang_html
(
'main/highest_users'
),
'label'
=>
qa_lang_html
(
'main/highest_users'
),
),
);
}
'users/special'
=>
array
(
if
(
$showSpecialUsersPage
)
{
$menuItems
[
'users/special'
]
=
array
(
'label'
=>
qa_lang
(
'users/special_users'
),
'label'
=>
qa_lang
(
'users/special_users'
),
'url'
=>
qa_path_html
(
'users/special'
),
'url'
=>
qa_path_html
(
'users/special'
),
),
);
}
'users/blocked'
=>
array
(
if
(
$moderatorPlus
)
{
$menuItems
[
'users/blocked'
]
=
array
(
'label'
=>
qa_lang
(
'users/blocked_users'
),
'label'
=>
qa_lang
(
'users/blocked_users'
),
'url'
=>
qa_path_html
(
'users/blocked'
),
'url'
=>
qa_path_html
(
'users/blocked'
),
),
);
);
}
}
else
return
$menuItems
;
return
null
;
}
}
...
...
qa-include/app/options.php
View file @
8ff4bddf
...
@@ -320,6 +320,7 @@
...
@@ -320,6 +320,7 @@
'permit_post_wall'
=>
QA_PERMIT_CONFIRMED
,
'permit_post_wall'
=>
QA_PERMIT_CONFIRMED
,
'permit_select_a'
=>
QA_PERMIT_EXPERTS
,
'permit_select_a'
=>
QA_PERMIT_EXPERTS
,
'permit_view_q_page'
=>
QA_PERMIT_ALL
,
'permit_view_q_page'
=>
QA_PERMIT_ALL
,
'permit_view_special_users_page'
=>
QA_PERMIT_MODERATORS
,
'permit_view_voters_flaggers'
=>
QA_PERMIT_ADMINS
,
'permit_view_voters_flaggers'
=>
QA_PERMIT_ADMINS
,
'permit_vote_a'
=>
QA_PERMIT_USERS
,
'permit_vote_a'
=>
QA_PERMIT_USERS
,
'permit_vote_down'
=>
QA_PERMIT_USERS
,
'permit_vote_down'
=>
QA_PERMIT_USERS
,
...
@@ -788,6 +789,8 @@
...
@@ -788,6 +789,8 @@
if
(
qa_opt
(
'allow_user_walls'
))
if
(
qa_opt
(
'allow_user_walls'
))
$permits
[]
=
'permit_post_wall'
;
$permits
[]
=
'permit_post_wall'
;
$permits
[]
=
'permit_view_special_users_page'
;
return
$permits
;
return
$permits
;
}
}
...
...
qa-include/lang/qa-lang-profile.php
View file @
8ff4bddf
...
@@ -56,6 +56,7 @@
...
@@ -56,6 +56,7 @@
'permit_retag'
=>
'Retagging any question'
,
'permit_retag'
=>
'Retagging any question'
,
'permit_select_a'
=>
'Selecting answer for any question'
,
'permit_select_a'
=>
'Selecting answer for any question'
,
'permit_view_q_page'
=>
'Viewing question pages'
,
'permit_view_q_page'
=>
'Viewing question pages'
,
'permit_view_special_users_page'
=>
'Viewing the special users page'
,
'permit_view_voters_flaggers'
=>
'Viewing who voted or flagged posts'
,
'permit_view_voters_flaggers'
=>
'Viewing who voted or flagged posts'
,
'permit_vote_a'
=>
'Voting on answers'
,
'permit_vote_a'
=>
'Voting on answers'
,
'permit_vote_down'
=>
'Voting posts down'
,
'permit_vote_down'
=>
'Voting posts down'
,
...
...
qa-include/pages/admin/admin-default.php
View file @
8ff4bddf
...
@@ -1343,6 +1343,7 @@ foreach ($showoptions as $optionname) {
...
@@ -1343,6 +1343,7 @@ foreach ($showoptions as $optionname) {
break
;
break
;
case
'permit_view_q_page'
:
case
'permit_view_q_page'
:
case
'permit_view_special_users_page'
:
case
'permit_post_q'
:
case
'permit_post_q'
:
case
'permit_post_a'
:
case
'permit_post_a'
:
case
'permit_post_c'
:
case
'permit_post_c'
:
...
@@ -1370,7 +1371,7 @@ foreach ($showoptions as $optionname) {
...
@@ -1370,7 +1371,7 @@ foreach ($showoptions as $optionname) {
else
else
$optionfield
[
'label'
]
=
qa_lang_html
(
'profile/'
.
$optionname
)
.
':'
;
$optionfield
[
'label'
]
=
qa_lang_html
(
'profile/'
.
$optionname
)
.
':'
;
if
(
$optionname
==
'permit_view_q_page'
||
$optionname
==
'permit_post_q'
||
$optionname
==
'permit_post_a'
||
$optionname
==
'permit_post_c'
||
$optionname
==
'permit_anon_view_ips'
)
if
(
$optionname
==
'permit_view_q_page'
||
$optionname
==
'permit_
view_special_users_page'
||
$optionname
==
'permit_
post_q'
||
$optionname
==
'permit_post_a'
||
$optionname
==
'permit_post_c'
||
$optionname
==
'permit_anon_view_ips'
)
$widest
=
QA_PERMIT_ALL
;
$widest
=
QA_PERMIT_ALL
;
elseif
(
$optionname
==
'permit_close_q'
||
$optionname
==
'permit_select_a'
||
$optionname
==
'permit_moderate'
||
$optionname
==
'permit_hide_show'
)
elseif
(
$optionname
==
'permit_close_q'
||
$optionname
==
'permit_select_a'
||
$optionname
==
'permit_moderate'
||
$optionname
==
'permit_hide_show'
)
$widest
=
QA_PERMIT_POINTS
;
$widest
=
QA_PERMIT_POINTS
;
...
@@ -1384,6 +1385,9 @@ foreach ($showoptions as $optionname) {
...
@@ -1384,6 +1385,9 @@ foreach ($showoptions as $optionname) {
if
(
$optionname
==
'permit_view_q_page'
)
{
if
(
$optionname
==
'permit_view_q_page'
)
{
$narrowest
=
QA_PERMIT_APPROVED
;
$narrowest
=
QA_PERMIT_APPROVED
;
$dopoints
=
false
;
$dopoints
=
false
;
}
elseif
(
$optionname
==
'permit_view_special_users_page'
)
{
$narrowest
=
QA_PERMIT_SUPERS
;
$dopoints
=
false
;
}
elseif
(
$optionname
==
'permit_edit_c'
||
$optionname
==
'permit_close_q'
||
$optionname
==
'permit_select_a'
||
$optionname
==
'permit_moderate'
||
$optionname
==
'permit_hide_show'
||
$optionname
==
'permit_anon_view_ips'
)
}
elseif
(
$optionname
==
'permit_edit_c'
||
$optionname
==
'permit_close_q'
||
$optionname
==
'permit_select_a'
||
$optionname
==
'permit_moderate'
||
$optionname
==
'permit_hide_show'
||
$optionname
==
'permit_anon_view_ips'
)
$narrowest
=
QA_PERMIT_MODERATORS
;
$narrowest
=
QA_PERMIT_MODERATORS
;
elseif
(
$optionname
==
'permit_post_c'
||
$optionname
==
'permit_edit_q'
||
$optionname
==
'permit_retag_cat'
||
$optionname
==
'permit_edit_a'
||
$optionname
==
'permit_flag'
)
elseif
(
$optionname
==
'permit_post_c'
||
$optionname
==
'permit_edit_q'
||
$optionname
==
'permit_retag_cat'
||
$optionname
==
'permit_edit_a'
||
$optionname
==
'permit_flag'
)
...
...
qa-include/pages/users-special.php
View file @
8ff4bddf
...
@@ -43,7 +43,7 @@ $users = qa_db_select_with_pending(qa_db_users_from_level_selectspec(QA_USER_LEV
...
@@ -43,7 +43,7 @@ $users = qa_db_select_with_pending(qa_db_users_from_level_selectspec(QA_USER_LEV
// Check we have permission to view this page (moderator or above)
// Check we have permission to view this page (moderator or above)
if
(
qa_
get_logged_in_level
()
<
QA_USER_LEVEL_MODERATOR
)
{
if
(
qa_
user_permit_error
(
'permit_view_special_users_page'
)
)
{
$qa_content
=
qa_content_prepare
();
$qa_content
=
qa_content_prepare
();
$qa_content
[
'error'
]
=
qa_lang_html
(
'users/no_permission'
);
$qa_content
[
'error'
]
=
qa_lang_html
(
'users/no_permission'
);
return
$qa_content
;
return
$qa_content
;
...
@@ -77,5 +77,4 @@ foreach ($users as $user) {
...
@@ -77,5 +77,4 @@ foreach ($users as $user) {
$qa_content
[
'navigation'
][
'sub'
]
=
qa_users_sub_navigation
();
$qa_content
[
'navigation'
][
'sub'
]
=
qa_users_sub_navigation
();
return
$qa_content
;
return
$qa_content
;
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