equal
deleted
inserted
replaced
25 { |
25 { |
26 error(ERR_LEVEL_5); |
26 error(ERR_LEVEL_5); |
27 |
27 |
28 } |
28 } |
29 |
29 |
30 if ($_POST["submit"]) |
30 if (isset($_POST["submit"])) |
31 { |
31 { |
32 $domain = trim($_POST["domain"]); |
32 $domain = trim($_POST["domain"]); |
33 $owner = $_POST["owner"]; |
33 $owner = $_POST["owner"]; |
34 $slave_master = $_POST["slave_master"]; |
34 $slave_master = $_POST["slave_master"]; |
35 $dom_type = "SLAVE"; |
35 $dom_type = "SLAVE"; |
36 if (!$error) |
36 if (!isset($error)) |
37 { |
37 { |
38 if (!is_valid_domain($domain)) |
38 if (!is_valid_domain($domain)) |
39 { |
39 { |
40 $error = "Zone name is invalid!"; |
40 $error = "Zone name is invalid!"; |
41 } |
41 } |
47 { |
47 { |
48 $error = "IP of master NS for slave zone is not valid!"; |
48 $error = "IP of master NS for slave zone is not valid!"; |
49 } |
49 } |
50 else |
50 else |
51 { |
51 { |
52 if(add_domain($domain, $owner, $webip, $mailip, $empty, $dom_type, $slave_master)) |
52 if(add_domain($domain, $owner, '', '', 1, $dom_type, $slave_master)) |
53 { |
53 { |
54 $success = _('Successfully added slave zone.'); |
54 $success = _('Successfully added slave zone.'); |
55 } |
55 } |
56 } |
56 } |
57 } |
57 } |
58 } |
58 } |
59 |
59 |
60 include_once("inc/header.inc.php"); |
60 include_once("inc/header.inc.php"); |
61 |
61 |
62 if ($error != "") |
62 if ((isset($error)) && ($error != "")) |
63 { |
63 { |
64 ?><div class="error"><?php echo _('Error'); ?>: <?php echo $error; ?></div><?php |
64 ?><div class="error"><?php echo _('Error'); ?>: <?php echo $error; ?></div><?php |
65 } |
65 } |
66 elseif ($success != "") |
66 elseif ((isset($success)) && ($success != "")) |
67 { |
67 { |
68 ?><div class="success"><?php echo $success; ?></div><?php |
68 ?><div class="success"><?php echo $success; ?></div><?php |
69 } |
69 } |
70 |
70 |
71 $users = show_users(); |
71 $users = show_users(); |
75 <form method="post" action="add_zone_slave.php"> |
75 <form method="post" action="add_zone_slave.php"> |
76 <table> |
76 <table> |
77 <tr> |
77 <tr> |
78 <td class="n"><?php echo _('Zone name'); ?>:</td> |
78 <td class="n"><?php echo _('Zone name'); ?>:</td> |
79 <td class="n"> |
79 <td class="n"> |
80 <input type="text" class="input" name="domain" value="<?php if ($error) print $_POST["domain"]; ?>"> |
80 <input type="text" class="input" name="domain" value="<?php if (isset($error)) print $_POST["domain"]; ?>"> |
81 </td> |
81 </td> |
82 </tr> |
82 </tr> |
83 <tr> |
83 <tr> |
84 <td class="n"><?php echo _('IP of master NS'); ?>:</td> |
84 <td class="n"><?php echo _('IP of master NS'); ?>:</td> |
85 <td class="n"> |
85 <td class="n"> |
86 <input type="text" class="input" name="slave_master" value="<?php if ($error) print $_POST["slave_master"]; ?>"> |
86 <input type="text" class="input" name="slave_master" value="<?php if (isset($error)) print $_POST["slave_master"]; ?>"> |
87 </td> |
87 </td> |
88 </tr> |
88 </tr> |
89 <tr> |
89 <tr> |
90 <td class="n"><?php echo _('Owner'); ?>:</td> |
90 <td class="n"><?php echo _('Owner'); ?>:</td> |
91 <td class="n"> |
91 <td class="n"> |