* * Unicode Reminder メモ * * Processes the `notify_waiting` table and sends notification mails * on new caches and new OConly attributes. ***************************************************************************/ // needs absolute rootpath because called as cronjob $rootpath = dirname(__FILE__) . '/../../'; require_once $rootpath . 'lib/clicompatbase.inc.php'; require_once $rootpath . 'lib2/translate.class.php'; require_once 'settings.inc.php'; require_once $rootpath . 'lib/consts.inc.php'; require_once $rootpath . 'lib2/ProcessSync.class.php'; require_once $rootpath . 'lib/logic.inc.php'; require_once $rootpath . 'lib2/logic/geomath.class.php'; if (!cronjobs_enabled()) { exit; } // db connect db_connect(); if ($dblink === false) { echo 'Unable to connect to database'; exit; } $process_sync = new ProcessSync('run_notify'); if ($process_sync->Enter()) { // send out everything that has to be sent $rsNotify = sql("SELECT\n `notify_waiting`.`id`, `notify_waiting`.`cache_id`, `notify_waiting`.`type`,\n `user`.`username`,\n `user2`.`email`, `user2`.`username` AS `recpname`, `user2`.`latitude` AS `lat1`,\n `user2`.`longitude` AS `lon1`, `user2`.`user_id` AS `recid`,\n IFNULL(`user2`.`language`,'&1') AS `recp_lang`,\n `user2`.`domain` AS `recp_domain`,\n `caches`.`name` AS `cachename`, `caches`.`latitude`\n AS `lat2`, `caches`.`longitude`\n AS `lon2`, `caches`.`wp_oc`,\n `caches`.`date_hidden`,\n `caches`.`type` AS `cachetype`, `caches`.`size` AS `cachesize`,\n `cache_status`.`allow_user_view`,\n `ca`.`attrib_id` IS NOT NULL AS `oconly`\n FROM `notify_waiting`\n INNER JOIN `caches` ON `notify_waiting`.`cache_id`=`caches`.`cache_id`\n INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`\n INNER JOIN `user` `user2` ON `notify_waiting`.`user_id`=`user2`.`user_id`\n INNER JOIN `cache_type` ON `caches`.`type`=`cache_type`.`id`\n INNER JOIN `cache_size` ON `caches`.`size`=`cache_size`.`id`\n INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`\n LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `ca`.`attrib_id`=6", $opt['template']['default']['locale']); while ($rNotify = sql_fetch_array($rsNotify)) { if ($rNotify['allow_user_view']) { process_new_cache($rNotify);
$process_sync = new ProcessSync('runcron'); if ($process_sync->Enter()) { // Run as system user, if possible. // This is relevant e.g. for publishing and for auto-archiving caches. if ($opt['logic']['systemuser']['user'] != '') { if (!$login->system_login($opt['logic']['systemuser']['user'])) { die("ERROR: runcron system user login failed"); } } $modules_dir = $opt['rootpath'] . 'util2/cron/modules/'; if (count($argv) == 2 && !strstr("/", $argv[1])) { // run one job manually for debugging purpose $ignore_interval = true; require $modules_dir . $argv[1] . ".class.php"; } else { if (cronjobs_enabled()) { $ignore_interval = false; $hDir = opendir($modules_dir); while (false !== ($file = readdir($hDir))) { if (substr($file, -10) == '.class.php') { require $modules_dir . $file; } } } } $process_sync->Leave(); } function checkJob(&$job) { global $ignore_interval; $max_last_run = strftime(DB_DATE_FORMAT, time() - ($ignore_interval ? 0 : $job->interval));