mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-05-12 19:35:52 +03:00
Feature 1026 step 2 :
add author_id column so that guest cannot modify old users comments git-svn-id: http://piwigo.org/svn/trunk@3450 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
1ce50505e4
commit
64c872a83e
6 changed files with 127 additions and 37 deletions
|
@ -1202,13 +1202,14 @@ function is_adviser()
|
|||
* @param action edit/delete
|
||||
* @return bool
|
||||
*/
|
||||
function can_manage_comment($action, $comment_author)
|
||||
function can_manage_comment($action, $comment_author_id)
|
||||
{
|
||||
if (!in_array($action, array('delete','edit'))) {
|
||||
return false;
|
||||
}
|
||||
return (is_admin() ||
|
||||
(($GLOBALS['user']['username'] == $comment_author)
|
||||
(($GLOBALS['user']['id'] == $comment_author_id)
|
||||
&& !is_a_guest()
|
||||
&& $GLOBALS['conf'][sprintf('user_can_%s_comment', $action)]));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue