Пример #1
0
        $name = CronTask::launch(-CronTask::MODE_INTERNAL, 1, $_POST['execute']);
    }
    if ($name) {
        //TRANS: %s is a task name
        Session::addMessageAfterRedirect(sprintf(__('Task %s executed'), $name));
    }
    Html::back();
} else {
    if (isset($_POST["update"])) {
        Session::checkRight('config', UPDATE);
        $crontask->update($_POST);
        Html::back();
    } else {
        if (isset($_POST['resetdate']) && isset($_POST["id"])) {
            Session::checkRight('config', UPDATE);
            if ($crontask->getFromDB($_POST["id"])) {
                $crontask->resetDate();
            }
            Html::back();
        } else {
            if (isset($_POST['resetstate']) && isset($_POST["id"])) {
                Session::checkRight('config', UPDATE);
                if ($crontask->getFromDB($_POST["id"])) {
                    $crontask->resetState();
                }
                Html::back();
            } else {
                if (!isset($_GET["id"]) || empty($_GET["id"])) {
                    exit;
                }
                Html::header(Crontask::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], 'config', 'crontask');
Пример #2
0
// ----------------------------------------------------------------------
// Original Author of file: Remi Collet
// Purpose of file: Display tab on CronTask form
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
header_nocache();
if (!isset($_POST["id"])) {
    exit;
}
if (!isset($_REQUEST['glpi_tab'])) {
    exit;
}
$crontask = new CronTask();
if ($_POST['id'] > 0 && $crontask->getFromDB($_POST['id'])) {
    switch ($_REQUEST['glpi_tab']) {
        case -1:
            $crontask->showStatistics();
            $crontask->showHistory();
            Plugin::displayAction($crontask, $_REQUEST['glpi_tab']);
            break;
        case 2:
            $crontask->showHistory();
            break;
        default:
            if (!Plugin::displayAction($crontask, $_REQUEST['glpi_tab'])) {
                $crontask->showStatistics();
            }
    }
}
Пример #3
0
                     $input['_link']['link'] = $_POST['link'];
                     $input['_link']['tickets_id_2'] = $key;
                     if ($ticket->can($_POST['tickets_id_1'], 'w')) {
                         $ticket->update($input);
                     }
                 }
             }
         }
     }
     break;
 case 'reset':
     if ($_POST["itemtype"] == 'CronTask') {
         checkRight('config', 'w');
         $crontask = new CronTask();
         foreach ($_POST["item"] as $key => $val) {
             if ($val == 1 && $crontask->getFromDB($key)) {
                 $crontask->resetDate();
             }
         }
     }
     break;
 case 'move_under':
     if (isset($_POST['parent'])) {
         $fk = $item->getForeignKeyField();
         $parent = new $_POST["itemtype"]();
         if ($parent->getFromDB($_POST['parent'])) {
             foreach ($_POST["item"] as $key => $val) {
                 if ($val == 1 && $item->can($key, 'w')) {
                     // Check if parent is not a child of the original one
                     if (!in_array($parent->getID(), getSonsOf($item->getTable(), $item->getID()))) {
                         $item->update(array('id' => $key, $fk => $_POST['parent']));
Пример #4
0
*/
// ----------------------------------------------------------------------
// Original Author of file: Remi Collet
// Purpose of file: Form to edit Cron Task
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
$crontask = new CronTask();
if (isset($_POST["update"])) {
    checkRight('config', 'w');
    $crontask->update($_POST);
    glpi_header($_SERVER['HTTP_REFERER']);
} else {
    if (isset($_GET['resetdate']) && isset($_GET["id"])) {
        checkRight('config', 'w');
        if ($crontask->getFromDB($_GET["id"])) {
            $crontask->resetDate();
        }
        glpi_header($_SERVER['HTTP_REFERER']);
    } else {
        if (isset($_GET['resetstate']) && isset($_GET["id"])) {
            checkRight('config', 'w');
            if ($crontask->getFromDB($_GET["id"])) {
                $crontask->resetState();
            }
            glpi_header($_SERVER['HTTP_REFERER']);
        } else {
            if (!isset($_GET["id"]) || empty($_GET["id"])) {
                exit;
            }
            commonHeader($LANG['crontask'][0], $_SERVER['PHP_SELF'], "config", "crontask");