Example #1
0
<?php

include "../include/common.php";
include "../config.php";
include "../include/session.php";
include "../include/dbconnect.php";
include "../include/account.php";
include "../include/ghost.php";
if (isset($_SESSION['account_id']) && isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) && isset($_SESSION['is_' . $_REQUEST['id'] . '_ghost'])) {
    if (isset($_POST['action']) && $_POST['action'] == "update") {
        //create array of configurations we are updating
        $array = ghostGetConfigFromRequest(ghostGetParameters($_REQUEST['id']), $_REQUEST);
        ghostReconfigure($_REQUEST['id'], $array);
        if (!isset($_SESSION['noredirect'])) {
            header("Location: config_ghost.php?id=" . $_REQUEST['id']);
            return;
        }
    }
    $gconfig = ghostGetConfiguration($_REQUEST['id']);
    get_page("config_ghost", "ghost", array('service_id' => $_REQUEST['id'], 'gconfig' => $gconfig, 'parameters' => $ghostParameters));
} else {
    header("Location: ../panel/");
}
Example #2
0
             $bnet_keys = array_keys($bnets);
             if (count($bnet_keys) > 0) {
                 $bnet_id = $bnet_keys[count($bnet_keys) - 1];
             }
         } else {
             $message = $result;
         }
     } else {
         if ($_POST['action'] == "remove" && isset($_POST['bnet'])) {
             $bnet_id = $_POST['bnet'];
             ghostRemoveBnet($_REQUEST['id'], $bnet_id);
         } else {
             if ($_POST['action'] == "update" && isset($_POST['bnet'])) {
                 //get parameters for this case
                 $bnet_id = $_POST['bnet'];
                 $array = ghostGetConfigFromRequest($bnetParameters, $_REQUEST);
                 ghostReconfigureBnet($_REQUEST['id'], $bnet_id, $array);
             }
         }
     }
     if (!isset($_SESSION['noredirect'])) {
         header("Location: config_realm.php?id=" . $_REQUEST['id'] . "&bnet={$bnet_id}&message=" . urlencode($message));
         return;
     }
 }
 if ($bnets === false) {
     $bnets = ghostGetBnet($_REQUEST['id']);
 }
 if (isset($_REQUEST['bnet']) && isset($bnets[$_REQUEST['bnet']]) && isset($bnets[$_REQUEST['bnet']])) {
     $bnet_id = $_REQUEST['bnet'];
 }