implement check_occurence_name on account creation
This commit is contained in:
parent
0bfe7a2aac
commit
6f0106d4d0
|
@ -388,10 +388,20 @@ if(!empty($_POST)) {
|
|||
|
||||
/* Test de validation du formulaire */
|
||||
if($form->verify(TRUE)) {
|
||||
$is_domain_present = check_occurence_name($form->getField('domain')->getValue());
|
||||
$is_alias_present = check_occurence_name($form->getField('domain_alias')->getValue());
|
||||
|
||||
if (!$is_domain_present && !$is_alias_present) {
|
||||
if ($conf['cluster'])
|
||||
$exec_info = web_add_cluster($form, $conf['admin']['mail']);
|
||||
else
|
||||
$exec_info = web_add($form, $conf['admin']['mail']);
|
||||
}
|
||||
else {
|
||||
$errors_check = array();
|
||||
if ($is_domain_present) array_push($errors_check, "Domaine déjà présent dans d'autres vhosts.");
|
||||
if ($is_alias_present) array_push($errors_check, "Alias déjà présent(s) dans d'autres vhosts.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,8 +34,15 @@
|
|||
|
||||
print '</pre>';
|
||||
} else {
|
||||
?>
|
||||
|
||||
if (isset($errors_check)) {
|
||||
print '<p class="form-error"><strong>Erreur(s) : </strong><br>';
|
||||
foreach ($errors_check as $error) {
|
||||
printf('%s<br>', $error);
|
||||
}
|
||||
print '</p>';
|
||||
}
|
||||
?>
|
||||
<form name="form-add" id="form-add" action="" method="POST">
|
||||
<fieldset>
|
||||
<legend>Ajout d'un compte</legend>
|
||||
|
|
Loading…
Reference in a new issue