Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
adm_variables.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: adm_variables.php,v 1.1 2005/01/19 06:09:36 anarcat Exp $
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2002 by the AlternC Development Team.
7  http://alternc.org/
8  ----------------------------------------------------------------------
9  Based on:
10  Valentin Lacambre's web hosting softwares: http://altern.org/
11  ----------------------------------------------------------------------
12  LICENSE
13 
14  This program is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License (GPL)
16  as published by the Free Software Foundation; either version 2
17  of the License, or (at your option) any later version.
18 
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  To read the license please visit http://www.gnu.org/copyleft/gpl.html
25  ----------------------------------------------------------------------
26  Original Author of file: Benjamin Sonntag
27  Purpose of file: Manage allowed TLD on the server
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 
32 if (!$admin->enabled) {
33  __("This page is restricted to authorized staff");
34  exit();
35 }
36 $fields = array (
37  "member_id" => array ("post", "integer", null),
38  "fqdn_id" => array ("post", "integer", null),
39 );
41 
42 include_once ("head.php");
43 
44 ?>
45 <h3><?php __("Configure AlternC variables"); ?></h3>
46 <hr id="topbar"/>
47 <br />
48 
49 <p>
50 <?php __("Here are the internal AlternC variables that are currently being used."); ?>
51 </p>
52 
53 <table border="0" cellpadding="4" cellspacing="0" class='tlist' id="tab_listvar_glob">
54 <thead>
55  <tr>
56  <th><?php __("Names"); ?></th>
57  <th><?php __("Comment"); ?></th>
58  <th><?php __("Default value"); ?></th>
59  <th><?php __("Global value"); ?></th>
60  <th><?php __("Actual value used"); ?></th>
61  </tr>
62 </thead>
63 <?php
64 
65 $allvars = $variables->variables_list();
66 $global_conf=$variables->get_impersonated();
67 foreach( $variables->variables_list_name() as $varname => $varcomment) { ?>
68 
69  <tr class="lst">
70  <td><a href='adm_var_edit.php?var=<?php echo urlencode($varname)?>'><?php echo $varname; ?></a></td>
71  <td><?php echo $varcomment; ?></td>
72  <td><?php $variables->display_value_html($allvars, 'DEFAULT', NULL, $varname);?></td>
73  <td><?php $variables->display_value_html($allvars, 'GLOBAL', NULL, $varname);?></td>
74  <td><?php if (isset($global_conf[$varname]['value'])) { $variables->display_valueraw_html($global_conf[$varname]['value'], $varname); } ?></td>
75  </tr>
76 <?php } ?>
77 </table>
78 
79 <br/><br/><br/>
80 
81 <hr/>
82 <h3 id="overwrited_vars"><?php __("Overwrited vars"); ?></h3>
83 <form method="post" action="adm_variables.php#overwrited_vars">
84 <?php
85 $creator=$mem->get_creator_by_uid($member_id);
86 
87 $ml=array();
88 foreach($admin->get_list() as $mid=>$mlogin) {
89  $ml[$mid] = $mlogin['login'];
90 }
91 echo _("See the vars for the account")." ";
92 echo "<select name='member_id'>";eoption($ml, $member_id);echo "</select>";
93 echo " "._("logged via")." ";
94 echo "<select name='fqdn_id'>";eoption($dom->get_panel_url_list(), $fqdn_id );echo "</select> ";
95 echo "<input type='submit' class='ina' value=\""; echo ehe(_("View")); echo "\" />";
96 
97 ?>
98 </form>
99 <br/>
100 
101 <?php
102 if ( $member_id && $fqdn_id ) {
103 $sub_infos=$dom->get_sub_domain_all($fqdn_id);
104 $fqdn=$dom->get_panel_url_list()[$fqdn_id];
105 $impersonated_conf=$variables->get_impersonated($fqdn, $member_id);
106 
107 echo sprintf(_("Here are values for members %s logged via %s"), '<b>'.$ml[$member_id].'</b>', "<b>$fqdn</b>") ;?>
108 <table class='tlist' id="tab_listvar_impers">
109 <?php
110 echo "<thead><tr>";
111 echo "<th>"._("Var")."</th>";
112 foreach( $variables->strata_order as $st) {
113  echo "<th>$st</th>";
114 } // foeach
115 echo "<th>"._("Used value")."</th>";
116 echo "</tr></thead>";
117 foreach( $variables->variables_list_name() as $varname => $varcomment) { ?>
118  <tr class="lst">
119  <td><a href='adm_var_edit.php?var=<?php echo urlencode($varname); ?>'><?php echo $varname; ?></a></td>
120  <td><?php $variables->display_value_html($allvars, 'DEFAULT', NULL, $varname); ?></td>
121  <td><?php $variables->display_value_html($allvars, 'GLOBAL', NULL, $varname); ?></td>
122  <td><?php $variables->display_value_html($allvars, 'FQDN_CREATOR', $sub_infos['member_id'], $varname); ?></td>
123  <td><?php $variables->display_value_html($allvars, 'FQDN', $sub_infos['id'], $varname); ?></td>
124  <td><?php $variables->display_value_html($allvars, 'CREATOR', $creator, $varname); ?></td>
125  <td><?php $variables->display_value_html($allvars, 'MEMBER', $member_id, $varname); ?></td>
126  <td><?php $variables->display_value_html($allvars, 'DOMAIN', 'FIXME', $varname); ?></td>
127  <td><?php $variables->display_valueraw_html($impersonated_conf[$varname]['value'], $varname); ?></td>
128  </tr>
129 <?php
130 } //foreach
131 ?>
132 </table>
133 
134 <br/>
135 <?php } // if $member_id && $fqdn_id ?>
136 
137 <hr/>
138 <h3><?php __("Magical values");?></h3>
139 <?php __("Those var are automatically replaced by the value indicated"); ?>
140 <ul>
141 <?php
142 foreach ($variables->replace_array as $vrepk => $vrepvalue) {
143  echo "<li><code>$vrepk</code> => $vrepvalue</li>";
144 }
145 ?>
146 </ul>
147 
148 <script type="text/javascript">
149 
150 $(document).ready(function()
151  {
152  $("#tab_listvar_impers").tablesorter();
153  $("#tab_listvar_glob").tablesorter();
154  }
155 );
156 </script>
157 
158 <?php include_once("foot.php"); ?>