function CheckForPageSwitch()
{
    $nextPage = GetHiddenVar(NEXT_PAGE_ID);
    if ($nextPage != "") {
        SwitchToPage($nextPage);
    }
}
Exemple #2
0
             if ($packageNameLen < 4 || substr($packageName, $packageNameLen - 4, 4) != '.mgp') {
                 $fullPackageName = $packageName . '.mgp';
             } else {
                 $fullPackageName = $packageName;
             }
             foreach ($packages as $package) {
                 if (strcasecmp($package, $fullPackageName) == 0) {
                     $duplicatePackageName = true;
                     break;
                 }
             }
         }
         if (!$duplicatePackageName || $overwrite) {
             $folderName = str_replace(' ', '%20', $folderName);
             $packageName = str_replace(' ', '%20', $packageName);
             SwitchToPage('makepackage.php?' . $folderNameID . '=' . $folderName . '&' . $packageNameID . '=' . $packageName);
         }
     } catch (Exception $e) {
         if (empty($makePackageErrorMsg)) {
             $packageMakeErrorMsg = $e->getMessage();
         }
     }
 } else {
     try {
         // Are we switching to another page?
         CheckForPageSwitch();
         // Are we deleting the selected package?
         if (CheckForDeleteSelection() && DeletePackage($selectedPackage)) {
             $packageLoadConfirmationMsg = sprintf($confSuccessfulDeletion, $selectedPackage);
         }
     } catch (MgException $e) {
Exemple #3
0
    }
    // Get submitted data
    if (array_key_exists($selectedItemID, $_POST)) {
        $selectedItem = $_POST[$selectedItemID];
    }
    if (array_key_exists($selectedItemID, $_POST)) {
        $selectedItem = $_POST[$selectedItemID];
    }
    if (array_key_exists($viewSelectionID, $_POST)) {
        $viewSelection = $_POST[$viewSelectionID] == 'true';
    }
    // Are we switching to another page?
    $nextPage = GetHiddenVar(NEXT_PAGE_ID);
    if ($nextPage != "") {
        $selectedLog = $selectedItem;
        SwitchToPage($nextPage);
    }
    // Create a ServerAdmin object.
    $serverAdmin = new MgServerAdmin();
    $serverAdmin->Open($selectedServer, $userInfo);
    // Are we deleting the selected file?
    if (CheckForDeleteSelection()) {
        $serverAdmin->DeleteLog($selectedItem);
        $confirmationMsg = sprintf($confSuccessfulDeletion, $selectedItem);
    }
} catch (MgException $e) {
    CheckForFatalMgException($e);
    $errorMsg = $e->GetExceptionMessage();
} catch (Exception $e) {
    $errorMsg = $e->getMessage();
}