function testMultipleValues()
 {
     savePHPSettings(12, array('key1' => 'val1', 'key2' => 'off'));
     $this->assertEqual(2, count(readPHPSettings(12)));
 }
Ejemplo n.º 2
0
 #$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
 #$iswildcarddomain = makeyesno('iswildcarddomain', '1', '0', $result['iswildcarddomain']);
 #$isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']);
 $openbasedir = makeoption($lng['domain']['docroot'], 0, $result['openbasedir_path'], true) . makeoption($lng['domain']['homedir'], 1, $result['openbasedir_path'], true);
 $result_ipandport = $db->query_first("SELECT `ip` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id`='" . (int) $result['ipandport'] . "'");
 if (filter_var($result_ipandport['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
     $result_ipandport['ip'] = '[' . $result_ipandport['ip'] . ']';
 }
 $domainip = $result_ipandport['ip'];
 $result = htmlentities_array($result);
 $subdomain_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/domains/formfield.domains_edit.php');
 // Mix in the PHP options
 $php_options_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/domains/formfield.php_options.php');
 $subdomain_edit_data = array_merge_recursive($subdomain_edit_data, $php_options_data);
 // Replace the settings with real options
 $previous_php_settings = readPHPSettings((int) $id, $php_version);
 foreach ($subdomain_edit_data['domain_add']['sections']['section_c']['fields'] as $key => $field) {
     $label = $field['label'];
     if (strstr($key, 'zend_extension') !== false) {
         $label = $key;
     }
     $options = '';
     $selected_value = $field['default'];
     if (isset($previous_php_settings[$label])) {
         $selected_value = $previous_php_settings[$label];
     }
     // Allowed to see?
     $check_key = substr($key, 0, 4) == 'php_' ? substr($key, 4) : $key;
     if (!checkNitradoServiceLimit((int) $userinfo['customerid'], 'php', $check_key, $selected_value)) {
         continue;
     }