fixed a few small bugs in the contactform: verification can be turned off now, 2. customfiled is now disable if not set, email-address verification allows for "-" in the mail part

This commit is contained in:
Ralf Becker 2007-10-31 11:13:28 +00:00
parent 3938faeb19
commit ba380b7540
3 changed files with 10 additions and 8 deletions

View File

@ -37,7 +37,7 @@ class addressbook_contactform
if (is_array($content))
{
if ($content['captcha'] != $content['captcha_result'])
if (isset($content['captcha_result']) && $content['captcha'] != $content['captcha_result'])
{
$tpl->set_validation_error('captcha',lang('Wrong - try again ...'));
}
@ -134,9 +134,11 @@ class addressbook_contactform
{
$n = $num1; $num1 = $num2; $num2 = $n;
}
$content['captcha_task'] = sprintf('%d - %d =',$num1,$num2);
$preserv['captcha_result'] = $num1-$num2;
if (in_array('captcha',$fields))
{
$content['captcha_task'] = sprintf('%d - %d =',$num1,$num2);
$preserv['captcha_result'] = $num1-$num2;
}
return $tpl->exec('addressbook.addressbook_contactform.display',$content,$sel_options,$readonlys,$preserv);
}
}

File diff suppressed because one or more lines are too long

View File

@ -39,7 +39,7 @@
<row disabled="!@show[email]">
<image src="email.png"/>
<description value="Email"/>
<textbox size="64" maxlength="64" validator="/^[a-z0-9.-_]+@[a-z0-9-]+(\.[a-z0-9-]+)+$/i" span="4" id="email" needed="1"/>
<textbox size="64" maxlength="64" validator="/^[a-z0-9._-]+@[a-z0-9-]+(\.[a-z0-9-]+)+$/i" span="4" id="email" needed="1"/>
<description class="redItalic" value="*"/>
</row>
<row disabled="!@show[tel_work]">
@ -111,7 +111,7 @@
<textbox id="@customfield[1]" span="4" needed="1" size="64"/>
<description class="redItalic" value="*"/>
</row>
<row>
<row disabled="!@show[custom2]">
<description/>
<description value="@customlabel[2]"/>
<textbox id="@customfield[2]" span="4" size="64"/>