Ejemplo n.º 1
0
function phpVersionOptions($customerID, $domainID)
{
    global $db, $availablePHPVersions;
    $selectedPHPVersion = currentPHPVersion($customerID, $domainID);
    $phpVersionOptions = '';
    foreach ($availablePHPVersions as $phpVersion) {
        if (checkNitradoServiceLimit($customerID, 'php', 'php_version', $phpVersion)) {
            $phpVersionOptions .= makeoption($phpVersion, $phpVersion, $selectedPHPVersion, true);
        }
    }
    return $phpVersionOptions;
}
Ejemplo n.º 2
0
function savePHPSettings($panel_domain_id, $customer_id, $settings)
{
    global $db;
    $result = $db->query_first("SELECT `special_phpsettings` FROM `" . TABLE_PANEL_DOMAINS . "`\n        WHERE id = '" . $panel_domain_id . "'");
    $php_settings = "";
    foreach ($settings as $key => $value) {
        if ($value == "disabled") {
            continue;
        }
        if (strstr($key, "zend_extension") !== false) {
            $key = "zend_extension";
        }
        // Check restrictions before saving ...
        if (checkNitradoServiceLimit($customer_id, 'php', $key, $value)) {
            $php_settings .= "{$key} = {$value}\n";
        }
    }
    $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET\n       `special_phpsettings` = '" . $db->escape($php_settings) . "'\n        WHERE id = '" . $panel_domain_id . "'");
    inserttask('1');
    inserttask('5');
    inserttask('9');
    inserttask('10');
    return $php_settings;
}
Ejemplo n.º 3
0
                    $db_root = new db($sql_root[$result['dbserver']]['host'], $sql_root[$result['dbserver']]['user'], $sql_root[$result['dbserver']]['password'], '');
                    foreach (array_map('trim', explode(',', $settings['system']['mysql_access_host'])) as $mysql_access_host) {
                        $db_root->query('SET PASSWORD FOR `' . $db_root->escape($result['databasename']) . '`@`' . $db_root->escape($mysql_access_host) . '` = PASSWORD(\'' . $db_root->escape($password) . '\')');
                    }
                    //if ($access_result['allow_external_access'] == '1' && $_POST['mysql_allow_external_access'] == '1') {
                    if ($external_access_val == '1') {
                        $db_root->query('SET PASSWORD FOR `' . $db_root->escape($result['databasename']) . '`@`%` = PASSWORD(\'' . $db_root->escape($password) . '\')');
                    }
                    $db_root->query('FLUSH PRIVILEGES');
                    $db_root->close();
                    // End root-session
                }
                // Update the Database description -- PH 2004-11-29
                $log->logAction(USR_ACTION, LOG_INFO, "edited database '" . $result['databasename'] . "'");
                $databasedescription = validate($_POST['description'], 'description');
                $db->query('UPDATE `' . TABLE_PANEL_DATABASES . '` SET `description`="' . $db->escape($databasedescription) . '", `allow_external_access`="' . $external_access_val . '" WHERE `customerid`="' . (int) $userinfo['customerid'] . '" AND `id`="' . (int) $id . '"');
                redirectTo($filename, array('page' => $page, 's' => $s));
            } else {
                $access_result = $db->query_first('SELECT `allow_external_access` FROM `' . TABLE_PANEL_DATABASES . '` WHERE `customerid`="' . (int) $userinfo['customerid'] . '" AND `id`="' . (int) $id . '"');
                $mysql_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/mysql/formfield.mysql_edit.php');
                if (!checkNitradoServiceLimit((int) $userinfo['customerid'], 'mysql', 'allow_external_access', '1')) {
                    unset($mysql_edit_data['mysql_edit']['sections']['section_a']['fields']['mysql_allow_external_access']);
                }
                $mysql_edit_form = htmlform::genHTMLForm($mysql_edit_data);
                $title = $mysql_edit_data['mysql_edit']['title'];
                $image = $mysql_edit_data['mysql_edit']['image'];
                eval("echo \"" . getTemplate("mysql/mysqls_edit") . "\";");
            }
        }
    }
}