Example #1
0
             $install_date = $date[2] . "/" . $date[0] . "/" . $date[1] . " " . $protectedPost['INSTALL_HEURE'];
         } else {
             $install_date = $date[2] . "/" . $date[1] . "/" . $date[0] . " " . $protectedPost['INSTALL_HEURE'];
         }
         active_option('DOWNLOAD_SCHEDULE', $list_id, $protectedPost['SELECT'], $install_date);
     }
     if (isset($protectedPost['DOWNLOAD_POSTCMD']) and $protectedPost['DOWNLOAD_POSTCMD'] != '') {
         active_option('DOWNLOAD_POSTCMD', $list_id, $protectedPost['SELECT'], $protectedPost['DOWNLOAD_POSTCMD']);
     }
     if ($protectedGet['origine'] == "group") {
         $form_to_reload = 'config_group';
     } elseif ($protectedGet['origine'] == "mach") {
         $form_to_reload = 'config_mach';
     }
     if ($protectedPost['onglet'] == 'MACH') {
         $nb_affect = active_option('DOWNLOAD', $list_id, $protectedPost['SELECT']);
     }
     if ($protectedPost['onglet'] == 'SERV_GROUP') {
         $nb_affect = active_serv($list_id, $protectedPost['SELECT'], $protectedPost['rule_choise']);
     }
     msg_success($nb_affect . " " . $l->g(604));
     if (isset($form_to_reload)) {
         //add this $var => not delete this package on computer detail
         $_SESSION['OCS']["justAdded"] = true;
         echo "<script language='javascript'> window.opener.document." . $form_to_reload . ".submit();</script>";
     }
 }
 if ($protectedPost['sens_' . $table_name] == "") {
     $protectedPost['sens_' . $table_name] = 'DESC';
 }
 if ($protectedPost['onglet'] == "") {
// This code is open source and may be copied and modified as long as the source
// code is always made freely available.
// Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
//====================================================================================
require 'require/function_telediff.php';
//you can delete all packets if status=NOTIFIED and date>3 mounths
if (isset($protectedGet['reset_notified']) and is_numeric($protectedGet['reset_notified'])) {
    desactive_packet($systemid, $protectedGet['reset_notified']);
}
//affect again a packet
if ($protectedPost['Valid_modif_x']) {
    if (trim($protectedPost['MOTIF'])) {
        if ($protectedPost["ACTION"] == "again") {
            //delete all info of specific teledeploy
            desactive_download_option($systemid, $protectedGet['affect_again']);
            active_option('DOWNLOAD', $systemid, $protectedGet['affect_again']);
        } elseif ($protectedPost["ACTION"] == "reset") {
            desactive_packet($systemid, $protectedGet['affect_reset']);
        }
        mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
        if (mysql_affected_rows() != 0) {
            $sql = "INSERT INTO itmgmt_comments (hardware_id,comments,user_insert,date_insert,action) \n\t\t\t\t\tvalues ('%s','%s','%s',%s,'%s => %s')";
            $arg = array($systemid, $protectedPost['MOTIF'], $_SESSION['OCS']["loggeduser"], "sysdate()", $protectedPost["ACTION"], $protectedPost['NAME_PACK']);
            mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
        }
    } else {
        msg_error($l->g(903));
    }
}
if ($protectedPost['Reset_modif_x']) {
    unset($protectedGet['affect_again'], $protectedGet['affect_reset']);