diff options
author | nikrou <nikrou@piwigo.org> | 2009-06-23 21:18:16 +0000 |
---|---|---|
committer | nikrou <nikrou@piwigo.org> | 2009-06-23 21:18:16 +0000 |
commit | 64c872a83e726ec4d298be479b57dae13fb2c0c6 (patch) | |
tree | 6478da0a8067f078905038c312767690b440487c /include/functions_user.inc.php | |
parent | 1ce50505e4b9a6b533146e70902a7e426fd872a7 (diff) |
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
Diffstat (limited to 'include/functions_user.inc.php')
-rw-r--r-- | include/functions_user.inc.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index d7aa81f24..02c1e7e13 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -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)])); } |