Esempio n. 1
0
        $app->error('Reseller: ' . $wb["limit_aps_txt"]);
    }
}
$adminflag = $_SESSION['s']['user']['typ'] == 'admin' ? true : false;
$gui = new ApsGUIController($app);
$pkg_id = isset($_GET['id']) ? $app->db->quote($_GET['id']) : '';
// Check if a newer version is available for the current package
// Note: It's intended that here is no strict ID check (see below)
if (isset($pkg_id)) {
    $newest_pkg_id = $gui->getNewestPackageID($pkg_id);
    if ($newest_pkg_id != 0) {
        $pkg_id = $newest_pkg_id;
    }
}
// Make sure an integer ID is given
if (!isset($pkg_id) || !$gui->isValidPackageID($pkg_id, $adminflag)) {
    $app->error($app->lng('Invalid ID'));
}
// Get package details
$details = $gui->getPackageDetails($pkg_id);
if (isset($details['error'])) {
    $app->error($details['error']);
}
$settings = $gui->getPackageSettings($pkg_id);
if (isset($settings['error'])) {
    $app->error($settings['error']);
}
// Get domain list
$domains = array();
$domain_for_user = '';
if (!$adminflag) {
Esempio n. 2
0
$app->load('aps_guicontroller');
// Check the module permissions
$app->auth->check_module_permissions('sites');
$gui = new ApsGUIController($app);
// An action and ID are required in any case
if (!isset($_GET['action'])) {
    die('No action');
}
// List of operations which can be performed
if ($_GET['action'] == 'change_status') {
    // Only admins can perform this operation
    if ($_SESSION['s']['user']['typ'] != 'admin') {
        die('For admin use only.');
    }
    // Make sure a valid package ID is given
    if (!$gui->isValidPackageID($_GET['id'], true)) {
        die($app->lng('Invalid ID'));
    }
    // Change the existing status to the opposite
    $get_status = $app->db->queryOneRecord("SELECT package_status FROM aps_packages WHERE id = '" . $app->functions->intval($_GET['id']) . "';");
    if ($get_status['package_status'] == strval(PACKAGE_LOCKED)) {
        $app->db->query("UPDATE aps_packages SET package_status = " . PACKAGE_ENABLED . " WHERE id = '" . $app->functions->intval($_GET['id']) . "';");
        echo '<div class="swap" id="ir-Yes"><span>' . $app->lng('Yes') . '</span></div>';
    } else {
        $app->db->query("UPDATE aps_packages SET Package_status = " . PACKAGE_LOCKED . " WHERE id = '" . $app->functions->intval($_GET['id']) . "';");
        echo '<div class="swap" id="ir-No"><span>' . $app->lng('No') . '</span></div>';
    }
} else {
    if ($_GET['action'] == 'delete_instance') {
        // Make sure a valid package ID is given (also corresponding to the calling user)
        $client_id = 0;