Make operator's email field required

This commit is contained in:
Dmitriy Simushev 2013-07-08 10:24:34 +00:00
parent 1a0b315365
commit b41405ea09
2 changed files with 3 additions and 2 deletions

View File

@ -52,8 +52,9 @@ if ((isset($_POST['login']) || !is_capable(CAN_ADMINISTRATE, $operator)) && isse
$errors[] = getlocal("page_agent.error.wrong_login");
}
if ($email != '' && !is_valid_email($email))
if ($email == '' || !is_valid_email($email)) {
$errors[] = wrong_field("form.field.mail");
}
if ($code != '' && (! preg_match("/^[A-z0-9_]+$/", $code))) {
$errors[] = getlocal("page_agent.error.wrong_agent_code");

View File

@ -63,7 +63,7 @@ require_once('inc_errors.php');
</div>
<div class="field">
<div class="flabel"><?php echo getlocal('form.field.mail') ?></div>
<div class="flabel"><?php echo getlocal('form.field.mail') ?><span class="required">*</span></div>
<div class="fvalue">
<input type="text" name="email" size="40" value="<?php echo form_value('email') ?>" class="formauth"<?php echo $page['canmodify'] ? "" : " disabled=\"disabled\"" ?>/>
</div>