예제 #1
0
파일: update.php 프로젝트: 62BRAINS/EPESI
 protected function check_user()
 {
     if ($this->CLI) {
         Base_AclCommon::set_sa_user();
         if (!Base_AclCommon::i_am_sa()) {
             $this->quit('No proper admin user.');
         }
     }
     return Base_AclCommon::i_am_sa();
 }
예제 #2
0
파일: cron.php 프로젝트: 62BRAINS/EPESI
    require_once DATA_DIR . '/cron_token.php';
    if (CRON_TOKEN != $_GET['token']) {
        die('Invalid token in URL - please go to Administrator Panel->Cron and copy valid cron URL.');
    }
}
require_once 'include.php';
$lock = DATA_DIR . '/cron.lock';
if (file_exists($lock) && filemtime($lock) > time() - 6 * 3600) {
    die;
}
register_shutdown_function(create_function('', '@unlink("' . $lock . '");'));
file_put_contents($lock, '');
set_time_limit(0);
ini_set('memory_limit', '512M');
ModuleManager::load_modules();
Base_AclCommon::set_sa_user();
$ret = ModuleManager::call_common_methods('cron');
$cron_last = DB::GetAssoc('SELECT func,last,running FROM cron ORDER BY last');
$cron_funcs_prior = array();
//array of outdated cron callbacks
$t = time();
foreach ($ret as $name => $obj) {
    if (!$obj) {
        continue;
    }
    if (is_array($obj)) {
        foreach ($obj as $func => $every) {
            if (!strpos($func, '::')) {
                $func = $name . 'Common::' . $func;
            }
            $func_md5 = md5($func);