Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Admin switch  (Read 2881 times)

0 Members and 1 Guest are viewing this topic.

Zajda

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Admin switch
« on: July 21, 2006, 05:00:47 am »

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:
Code: [Select]
<!-- 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.
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Admin switch
« Reply #1 on: July 21, 2006, 05:28:31 am »

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:
Code: [Select]
$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:
Code: [Select]
$user_can_edit = GALLERY_ADMIN_MODE;
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.