coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: StoneHalo on January 12, 2004, 05:09:07 PM

Title: Username editable
Post by: StoneHalo on January 12, 2004, 05:09:07 PM
I have the integration with vBulletin. I noticed when editing a comment it allows them to change their username (the name of the person leaving the comment), this isn't good!

Could a future version only allow the content of the comment to be editable, not the username?

Thanks
Title: Username editable
Post by: Nibbler on January 12, 2004, 07:06:32 PM
I had this issue before here (http://forum.coppermine-gallery.net/viewtopic.php?p=8823). My solution was to make these changes:

Change:


$update = db_query("UPDATE {$CONFIG['TABLE_COMMENTS']} SET msg_body='$msg_body', msg_author='$msg_author' WHERE msg_id='$msg_id' AND author_id ='" . USER_ID . "' LIMIT 1");


to:


$update = db_query("UPDATE {$CONFIG['TABLE_COMMENTS']} SET msg_body='$msg_body', WHERE msg_id='$msg_id' AND author_id ='" . USER_ID . "' LIMIT 1");


and:


$update = db_query("UPDATE {$CONFIG['TABLE_COMMENTS']} SET msg_body='$msg_body', msg_author='$msg_author' WHERE msg_id='$msg_id' AND author_md5_id ='{$USER['ID']}' AND author_id = '0' LIMIT 1");


to:


$update = db_query("UPDATE {$CONFIG['TABLE_COMMENTS']} SET msg_body='$msg_body' WHERE msg_id='$msg_id' AND author_md5_id ='{$USER['ID']}' AND author_id = '0' LIMIT 1");



Now only admin can change the name of the poster. It would be nice to stop the name box being changeable too, but I couldnt find where to do that.
Title: Username editable
Post by: StoneHalo on January 12, 2004, 07:47:52 PM
Ok, thanks, I'll try that. What file do I make these changes in?
Title: Username editable
Post by: Nibbler on January 12, 2004, 08:00:04 PM
db_input.php
Title: Username editable
Post by: StoneHalo on January 12, 2004, 09:47:42 PM
Thanks Nibbler.

If anyone knows a way to disable the usename being editable when editing a comment please let us know!
Title: Username editable
Post by: Joachim Müller on January 13, 2004, 05:39:37 AM
just made a tracker out of this bugger: #875870 (http://sourceforge.net/tracker/index.php?func=detail&aid=875870&group_id=89658&atid=590907)

GauGau
Title: Username editable
Post by: StoneHalo on January 13, 2004, 11:41:32 AM
Thanks GauGau  :D I'll keep an eye on it.
Title: Username editable
Post by: Joachim Müller on January 29, 2004, 08:48:25 AM
just committed the changes Nibbler proposd to the devel branch of the cvs and updated the tracker. Waiting for a dev team member to confirm the fix.

GauGau
Title: Username editable
Post by: Flappo on March 16, 2004, 05:05:07 PM
The solution above did not work at mine so i did the following:

i removed

, msg_author='$msg_author'

from

 $update = db_query("UPDATE {$CONFIG['TABLE_COMMENTS']} SET msg_body='$msg_body', msg_author='$msg_author' WHERE msg_id='$msg_id' AND author_id ='" . USER_ID . "' LIMIT 1");

maybe it is not the finest solution, but it works.... if a user changes his name while editing a comment the query does not change the name of the user.. only when you are admin you can change it.....