Ejemplo n.º 1
0
 $confirmationMsg = "";
 $errorMsg = "";
 $pageEnabled = false;
 $bSiteServer = false;
 // Get Server
 $siteServerAddress = $site->GetCurrentSiteAddress();
 GetServerSelection($selectedServerID, $selectedServer);
 $serverRec = GetDataForServer($selectedServer);
 if ($serverRec == NULL) {
     throw new Exception(sprintf($errNotFound, $selectedServer));
 }
 if (!$serverRec->poweredUp) {
     throw new Exception(sprintf($errServerIsDown, $selectedServer));
 }
 $bSiteServer = $siteServerAddress == $selectedServer;
 $serverRec = GetDataForServer($selectedServer);
 $pageEnabled = $serverRec->poweredUp;
 // Is this our first time here?
 if (FirstTimeHere($pageName)) {
     $refreshRequested = true;
 } else {
     $refreshRequested = CheckForRefresh();
 }
 // Get services for this server
 if ($refreshRequested) {
     // Get props values from server
     $serverAdmin = new MgServerAdmin();
     $serverAdmin->Open($selectedServer, $userInfo);
     $featureServiceProps->GetProps($serverAdmin);
     $tileServiceProps->GetProps($serverAdmin);
     if ($bSiteServer) {
Ejemplo n.º 2
0
function DeleteServer($serverAddress)
{
    global $site;
    global $serverData;
    // Validate
    $servers = GetServerData();
    if (empty($serverAddress) || !array_key_exists($serverAddress, $servers)) {
        return false;
    }
    // Delete the server.
    $serverRec = GetDataForServer($serverAddress);
    if ($serverRec == NULL) {
        return false;
    }
    $serverName = $serverRec->name;
    $site->RemoveServer($serverName);
    // Update local serverData array
    // Note that this is done rather than calling EnumerateServers, again, because EnumerateServers may take some time
    // to execute.
    $oldServerData = array();
    CopyArray($serverData, $oldServerData);
    $serverData = array();
    foreach ($oldServerData as $key => $val) {
        if ($key != $serverAddress) {
            $serverData[$key] = $val;
        }
    }
    return true;
}