mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-06 09:52:29 +02: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:
@@ -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)]));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user