Alternc  latest
Alternc logiel libre pour l'hébergement
adm_variables.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Manages global variables of AlternC
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 
28 if (!$admin->enabled) {
29  $msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
30  echo $msg->msg_html_all();
31  exit();
32 }
33 
35 foreach ($conf as $name => $val) {
36  if (isset($GLOBALS['_POST'][$name])) {
37  variable_set($name, $GLOBALS['_POST'][$name]);
38  }
39 }
40 
41 include_once ("head.php");
42 
43 ?>
44 <h3><?php __("Configure AlternC variables"); ?></h3>
45 <hr id="topbar"/>
46 <br />
47 <?php echo $msg->msg_html_all(); ?>
48 <p>
49 <?php __("Here are the internal AlternC variables that are currently being used."); ?>
50 </p>
51 
52 <form method="post" action="adm_variables.php">
53  <?php csrf_get(); ?>
54 <table border="0" cellpadding="4" cellspacing="0" class='tlist'>
55 <tr><th><?php __("Names"); ?></th><th><?php __("Value"); ?></th><th><?php __("Comment"); ?></th></tr>
56 <?php
57 
58 foreach( variables_list() as $vars) { ?>
59 
60  <tr class="lst">
61  <td><?php ehe($vars['name']); ?></td>
62  <td><input type="text" class="int" name="<?php ehe($vars['name']); ?>" value="<?php ehe($vars['value']); ?>" style="width: 200px"/></td>
63  <td><?php ehe($vars['comment']); ?></td>
64  </tr>
65 <?php } ?>
66 </table>
67 <p><input type="submit" class="inb" value="<?php __("Save variables"); ?>" /></p>
68 </form>
69 <?php include_once("foot.php"); ?>
exit
Definition: adm_doadd.php:70
if(! $admin->enabled) $conf
Manages global variables of AlternC.
$msg
Definition: bootstrap.php:75
variable_set($name, $value, $comment=null)
Set a persistent variable.
Definition: variables.php:108
variable_init($conf=array())
Persistent variable table.
Definition: variables.php:36
variables_list()
List all variables.
Definition: variables.php:156
ehe($str, $display=TRUE)
Echo the HTMLSpecialChars version of a value.
Definition: functions.php:647
__($str)
Definition: functions.php:404
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 ...
Definition: functions.php:1159
$val
Definition: tempovars.php:15