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
d90bb416
Commit
d90bb416
authored
Dec 06, 2016
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add permission option for new users page
parent
071369a2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
6 deletions
+23
-6
format.php
qa-include/app/format.php
+7
-3
options.php
qa-include/app/options.php
+2
-1
qa-lang-profile.php
qa-include/lang/qa-lang-profile.php
+1
-0
admin-default.php
qa-include/pages/admin/admin-default.php
+3
-2
users-newest.php
qa-include/pages/users-newest.php
+10
-0
No files found.
qa-include/app/format.php
View file @
d90bb416
...
@@ -1294,10 +1294,10 @@
...
@@ -1294,10 +1294,10 @@
}
}
/**
* Return the sub navigation structure for user listing pages
*/
function
qa_users_sub_navigation
()
function
qa_users_sub_navigation
()
/*
Return the sub navigation structure for user listing pages
*/
{
{
if
(
QA_FINAL_EXTERNAL_USERS
)
{
if
(
QA_FINAL_EXTERNAL_USERS
)
{
return
null
;
return
null
;
...
@@ -1306,12 +1306,16 @@
...
@@ -1306,12 +1306,16 @@
$menuItems
=
array
();
$menuItems
=
array
();
$moderatorPlus
=
qa_get_logged_in_level
()
>=
QA_USER_LEVEL_MODERATOR
;
$moderatorPlus
=
qa_get_logged_in_level
()
>=
QA_USER_LEVEL_MODERATOR
;
$showNewUsersPage
=
!
qa_user_permit_error
(
'permit_view_new_users_page'
);
$showSpecialUsersPage
=
!
qa_user_permit_error
(
'permit_view_special_users_page'
);
$showSpecialUsersPage
=
!
qa_user_permit_error
(
'permit_view_special_users_page'
);
if
(
$moderatorPlus
||
$showNewUsersPage
||
$showSpecialUsersPage
)
{
// We want to show this item when more than one item should be displayed
$menuItems
[
'users$'
]
=
array
(
$menuItems
[
'users$'
]
=
array
(
'label'
=>
qa_lang_html
(
'main/highest_users'
),
'label'
=>
qa_lang_html
(
'main/highest_users'
),
'url'
=>
qa_path_html
(
'users'
),
'url'
=>
qa_path_html
(
'users'
),
);
);
}
$menuItems
[
'users/new'
]
=
array
(
$menuItems
[
'users/new'
]
=
array
(
'label'
=>
qa_lang_html
(
'main/newest_users'
),
'label'
=>
qa_lang_html
(
'main/newest_users'
),
...
...
qa-include/app/options.php
View file @
d90bb416
...
@@ -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_new_users_page'
=>
QA_PERMIT_EDITORS
,
'permit_view_special_users_page'
=>
QA_PERMIT_MODERATORS
,
'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
,
...
@@ -789,7 +790,7 @@
...
@@ -789,7 +790,7 @@
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'
;
array_push
(
$permits
,
'permit_view_new_users_page'
,
'permit_view_special_users_page'
)
;
return
$permits
;
return
$permits
;
}
}
...
...
qa-include/lang/qa-lang-profile.php
View file @
d90bb416
...
@@ -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_new_users_page'
=>
'Viewing the newest users page'
,
'permit_view_special_users_page'
=>
'Viewing the special users page'
,
'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'
,
...
...
qa-include/pages/admin/admin-default.php
View file @
d90bb416
...
@@ -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_new_users_page'
:
case
'permit_view_special_users_page'
:
case
'permit_view_special_users_page'
:
case
'permit_post_q'
:
case
'permit_post_q'
:
case
'permit_post_a'
:
case
'permit_post_a'
:
...
@@ -1371,7 +1372,7 @@ foreach ($showoptions as $optionname) {
...
@@ -1371,7 +1372,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_view_special_users_page'
||
$optionname
==
'permit_post_q'
||
$optionname
==
'permit_post_a'
||
$optionname
==
'permit_post_c'
||
$optionname
==
'permit_anon_view_ips'
)
if
(
in_array
(
$optionname
,
array
(
'permit_view_q_page'
,
'permit_view_new_users_page'
,
'permit_view_special_users_page'
,
'permit_post_q'
,
'permit_post_a'
,
'permit_post_c'
,
'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
;
...
@@ -1385,7 +1386,7 @@ foreach ($showoptions as $optionname) {
...
@@ -1385,7 +1386,7 @@ 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'
)
{
}
elseif
(
$optionname
==
'permit_view_special_users_page'
||
$optionname
==
'permit_view_new_users_page'
)
{
$narrowest
=
QA_PERMIT_SUPERS
;
$narrowest
=
QA_PERMIT_SUPERS
;
$dopoints
=
false
;
$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'
)
...
...
qa-include/pages/users-newest.php
View file @
d90bb416
...
@@ -33,6 +33,16 @@ require_once QA_INCLUDE_DIR . 'app/format.php';
...
@@ -33,6 +33,16 @@ require_once QA_INCLUDE_DIR . 'app/format.php';
if
(
QA_FINAL_EXTERNAL_USERS
)
if
(
QA_FINAL_EXTERNAL_USERS
)
qa_fatal_error
(
'User accounts are handled by external code'
);
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
();
$qa_content
[
'error'
]
=
qa_lang_html
(
'users/no_permission'
);
return
$qa_content
;
}
// Get list of all users
// Get list of all users
$start
=
qa_get_start
();
$start
=
qa_get_start
();
...
...
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