forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: Burana on April 18, 2004, 10:44:52 am

Title: Users commenting with default name. How to disable?
Post by: Burana on April 18, 2004, 10:44:52 am
I have problems with users commenting pictures with default name entry. For example here (http://www.vastus.net/coppermine/displayimage.php?album=32&pos=12) user just dropped short comment without adding username. Default is "Nimesi". I dont want to disable anonymous commenting, just to prevent adding comments without proper name.

Is there a simple way to fix this?
Title: [Solved]:Users commenting with default name. How to disable?
Post by: Joachim Müller on April 18, 2004, 12:56:39 pm
I suggest adding the default name to the word censor in your language file; edit lang/your_language_file.php (e.g. english.php) and find
Code: [Select]
// For the word censorAdd the default username to the word censor list that comes after it.

GauGau
Title: [Solved]:Users commenting with default name. How to disable?
Post by: Burana on April 18, 2004, 01:20:36 pm
That doesn't seem to work. It accepts the forbidden word as a name and simply censors it from the comment part. Example on the same page.
Title: [Solved]:Users commenting with default name. How to disable?
Post by: Joachim Müller on April 18, 2004, 01:25:28 pm
I guess you'll then have to add an if/then switch to db_input.php, or you can have a blank the name input field pre-filled with a blank instead of "your name".

Letting anon users post comments is not a good idea imo, as it will always result in user misbehaving (either by not filling in their name or by posting "funny" comments, hiding behind anonymity).

GauGau
Title: [Solved]:Users commenting with default name. How to disable?
Post by: Burana on April 18, 2004, 01:37:47 pm
Simple problems often have simple solutions. From the language file I just changed
Code: [Select]
'your_name' => 'Nimesi'
to
Code: [Select]
'your_name' => ''
Now it simply prompts ignorant user to enter something into the name-field, instead of simpy accepting the formerly-default 'Nimesi'.

But thanks for the pointers, they really helped.
Title: Re: [Solved]:Users commenting with default name. How to disable?
Post by: jaydj on December 03, 2004, 01:53:31 am
i tested my own installation and typed in censored words to check and see how coppermine deals with them.

Works fine for censors, replaces those words with ....

It doesn't censor usernames assuming you've configured it to "allow anyone to post comment"
So users can place anything under the "Your Name", even if it's a censored word.  How do I fix this ? Or where exactly in the code/files need to be edited ? Any existing hack/mod for this ?

Thanks!
Title: Re: [Solved]:Users commenting with default name. How to disable?
Post by: Nibbler on December 03, 2004, 11:36:42 am
Looks like you'd need to edit db_input.php to insert

Code: [Select]
check_comment($HTTP_POST_VARS['msg_author']);
under

Code: [Select]
check_comment($HTTP_POST_VARS['msg_body']);
It already happens for updating the comment it seems it is missing here.

[added to stable cvs (- apologies for the typo in the commit comment)]
Title: Re: [Solved]:Users commenting with default name. How to disable?
Post by: jaydj on December 15, 2004, 12:47:40 pm
thanks ! worked like a charm :)
added that coded and tested it.  yey ! thanks for the help !