Feature 1026 : Modify / delete comments for users

+ update config table content
 + minor modification of Sylvia theme
 + need refactoring

git-svn-id: http://piwigo.org/svn/trunk@3445 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
nikrou
2009-06-23 13:44:58 +00:00
parent 5b52442589
commit 9245227e70
16 changed files with 365 additions and 51 deletions
+15
View File
@@ -1197,6 +1197,21 @@ function is_adviser()
return ($user['adviser'] == 'true');
}
/*
* Return if current user can edit/delete a comment
* @param action edit/delete
* @return bool
*/
function can_manage_comment($action, $comment_author)
{
if (!in_array($action, array('delete','edit'))) {
return false;
}
return (is_admin() ||
(($GLOBALS['user']['username'] == $comment_author)
&& $GLOBALS['conf'][sprintf('user_can_%s_comment', $action)]));
}
/*
* Return mail address as display text
* @return string