diff options
author | nikrou <nikrou@piwigo.org> | 2009-06-23 13:44:58 +0000 |
---|---|---|
committer | nikrou <nikrou@piwigo.org> | 2009-06-23 13:44:58 +0000 |
commit | 9245227e7095ce46272df8ff2990586e43a915c8 (patch) | |
tree | 468819f8b412c91e26512e99a4aa2653566919fc /include/functions_user.inc.php | |
parent | 5b524425892c99aed47fce58023e1f66300d516e (diff) |
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
Diffstat (limited to '')
-rw-r--r-- | include/functions_user.inc.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index d7ef88992..d7aa81f24 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -1198,6 +1198,21 @@ function is_adviser() } /* + * 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 */ |