Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
adm_doms_def_type.php
Go to the documentation of this file.
1 <?php
2 require_once("../class/config.php");
3 
4 if (!$admin->enabled) {
5  __("This page is restricted to authorized staff");
6  exit();
7  }
8 
9  include_once("head.php");
10 
11  ?>
12  <h3><?php __("Manage defaults domains type"); ?></h3>
13  <hr id="topbar" />
14  <p><?php __("If you don't know what this page is about, don't touch anything, and read AlternC documentation about domain types"); ?></p>
15  <p><?php __("The Type column contains a type of available VirtualHost config on The server."); ?></p>
16  <p><?php __("The Setting column contains the variables to be expanded in the defaults configuration. Available values are: "); ?></p>
17  <ul>
18  <li><?php __("%%DOMAIN%% : the Domain name"); ?></li>
19  <li><?php __("%%TARGETDOM%%: The destination domain"); ?></li>
20  <li><?php __("%%SUB%% : The subdomain name"); ?></li>
21  <li><?php __("%%DOMAINDIR%%: the domain directory on the file system"); ?></li>
22  </ul>
23 
24  <br />
25  <?php
26  if (isset($error) && $error) {
27  echo "<p class=\"alert alert-danger\">$error</p>";
28  }
29 
30 
31 $fields = array (
32  "domup" => array ("post", "array", ""),
33 );
35 
36 if (!empty($domup)) {
37  if (!$dom->update_default_subdomains($domup) ) {
38  $error=_("There was an error during the record.");
39  } else {
40  $error=_("Save done.");
41  }
42 }
43 
44 $tab=$dom->lst_default_subdomains();
45 ?>
46 <form method="post" action="adm_doms_def_type.php" name="main" id="main">
47 <table class="tlist">
48  <tr><th>&nbsp;</th><th><?php __("Sub"); ?></th><th><?php __("Type"); ?></th><th><?php __("settings"); ?></th><th><?php __("Concerned"); ?></th><th><?php __("Activation"); ?></th></tr>
49 <?php
50 for($i=0;$i<count($tab)+1;$i++) {?>
51  <tr class="lst">
52  <td>
53 
54 <?php
55  @$val=$tab[$i];
56  if (isset($tab[$i])){
57  echo "<input type='hidden' name='domup[$i][id]' value='".$val['id']."' />";
58  }
59 ?>
60  <div class="ina delete"><a href='dom_defdel.php?id=<?php echo $val['id']; ?>' type=''><?php __("Delete"); ?></a></div>
61  </td>
62 
63  <td><input type='text' size="16" name='domup[<?php echo $i; ?>][sub]' value="<?php echo $val['sub']; ?>"/></td>
64  <?php $type=array("VHOST","URL","WEBMAIL","");
65  if(in_array($val['domain_type'],$type)){?>
66  <td><select name='domup[<?php echo $i; ?>][domain_type]'>
67  <option value='VHOST' <?php if($val['domain_type']=='VHOST') echo "selected=\"selected\""; ?> >VHOST</option>
68  <option value='URL' <?php if($val['domain_type']=='URL') echo "selected=\"selected\""; ?> >URL</option>
69  <option value='WEBMAIL' <?php if($val['domain_type']=='WEBMAIL') echo "selected=\"selected\""; ?> >WEBMAIL</option>
70  </select>
71  <?php }else{?>
72  <td><input type ='text' width="100px" style="width:100px" name='domup[<?php echo $i; ?>][domain_type]' value='<?php echo $val['domain_type']?>' ></td>
73  <? }?>
74  </td>
75  <td><input type ='text' name='domup[<?php echo $i; ?>][domain_type_parameter]' value='<?php echo $val['domain_type_parameter']?>' /></td>
76  <td><select name='domup[<?php echo $i; ?>][concerned]'>
77  <option value='MAIN' <?php if($val['concerned']=='MAIN') echo "selected=\"selected\""; ?> >MAIN</option>
78  <option value='SLAVE' <?php if($val['concerned']=='SLAVE') echo "selected=\"selected\""; ?> >SLAVE</option>
79  <option value='BOTH' <?php if($val['concerned']=='BOTH') echo "selected=\"selected\""; ?> >BOTH</option>
80  </select>
81  </td>
82  <td><input type="checkbox" name="domup[<?php echo $i; ?>][enabled]" value="1" <?php if ($val['enabled']==1) echo "checked=\"checked\""; ?> /></td>
83  </tr>
84 <?php
85 }
86 ?>
87  <tr>
88  <td colspan='6'><p><input type="submit" class="inb" name="submit" value="<?php __("Save"); ?>" /></p></td>
89  </tr>
90 </table>
91 </form>
92 <?php
93  include_once("foot.php"); ?>