mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-21 00:53:04 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user