28 require_once(
"../class/config.php");
30 if (!$admin->enabled) {
31 $msg->raise(
"ERROR",
"admin", _(
"This page is restricted to authorized staff"));
32 echo
$msg->msg_html_all();
36 include_once(
"head.php");
38 <h3><?php
__(
"Manage defaults domains type"); ?></h3>
40 <p><?php
__(
"If you don't know what this page is about, don't touch anything, and read AlternC documentation about domain types"); ?></p>
41 <p><?php
__(
"The Type column contains a type of available VirtualHost config on The server."); ?></p>
42 <p><?php
__(
"The Setting column contains the variables to be expanded in the defaults configuration. Available values are: "); ?></p>
44 <li><?php
__(
"%%DOMAIN%% : the Domain name"); ?></li>
45 <li><?php
__(
"%%TARGETDOM%%: The destination domain"); ?></li>
46 <li><?php
__(
"%%SUB%% : The subdomain name"); ?></li>
47 <li><?php
__(
"%%DOMAINDIR%%: the domain directory on the file system"); ?></li>
53 "domup" => array(
"post",
"array",
""),
58 if (!
$dom->update_default_subdomains($domup)) {
59 $msg->raise(
"ERROR",
"admin", _(
"There was an error during the record."));
61 $msg->raise(
"INFO",
"admin", _(
"Save done."));
64 echo
$msg->msg_html_all();
68 <form method=
"post" action=
"adm_doms_def_type.php" name=
"main" id=
"main">
71 <tr><th> </th><th><?php
__(
"Sub"); ?></th><th><?php
__(
"Type"); ?></th><th><?php
__(
"settings"); ?></th><th><?php
__(
"Concerned"); ?></th><th><?php
__(
"Activation"); ?></th></tr>
72 <?php
for (
$i = 0;
$i < count(
$tab) + 1;
$i++) { ?>
78 echo
"<input type='hidden' name='domup[$i][id]' value='" .
$val[
'id'] .
"' />";
81 <div
class=
"ina delete"><a href=
"dom_defdel.php?id=<?php echo $val['id']; ?>"><?php
__(
"Delete"); ?></a></div>
84 <td><input type=
'text' size=
"16" name=
'domup[<?php echo $i; ?>][sub]' value=
"<?php echo $val['sub']; ?>"/></td>
86 $type = array(
"VHOST",
"URL",
"WEBMAIL",
"");
87 if (in_array(
$val[
'domain_type'], $type)) {
89 <td><select name=
'domup[<?php echo $i; ?>][domain_type]'>
90 <option value=
'VHOST' <?php
if (
$val[
'domain_type'] ==
'VHOST') echo
"selected=\"selected\""; ?> >VHOST</option>
91 <option value=
'URL' <?php
if (
$val[
'domain_type'] ==
'URL') echo
"selected=\"selected\""; ?> >URL</option>
92 <option value=
'WEBMAIL' <?php
if (
$val[
'domain_type'] ==
'WEBMAIL') echo
"selected=\"selected\""; ?> >WEBMAIL</option>
95 <td><input type=
"text" style=
"width:100px" name=
"domup[<?php echo $i; ?>][domain_type]" value=
"<?php echo $val['domain_type'] ?>" ></td>
97 <td><input type =
'text' name=
'domup[<?php echo $i; ?>][domain_type_parameter]' value=
'<?php echo $val['domain_type_parameter
'] ?>' /></td>
98 <td><select name=
'domup[<?php echo $i; ?>][concerned]'>
99 <option value=
'MAIN' <?php
if (
$val[
'concerned'] ==
'MAIN') echo
"selected=\"selected\""; ?> >MAIN</option>
100 <option value=
'SLAVE' <?php
if (
$val[
'concerned'] ==
'SLAVE') echo
"selected=\"selected\""; ?> >SLAVE</option>
101 <option value=
'BOTH' <?php
if (
$val[
'concerned'] ==
'BOTH') echo
"selected=\"selected\""; ?> >BOTH</option>
104 <td><input type=
"checkbox" name=
"domup[<?php echo $i; ?>][enabled]" value=
"1" <?php
if (
$val[
'enabled'] == 1) echo
"checked=\"checked\""; ?> /></td>
110 <td colspan=
'6'><p><input type=
"submit" class=
"inb" name=
"submit" value=
"<?php __("Save
"); ?>" /></p></td>
114 <?php include_once(
"foot.php");
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
csrf_get($return=false)
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session ...