implement check_occurence_name on account creation
This commit is contained in:
parent
0bfe7a2aac
commit
6f0106d4d0
|
@ -388,11 +388,21 @@ if(!empty($_POST)) {
|
||||||
|
|
||||||
/* Test de validation du formulaire */
|
/* Test de validation du formulaire */
|
||||||
if($form->verify(TRUE)) {
|
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'])
|
if ($conf['cluster'])
|
||||||
$exec_info = web_add_cluster($form, $conf['admin']['mail']);
|
$exec_info = web_add_cluster($form, $conf['admin']['mail']);
|
||||||
else
|
else
|
||||||
$exec_info = web_add($form, $conf['admin']['mail']);
|
$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.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include_once EVOADMIN_BASE . '../tpl/header.tpl.php';
|
include_once EVOADMIN_BASE . '../tpl/header.tpl.php';
|
||||||
|
|
|
@ -34,8 +34,15 @@
|
||||||
|
|
||||||
print '</pre>';
|
print '</pre>';
|
||||||
} else {
|
} 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">
|
<form name="form-add" id="form-add" action="" method="POST">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Ajout d'un compte</legend>
|
<legend>Ajout d'un compte</legend>
|
||||||
|
|
Loading…
Reference in a new issue