Admin switch Admin switch
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Admin switch

Started by Zajda, July 21, 2006, 05:00:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zajda

I dont want users in my gallery to edit or delete their comments. How to do this in 1.4.8 version?


I know that buttons "edit" and "delete" are:
<!-- BEGIN buttons -->
                                       <a href="javascript:;" onclick="blocking('cbody{MSG_ID}','', 'block'); blocking('cedit{MSG_ID}','', 'block'); return false;" title="{EDIT_TITLE}"><img src="images/edit.gif" border="0" align="middle" /></a>
                                     <a href="delete.php?msg_id={MSG_ID}&what=comment"  onclick="return confirm('{CONFIRM_DELETE}');"><img src="images/delete.gif" border="0" align="middle" /></a>
<!-- END buttons -->


But i would like to disable this for normal users and keep it working for me - admin. So how to do a switch? Thanks.

Paver

Yes, that is the template code.  So if you look where that is used, it is in the function theme_html_comments.  Scanning the code, you'll see this line:
$user_can_edit = (GALLERY_ADMIN_MODE) || (USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS) || (!USER_ID && USER_CAN_POST_COMMENTS && ($USER['ID'] == $row['author_md5_id']));

If you replace the line above with this line, you should have what you want:
$user_can_edit = GALLERY_ADMIN_MODE;