Updating domain types admin for creating tmp or target directory

This commit is contained in:
Steven Mondji-Lerider 2012-10-11 07:43:48 +00:00
parent a2bc7acad0
commit 0e67b0278b
4 changed files with 24 additions and 4 deletions

View File

@ -64,6 +64,8 @@ if (isset($error) && $error) {
<th><?php __("Only DNS?");?></th>
<th><?php __("Need to be DNS?");?></th>
<th><?php __("Advanced?");?></th>
<th><?php __("Create tmp directory ?");?></th>
<th><?php __("create www directory ?");?></th>
<th/>
</tr>
<?php
@ -83,6 +85,8 @@ foreach($dom->domains_type_lst() as $d) {
<td><?php echo $d['only_dns']?__("Yes"):__("No");?></td>
<td><?php echo $d['need_dns']?__("Yes"):__("No");?></td>
<td><?php echo $d['advanced']?__("Yes"):__("No");?></td>
<td><?php echo $d['create_tmpdir']?__("Yes"):__("No");?></td>
<td><?php echo $d['create_targetdir']?__("Yes"):__("No");?></td>
</tr>
<?php } // end foreach
?>

View File

@ -15,10 +15,12 @@ $fields = array (
"only_dns" => array ("post", "string", ""),
"need_dns" => array ("post", "string", ""),
"advanced" => array ("post", "string", ""),
"create_tmpdir" => array ("post", "string", ""),
"create_targetdir" => array ("post", "string", ""),
);
getFields($fields);
if ( ! $dom->domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced) ) {
if ( ! $dom->domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced,$create_tmpdir,$create_targetdir) ) {
die($err->errstr());
} else {
include("adm_domstype.php");

View File

@ -45,6 +45,8 @@ $fields = array (
"only_dns" => array ("request", "boolean", ""),
"need_dns" => array ("request", "boolean", ""),
"advanced" => array ("request", "boolean", ""),
"create_tmpdir" => array ("request", "boolean", ""),
"create_targetdir" => array ("request", "boolean", ""),
);
getFields($fields);
@ -116,6 +118,16 @@ if (isset($error_edit) && $error_edit) {
<th><?php __("Is it an advanced option?");?></th>
<td><input name="advanced" type="checkbox" value="1" <?php cbox($d['advanced']); ?> /></td>
</tr>
</tr>
<tr>
<th><?php __("Create tmp directory ?");?></th>
<td><input name="create_tmpdir" type="checkbox" value="1" <?php cbox($d['create_tmpdir']); ?> /></td>
</tr>
</tr>
<tr>
<th><?php __("Create target directory ?");?></th>
<td><input name="create_targetdir" type="checkbox" value="1" <?php cbox($d['create_targetdir']); ?> /></td>
</tr>
<tr class="trbtn">
<td colspan="2">
<input type="submit" class="inb" name="submit" value="<?php __("Change this domain type"); ?>" />

View File

@ -160,7 +160,7 @@ class m_dom {
return true;
}
function domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns,$advanced) {
function domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns,$advanced,$create_tmpdir,$create_targetdir) {
global $err,$cuid,$db;
$id=intval($id);
// The name MUST contain only letter and digits, it's an identifier after all ...
@ -170,8 +170,10 @@ class m_dom {
}
$name=mysql_real_escape_string($name); $description=mysql_real_escape_string($description); $target=mysql_real_escape_string($target);
$entry=mysql_real_escape_string($entry); $compatibility=mysql_real_escape_string($compatibility); $enable=mysql_real_escape_string($enable);
$only_dns=intval($only_dns); $need_dns=intval($need_dns); $advanced=intval($advanced);
$db->query("UPDATE domaines_type SET description='$description', target='$target', entry='$entry', compatibility='$compatibility', enable='$enable', need_dns=$need_dns, only_dns=$only_dns, advanced='$advanced' where name='$name';");
$only_dns=intval($only_dns); $need_dns=intval($need_dns); $advanced=intval($advanced); $create_tmpdir=intval($create_tmpdir); $create_targetdir=intval($create_targetdir);
printvar($create_targetdir);
printvar("UPDATE domaines_type SET description='$description', target='$target', entry='$entry', compatibility='$compatibility', enable='$enable', need_dns=$need_dns, only_dns=$only_dns, advanced='$advanced',create_tmpdir=$create_tmpdir,create_targetdir=$create_targetdir where name='$name';");
$db->query("UPDATE domaines_type SET description='$description', target='$target', entry='$entry', compatibility='$compatibility', enable='$enable', need_dns=$need_dns, only_dns=$only_dns, advanced='$advanced',create_tmpdir=$create_tmpdir,create_targetdir=$create_targetdir where name='$name';");
return true;
}