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
ec882b4b
Commit
ec882b4b
authored
Mar 13, 2017
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle allow_close_own_questions option
parent
4060d1fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
question-view.php
qa-include/pages/question-view.php
+5
-3
No files found.
qa-include/pages/question-view.php
View file @
ec882b4b
...
@@ -134,7 +134,9 @@ function qa_page_q_post_rules($post, $parentpost = null, $siblingposts = null, $
...
@@ -134,7 +134,9 @@ function qa_page_q_post_rules($post, $parentpost = null, $siblingposts = null, $
$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
(
'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_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
);
$close_option
=
$rules
[
'isbyuser'
]
&&
qa_opt
(
'allow_close_own_questions'
)
?
null
:
'permit_close_q'
;
$permiterror_close_open
=
qa_user_permit_error
(
$close_option
,
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
...
@@ -182,9 +184,9 @@ function qa_page_q_post_rules($post, $parentpost = null, $siblingposts = null, $
...
@@ -182,9 +184,9 @@ function qa_page_q_post_rules($post, $parentpost = null, $siblingposts = null, $
$notclosedbyother
=
!
(
$rules
[
'closed'
]
&&
isset
(
$post
[
'closedbyid'
])
&&
!
$rules
[
'authorlast'
]);
$notclosedbyother
=
!
(
$rules
[
'closed'
]
&&
isset
(
$post
[
'closedbyid'
])
&&
!
$rules
[
'authorlast'
]);
$nothiddenbyother
=
!
(
$post
[
'hidden'
]
&&
!
$rules
[
'authorlast'
]);
$nothiddenbyother
=
!
(
$post
[
'hidden'
]
&&
!
$rules
[
'authorlast'
]);
$rules
[
'closeable'
]
=
qa_opt
(
'allow_close_questions'
)
&&
$post
[
'type'
]
==
'Q'
&&
!
$rules
[
'closed'
]
&&
!
$permiterror_close_open
;
$rules
[
'closeable'
]
=
qa_opt
(
'allow_close_questions'
)
&&
$post
[
'type'
]
==
'Q'
&&
!
$rules
[
'closed'
]
&&
$permiterror_close_open
===
false
;
// cannot reopen a question if it's been hidden, or if it was closed by someone else and you don't have global closing permissions
// cannot reopen a question if it's been hidden, or if it was closed by someone else and you don't have global closing permissions
$rules
[
'reopenable'
]
=
$rules
[
'closed'
]
&&
isset
(
$post
[
'closedbyid'
])
&&
!
$permiterror_close_open
&&
!
$post
[
'hidden'
]
$rules
[
'reopenable'
]
=
$rules
[
'closed'
]
&&
isset
(
$post
[
'closedbyid'
])
&&
$permiterror_close_open
===
false
&&
!
$post
[
'hidden'
]
&&
(
$notclosedbyother
||
!
qa_user_permit_error
(
'permit_close_q'
,
null
,
$userlevel
,
true
,
$userfields
));
&&
(
$notclosedbyother
||
!
qa_user_permit_error
(
'permit_close_q'
,
null
,
$userlevel
,
true
,
$userfields
));
$rules
[
'moderatable'
]
=
$rules
[
'queued'
]
&&
!
$permiterror_moderate
;
$rules
[
'moderatable'
]
=
$rules
[
'queued'
]
&&
!
$permiterror_moderate
;
...
...
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