ns/ & ht/: check that domain isn't already used
This commit is contained in:
parent
9be11ea27a
commit
247c814d5d
|
@ -41,6 +41,9 @@ checkDomainFormat($_POST['domain']);
|
||||||
if ($dirsStatuses[$_POST['dir']] !== false)
|
if ($dirsStatuses[$_POST['dir']] !== false)
|
||||||
userError("Wrong value for <code>dir</code>.");
|
userError("Wrong value for <code>dir</code>.");
|
||||||
|
|
||||||
|
if (query('select', 'sites', ['domain' => $_POST['domain']], 'domain') !== [])
|
||||||
|
userError("Ce domaine existe déjà sur ce service.");
|
||||||
|
|
||||||
addSite($_SESSION['username'], $_POST['dir'], $_POST['domain'], "dns", "http");
|
addSite($_SESSION['username'], $_POST['dir'], $_POST['domain'], "dns", "http");
|
||||||
|
|
||||||
$nginxConf = 'server {
|
$nginxConf = 'server {
|
||||||
|
|
|
@ -12,6 +12,9 @@ switchToFormProcess();
|
||||||
|
|
||||||
$_POST['domain'] = formatAbsoluteDomain($_POST['domain']);
|
$_POST['domain'] = formatAbsoluteDomain($_POST['domain']);
|
||||||
|
|
||||||
|
if (query('select', 'zones', ['zone' => $_POST['domain']], 'zone') !== [])
|
||||||
|
userError("Cette zone existe déjà sur ce service.");
|
||||||
|
|
||||||
$db = new PDO('sqlite:' . DB_PATH);
|
$db = new PDO('sqlite:' . DB_PATH);
|
||||||
$stmt = $db->prepare("INSERT INTO zones(zone, username) VALUES(:zone, :username)");
|
$stmt = $db->prepare("INSERT INTO zones(zone, username) VALUES(:zone, :username)");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue