82 lines
2.7 KiB
PHP
82 lines
2.7 KiB
PHP
<?php
|
|
|
|
// CRONJOB - klice se vsako noc okoli treh
|
|
|
|
ob_start();
|
|
set_time_limit(2400); # 30 minut
|
|
|
|
include_once('../admin/survey/definition.php');
|
|
include_once('../function.php');
|
|
include_once('../vendor/autoload.php');
|
|
|
|
|
|
// Nov nacin za izvajanje cronjobov (razred utils/1kaCron/class.CronJobs.php)
|
|
$cj = new CronJobs();
|
|
|
|
// Cronjobe logiramo
|
|
$SL = new SurveyLog();
|
|
|
|
|
|
|
|
/*** BRISANJE ***/
|
|
|
|
// Brisanje pobrisanih anket (starejsih od 1 meseca) (prej utils/cronetab_send_survey_alert.php)
|
|
$SL->addMessage(SurveyLog::INFO, "CRONJOB 3am - brisanje pobrisanih anket (starejsih od 1 meseca)");
|
|
$cj->executeAction('surveyDeleteFromDB');
|
|
|
|
// Brisanje pobrisanih podatkov anket (starejsi od 3 mesecev)
|
|
$SL->addMessage(SurveyLog::INFO, "CRONJOB 3am - brisanje pobrisanih podatkov anket (starejsi od 3 mesecev)");
|
|
$cj->executeAction('userDeleteFromDB');
|
|
|
|
// Brisanje pingdom podatkov anket
|
|
$SL->addMessage(SurveyLog::INFO, "CRONJOB 3am - brisanje podatkov iz pingdom anket");
|
|
$cj->executeAction('userPingdomDeleteFromDB');
|
|
|
|
// Generiranje grafov - zanekrat samo čistimo stare grafe (starejše od 30 dni) in ne generiramo ničesar
|
|
$SL->addMessage(SurveyLog::INFO, "CRONJOB 3am - ciscenje starih grafov");
|
|
$cj->executeAction('cacheCharts');
|
|
|
|
/*** BRISANJE KONEC ***/
|
|
|
|
|
|
|
|
/*** KESIRANJE ***/
|
|
|
|
// Generiranje podatkovnih datotek
|
|
$SL->addMessage(SurveyLog::INFO, "CRONJOB 3am - generiranje podatkovnih datotek");
|
|
$cj->executeAction('cacheData');
|
|
|
|
if(Common::checkModule('maza')){
|
|
// Za modul MAZA - javljanje aplikacijam, ce je anketa potekla (deaktivirana)
|
|
$SL->addMessage(SurveyLog::INFO, "CRONJOB 3am - MAZA posiljanje pretecenih anket");
|
|
$cj->executeAction('mazaCheckExpiredSurveys');
|
|
}
|
|
|
|
/*** KESIRANJE KONEC ***/
|
|
|
|
|
|
|
|
/*** OBVESTILA ***/
|
|
|
|
// Posiljanje obvestil o poteku anket (prej utils/cronetab_send_survey_alert.php) - TODO
|
|
//$SL->addMessage(SurveyLog::INFO, "CRONJOB 3am - posiljanje obvestil o poteku anket");
|
|
//$cj->executeAction('surveySendAlert');
|
|
|
|
// Posiljanje obvestila adminom za reset gesla vsakih 6 mesecev
|
|
//$SL->addMessage(SurveyLog::INFO, "CRONJOB 3am - posiljanje obvestila adminom za reset gesla vsakih 6 mesecev");
|
|
//$cj->executeAction('adminResetPassword');
|
|
|
|
// Posiljanje obvestila metaadminom in avtorju ankete 5 let po aktivaciji, da naj pobrisejo podatke
|
|
//$SL->addMessage(SurveyLog::INFO, "CRONJOB 3am - posiljanje gdpr obvestil po 5 letih za brisanje podatkov");
|
|
//$cj->executeAction('gdprMailExpired');
|
|
|
|
/*** OBVESTILA KONEC ***/
|
|
|
|
|
|
|
|
// Zapiše v log file
|
|
$SL->write();
|
|
|
|
|
|
ob_get_clean();
|
|
?>
|