Commit 0d307bd6 authored by alban's avatar alban
Browse files

[fix] Rewrites code to be 5.3 compliant by removing func()[key] notations

parent 28675a29
......@@ -113,9 +113,9 @@ $creators_list=array();
foreach($admin->get_creator_list() as $mid=>$mlogin) {
$creators_list[$mid] = $mlogin['login'];
}
$variablesList = $variables->variables_list_name();
echo "<fieldset><legend>"._("Description")."</legend>";
echo "<p>".$variables->variables_list_name()[$var]."</p>";
echo "<p>".$variablesList[$var]."</p>";
echo "</fieldset>";
echo "<br/>";
......
......@@ -101,7 +101,8 @@ echo "<input type='submit' class='ina' value=\""; echo ehe(_("View")); echo "\"
<?php
if ( $member_id && $fqdn_id ) {
$sub_infos=$dom->get_sub_domain_all($fqdn_id);
$fqdn=$dom->get_panel_url_list()[$fqdn_id];
$domList = $dom->get_panel_url_list();
$fqdn=$domList[$fqdn_id];
$impersonated_conf=$variables->get_impersonated($fqdn, $member_id);
echo sprintf(_("Here are values for members %s logged via %s"), '<b>'.$ml[$member_id].'</b>', "<b>$fqdn</b>") ;?>
......
......@@ -181,7 +181,8 @@ class system_bind {
*/
function dkim_generate_key($domain) {
// Stop here if we do not manage the mail
if ( ! $this->get_domain_summary($domain)['gesmx'] ) return;
$domainInfo = $this->get_domain_summary($domain);
if ( ! $domainInfo['gesmx'] ) return;
$target_dir = "/etc/opendkim/keys/$domain";
......@@ -266,7 +267,8 @@ class system_bind {
*/
function dkim_entry($domain) {
$keyfile="/etc/opendkim/keys/$domain/alternc.txt";
if (! file_exists($keyfile) && $this->get_domain_summary($domain)['gesmx'] ) {
$domainInfo = $this->get_domain_summary($domain);
if (! file_exists($keyfile) && $domainInfo['gesmx'] ) {
$this->dkim_generate_key($domain);
}
return @file_get_contents($keyfile);
......@@ -283,7 +285,8 @@ class system_bind {
$zone= implode("\n",$this->conf_from_db($domain))."\n".$this->get_persistent($domain);
$entry='';
if ( $this->get_domain_summary($domain)['gesmx'] ) {
$domainInfo = $this->get_domain_summary($domain);
if ( $domainInfo['gesmx'] ) {
// If we manage the mail
// Check if there is no the same entry (defined or manual)
......@@ -324,6 +327,7 @@ class system_bind {
$zone.="\n;;;END ALTERNC AUTOGENERATE CONFIGURATION";
$zone.=$this->get_persistent($domain);
$domainInfo = $this->get_domain_summary($domain);
// FIXME check those vars
$zone = strtr($zone, array(
......@@ -340,7 +344,7 @@ class system_bind {
"@@DOMAINE@@"=>"$domain",
"@@SERIAL@@"=>$this->get_serial($domain),
"@@PUBLIC_IP@@"=>"$L_PUBLIC_IP",
"@@ZONETTL@@"=> $this->get_domain_summary($domain)['zonettl'],
"@@ZONETTL@@"=> $domainInfo['zonettl'],
));
return $zone;
......
......@@ -31,6 +31,7 @@
*
* @author Drupal Developpement Team
* @link http://cvs.drupal.org/viewcvs/drupal/drupal/includes/bootstrap.inc?rev=1.38&view=auto
* @
*/
class m_variables {
var $strata_order = array('DEFAULT','GLOBAL','FQDN_CREATOR','FQDN','CREATOR','MEMBER','DOMAIN');
......@@ -299,6 +300,7 @@ class m_variables {
*/
function display_valueraw_html($v,$varname,$echo = true) {
$output = "";
$varList = $this->variables_list();
if (is_array($v)) {
if (empty($v)) {
$output .= "<em>"._("Empty array")."</em>";
......@@ -310,19 +312,19 @@ class m_variables {
if (is_null($varname)) {
$output .= "$k";
} else {
if ( !isset($this->variables_list()['DEFAULT'][null][$varname]['type'][$k]) || is_array( $this->variables_list()['DEFAULT'][null][$varname]['type'][$k] ) ) {
if (isset($this->variables_list()['DEFAULT'][null][$varname]['type'][$k]['desc'])) {
$output .= $this->variables_list()['DEFAULT'][null][$varname]['type'][$k]['desc'];
if ( !isset($varList['DEFAULT'][null][$varname]['type'][$k]) || is_array( $varList['DEFAULT'][null][$varname]['type'][$k] ) ) {
if (isset($varList['DEFAULT'][null][$varname]['type'][$k]['desc'])) {
$output .= $varList['DEFAULT'][null][$varname]['type'][$k]['desc'];
} else {
$output .= $k;
}
} else {
$output .= $this->variables_list()['DEFAULT'][null][$varname]['type'][$k];
$output .= $varList['DEFAULT'][null][$varname]['type'][$k];
}
}
} else {
if (isset($this->variables_list()['DEFAULT'][null][$varname]['type'][$k]['desc'] )) {
$output .= $this->variables_list()['DEFAULT'][null][$varname]['type'][$k]['desc'];
if (isset($varList['DEFAULT'][null][$varname]['type'][$k]['desc'] )) {
$output .= $varList['DEFAULT'][null][$varname]['type'][$k]['desc'];
}
}
if (is_array($l)) {
......@@ -332,7 +334,7 @@ class m_variables {
if ( is_numeric($m)) {
$output .= "$m";
} else {
$output .= $this->variables_list()['DEFAULT'][null][$varname]['type'][$k][$m]['desc'];
$output .= $varList['DEFAULT'][null][$varname]['type'][$k][$m]['desc'];
}
$output .= " => $n";
$output .= "</li>";
......
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