Example #1
0
 * Enable debug info
 */
define("_SSC_DEBUG", 0);
$ssc_execute_time = microtime(true);
error_reporting(E_ALL);
// App startup
include './includes/core.inc.php';
// We don't need the front-end initialized for ajax requests
if (isset($_GET['ajax']) && $_GET['ajax'] == 'y') {
    ssc_init(SSC_INIT_EXTENSION);
    header("Content-type: application/x-javascript; charset=utf-8", true);
    // Hook in form validation as a core function
    if (isset($_GET['core']) && $_GET['core'] == 'val-form') {
        // Check the form target exists
        if (!isset($_GET['form'])) {
            exit;
        }
        $target = str_replace("-", "_", $_GET['form']);
        if (function_exists($target)) {
            echo json_encode($target());
        }
    } else {
        echo ssc_execute();
    }
} else {
    ssc_init(SSC_INIT_FULL);
    $page = ssc_execute();
    theme_render($page);
}
// Clean up
ssc_close();
Example #2
0
 */
define("_VALID_SSC", 1);
define("SSC_CRON_MIN_TIME", 60 * 59);
// Minimum 1hr time
// Only load from internally
if (isset($_SERVER['REMOTE_ADDR']) || !isset($_SERVER['argv'])) {
    die('Restricted access');
}
$sites = glob('./config/*.settings.inc.php');
if ($sites === false) {
    die('Restricted access');
}
include './includes/core.inc.php';
foreach ($sites as $site) {
    $site = str_replace(".settings.inc.php", "", $site);
    $site = substr($site, 9);
    $_SERVER['SERVER_NAME'] = $site;
    if ($site == 'default') {
        continue;
    }
    // Begin application startup
    ssc_init(SSC_INIT_EXTENSION);
    $lastrun = ssc_var_get("cron_last_run", 0);
    $now = time();
    // Run only if not up to hardcoded minimum per-run time
    if ($lastrun < $now - SSC_CRON_MIN_TIME) {
        module_hook('cron');
    }
    ssc_var_set("cron_last_run", $now);
    ssc_close();
}