From ba77be7a0c250d3a0b62725717c18dc87c52ce80 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Tue, 21 Jan 2014 13:35:50 +0000 Subject: [PATCH] Corrige un bug sur l'affichage des variables --- .gitattributes | 1 + bureau/admin/adm_editvar.php | 1 + bureau/admin/adm_variables.php | 46 ++++++++++++++++------------------ bureau/class/m_variables.php | 9 +++++-- 4 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 bureau/admin/adm_editvar.php diff --git a/.gitattributes b/.gitattributes index 98eaa790..07a640ae 100644 --- a/.gitattributes +++ b/.gitattributes @@ -68,6 +68,7 @@ bureau/admin/adm_donosu.php -text bureau/admin/adm_dorenew.php -text bureau/admin/adm_dosu.php -text bureau/admin/adm_edit.php -text +bureau/admin/adm_editvar.php -text bureau/admin/adm_email.php -text bureau/admin/adm_list.php -text bureau/admin/adm_lockpanel.php -text diff --git a/bureau/admin/adm_editvar.php b/bureau/admin/adm_editvar.php new file mode 100644 index 00000000..1333ed77 --- /dev/null +++ b/bureau/admin/adm_editvar.php @@ -0,0 +1 @@ +TODO diff --git a/bureau/admin/adm_variables.php b/bureau/admin/adm_variables.php index 52880283..fc2e077a 100644 --- a/bureau/admin/adm_variables.php +++ b/bureau/admin/adm_variables.php @@ -39,13 +39,6 @@ $fields = array ( ); getFields($fields); -$conf = $variables->variable_init(); -foreach ($conf as $name => $val) { - if (isset($GLOBALS['_POST'][$name])) { - $variables->variable_set($name, $GLOBALS['_POST'][$name]); - } -} - include_once ("head.php"); ?> @@ -57,8 +50,7 @@ include_once ("head.php");

-
- +
@@ -71,27 +63,21 @@ include_once ("head.php"); variables_list(); +$global_conf=$variables->get_impersonated(); foreach( $variables->variables_list_name() as $varname => $varcomment) { ?> - - - - - - - + + + + + +
- -
-


+



@@ -115,12 +101,13 @@ echo " get_sub_domain_all($fqdn_id); $fqdn=$dom->get_panel_url_list()[$fqdn_id]; $impersonated_conf=$variables->get_impersonated($fqdn, $member_id); echo sprintf(_("Here are values for members %s logged via %s"), ''.$ml[$member_id].'', "$fqdn") ;?> - +
"; echo ""; @@ -140,6 +127,7 @@ foreach( $variables->variables_list_name() as $varname => $varcomment) { ?> + variables_list_name() as $varname => $varcomment) { ?>
"._("Var")."

+ + diff --git a/bureau/class/m_variables.php b/bureau/class/m_variables.php index a77c3532..d3351089 100644 --- a/bureau/class/m_variables.php +++ b/bureau/class/m_variables.php @@ -63,13 +63,18 @@ class m_variables { } - function get_impersonated($fqdn, $uid=null, $var=null) { + function get_impersonated($fqdn=null, $uid=null, $var=null) { global $db, $err; $arr_var=$this->variables_list(); // Get some vars we are going to need. - $sub_infos=m_dom::get_sub_domain_id_and_member_by_name( strtolower($fqdn) ); + if ($fqdn != NULL) { + $sub_infos=m_dom::get_sub_domain_id_and_member_by_name( strtolower($fqdn) ); + } else { + $sub_infos=false; + } + if ( $uid != NULL ) { $creator=m_mem::get_creator_by_uid($uid); } else {