public function execute($request, $response)
 {
     //Destroy corresponding session in API
     ServiceUtils::DestroySession(session_id());
     /* Clear all session variables */
     foreach ($_SESSION as $key => $session_item) {
         unset($_SESSION[$key]);
     }
     session_unset();
     session_destroy();
     //            header("Location: " . BASE_URL . WEBAPP_HOME_PAGE );
     header("Location: " . BASE_URL . "/EditUser");
     exit;
 }
Example #2
0
 function checkServiceCall()
 {
     if (isset($_GET['AjaxServiceCall'])) {
         $param_errors = array();
         $object = null;
         $method = null;
         if (!isset($_GET['ServiceObject'])) {
             array_push($param_errors, 'Missing object definition!');
         } else {
             $object = $_GET['ServiceObject'];
             if ($object == '') {
                 $object = null;
             }
         }
         if (!isset($_GET['ServiceMethod'])) {
             array_push($param_errors, 'Missing method definition!');
         } else {
             $method = $_GET['ServiceMethod'];
         }
         if (!$this->findServiceCall($object, $method)) {
             array_push($param_errors, 'The object / method pair is not defined in this page for object: ' . $object . ', method: ' . $method . '!');
         }
         if (count($param_errors) > 0) {
             ServiceUtils::showMissingAjaxServiceParamsError($param_errors);
         }
     }
 }
Example #3
0
    KT_sendExpireHeader($seconds_expire);
    $isOpera = false;
    if (isset($_SERVER) && isset($_SERVER['HTTP_USER_AGENT'])) {
        if (stristr($_SERVER['HTTP_USER_AGENT'], 'opera/9.')) {
            $isOpera = true;
        }
    }
    if (isset($_SERVER['HTTP_KT_CHARSET'])) {
        header('Content-Type: text/' . (!$isOpera ? 'jaxon' : 'plain') . '; charset=' . $_SERVER['HTTP_KT_CHARSET']);
    } else {
        header('Content-Type: text/' . (!$isOpera ? 'jaxon' : 'plain') . '');
    }
    echo $s->execute();
} else {
    // do not cache AJAX Requests
    $seconds_expire = -86400;
    //one day ago
    KT_sendExpireHeader($seconds_expire);
    $isOpera = false;
    if (isset($_SERVER) && isset($_SERVER['HTTP_USER_AGENT'])) {
        if (stristr($_SERVER['HTTP_USER_AGENT'], 'opera/9.')) {
            $isOpera = true;
        }
    }
    if (isset($_SERVER['HTTP_KT_CHARSET'])) {
        header('Content-Type: text/' . (!$isOpera ? 'jaxon' : 'plain') . '; charset=' . $_SERVER['HTTP_KT_CHARSET']);
    } else {
        header('Content-Type: text/' . (!$isOpera ? 'jaxon' : 'plain') . '');
    }
    ServiceUtils::showMissingParamsError("gallery", array('gallery_id'));
}
require_once 'Google/Api/Ads/Common/Util/MapUtils.php';
try {
    // Get DfpUser from credentials in "../auth.ini"
    // relative to the DfpUser.php file's directory.
    $user = new DfpUser();
    // Log SOAP XML request and response.
    $user->LogDefaults();
    // Get the SuggestedAdUnitService.
    $suggestedAdUnitService = $user->GetService('SuggestedAdUnitService', 'v201208');
    // Set the number of requests to 50 or more.
    define('NUMBER_OF_REQUESTS', 50);
    // Create statement text to select all suggested ad units
    // that have been requested 50 times or more.
    $filterStatementText = 'WHERE numRequests >= ' . NUMBER_OF_REQUESTS;
    // Get all suggested ad units.
    $allSuggestedAdUnits = ServiceUtils::GetAllObjects($suggestedAdUnitService, 'getSuggestedAdUnitsByStatement', $filterStatementText);
    $numSuggestedAdUnits = 0;
    foreach ($allSuggestedAdUnits as $suggestedAdUnit) {
        $numSuggestedAdUnits++;
        printf("%d) Suggested ad unit with ID '%s' and number of requests '%d' " . "will be approved.\n", $numSuggestedAdUnits, $suggestedAdUnit->id, $suggestedAdUnit->numRequests);
    }
    printf("Number of suggested ad units to be approved: %d\n", $numSuggestedAdUnits);
    if ($numSuggestedAdUnits > 0) {
        // Create action statement.
        $filterStatement = new Statement($filterStatementText);
        // Create action.
        $action = new ApproveSuggestedAdUnit();
        // Perform action.
        $result = $suggestedAdUnitService->performSuggestedAdUnitAction($action, $filterStatementText);
        // Display results.
        if (isset($result) && $result->numChanges > 0) {
 public static function GetCountriesDropdown()
 {
     //Initialise
     $dropdown = "";
     //Get countries from Server collection
     $countriesArrayTemp = ServiceUtils::GetAllCountries();
     if (count($countriesArrayTemp) > 0) {
         foreach ($countriesArrayTemp as $value) {
             $countriesArray[] = array("id" => $value["id"]['$id'], "name" => $value["name"], "code" => $value["code"], "alias" => $value["alias"]);
         }
     }
     return $countriesArray;
 }