Ignore:
Timestamp:
Jun 23, 2009, 3:44:58 PM (15 years ago)
Author:
nikrou
Message:

Feature 1026 : Modify / delete comments for users

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions_user.inc.php

    r3282 r3445  
    11961196
    11971197  return ($user['adviser'] == 'true');
     1198}
     1199
     1200/*
     1201 * Return if current user can edit/delete a comment
     1202 * @param action edit/delete
     1203 * @return bool
     1204 */
     1205function can_manage_comment($action, $comment_author)
     1206{
     1207  if (!in_array($action, array('delete','edit'))) {
     1208    return false;
     1209  }
     1210  return (is_admin() ||
     1211          (($GLOBALS['user']['username'] == $comment_author)
     1212           && $GLOBALS['conf'][sprintf('user_can_%s_comment', $action)]));
    11981213}
    11991214
Note: See TracChangeset for help on using the changeset viewer.