当前位置: 首页>>代码示例>>PHP>>正文


PHP Notification::show方法代码示例

本文整理汇总了PHP中Notification::show方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::show方法的具体用法?PHP Notification::show怎么用?PHP Notification::show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notification的用法示例。


在下文中一共展示了Notification::show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: check_writable_relative

function check_writable_relative($dir)
{
    $uid = posix_getuid();
    $gid = posix_getgid();
    $user_info = posix_getpwuid($uid);
    $user = $user_info['name'];
    $group_info = posix_getgrgid($gid);
    $group = $group_info['name'];
    $fix_cmd = '. ' . _("To fix that, execute following commands as root") . ':<br><br>' . "cd " . getcwd() . "<br>" . "mkdir -p {$dir}<br>" . "chown {$user}:{$group} {$dir}<br>" . "chmod 0700 {$dir}";
    if (!is_dir($dir)) {
        $config_nt = array('content' => _("Required directory " . getcwd() . "{$dir} does not exist") . $fix_cmd, 'options' => array('type' => 'nf_warning', 'cancel_button' => FALSE), 'style' => 'width: 80%; margin: 20px auto;');
        $nt = new Notification('nt_1', $config_nt);
        $nt->show();
        exit;
    }
    if (!($stat = stat($dir))) {
        $config_nt = array('content' => _("Could not stat configs dir") . $fix_cmd, 'options' => array('type' => 'nf_warning', 'cancel_button' => FALSE), 'style' => 'width: 80%; margin: 20px auto;');
        $nt = new Notification('nt_1', $config_nt);
        $nt->show();
        exit;
    }
    // 2 -> file perms (must be 0700)
    // 4 -> uid (must be the apache uid)
    // 5 -> gid (must be the apache gid)
    if ($stat[2] != 16832 || $stat[4] !== $uid || $stat[5] !== $gid) {
        $config_nt = array('content' => _("Invalid perms for configs dir") . $fix_cmd, 'options' => array('type' => 'nf_warning', 'cancel_button' => FALSE), 'style' => 'width: 80%; margin: 20px auto;');
        $nt = new Notification('nt_1', $config_nt);
        $nt->show();
        exit;
    }
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:view.php

示例2: display_errors

function display_errors($info_error)
{
    $errors = implode("</div><div style='padding-top: 3px;'>", $info_error);
    $error_msg = "<div>" . _("The following errors occurred:") . "</div><div style='padding-left: 15px;'><div>{$errors}</div></div>";
    $config_nt = array('content' => $error_msg, 'options' => array('type' => 'nf_error', 'cancel_button' => FALSE), 'style' => 'width: 90%; margin: 20px auto; padding: 10px 0px; text-align: left; font-style: italic');
    $nt = new Notification('nt_1', $config_nt);
    return $nt->show(FALSE);
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:8,代码来源:incidenttag.php

示例3: show_notification

function show_notification($msg, $type = 'nf_error')
{
    echo "<div class='container' style='width:100%;height:30px;margin:10px auto;text-align:center'>";
    $config_nt = array('content' => $msg, 'options' => array('type' => $type, 'cancel_button' => FALSE), 'style' => ' margin:0 auto;text-align:center;');
    $nt = new Notification('nt_panel', $config_nt);
    $nt->show();
    echo "</div>";
    die;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:9,代码来源:repository_common.php

示例4: notify_and_die

function notify_and_die($msg, $db)
{
    $config_nt = array('content' => $msg, 'options' => array('type' => 'nf_error', 'cancel_button' => ''), 'style' => ' margin:25px auto 0 auto;text-align:center;padding:3px 30px;');
    $nt = new Notification('nt_panel', $config_nt);
    $nt->show();
    if (is_object($db)) {
        $db->close();
    }
    die;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:10,代码来源:alarm_detail.php

示例5: check_deploy_perms

function check_deploy_perms()
{
    if (!Session::am_i_admin()) {
        $config_nt = array('content' => _("You do not have permission to see this section"), 'options' => array('type' => 'nf_error', 'cancel_button' => false), 'style' => 'width: 60%; margin: 30px auto; text-align:center;');
        $nt = new Notification('nt_1', $config_nt);
        $nt->show();
        die;
    }
    return true;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:10,代码来源:deploy_common.php

示例6: prepare

 public function prepare()
 {
     $notification = new Notification($this->curpage, $this->db, $this->config);
     $notification->prepare();
     $mainToggle = '';
     $tasksToggle = '';
     $usersToggle = '';
     $serversToggle = '';
     $storeToggle = '';
     $settingsToggle = '';
     $route = getroute();
     if ($route == '') {
         $mainToggle = 'active';
     }
     if ($route == 'servers' || strpos('##' . $route, 'servers/')) {
         $serversToggle = 'active';
     } elseif ($route == 'tasks' || strpos('##' . $route, 'tasks/')) {
         $tasksToggle = 'active';
     }
     if ($route == 'users' || strpos('##' . $route, 'users/')) {
         $usersToggle = 'active';
     }
     if ($route == 'store' || strpos('##' . $route, 'store/')) {
         $storeToggle = 'active';
     }
     if ($route == 'settings' || strpos('##' . $route, 'settings/')) {
         $settingsToggle = 'active';
     }
     $this->data['mainToggle'] = $mainToggle;
     $this->data['tasksToggle'] = $tasksToggle;
     $this->data['usersToggle'] = $usersToggle;
     $this->data['serversToggle'] = $serversToggle;
     $this->data['storeToggle'] = $storeToggle;
     $this->data['settingsToggle'] = $settingsToggle;
     $this->data['notification'] = $notification->show();
 }
开发者ID:openweb-tech,项目名称:hotbackup,代码行数:36,代码来源:topMenu.php

示例7: _

echo $back_url;
?>
";return false;'/>
    </div> 
    
	<div id='av_info'>
		<?php 
if ($update == 1) {
    $config_nt = array('content' => _('Server saved successfully'), 'options' => array('type' => 'nf_success', 'cancel_button' => true), 'style' => 'width: 100%; margin: auto; text-align:center;');
    $nt = new Notification('nt_1', $config_nt);
    $nt->show();
}
if (!$can_i_modify_elem) {
    $config_nt = array('content' => _('The properties of this asset can only be modified at the USM:') . " <strong>" . $external_ctx . "</strong>", 'options' => array('type' => 'nf_warning', 'cancel_button' => TRUE), 'style' => 'width: 100%; margin: auto; text-align:center;');
    $nt = new Notification('nt_1', $config_nt);
    $nt->show();
}
?>
	</div>
	
	<div id='server_container'>
	    <div class='legend'>
            <?php 
echo _('Values marked with (*) are mandatory');
?>
        </div>	

	    <form method="post" name='form_server' id='form_server' action="<?php 
echo $action;
?>
">
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:newserverform.php

示例8: show_notif

function show_notif($msg, $type)
{
    $config_nt = array('content' => $msg, 'options' => array('type' => $type, 'cancel_button' => true), 'style' => 'position:absolute;top:15px;left:0;right:0;margin:0 auto;width:400px;text-align:center;padding:1px 20px;z-index:999');
    $nt = new Notification('nt_notif', $config_nt);
    $nt->show();
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:6,代码来源:list.php

示例9: array

                    </div>
                </td>
            </tr>
        </table>

        <?php 
if ($can_i_modify_elem) {
    ?>
            <table id='table_so'>
                <?php 
    if (!empty($config_nt['content'])) {
        $config_nt = array('content' => $config_nt['content'], 'options' => array('type' => $config_nt['options']['type'], 'cancel_button' => FALSE), 'style' => 'width: 100%; margin: auto; text-align:center;');
        $nt = new Notification('nt_1', $config_nt);
        ?>
                    <tr><td class='noborder center' style="padding:0px 0px 9px 0px;"><?php 
        echo $nt->show();
        ?>
</td></tr>
                    <?php 
    }
    ?>


                <!-- Inventory Tasks -->
                <tr>
                    <td class="sec_title"><?php 
    echo _("Inventory Task");
    ?>
</td>
                </tr>
开发者ID:jackpf,项目名称:ossim-arc,代码行数:30,代码来源:interfaces.php

示例10: _

                    <span class="s_label" id="sl_sboxs[]"><?php 
echo _('Sensors');
?>
</span>
                </td>
            </tr>


            <!-- Sensor inputs -->
            <?php 
$s_chks = array();
$no_sensors = '';
if ($s_total <= 0) {
    $config_nt = array('content' => _('Warning! No sensors found'), 'options' => array('type' => 'nf_warning', 'cancel_button' => FALSE), 'style' => 'width: 80%; margin: 25px auto; text-align: left; font-size: 11px;');
    $nt = new Notification('nt_1', $config_nt);
    $no_sensors = $nt->show(FALSE);
} else {
    $i = 1;
    foreach ($all_sensors as $s_id => $s_data) {
        $s_name = $s_data['name'];
        $s_ip = $s_data['ip'];
        $all_ctxs = $s_data['ctx'];
        $s_ctxs = '';
        $s_status = 'disabled';
        //Search enabled sensors by CTXs
        foreach ($all_ctxs as $e_id => $e_name) {
            if ($e_id == $ctx && !empty($ctx)) {
                $s_status = 'enabled';
            }
            $s_ctxs .= ' ' . $e_id;
        }
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:bk_tpl_tab_general.php

示例11: display_errors

function display_errors($info_error)
{
    $errors = implode("</div><div style='padding-top: 3px;'>", $info_error);
    $error_msg = "<div style='padding-bottom: 3px;'>" . _("We found the following errors:") . "</div>\n                    <div style='margin-left: 15px;'><div>{$errors}</div></div>";
    $style = empty($style) ? 'margin: 20px auto; width: 60%; text-align:left' : $style;
    $config_nt = array('content' => $error_msg, 'options' => array('type' => 'nf_error', 'cancel_button' => true), 'style' => $style);
    $nt = new Notification('nt_1', $config_nt);
    return $nt->show(false);
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:9,代码来源:wizard_common.php

示例12: show_incident_error

function show_incident_error($msg, $style = '', $type = 'nf_error')
{
    $config_nt = array('content' => $msg, 'options' => array('type' => $type, 'cancel_button' => FALSE), 'style' => $style);
    $nt = new Notification('nt_1', $config_nt);
    $nt->show();
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:6,代码来源:incident_common.php

示例13: submit_scan


//.........这里部分代码省略.........
                        if (count($host_list) > 0) {
                            $first_host = array_shift($host_list);
                            $hips = explode(",", $first_host['ips']);
                            foreach ($hips as $hip) {
                                $hip = trim($hip);
                                $arr_ctx[$hip] = $first_host['ctx'];
                            }
                        }
                    }
                }
            }
        }
        ossim_clean_error();
        unset($_SESSION["_vuln_targets"]);
        // clean scan targets
        $query = array();
        $IP_ctx = array();
        foreach ($arr_ctx as $aip => $actx) {
            $IP_ctx[] = $actx . "#" . $aip;
        }
        if ($vuln_op == "editrecurring" && $sched_id > 0) {
            $query[] = "DELETE FROM vuln_job_schedule WHERE id='{$sched_id}'";
            $i = 1;
            foreach ($sgr as $notify_sensor => $targets) {
                $target_list = implode("\n", $targets);
                $target_list .= "\n" . implode("\n", $ip_exceptions_list);
                $query[] = "INSERT INTO vuln_job_schedule ( name, username, fk_name, job_TYPE, schedule_type, day_of_week, day_of_month, \n                            time, email, meth_TARGET, meth_CRED, meth_VSET, meth_CUSTOM, meth_CPLUGINS, meth_Wfile, \n                            meth_Ucheck, meth_TIMEOUT, next_CHECK, createdate, enabled, resolve_names, time_interval, IP_ctx, credentials) VALUES ( '{$sname}', '{$username}', '" . Session::get_session_user() . "', '{$jobType}',\n                            '{$schedule_type}', '{$dayofweek}', '{$dayofmonth}', '{$time_value}', '{$notify_sensor}', '{$target_list}',\n                            {$I3crID}, '{$sid}', '{$custadd_type}', {$plugs_list}, {$semail}, '{$scan_locally}',\n                            '{$timeout}', '{$requested_run}', '{$insert_time}', '1', '{$resolve_names}' ,'{$time_interval}', '" . implode("\n", $IP_ctx) . "', '{$credentials}') ";
                $sjobs_names[] = $sname . $i;
                $i++;
            }
        } elseif ($recurring) {
            $i = 1;
            foreach ($sgr as $notify_sensor => $targets) {
                $target_list = implode("\n", $targets);
                $target_list .= "\n" . implode("\n", $ip_exceptions_list);
                $query[] = "INSERT INTO vuln_job_schedule ( name, username, fk_name, job_TYPE, schedule_type, day_of_week, day_of_month, \n                                time, email, meth_TARGET, meth_CRED, meth_VSET, meth_CUSTOM, meth_CPLUGINS, meth_Wfile, \n                                meth_Ucheck, meth_TIMEOUT, scan_ASSIGNED, next_CHECK, createdate, enabled, resolve_names, time_interval, IP_ctx, credentials) VALUES ( '{$sname}', '{$username}', '" . Session::get_session_user() . "', '{$jobType}',\n                                '{$schedule_type}', '{$dayofweek}', '{$dayofmonth}', '{$time_value}', '{$notify_sensor}', '{$target_list}',\n                                {$I3crID}, '{$sid}', '{$custadd_type}', {$plugs_list}, {$semail}, '{$scan_locally}',\n                                '{$timeout}', '{$SVRid}', '{$requested_run}', '{$insert_time}', '1', '{$resolve_names}' , '{$time_interval}', '" . implode("\n", $IP_ctx) . "', '{$credentials}') ";
                $sjobs_names[] = $sname . $i;
                $i++;
            }
        } else {
            $i = 1;
            foreach ($sgr as $notify_sensor => $targets) {
                $target_list = implode("\n", $targets);
                $target_list .= "\n" . implode("\n", $ip_exceptions_list);
                $query[] = "INSERT INTO vuln_jobs ( name, username, fk_name, job_TYPE, meth_SCHED, meth_TARGET,  meth_CRED,\n                        meth_VSET, meth_CUSTOM, meth_CPLUGINS, meth_Wfile, meth_TIMEOUT, scan_ASSIGNED,\n                        scan_SUBMIT, scan_next, scan_PRIORITY, status, notify, authorized, author_uname, resolve_names, credentials ) VALUES ( '{$sname}',\n                        '{$username}', '" . Session::get_session_user() . "', '{$jobType}', '{$schedule_type}', '{$target_list}', {$I3crID}, '{$sid}', '{$custadd_type}', {$plugs_list},\n                         {$semail}, '{$timeout}', '{$SVRid}', '{$insert_time}', '{$requested_run}', '3',\n                        'S', '{$notify_sensor}', '{$scan_locally}', '" . implode("\n", $IP_ctx) . "', '{$resolve_names}' , '{$credentials}') ";
                // echo "$query1";
                // die();
                $jobs_names[] = $sname . $i;
                $i++;
            }
        }
        $query_insert_time = gen_strtotime($insert_time, "");
        foreach ($query as $sql) {
            $error_updating = false;
            $error_inserting = false;
            if ($dbconn->execute($sql) === false) {
                echo _("Error creating scan job") . ": " . $dbconn->ErrorMsg();
                if ($vuln_op == "editrecurring") {
                    $error_updating = true;
                } else {
                    $error_creating = true;
                }
            } else {
                $config_nt = array('content' => "", 'options' => array('type' => "nf_success", 'cancel_button' => false), 'style' => 'width: 40%; margin: 20px auto; text-align: center;');
                if ($vuln_op == "editrecurring" && !$error_updating) {
                    $config_nt["content"] = _("Successfully Updated Recurring Job");
                    $nt = new Notification('nt_1', $config_nt);
                    $nt->show();
                } elseif (!$error_creating) {
                    $config_nt["content"] = _("Successfully Submitted Job");
                    $nt = new Notification('nt_1', $config_nt);
                    $nt->show();
                    //logAccess( "Submitted Job [ $jid ] $request" );
                    foreach ($jobs_names as $job_name) {
                        $infolog = array($job_name);
                        Log_action::log(66, $infolog);
                    }
                    foreach ($sjobs_names as $job_name) {
                        $infolog = array($job_name);
                        Log_action::log(67, $infolog);
                    }
                } else {
                    echo "<br><center>" . _("Failed Job Creation") . "</center>";
                }
                ?>
                <script type="text/javascript">
                //<![CDATA[                    
                document.location.href='<?php 
                echo Menu::get_menu_url(AV_MAIN_PATH . '/vulnmeter/manage_jobs.php', 'environment', 'vulnerabilities', 'scan_jobs');
                ?>
'; 
                //]]>
                </script>
                <?php 
            }
        }
    }
    // count($_SESSION["_vuln_targets"])>0
    echo "</b></center>";
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:101,代码来源:sched.php

示例14: array

                $header = _('Policy and auditing database');
                if (count($res) > 0) {
                    $data['data'] = "<div style='font-weight: bold; font-size: 11px; padding: 10px 0px;'>" . _($header) . ":</div>\n                                        <table class='table_files table_data' id='tf'>\n                                            <thead>\n                                                <tr>\n                                                    <th class='cf_type'>" . _('Type') . "</th>\n                                                    <th class='cf_date'>" . _('Last Date') . "</th>\n                                                    <th class='cf_date'>" . _('First Date') . "</th>\n                                                    <th>" . _('Event') . "</th>\n                                                </tr>\n                                            </thead>\n                                            \n                                            <tbody>";
                    $days = 0;
                    $dates = array();
                    foreach ($res as $line) {
                        $r_data = explode(',', $line);
                        if (!empty($r_data)) {
                            if (empty($dates[$r_data[1]])) {
                                $dates[$data[1]] = $r_data[1];
                                $days = $days + 1;
                                $color = $days % 2 == 0 ? 'class="odd"' : 'class="even"';
                            }
                            $data['data'] .= "<tr {$color}>\n                                                    <td class='cf_type'>" . $r_data[0] . "</td>\n                                                    <td class='cf_date'>" . $r_data[1] . "</td>\n                                                    <td class='cf_date'>" . $r_data[2] . "</td>\n                                                    <td class='cf_path'>" . $r_data[3] . "</td>\n                                                </tr>";
                        }
                    }
                    $data['data'] .= "</tbody>\n                                </table>";
                } else {
                    $config_nt = array('content' => $header . ": <span style='font-weight: bold;'>" . _('No results') . "</span>", 'options' => array('type' => 'nf_info', 'cancel_button' => FALSE), 'style' => 'width: 80%; margin: 20px auto; text-align: left;');
                    $nt = new Notification('nt_1', $config_nt);
                    $data['data'] = $nt->show(FALSE);
                }
            } catch (Exception $e) {
                $data['status'] = 'error';
                $data['data'] = _('Error! Policy and auditing database could not be extracted for this agent');
            }
            break;
    }
    echo json_encode($data);
    exit;
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:agent_actions.php

示例15: submit_scan


//.........这里部分代码省略.........
            preg_match("/(\\d{4})(\\d{2})(\\d{2})/", $next_day, $found);
            list($b_y, $b_m, $b_d, $b_h, $b_u, $b_s, $b_time) = Util::get_utc_from_date($dbconn, $found[1] . "-" . $found[2] . "-" . $found[3] . " {$btime_hour}:{$btime_min}:00", $tz);
            $requested_run = sprintf("%04d%02d%02d%02d%02d%02d", $b_y, $b_m, $b_d, $b_h, $b_u, "00");
            break;
        case 'M':
            if ($begin_in_seconds > $current_in_seconds) {
                // if it is a future date
                if ($run_mday >= $biday) {
                    $next_day = $biyear . $bimonth . ($run_mday < 10 ? "0" : "") . $run_mday;
                    // this month
                } else {
                    $next_day = sprintf("%06d%02d", gmdate("Ym", strtotime("next month GMT", mktime(0, 0, 0, $bimonth, $biday, $biyear))), $run_mday);
                }
            } else {
                if ($run_mday > $mday || $run_mday == $mday && $run_time > $timenow) {
                    $next_day = $year . $mon . ($run_mday < 10 ? "0" : "") . $run_mday;
                    // this month
                } else {
                    $next_day = sprintf("%06d%02d", gmdate("Ym", strtotime("next month GMT", gmdate("U"))), $run_mday);
                }
            }
            preg_match("/(\\d{4})(\\d{2})(\\d{2})/", $next_day, $found);
            list($b_y, $b_m, $b_d, $b_h, $b_u, $b_s, $b_time) = Util::get_utc_from_date($dbconn, $found[1] . "-" . $found[2] . "-" . $found[3] . " {$btime_hour}:{$btime_min}:00", $tz);
            $requested_run = sprintf("%04d%02d%02d%02d%02d%02d", $b_y, $b_m, $b_d, $b_h, $b_u, "00");
            break;
        case 'NW':
            if ($begin_in_seconds > $current_in_seconds) {
                // if it is a future date
                $array_time = array('month' => $bbimonth, 'day' => $bbiday, 'year' => $bbiyear);
                $requested_run = weekday_month(strtolower($daysMap[$dayofweek]['text']), $nthweekday, $btime_hour, $btime_min, $array_time);
            } else {
                $requested_run = weekday_month(strtolower($daysMap[$dayofweek]['text']), $nthweekday, $btime_hour, $btime_min);
            }
            preg_match("/(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/", $requested_run, $found);
            list($b_y, $b_m, $b_d, $b_h, $b_u, $b_s, $b_time) = Util::get_utc_from_date($dbconn, $found[1] . "-" . $found[2] . "-" . $found[3] . " " . $found[4] . ":" . $found[5] . ":00", $tz);
            $requested_run = sprintf("%04d%02d%02d%02d%02d%02d", $b_y, $b_m, $b_d, $b_h, $b_u, "00");
            $dayofmonth = $nthweekday;
            break;
        default:
            break;
    }
    $insert_time = gmdate('YmdHis');
    if (!empty($_SESSION['_vuln_targets']) && count($_SESSION['_vuln_targets']) > 0) {
        $sgr = array();
        foreach ($_SESSION['_vuln_targets'] as $target_selected => $server_id) {
            $sgr[$server_id][] = $target_selected;
        }
        ossim_clean_error();
        unset($_SESSION['_vuln_targets']);
        // clean scan targets
        $resolve_names = $not_resolve == '1' ? 0 : 1;
        $queries = array();
        $bbimonth = strlen($bbimonth) == 1 ? '0' . $bbimonth : $bbimonth;
        $bbiday = strlen($bbiday) == 1 ? '0' . $bbiday : $bbiday;
        $qc = 0;
        if ($schedule_type == 'N') {
            foreach ($sgr as $notify_sensor => $target_list) {
                $target_list = implode("\n", $target_list);
                $params = array($job_name, $username, Session::get_session_user(), $schedule_type, $target_list, $hosts_alive, $sid, $send_email, $timeout, $SVRid, $insert_time, $requested_run, '3', 'S', $notify_sensor, $scan_locally, '', $resolve_names, $credentials);
                $queries[$qc]['query'] = 'INSERT INTO vuln_jobs ( name, username, fk_name, meth_SCHED, meth_TARGET,  meth_CRED,
                    meth_VSET, meth_Wfile, meth_TIMEOUT, scan_ASSIGNED,
                    scan_SUBMIT, scan_next, scan_PRIORITY, status, notify, authorized, author_uname, resolve_names, credentials )
                    VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
                $queries[$qc]['params'] = $params;
                $qc++;
            }
        } else {
            $params = array($bbiyear . $bbimonth . $bbiday, $job_name, $username, Session::get_session_user(), $schedule_type, $dayofweek, $dayofmonth, $time_value, implode("\n", $targets), $hosts_alive, $sid, $send_email, $scan_locally, $timeout, $requested_run, $insert_time, strval($scheduled_status), $resolve_names, $time_interval, '', $credentials, $SVRid);
            $queries[$qc]['query'] = 'INSERT INTO vuln_job_schedule ( begin, name, username, fk_name, schedule_type, day_of_week, day_of_month, time, meth_TARGET, meth_CRED, meth_VSET, meth_Wfile,  meth_Ucheck, meth_TIMEOUT, next_CHECK, createdate, enabled, resolve_names, time_interval, IP_ctx, credentials, email)
                                     VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ';
            $queries[$qc]['params'] = $params;
            $qc++;
        }
        $execute_errors = array();
        foreach ($queries as $id => $sql_data) {
            $rs = $dbconn->execute($sql_data['query'], $sql_data['params']);
            if ($rs === FALSE) {
                $execute_errors[] = $dbconn->ErrorMsg();
            }
        }
        if (empty($execute_errors) && $schedule_type != 'N') {
            // We have to update the vuln_job_assets
            if (intval($sched_id) == 0) {
                $query = ossim_query('SELECT LAST_INSERT_ID() as sched_id');
                $rs = $dbconn->Execute($query);
                if (!$rs) {
                    Av_exception::throw_error(Av_exception::DB_ERROR, $dbconn->ErrorMsg());
                } else {
                    $sched_id = $rs->fields['sched_id'];
                }
            }
            Vulnerabilities::update_vuln_job_assets($dbconn, 'insert', $sched_id, 0);
        }
        $config_nt = array('content' => '', 'options' => array('type' => 'nf_success', 'cancel_button' => FALSE), 'style' => 'width: 40%; margin: 20px auto; text-align: center;');
        $config_nt['content'] = empty($execute_errors) ? _('Successfully Submitted Job') : _('Error creating scan job:') . implode('<br>', $execute_errors);
        $nt = new Notification('nt_1', $config_nt);
        $nt->show();
        $dbconn->close();
    }
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:101,代码来源:new_scan.php


注:本文中的Notification::show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。