Commit d2e69b49 authored by Alan Garcia's avatar Alan Garcia

Corrige des variables

parent 5888b72e
......@@ -122,6 +122,11 @@ if (isset($error) && $error) {
<th colspan="2">
<input type="checkbox" name="create_dom" value="1" class="inc" id="create_dom" <?php cbox($create_dom==1); ?>/>
<label for="create_dom"><?php printf(_("Install the domain"),""); ?></label>
<?php
echo "plop";
printvar( variable_get('hosting_tld') );
?>
<span class="int" id="create_dom_list_pfx">login.</span><select name="create_dom_list" class="int" id="create_dom_list">
<?php if (variable_get('hosting_tld')) { ?>
<option value="<?php echo variable_get('hosting_tld'); ?>" selected="selected"><?php echo variable_get('hosting_tld'); ?></option>
......
......@@ -150,9 +150,12 @@ function edit_var($var_arr) {
global $allvars;
echo "<div id='edit_var_div_{$var_arr['id']}'><form method=post>";
echo "<input type='hidden' name='var_id' value='";ehe($var_arr['id']);echo "' />";
if (is_array( $allvars['DEFAULT'][null][$var_arr['name']]['type'] )) {
$infotype = $allvars['DEFAULT'][null][$var_arr['name']]['type'];
if (is_array( $infotype ) && ( isset($infotype['type']) && isset($infotype['desc']))) {
var_input($infotype, "var_value", $var_arr['value']);
} else if (is_array( $infotype )) {
echo "<ul>";
$infotype = $allvars['DEFAULT'][null][$var_arr['name']]['type'];
//foreach ($allvars['DEFAULT'][null][$var_arr['name']]['type'] as $kk => $vv) {
foreach ($var_arr['value'] as $kk => $vv) {
echo "<li>";
......@@ -195,7 +198,9 @@ function add_var($stratatata, $stratatata_arr=null) {
echo "</select> ";
}
$infotype = $allvars['DEFAULT'][null][$var]['type'];
if (is_array( $infotype )) {
if (is_array( $infotype ) && (isset($infotype['desc']) && isset($infotype['type'])) ) {
var_input($infotype, "var_value");
} else if (is_array( $infotype ) && ! (isset($infotype['desc']) && isset($infotype['type'])) ) {
echo "<ul>";
foreach ($allvars['DEFAULT'][null][$var]['type'] as $kk => $vv) {
echo "<li>";
......
......@@ -47,6 +47,12 @@ if (!isset($noread) || !$noread) {
}
}
// Just in case
if (!$r) {
include_once('foot.php');
die();
}
$dt=$dom->domains_type_lst();
if (!$isinvited && $dt[strtolower($r['type'])]["enable"] != "ALL" ) {
__("This page is restricted to authorized staff");
......
......@@ -38,7 +38,7 @@ if (file_exists("styles/style-custom.css") ) {
echo '<link rel="stylesheet" href="styles/style-custom.css" type="text/css" />';
}
$favicon = variable_get('favicon', 'favicon.ico' ,'You can specify a favicon, for example /images/my_logo.ico', array(array('desc'=>'URL','type'=>'string')));
$favicon = variable_get('favicon', 'favicon.ico' ,'You can specify a favicon, for example /images/my_logo.ico', array('desc'=>'URL','type'=>'string'));
?>
......
......@@ -61,7 +61,7 @@ if (file_exists("styles/style-custom.css") ) {
<div id="content" style="width:1000px;">
<?php
// Getting logo
$logo = variable_get('logo_login', '' ,'You can specify a logo for the login page, example /images/my_logo.png .', array(array('desc'=>'URL','type'=>'string')));
$logo = variable_get('logo_login', '' ,'You can specify a logo for the login page, example /images/my_logo.png .', array('desc'=>'URL','type'=>'string'));
if ( empty($logo) || ! $logo ) {
$logo = 'images/logo.png';
}
......
......@@ -44,7 +44,7 @@ if ($mem->user["lastfail"]) {
if (!empty($error) ) { echo "<p class='alert alert-danger'>$error</p>";$error=''; }
$feed_url = variable_get('rss_feed', '', 'This is an RSS feed that will be displayed on the users homepages when they log in.', array(array('desc'=>'URL','type'=>'string')));
$feed_url = variable_get('rss_feed', '', 'This is an RSS feed that will be displayed on the users homepages when they log in.', array('desc'=>'URL','type'=>'string'));
if (!empty($feed_url)) {
$cache_time = 60*5; // 5 minutes
$cache_file = "/tmp/alterncpanel_cache_main.rss";
......
......@@ -30,7 +30,7 @@
require_once("../class/config.php");
// Getting logo
$logo = variable_get('logo_menu', '' ,'You can specify a logo for the menu, example /images/my_logo.png .', array(array('desc'=>'URL','type'=>'string')));
$logo = variable_get('logo_menu', '' ,'You can specify a logo for the menu, example /images/my_logo.png .', array('desc'=>'URL','type'=>'string'));
if ( empty($logo) || ! $logo ) {
$logo = 'images/logo3.png';
}
......
......@@ -214,12 +214,13 @@ if ($oldid && $oldid!=$cuid) {
$isinvited=true;
}
variable_get('aaa1', '','plop');
// Init some vars
variable_get('hosting_tld', '','This is a FQDN that designates the main hostname of the service. For example, hosting_tld determines in what TLD the "free" user domain is created. If this is set to "example.com", a checkbox will appear in the user creation dialog requesting the creator if he wants to create the domain "username.example.com".', array(array('desc'=>'Wanted FQDN','type'=>'string')));
variable_get('hosting_tld', '','This is a FQDN that designates the main hostname of the service. For example, hosting_tld determines in what TLD the "free" user domain is created. If this is set to "example.com", a checkbox will appear in the user creation dialog requesting the creator if he wants to create the domain "username.example.com".', array('desc'=>'Wanted FQDN','type'=>'string'));
variable_get('subadmin_restriction', '0', "This variable set the way the account list works for accounts other than 'admin' (2000). 0 (default) = admin other than admin/2000 can see their own account, but not the other one 1 = admin other than admin/2000 can see any account by clicking the ''show all accounts'' link.", array(array('desc'=>'Shared access activated?','type'=>'boolean')));
variable_get('subadmin_restriction', '0', "This variable set the way the account list works for accounts other than 'admin' (2000). 0 (default) = admin other than admin/2000 can see their own account, but not the other one 1 = admin other than admin/2000 can see any account by clicking the ''show all accounts'' link.", array('desc'=>'Shared access activated?','type'=>'boolean'));
variable_get('auth_ip_ftp_default_yes', '1', "This variable set if you want to allow all IP address to access FTP by default. If the user start to define some IP or subnet in the allow list, only those he defined will be allowed.", array(array('desc'=>'Allow by default?','type'=>'boolean')));
variable_get('auth_ip_ftp_default_yes', '1', "This variable set if you want to allow all IP address to access FTP by default. If the user start to define some IP or subnet in the allow list, only those he defined will be allowed.", array('desc'=>'Allow by default?','type'=>'boolean'));
?>
......@@ -676,7 +676,7 @@ class m_admin {
*/
function hook_admin_add_member() {
global $err, $cuid, $L_FQDN, $L_HOSTING;
$dest = variable_get('new_email', '0', 'An email will be sent to this address when new accounts are created if set.', array(array('desc'=>'Enabled','type'=>'boolean')));
$dest = variable_get('new_email', '0', 'An email will be sent to this address when new accounts are created if set.', array('desc'=>'Enabled','type'=>'boolean'));
if (!$dest) {
return false;
}
......
......@@ -85,8 +85,8 @@ class m_dom {
* Constructeur
*/
function m_dom() {
$this->tld_no_check_at_all = variable_get('tld_no_check_at_all', 0, 'Disable ALL check on the TLD (users will be able to add any domain)', array(array('desc' => 'Disabled', 'type' => 'boolean')));
variable_get('mailname_bounce', '%%FQDN%%', 'FQDN of the mail server, used to create vhost virtual mail_adress.', array(array('desc' => 'FQDN', 'type' => 'string')));
$this->tld_no_check_at_all = variable_get('tld_no_check_at_all', 0, 'Disable ALL check on the TLD (users will be able to add any domain)', array('desc' => 'Disabled', 'type' => 'boolean'));
variable_get('mailname_bounce', '%%FQDN%%', 'FQDN of the mail server, used to create vhost virtual mail_adress.', array('desc' => 'FQDN', 'type' => 'string'));
}
function get_panel_url_list() {
......
......@@ -36,7 +36,7 @@ class m_ftp {
*/
function m_ftp() {
global $L_FQDN;
$this->srv_name = variable_get('ftp_human_name', '%%FQDN%%','Human name for FTP server', array(array('desc'=>'Name','type'=>'string')));
$this->srv_name = variable_get('ftp_human_name', '%%FQDN%%','Human name for FTP server', array('desc'=>'Name','type'=>'string'));
}
......
......@@ -45,10 +45,10 @@ class m_lxc implements vm {
* Constructor, initialize the class informations from AlternC's variables
*/
function m_lxc() {
$this->IP = variable_get('lxc_ip', '', "IP address of the Alternc's LXC server. If empty, no LXC server.", array(array('desc'=>'IP address','type'=>'ip')));
$this->PORT = variable_get('lxc_port', '6504', "Port of the Alternc's LXC server", array(array('desc'=>'Port','type'=>'integer')));
$this->KEY = variable_get('lxc_key', '', "Shared key with the Alternc's LXC server", array(array('desc'=>'Shared key','type'=>'string')));
$this->maxtime = variable_get('lxc_maxtime', '4', "How many hours do we allow to have a server before shutting it down", array(array('desc'=>'Max time','type'=>'integer')));
$this->IP = variable_get('lxc_ip', '', "IP address of the Alternc's LXC server. If empty, no LXC server.", array('desc'=>'IP address','type'=>'ip'));
$this->PORT = variable_get('lxc_port', '6504', "Port of the Alternc's LXC server", array('desc'=>'Port','type'=>'integer'));
$this->KEY = variable_get('lxc_key', '', "Shared key with the Alternc's LXC server", array('desc'=>'Shared key','type'=>'string'));
$this->maxtime = variable_get('lxc_maxtime', '4', "How many hours do we allow to have a server before shutting it down", array('desc'=>'Max time','type'=>'integer'));
}
......
......@@ -82,13 +82,13 @@ class m_mail {
* Constructeur
*/
function m_mail() {
$this->srv_submission = variable_get('mail_human_submission', '%%FQDN%%','Human name for mail server (submission protocol)', array(array('desc'=>'Name','type'=>'string')));
$this->srv_smtp = variable_get('mail_human_smtp', '%%FQDN%%','Human name for mail server (SMTP protocol)', array(array('desc'=>'Name','type'=>'string')));
$this->srv_smtps = variable_get('mail_human_smtps', '%%FQDN%%','Human name for mail server (SMTPS protocol)', array(array('desc'=>'Name','type'=>'string')));
$this->srv_imap = variable_get('mail_human_imap', '%%FQDN%%','Human name for IMAP mail server', array(array('desc'=>'Name','type'=>'string')));
$this->srv_imaps = variable_get('mail_human_imaps', '%%FQDN%%','Human name for IMAPS mail server', array(array('desc'=>'Name','type'=>'string')));
$this->srv_pop3 = variable_get('mail_human_pop3', '%%FQDN%%','Human name for POP3 mail server', array(array('desc'=>'Name','type'=>'string')));
$this->srv_pop3s = variable_get('mail_human_pop3s', '%%FQDN%%','Human name for POP3s mail server', array(array('desc'=>'Name','type'=>'string')));
$this->srv_submission = variable_get('mail_human_submission', '%%FQDN%%','Human name for mail server (submission protocol)', array('desc'=>'Name','type'=>'string'));
$this->srv_smtp = variable_get('mail_human_smtp', '%%FQDN%%','Human name for mail server (SMTP protocol)', array('desc'=>'Name','type'=>'string'));
$this->srv_smtps = variable_get('mail_human_smtps', '%%FQDN%%','Human name for mail server (SMTPS protocol)', array('desc'=>'Name','type'=>'string'));
$this->srv_imap = variable_get('mail_human_imap', '%%FQDN%%','Human name for IMAP mail server', array('desc'=>'Name','type'=>'string'));
$this->srv_imaps = variable_get('mail_human_imaps', '%%FQDN%%','Human name for IMAPS mail server', array('desc'=>'Name','type'=>'string'));
$this->srv_pop3 = variable_get('mail_human_pop3', '%%FQDN%%','Human name for POP3 mail server', array('desc'=>'Name','type'=>'string'));
$this->srv_pop3s = variable_get('mail_human_pop3s', '%%FQDN%%','Human name for POP3s mail server', array('desc'=>'Name','type'=>'string'));
}
function hook_menu() {
......
......@@ -49,7 +49,7 @@ class m_quota {
* Constructor
*/
function m_quota() {
$this->disk_quota_enable = variable_get('disk_quota_enable', 1,'Are disk quota enabled for this server', array(array('desc'=>'Enabled','type'=>'boolean')));
$this->disk_quota_enable = variable_get('disk_quota_enable', 1,'Are disk quota enabled for this server', array('desc'=>'Enabled','type'=>'boolean'));
if ( $this->disk_quota_enable ) {
$this->disk = Array( "web"=>"web" );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment