Ejemplo n.º 1
0
 function __construct()
 {
     global $cms;
     $geo_service = $cms->getSetting("bigtree-internal-geocoding-service");
     // If for some reason the setting doesn't exist, make one.
     if (!is_array($geo_service) || !$geo_service["service"]) {
         $this->Service = "google";
         $admin = new BigTreeAdmin();
         $admin->createSetting(array("id" => "bigtree-internal-geocoding-service", "encrypted" => "on", "system" => "on"));
         $admin->updateSettingValue("bigtree-internal-geocoding-service", array("service" => "google"));
     } else {
         $this->Service = $geo_service["service"];
         $this->Settings = $geo_service;
     }
     // Yahoo BOSS Geocoding uses the Yahoo BOSS API.
     if ($this->Service == "yahoo-boss") {
         $this->API = new BigTreeYahooBOSSAPI();
     }
 }
Ejemplo n.º 2
0
 function __construct()
 {
     $admin = new BigTreeAdmin();
     $s = $admin->getSetting("bigtree-internal-payment-gateway");
     if ($s === false) {
         $admin->createSetting(array("id" => "bigtree-internal-payment-gateway", "system" => "on", "encrypted" => "on"));
         $s = array("service" => "", "settings" => array());
         $admin->updateSettingValue("bigtree-internal-payment-gateway", $s);
     }
     // If for some reason the setting doesn't exist, make one.
     $this->Service = isset($s["value"]["service"]) ? $s["value"]["service"] : "";
     $this->Settings = isset($s["value"]["settings"]) ? $s["value"]["settings"] : array();
     if ($this->Service == "authorize.net") {
         $this->setupAuthorize();
     } elseif ($this->Service == "paypal") {
         $this->setupPayPal();
     } elseif ($this->Service == "paypal-rest") {
         $this->setupPayPalREST();
     } elseif ($this->Service == "payflow") {
         $this->setupPayflow();
     } elseif ($this->Service == "linkpoint") {
         $this->setupLinkPoint();
     }
 }
Ejemplo n.º 3
0
    foreach ($footers as $footer) {
        include $footer;
    }
    die;
}
// We're loading a page in the admin, so let's pass some headers
header("Content-Type: text/html; charset=utf-8");
header("X-Frame-Options: SAMEORIGIN");
if (function_exists("header_remove")) {
    header_remove("Server");
    header_remove("X-Powered-By");
}
// Execute cron tab functions if they haven't been run in 24 hours
$last_check = $cms->getSetting("bigtree-internal-cron-last-run");
if ($last_check === false) {
    $admin->createSetting(array("id" => "bigtree-internal-cron-last-run", "system" => "on"));
}
// It's been more than 24 hours since we last ran cron.
if (time() - $last_check > 24 * 60 * 60) {
    // Update the setting.
    $admin->updateSettingValue("bigtree-internal-cron-last-run", time());
    // Email the daily digest
    $admin->emailDailyDigest();
    // Cache google analytics
    $ga = new BigTreeGoogleAnalyticsAPI();
    if ($ga->API && $ga->Profile) {
        // The Google Analytics wrappers can cause Exceptions and we don't want the page failing to load due to them.
        try {
            $ga->cacheInformation();
        } catch (Exception $e) {
            // We should log this in 4.1