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
c1e7ddfd
Commit
c1e7ddfd
authored
Feb 01, 2016
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove more calls to qa_user_permit_error
parent
a2e7ae23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
question-view.php
qa-include/pages/question-view.php
+8
-7
No files found.
qa-include/pages/question-view.php
View file @
c1e7ddfd
...
@@ -121,14 +121,15 @@
...
@@ -121,14 +121,15 @@
$permiterror_edit
=
qa_user_permit_error
(
$edit_option
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_edit
=
qa_user_permit_error
(
$edit_option
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_retagcat
=
qa_user_permit_error
(
'permit_retag_cat'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_retagcat
=
qa_user_permit_error
(
'permit_retag_cat'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_flag
=
qa_user_permit_error
(
'permit_flag'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_flag
=
qa_user_permit_error
(
'permit_flag'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_hide_show
=
qa_user_permit_error
(
$rules
[
'isbyuser'
]
?
null
:
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_hide_show
=
qa_user_permit_error
(
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_hide_show_self
=
$rules
[
'isbyuser'
]
?
qa_user_permit_error
(
null
,
null
,
$userlevel
,
true
,
$userfields
)
:
$permiterror_hide_show
;
$permiterror_close_open
=
qa_user_permit_error
(
$rules
[
'isbyuser'
]
?
null
:
'permit_close_q'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_close_open
=
qa_user_permit_error
(
$rules
[
'isbyuser'
]
?
null
:
'permit_close_q'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_moderate
=
qa_user_permit_error
(
'permit_moderate'
,
null
,
$userlevel
,
true
,
$userfields
);
$permiterror_moderate
=
qa_user_permit_error
(
'permit_moderate'
,
null
,
$userlevel
,
true
,
$userfields
);
// General permissions
// General permissions
$rules
[
'authorlast'
]
=
!
isset
(
$post
[
'lastuserid'
])
||
$post
[
'lastuserid'
]
===
$post
[
'userid'
];
$rules
[
'authorlast'
]
=
!
isset
(
$post
[
'lastuserid'
])
||
$post
[
'lastuserid'
]
===
$post
[
'userid'
];
$rules
[
'viewable'
]
=
$post
[
'hidden'
]
?
!
$permiterror_hide_show
:
(
$rules
[
'queued'
]
?
(
$rules
[
'isbyuser'
]
||
!
$permiterror_moderate
)
:
true
);
$rules
[
'viewable'
]
=
$post
[
'hidden'
]
?
!
$permiterror_hide_show
_self
:
(
$rules
[
'queued'
]
?
(
$rules
[
'isbyuser'
]
||
!
$permiterror_moderate
)
:
true
);
// Answer, comment and edit might show the button even if the user still needs to do something (e.g. log in)
// Answer, comment and edit might show the button even if the user still needs to do something (e.g. log in)
...
@@ -163,7 +164,7 @@
...
@@ -163,7 +164,7 @@
&&
!@
$post
[
'userflag'
]
&&
!
in_array
(
$permiterror_flag
,
$button_errors
);
&&
!@
$post
[
'userflag'
]
&&
!
in_array
(
$permiterror_flag
,
$button_errors
);
$rules
[
'flagtohide'
]
=
$rules
[
'flagbutton'
]
&&
!
$permiterror_flag
&&
(
$post
[
'flagcount'
]
+
1
)
>=
qa_opt
(
'flagging_hide_after'
);
$rules
[
'flagtohide'
]
=
$rules
[
'flagbutton'
]
&&
!
$permiterror_flag
&&
(
$post
[
'flagcount'
]
+
1
)
>=
qa_opt
(
'flagging_hide_after'
);
$rules
[
'unflaggable'
]
=
@
$post
[
'userflag'
]
&&
!
$post
[
'hidden'
];
$rules
[
'unflaggable'
]
=
@
$post
[
'userflag'
]
&&
!
$post
[
'hidden'
];
$rules
[
'clearflaggable'
]
=
(
$post
[
'flagcount'
]
>=
(
@
$post
[
'userflag'
]
?
2
:
1
))
&&
!
qa_user_permit_error
(
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
)
;
$rules
[
'clearflaggable'
]
=
$post
[
'flagcount'
]
>=
(
@
$post
[
'userflag'
]
?
2
:
1
)
&&
!
$permiterror_hide_show
;
// Other actions only show the button if it's immediately possible
// Other actions only show the button if it's immediately possible
...
@@ -177,12 +178,12 @@
...
@@ -177,12 +178,12 @@
$rules
[
'moderatable'
]
=
$rules
[
'queued'
]
&&
!
$permiterror_moderate
;
$rules
[
'moderatable'
]
=
$rules
[
'queued'
]
&&
!
$permiterror_moderate
;
// cannot hide a question if it was closed by someone else and you don't have global hiding permissions
// cannot hide a question if it was closed by someone else and you don't have global hiding permissions
$rules
[
'hideable'
]
=
!
$post
[
'hidden'
]
&&
(
$rules
[
'isbyuser'
]
||
!
$rules
[
'queued'
])
&&
!
$permiterror_hide_show
$rules
[
'hideable'
]
=
!
$post
[
'hidden'
]
&&
(
$rules
[
'isbyuser'
]
||
!
$rules
[
'queued'
])
&&
!
$permiterror_hide_show
_self
&&
(
$notclosedbyother
||
!
qa_user_permit_error
(
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
)
);
&&
(
$notclosedbyother
||
!
$permiterror_hide_show
);
// means post can be reshown immediately without checking whether it needs moderation
// means post can be reshown immediately without checking whether it needs moderation
$rules
[
'reshowimmed'
]
=
$post
[
'hidden'
]
&&
!
qa_user_permit_error
(
'permit_hide_show'
,
null
,
$userlevel
,
true
,
$userfields
)
;
$rules
[
'reshowimmed'
]
=
$post
[
'hidden'
]
&&
!
$permiterror_hide_show
;
// cannot reshow a question if it was hidden by someone else, or if it has flags - unless you have global hide/show permissions
// cannot reshow a question if it was hidden by someone else, or if it has flags - unless you have global hide/show permissions
$rules
[
'reshowable'
]
=
$post
[
'hidden'
]
&&
(
!
$permiterror_hide_show
)
&&
$rules
[
'reshowable'
]
=
$post
[
'hidden'
]
&&
(
!
$permiterror_hide_show
_self
)
&&
(
$rules
[
'reshowimmed'
]
||
(
$nothiddenbyother
&&
!
$post
[
'flagcount'
]));
(
$rules
[
'reshowimmed'
]
||
(
$nothiddenbyother
&&
!
$post
[
'flagcount'
]));
$rules
[
'deleteable'
]
=
$post
[
'hidden'
]
&&
!
qa_user_permit_error
(
'permit_delete_hidden'
,
null
,
$userlevel
,
true
,
$userfields
);
$rules
[
'deleteable'
]
=
$post
[
'hidden'
]
&&
!
qa_user_permit_error
(
'permit_delete_hidden'
,
null
,
$userlevel
,
true
,
$userfields
);
...
...
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