Exemplo n.º 1
0
        stExec($stH, array(empty($_SESSION['lcUser']) ? $_GET['lcUser'] : $_SESSION['lcUser']));
        unset($_SESSION['uid'], $_SESSION['lcUser'], $_GET['lcUser']);
        $row = $stH->fetch(PDO::FETCH_NUM);
        $stH = null;
        //release statement handle
        if (!empty($row)) {
            //user id found
            $_SESSION['uid'] = $row[0];
        }
    }
    //if no SSO get user ID
    if (empty($_SESSION['uid'])) {
        $_SESSION['uid'] = isset($_COOKIE['LCALuid']) ? @unserialize($_COOKIE['LCALuid']) : 1;
    }
    //get all calender IDs
    $_SESSION['calIDs'] = getCIDs();
} else {
    //internal hit
    //get calendar ID
    if (empty($_SESSION)) {
        //session expired, get cal & user ID from cookies
        $calID = $_SESSION['cal'] = isset($_COOKIE['LCALcid']) ? @unserialize($_COOKIE['LCALcid']) : $dbDef;
        $_SESSION['uid'] = isset($_COOKIE['LCALuid']) ? @unserialize($_COOKIE['LCALuid']) : 1;
    } elseif (isset($_POST['cal'])) {
        //switch cal
        $calID = $_SESSION['cal'] = $_POST['cal'];
        setcookie('LCALcid', serialize($calID), $nowTS + 2592000);
        //set calID cookie to 30 days
    } elseif (isset($_SESSION['cal'])) {
        //active cal
        $calID = $_SESSION['cal'];
Exemplo n.º 2
0
//end of Send cronjob summary
//
//set working directory
chdir(dirname(__FILE__));
//all event categories
$ucats = 0;
//load config data
require './lcconfig.php';
//load toolbox
require './common/toolbox.php';
require './common/toolboxd.php';
//database tools
//log start of cron job
logMessage('luxcal', 'Cron job started', true, 'lcalcron:' . __LINE__);
//get calendars
$calIDs = getCIDs();
if (empty($calIDs)) {
    exit('No calendars found in database');
}
//load retrieve functions
require './common/retrieve.php';
require './common/retrieve2.php';
//load cronjob functions
require './cronjobs/notify.php';
require './cronjobs/sendchg.php';
require './cronjobs/expical.php';
require './cronjobs/eventchk.php';
require './cronjobs/userchk.php';
//run job for each calendar in the db
foreach ($calIDs as $calID) {
    //connect to database