Recommended patch for bug [ #27 ] Only root can moderate comments
In the file /sql/mysql_tableanddata.php, add the following SQL statements:
$_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (23,'story.comment','Ability to delete comments on stories',1) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (24,'poll.comment','Ability to delete comments on polls',1) "; $_DATA[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (23,3) "; $_DATA[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (24,8) ";
In the function deletecomment (located in /public_html/comment.php) find this section of code (starting at or about line 318):
if (SEC_hasAccess ($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']) == 3) {
Replace it with this:
if ((SEC_hasAccess ($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']) == 3) OR (($type == 'article') AND SEC_hasrights('story.comment')) OR (($type == 'poll') AND SEC_hasrights('poll.comment'))) {
In the function COM_comment (located in /lib-common.php) find this section of code (starting at or about line 2934):
if( SEC_hasAccess( $A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon'] ) == 3 )
Replace it with this:
if( SEC_hasAccess( $A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon'] ) == 3 OR (($type == 'article') AND SEC_hasrights('story.comment')) OR (($type == 'poll') AND SEC_hasrights('poll.comment')))
-- That's it - All Done --