<?php

/**
 * $Id$
 *  
 * @category System
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
$identifiant = CValue::get("identifiant");
$list_ip = trim(CAppUI::conf("servers_ip"));
$address = array();
if ($list_ip) {
    $address = preg_split("/\\s*,\\s*/", $list_ip, -1, PREG_SPLIT_NO_EMPTY);
}
$cronjob = new CCronJob();
$cronjob->load($identifiant);
$smarty = new CSmartyDP();
$smarty->assign("cronjob", $cronjob);
$smarty->assign("address", $address);
$smarty->display("inc_edit_cronjob.tpl");
<?php

/**
 * $Id$
 *  
 * @category System
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
$cronjob = new CCronJob();
/** @var CCronJob[] $cronjobs */
$cronjobs = $cronjob->loadList();
$cronjob->loadLibrary();
foreach ($cronjobs as $_cronjob) {
    $_cronjob->getNextDate();
}
$smarty = new CSmartyDP();
$smarty->assign("cronjobs", $cronjobs);
$smarty->display("inc_list_cronjobs.tpl");
Exemple #3
0
/**
 * $Id$
 *  
 * @category System
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
//Chargement des librairies
CCronJob::loadLibrary();
$now = CMbDT::dateTime();
$cronjob = new CCronJob();
$cronjob->active = "1";
/** @var CCronJob[] $cronjobs */
$cronjobs = $cronjob->loadMatchingList();
$server_addr = get_server_var("SERVER_ADDR");
//Parcours des tâches actives
foreach ($cronjobs as $_cronjob) {
    if ($_cronjob->_servers && !in_array($server_addr, $_cronjob->_servers)) {
        continue;
    }
    //Récupération de la prochaine date d'éxécution
    $next = $_cronjob->getNextDate(1);
    $next = current($next);
    $tolerance = CMbDT::dateTime("+ 5 SECOND", $next);
    //On vérifie si le script doit être éxécuté
    if ($next <= $now && $now <= $tolerance) {