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:
nikrou 2009-06-23 21:18:16 +00:00
parent 1ce50505e4
commit 64c872a83e
6 changed files with 127 additions and 37 deletions

View file

@ -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)]));
}