Sorry everyone. It was just a typo by me. Damn these monkey fingers.
1 2005-08-02 08:21
Re: Validating realname field in profile.php (1 replies, posted in PunBB 1.2 modifications, plugins and integrations)
2 2005-08-01 18:26
Topic: Validating realname field in profile.php (1 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Hi
I need to ensure users sign up with a real name as the forum registration forms part of other functionality on the site. I can get this to work on the register.php ok but I seem to have a problem in the profile.php script. Obviously I need to ensure that the real name field is validated here as well.
I've added the following into the $lang_profile array in lang/profile.php:
'Realname too short' => 'Your real name must be 4 characters in length.',
'Realname censor' => 'The real name you entered contains one or more censored words. Please choose your real name!',
and the following into profile.php:
// Validate real name
$form['realname'] = trim($_POST['realname']);
if (strlen($realname) < 4)
message($lang_profile['Real name too short']);
// Check realname for any censored words
if ($pun_config['o_censoring'] == '1')
{
// If the censored username differs from the username
if (censor_words($form['realname']) != $form['realname'])
message($lang_profile['Realname censor']);
}
which is taken from the username validation from register.php
The problem is no message appears to warn users that their real name needs to be 4 chars or more.
I can't see where message(); is defined or where the the warning is pulled in from. IE the bit that produces the following div:
<div id="msg" class="block">
Any help is greatly appreciated.
Cheers