• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP log_event函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中log_event函数的典型用法代码示例。如果您正苦于以下问题:PHP log_event函数的具体用法?PHP log_event怎么用?PHP log_event使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: delete_note

function delete_note($noteid)
{
    $db = new DbConn();
    $result = $db->fetch('select userid from notes where id = ?');
    if ($result) {
        $db->exec('delete from notes where id = ?', $noteid);
        log_event(LOG_NOTE_DELETED, $result->userid, $noteid);
    }
}
开发者ID:jcheng5,项目名称:vteer,代码行数:9,代码来源:note_helper.php


示例2: run_sql

function run_sql($query)
{
    global $dblog;
    log_event($query, $dblog);
    $tmp = mysql_query($query) or die("Error in query:" . $query . " " . mysql_error());
    return $tmp;
}
开发者ID:ejs,项目名称:sturgeonstv,代码行数:7,代码来源:models.php


示例3: update

 function update()
 {
     $this->load->helper('html2text');
     $id = $this->input->post('id');
     $subject = $this->input->post('subject');
     $htmlbody = $this->input->post('htmlbody');
     $textbody = html_to_plaintext($htmlbody);
     $attachments = $this->input->post('attachment');
     $db = new DbConn();
     if (!$id) {
         // New template
         $db->exec('insert into mail_templates () values ()');
         $id = $db->last_insert_id();
     }
     $rows = $db->exec('insert into mail_template_versions (templateid, subject, html, plaintext, datecreated, creator)
                    values (?, ?, ?, ?, ?, ?)', (int) $id, $subject, $htmlbody, $textbody, date_create(), $this->admin->id());
     if ($rows != 1) {
         throw new RuntimeException("Insertion failed!");
     }
     $newId = $db->last_insert_id();
     // process attachments
     if ($attachments) {
         foreach ($attachments as $attachId) {
             $attachId = (int) $attachId;
             $db->exec('insert into templatevers_to_attachments (templateverid, attachmentid) values (?, ?)', $newId, $attachId);
         }
     }
     $template = get_mail_template($id);
     $role = $template ? $template->role : '(unknown)';
     log_event(LOG_MAIL_TEMPLATE_EDITED, NULL, $role);
     redirect("admin/emails/index/{$id}");
 }
开发者ID:jcheng5,项目名称:vteer,代码行数:32,代码来源:emails.php


示例4: exitFail

/**
 * Script finished with errors
 */
function exitFail($error, $exit)
{
    echo "1;" . $error;
    log_event("ERROR", $error);
    if ($exit) {
        exit;
    }
}
开发者ID:zagorskid,项目名称:GalaxyUsers,代码行数:11,代码来源:functions.php


示例5: discover_service

function discover_service($device, $service)
{
    if (!dbFetchCell('SELECT COUNT(service_id) FROM `services` WHERE `service_type`= ? AND `device_id` = ?', array($service, $device['device_id']))) {
        add_service($device, $service, "(Auto discovered) {$service}");
        log_event('Autodiscovered service: type ' . mres($service), $device, 'service');
        echo '+';
    }
    echo "{$service} ";
}
开发者ID:job,项目名称:librenms,代码行数:9,代码来源:services.inc.php


示例6: discover_service

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage poller
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
function discover_service($device, $service)
{
    if (!dbFetchCell("SELECT COUNT(service_id) FROM `services` WHERE `service_type`= ? AND `device_id` = ?", array($service, $device['device_id']))) {
        add_service($device, $service, "(自动发现) {$service}");
        log_event("自动发现服务: 类型 {$service}", $device, 'service');
        echo "+";
    }
    echo "{$service} ";
}
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:19,代码来源:services.inc.php


示例7: login

 function login()
 {
     $this->_logout();
     $email = $this->input->post('login_email');
     $password = $this->input->post('login_password');
     $user = FALSE;
     if (!($email === FALSE || $password === FALSE)) {
         $user = get_user_by_credentials($email, $password);
     }
     if (!$user) {
         $errmsg = 'Sorry, unrecognized e-mail or incorrect password.';
         $this->load->view('header');
         $this->load->view('index', array('login_error' => $errmsg));
         $this->load->view('footer');
     } else {
         log_event(LOG_USER_LOGIN, $user->id);
         $this->session->set_userdata('userid', $user->id);
         // TODO: Pick up where user left off, not on page 1
         redirect('welcome/dispatch');
     }
 }
开发者ID:jcheng5,项目名称:vteer,代码行数:21,代码来源:welcome.php


示例8: log_action

function log_action($op, $user, $agg, $slice = NULL, $rspec = NULL, $slice_id = NULL)
{
    $log_url = get_first_service_of_type(SR_SERVICE_TYPE::LOGGING_SERVICE);
    $user_id = $user->account_id;
    if (!is_array($agg)) {
        $aggs[] = $agg;
    } else {
        $aggs = $agg;
    }
    foreach ($aggs as $am) {
        $attributes['aggregate'] = $am;
        $msg = "{$op} at {$am}";
        if ($slice) {
            $msg .= " on {$slice}";
            $slice_attributes = get_attribute_for_context(CS_CONTEXT_TYPE::SLICE, $slice_id);
            $attributes = array_merge($attributes, $slice_attributes);
        }
        if ($rspec) {
            $attributes['rspec'] = $rspec;
        }
        $result = log_event($log_url, $user, $msg, $attributes);
    }
}
开发者ID:ahelsing,项目名称:geni-portal,代码行数:23,代码来源:am_client.php


示例9: elseif

     } elseif (isset($data['ipNetToMediaPhysAddress'])) {
         $raw_mac = $data['ipNetToMediaPhysAddress'];
         list($if, $ip) = explode('.', $ip, 2);
         $ipv = 'ipv4';
     }
     $interface = get_port_by_index_cache($device['device_id'], $if);
     $port_id = $interface['port_id'];
     if (!empty($ip) && $ipv === 'ipv4' && $raw_mac != '0:0:0:0:0:0' && !isset($arp_table[$port_id][$ip])) {
         $mac = implode(array_map('zeropad', explode(':', $raw_mac)));
         $arp_table[$port_id][$ip] = $mac;
         $index = array_search($ip, $ipv4_addresses);
         if ($index !== false) {
             $old_mac = $existing_data[$index]['mac_address'];
             if ($mac != $old_mac && $mac != '') {
                 d_echo("Changed mac address for {$ip} from {$old_mac} to {$mac}\n");
                 log_event("MAC change: {$ip} : " . mac_clean_to_readable($old_mac) . ' -> ' . mac_clean_to_readable($mac), $device, 'interface', $port_id);
                 dbUpdate(array('mac_address' => $mac), 'ipv4_mac', 'port_id=? AND ipv4_address=? AND context_name=?', array($port_id, $ip, $context));
             }
             d_echo(null, '.');
         } elseif (isset($interface['port_id'])) {
             d_echo(null, '+');
             $insert_data[] = array('port_id' => $port_id, 'mac_address' => $mac, 'ipv4_address' => $ip, 'context_name' => $context);
         }
     }
 }
 // add new entries
 if (!empty($insert_data)) {
     dbBulkInsert($insert_data, 'ipv4_mac');
 }
 // remove stale entries
 foreach ($existing_data as $entry) {
开发者ID:Rosiak,项目名称:librenms,代码行数:31,代码来源:arp-table.inc.php


示例10: renamehost

function renamehost($id, $new, $source = 'console')
{
    global $config;
    // FIXME does not check if destination exists!
    $host = dbFetchCell("SELECT `hostname` FROM `devices` WHERE `device_id` = ?", array($id));
    if (rename($config['rrd_dir'] . "/{$host}", $config['rrd_dir'] . "/{$new}") === TRUE) {
        dbUpdate(array('hostname' => $new), 'devices', 'device_id=?', array($id));
        log_event("Hostname changed -> {$new} ({$source})", $id, 'system');
    } else {
        echo "Renaming of {$host} failed\n";
        log_event("Renaming of {$host} failed", $id, 'system');
    }
}
开发者ID:syzdek,项目名称:librenms,代码行数:13,代码来源:functions.php


示例11: del_dev_attrib

     } else {
         del_dev_attrib($device, 'override_sysLocation_bool');
     }
     if (isset($override_sysLocation_string)) {
         set_dev_attrib($device, 'override_sysLocation_string', $override_sysLocation_string);
     }
     # FIXME needs more sanity checking! and better feedback
     # FIXME -- update location too? Need to trigger geolocation!
     $param = array('purpose' => $vars['descr'], 'type' => $vars['type'], 'ignore' => $vars['ignore'], 'disabled' => $vars['disabled']);
     $rows_updated = dbUpdate($param, 'devices', '`device_id` = ?', array($device['device_id']));
     if ($rows_updated > 0 || $updated) {
         if ((bool) $vars['ignore'] != (bool) $device['ignore']) {
             log_event('设备 ' . ((bool) $vars['ignore'] ? 'ignored' : 'attended') . ': ' . $device['hostname'], $device['device_id'], 'device', $device['device_id'], 5);
         }
         if ((bool) $vars['disabled'] != (bool) $device['disabled']) {
             log_event('设备 ' . ((bool) $vars['disabled'] ? 'disabled' : 'enabled') . ': ' . $device['hostname'], $device['device_id'], 'device');
         }
         $update_message = "设备更新的记录.";
         if ($updated == 2) {
             $update_message .= " 请注意, 最新的系统位置字符串将在轮询后可见.";
         }
         $updated = 1;
         $device = dbFetchRow("SELECT * FROM `devices` WHERE `device_id` = ?", array($device['device_id']));
     } elseif ($rows_updated = '-1') {
         $update_message = "装置记录不变. 没有更新的必要.";
         $updated = -1;
     } else {
         $update_message = "装置的记录更新错误.";
     }
 } else {
     include "includes/error-no-perm.inc.php";
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:31,代码来源:device.inc.php


示例12: d_echo

     $stp['rootBridge'] = '0';
 }
 d_echo($stp);
 if ($stp_raw[0]['version'] == '3') {
     echo "RSTP ";
 } else {
     echo "STP ";
 }
 if (!$stp_db['bridgeAddress'] && $stp['bridgeAddress']) {
     dbInsert($stp, 'stp');
     log_event('STP added, bridge address: ' . $stp['bridgeAddress'], $device, 'stp');
     echo '+';
 }
 if ($stp_db['bridgeAddress'] && !$stp['bridgeAddress']) {
     dbDelete('stp', 'device_id = ?', array($device['device_id']));
     log_event('STP removed', $device, 'stp');
     echo '-';
 }
 // STP port related stuff
 foreach ($stp_raw as $port => $value) {
     if ($port) {
         // $stp_raw[0] ist not port related so we skip this one
         $stp_port = array('priority' => $stp_raw[$port]['dot1dStpPortPriority'], 'state' => $stp_raw[$port]['dot1dStpPortState'], 'enable' => $stp_raw[$port]['dot1dStpPortEnable'], 'pathCost' => $stp_raw[$port]['dot1dStpPortPathCost'], 'designatedCost' => $stp_raw[$port]['dot1dStpPortDesignatedCost'], 'designatedPort' => $stp_raw[$port]['dot1dStpPortDesignatedPort'], 'forwardTransitions' => $stp_raw[$port]['dot1dStpPortForwardTransitions']);
         // set device binding
         $stp_port['device_id'] = $device['device_id'];
         // set port binding
         $stp_port['port_id'] = dbFetchCell('SELECT port_id FROM `ports` WHERE `device_id` = ? AND `ifIndex` = ?', array($device['device_id'], $stp_raw[$port]['dot1dStpPort']));
         $dr = str_replace(array(' ', ':', '-'), '', strtolower($stp_raw[$port]['dot1dStpPortDesignatedRoot']));
         $dr = substr($dr, -12);
         //remove first two octets
         $stp_port['designatedRoot'] = $dr;
开发者ID:awlx,项目名称:librenms,代码行数:31,代码来源:stp.inc.php


示例13: poll_device

function poll_device($device, $options)
{
    global $config, $device, $polled_devices, $db_stats, $memcache;
    $attribs = get_dev_attribs($device['device_id']);
    $status = 0;
    unset($array);
    $device_start = utime();
    // Start counting device poll time
    echo $device['hostname'] . ' ' . $device['device_id'] . ' ' . $device['os'] . ' ';
    if ($config['os'][$device['os']]['group']) {
        $device['os_group'] = $config['os'][$device['os']]['group'];
        echo '(' . $device['os_group'] . ')';
    }
    echo "\n";
    unset($poll_update);
    unset($poll_update_query);
    unset($poll_separator);
    $poll_update_array = array();
    $update_array = array();
    $host_rrd = $config['rrd_dir'] . '/' . $device['hostname'];
    if (!is_dir($host_rrd)) {
        mkdir($host_rrd);
        echo "Created directory : {$host_rrd}\n";
    }
    $address_family = snmpTransportToAddressFamily($device['transport']);
    $ping_response = isPingable($device['hostname'], $address_family, $attribs);
    $device_perf = $ping_response['db'];
    $device_perf['device_id'] = $device['device_id'];
    $device_perf['timestamp'] = array('NOW()');
    if (can_ping_device($attribs) === true && is_array($device_perf)) {
        dbInsert($device_perf, 'device_perf');
    }
    $device['pingable'] = $ping_response['result'];
    $ping_time = $ping_response['last_ping_timetaken'];
    $response = array();
    $status_reason = '';
    if ($device['pingable']) {
        $device['snmpable'] = isSNMPable($device);
        if ($device['snmpable']) {
            $status = '1';
            $response['status_reason'] = '';
        } else {
            echo 'SNMP Unreachable';
            $status = '0';
            $response['status_reason'] = 'snmp';
        }
    } else {
        echo 'Unpingable';
        $status = '0';
        $response['status_reason'] = 'icmp';
    }
    if ($device['status'] != $status) {
        $poll_update .= $poll_separator . "`status` = '{$status}'";
        $poll_separator = ', ';
        dbUpdate(array('status' => $status, 'status_reason' => $response['status_reason']), 'devices', 'device_id=?', array($device['device_id']));
        dbInsert(array('importance' => '0', 'device_id' => $device['device_id'], 'message' => 'Device is ' . ($status == '1' ? 'up' : 'down')), 'alerts');
        log_event('Device status changed to ' . ($status == '1' ? 'Up' : 'Down'), $device, $status == '1' ? 'up' : 'down');
    }
    if ($status == '1') {
        $graphs = array();
        $oldgraphs = array();
        if ($options['m']) {
            foreach (explode(',', $options['m']) as $module) {
                if (is_file('includes/polling/' . $module . '.inc.php')) {
                    include 'includes/polling/' . $module . '.inc.php';
                }
            }
        } else {
            foreach ($config['poller_modules'] as $module => $module_status) {
                if ($attribs['poll_' . $module] || $module_status && !isset($attribs['poll_' . $module])) {
                    // TODO per-module polling stats
                    include 'includes/polling/' . $module . '.inc.php';
                } else {
                    if (isset($attribs['poll_' . $module]) && $attribs['poll_' . $module] == '0') {
                        echo "Module [ {$module} ] disabled on host.\n";
                    } else {
                        echo "Module [ {$module} ] disabled globally.\n";
                    }
                }
            }
        }
        //end if
        if (!$options['m']) {
            // FIXME EVENTLOGGING -- MAKE IT SO WE DO THIS PER-MODULE?
            // This code cycles through the graphs already known in the database and the ones we've defined as being polled here
            // If there any don't match, they're added/deleted from the database.
            // Ideally we should hold graphs for xx days/weeks/polls so that we don't needlessly hide information.
            foreach (dbFetch('SELECT `graph` FROM `device_graphs` WHERE `device_id` = ?', array($device['device_id'])) as $graph) {
                if (isset($graphs[$graph['graph']])) {
                    $oldgraphs[$graph['graph']] = true;
                } else {
                    dbDelete('device_graphs', '`device_id` = ? AND `graph` = ?', array($device['device_id'], $graph['graph']));
                }
            }
            foreach ($graphs as $graph => $value) {
                if (!isset($oldgraphs[$graph])) {
                    echo '+';
                    dbInsert(array('device_id' => $device['device_id'], 'graph' => $graph), 'device_graphs');
                }
                echo $graph . ' ';
//.........这里部分代码省略.........
开发者ID:jcbailey2,项目名称:librenms,代码行数:101,代码来源:functions.inc.php


示例14: print_cli_data

print_cli_data("Asset", $asset_tag ?: "%b<empty>%n");
echo PHP_EOL;
foreach ($os_additional_info as $header => $entries) {
    print_cli_heading($header, 3);
    foreach ($entries as $field => $entry) {
        print_cli_data($field, $entry, 3);
    }
    echo PHP_EOL;
}
// Fields notified in event log
$update_fields = array('version', 'features', 'hardware', 'serial', 'kernel', 'distro', 'distro_ver', 'arch', 'asset_tag');
// Log changed variables
foreach ($update_fields as $field) {
    if (isset(${$field})) {
        ${$field} = snmp_fix_string(${$field});
    }
    // Fix unprintable chars
    if ((isset(${$field}) || strlen($device[$field])) && ${$field} != $device[$field]) {
        $update_array[$field] = ${$field};
        log_event(nicecase($field) . " -> " . $update_array[$field], $device, 'device', $device['device_id']);
    }
}
// Here additional fields, change only if not set already
foreach (array('type', 'icon') as $field) {
    if (isset(${$field}) && ($device[$field] == "unknown" || $device[$field] == '' || !isset($device[$field]) || !strlen($device[$field]))) {
        $update_array[$field] = ${$field};
        log_event(nicecase($field) . " -> " . $update_array[$field], $device, 'device', $device['device_id']);
    }
}
unset($entPhysical, $oids, $hw, $os_additional_info);
// EOF
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:os.inc.php


示例15: do_sendit

	/**
	 * @param $userid
	 * @param $headers
	 * @param $table_csv
	 * @param array $fields
	 * @param $parent_chkd_flds
	 * @param $export_file_name
	 * @param $debug
	 * @param null $comment
	 * @param array $to
	 */
	public static function do_sendit($userid, $headers, $table_csv, $fields = array(), $parent_chkd_flds, $export_file_name, $comment = null, $to = array(), $debug)
	{
		global $project_id, $user_rights, $app_title, $lang, $redcap_version; // we could use the global $userid, but we need control of it for setting the user as [CRON], so this is passed in args.
		$return_val = false;
		$export_type = 0; // this puts all files generated here in the Data Export category in the File Repository
		$today = date("Y-m-d_Hi"); //get today for filename
		$projTitleShort = substr(str_replace(" ", "", ucwords(preg_replace("/[^a-zA-Z0-9 ]/", "", html_entity_decode($app_title, ENT_QUOTES)))), 0, 20); // shortened project title for filename
		$originalFilename = $projTitleShort . "_" . $export_file_name . "_DATA_" . $today . ".csv"; // name the file for storage
		$today = date("Y-m-d-H-i-s"); // get today for comment, subsequent processing as needed
		$docs_comment_WH = $export_type ? "Data export file created by $userid on $today" : fix_case($export_file_name) . " file created by $userid on $today. $comment"; // unused, but I keep it around just in case
		/**
		 * setup vars for value export logging
		 */
		$chkd_fields = implode(',', $fields);
		/**
		 * turn on/off exporting per user rights
		 */
		if (($user_rights['data_export_tool'] || $userid == '[CRON]') && !$debug) {
			$table_csv = addBOMtoUTF8($headers . $table_csv);
			/**
			 * Store the file in the file system and log the activity, handle if error
			 */
			if (!DataExport::storeExportFile($originalFilename, $table_csv, true)) {
				log_event("", "redcap_data", "data_export", "", str_replace("'", "", $chkd_fields) . (($parent_chkd_flds == "") ? "" : ", " . str_replace("'", "", $parent_chkd_flds)), "Data Export Failed");
			} else {
				log_event("", "redcap_data", "data_export", "", str_replace("'", "", $chkd_fields) . (($parent_chkd_flds == "") ? "" : ", " . str_replace("'", "", $parent_chkd_flds)), "Export data for SendIt");
				/**
				 * email file link and download password in two separate emails via REDCap SendIt
				 */
				$file_info_sql = db_query("SELECT docs_id, docs_size, docs_type FROM redcap_docs WHERE project_id = $project_id ORDER BY docs_id DESC LIMIT 1"); // get required info about the file we just created
				if ($file_info_sql) {
					$docs_id = db_result($file_info_sql, 0, 'docs_id');
					$docs_size = db_result($file_info_sql, 0, 'docs_size');
					$docs_type = db_result($file_info_sql, 0, 'docs_type');
				}
				$yourName = 'PRIORITIZE REDCap';
				$expireDays = 3; // set the SendIt to expire in this many days
				/**
				 * $file_location:
				 * 1 = ephemeral, will be deleted on $expireDate
				 * 2 = export file, visible only to rights in file repository
				 */
				$file_location = 2;
				$send = 1; // always send download confirmation
				$expireDate = date('Y-m-d H:i:s', strtotime("+$expireDays days"));
				$expireYear = substr($expireDate, 0, 4);
				$expireMonth = substr($expireDate, 5, 2);
				$expireDay = substr($expireDate, 8, 2);
				$expireHour = substr($expireDate, 11, 2);
				$expireMin = substr($expireDate, 14, 2);

				// Add entry to sendit_docs table
				$query = "INSERT INTO redcap_sendit_docs (doc_name, doc_orig_name, doc_type, doc_size, send_confirmation, expire_date, username,
					location, docs_id, date_added)
				  VALUES ('$originalFilename', '" . prep($originalFilename) . "', '$docs_type', '$docs_size', $send, '$expireDate', '" . prep($userid) . "',
					$file_location, $docs_id, '" . NOW . "')";
				db_query($query);
				$newId = db_insert_id();

				$logDescrip = "Send file from file repository (Send-It)";
				log_event($query, "redcap_sendit_docs", "MANAGE", $newId, "document_id = $newId", $logDescrip);

				// Set email subject
				$subject = "[PRIORITIZE] " . $comment;
				$subject = html_entity_decode($subject, ENT_QUOTES);

				// Set email From address
				$from = array('Ken Bergquist' => '[email protected]');

				// Begin set up of email to send to recipients
				$email = new Message();
				foreach ($from as $name => $address) {
					$email->setFrom($address);
					$email->setFromName($name);
				}
				$email->setSubject($subject);

				// Loop through each recipient and send email
				foreach ($to as $name => $address) {
					// If a non-blank email address
					if (trim($address) != '') {
						// create key for unique url
						$key = strtoupper(substr(uniqid(md5(mt_rand())), 0, 25));

						// create password
						$pwd = generateRandomHash(8, false, true);

						$query = "INSERT INTO redcap_sendit_recipients (email_address, sent_confirmation, download_date, download_count, document_id, guid, pwd)
						  VALUES ('$address', 0, NULL, 0, $newId, '$key', '" . md5($pwd) . "')";
//.........这里部分代码省略.........
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:101,代码来源:Prioritize.php


示例16: db_error

        print "<script type='text/javascript'>\n\t\t\t\twindow.opener.location.reload();\n\t\t\t\tsetTimeout(function(){self.close();},2500);\n\t\t\t\t</script>";
        //Query failed
    } else {
        print "<p><b>{$lang['global_01']}{$lang['colon']}</b> {$lang['calendar_popup_28']}</p>";
        if (SUPER_USER) {
            print db_error() . "<br>QUERY:<br>{$sql}";
        }
    }
    /**
     * DISPLAY CONFIRMATION THAT CALENDAR EVENT WAS DELETED
     */
} elseif (isset($_GET['cal_id']) && is_numeric($_GET['cal_id']) && !empty($_POST) && isset($_POST['deleteCalEv'])) {
    //Query to delete calendar event
    $sql = "delete from redcap_events_calendar where cal_id = " . $_GET['cal_id'];
    //Logging
    log_event($sql, "redcap_events_calendar", "MANAGE", $_GET['cal_id'], calLogChange($_GET['cal_id']), "Delete calendar event");
    //Run query after logging because values will be deleted
    db_query($sql);
    //Show confirmation
    print "<div style='color:red;padding:30px 0 0 15px;margin-bottom:10px;font-weight:bold;font-size:16px;'>\n\t\t\t\t{$lang['calendar_popup_29']}<br><br><br>\n\t\t\t</div>";
    //Render javascript to refresh calendar underneath and close pop-up
    print "<script type='text/javascript'>\n\t\t\twindow.opener.location.reload();\n\t\t\tsetTimeout(function(){self.close();},2500);\n\t\t\t</script>";
}
/**
 * PAGE FOOTER
 */
callJSfile('Calendar.js');
$_GET['width'] = isset($_GET['width']) && is_numeric($_GET['width']) && $_GET['width'] < 1200 ? $_GET['width'] : 800;
print "</div>\n\t\t<script type='text/javascript'>\n\t\t\$(function(){\n\t\t\t// Resize window to fit contents\n\t\t\tvar maxh = window.screen.height - 100;\n\t\t\tvar divh = document.getElementById('bodydiv').offsetHeight + 130;\n\t\t\tvar newh = (divh > maxh) ? maxh : divh;\n\t\t\twindow.resizeTo({$_GET['width']},newh);\n\t\t\t// Load calendar pop-up\n\t\t\t\$('#newdate').datepicker({buttonText: 'Click to select a date',yearRange: '-100:+10',changeMonth: true, changeYear: true, dateFormat: user_date_format_jquery});\t\t\t\t\t\t\n\t\t\t// Pop-up time-select initialization\n\t\t\t\$('.time').timepicker({hour: currentTime('h'), minute: currentTime('m'), timeFormat: 'hh:mm'});\n\t\t});\n\t\t</script>";
?>
</body>
开发者ID:hcv-target,项目名称:redcap_plugins,代码行数:31,代码来源:calendar_popup.php


示例17: foreach

     */
    if (preg_match("/^([0-9]+) .*\$/", $vm_info["vmwVmMemSize"], $matches)) {
        $vm_info["vmwVmMemSize"] = $matches[1];
    }
    /*
     * If VMware Tools is not running then don't overwrite the GuesOS with the error
     * message, but just leave it as it currently is.
     */
    if (stristr($vm_info["vmwVmGuestOS"], 'tools not running') !== FALSE) {
        $vm_info["vmwVmGuestOS"] = $db_info["vmwVmGuestOS"];
    }
    /*
     * Process all the VMware Virtual Machine properties.
     */
    foreach ($vm_info as $property => $value) {
        /*
         * Check the property for any modifications.
         */
        if ($vm_info[$property] != $db_info[$property]) {
            echo $vm_info[$property] . "!=" . $db_info[$property] . PHP_EOL;
            // FIXME - this should loop building a query and then run the query after the loop (bad geert!)
            dbUpdate(array($property => $vm_info[$property]), 'vminfo', '`id` = ?', array($db_info["id"]));
            log_event($db_info["vmwVmDisplayName"] . " (" . preg_replace("/^vmwVm/", "", $property) . ") -> " . $vm_info[$property], $device, 'vm');
        }
    }
}
/*
 * Finished discovering VMware information.
 */
echo PHP_EOL;
// EOF
开发者ID:skive,项目名称:observium,代码行数:31,代码来源:vmware.inc.php


示例18: print_debug

                 if (!isset($p_list[$peer_ip][$peer_as]) && is_bgp_peer_valid($peer, $device)) {
                     $p_list[$peer_ip][$peer_as] = 1;
                     $peerlist[] = $peer;
                     print_debug("Found peer IP: {$peer_ip} (AS{$peer_as}, LocalIP: {$local_ip})");
                 }
             }
         } else {
             $vendor_mib = FALSE;
             // Unset vendor_mib since not found on device
         }
     }
     # Vendors
 } else {
     echo "No BGP on host";
     if (is_numeric($device['bgpLocalAs'])) {
         log_event('BGP ASN removed: AS' . $device['bgpLocalAs'], $device, 'bgp');
         dbUpdate(array('bgpLocalAs' => array('NULL')), 'devices', 'device_id = ?', array($device['device_id']));
         print_message('Removed ASN (' . $device['bgpLocalAs'] . ')');
     }
     # End if
 }
 # End if
 // Process discovered peers
 $table_rows = array();
 if (OBS_DEBUG > 1) {
     print_vars($peerlist);
 }
 if (isset($peerlist)) {
     // Walk vendor oids
     if ($vendor_mib) {
         if (!isset($vendor_use_index[$vendor_PeerRemoteAddrType])) {
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:bgp-peers.inc.php


示例19: str_replace

}
//end if
$poll_device['sysLocation'] = str_replace('"', '', $poll_device['sysLocation']);
// Remove leading & trailing backslashes added by VyOS/Vyatta/EdgeOS
$poll_device['sysLocation'] = trim($poll_device['sysLocation'], '\\');
// Rewrite sysLocation if there is a mapping array (database too?)
if (!empty($poll_device['sysLocation']) && (is_array($config['location_map']) || is_array($config['location_map_regex']))) {
    $poll_device['sysLocation'] = rewrite_location($poll_device['sysLocation']);
}
$poll_device['sysContact'] = str_replace('"', '', $poll_device['sysContact']);
// Remove leading & trailing backslashes added by VyOS/Vyatta/EdgeOS
$poll_device['sysContact'] = trim($poll_device['sysContact'], '\\');
foreach (array('sysLocation', 'sysContact') as $elem) {
    if ($poll_device[$elem] == 'not set') {
        $poll_device[$elem] = '';
    }
}
// Save results of various polled values to the database
foreach (array('sysContact', 'sysObjectID', 'sysName', 'sysDescr') as $elem) {
    if ($poll_device[$elem] && $poll_device[$elem] != $device[$elem]) {
        $update_array[$elem] = $poll_device[$elem];
        log_event("{$elem} -> " . $poll_device[$elem], $device, 'system');
    }
}
if ($poll_device['sysLocation'] && $device['location'] != $poll_device['sysLocation'] && $device['override_sysLocation'] == 0) {
    $update_array['location'] = $poll_device['sysLocation'];
    log_event('Location -> ' . $poll_device['sysLocation'], $device, 'system');
}
if ($config['geoloc']['latlng'] === true) {
    location_to_latlng($device);
}
开发者ID:awlx,项目名称:librenms,代码行数:31,代码来源:core.inc.php


示例20: array

        $r->close();
        break;
    }
    $r->close();
    // Create user
    $q = "INSERT INTO users SET username='" . $m->escape_string($_POST["u"]) . "', password='" . $m->escape_string($_POST["p"]) . "', dt_lastlogin=NOW()";
    if (@$m->query($q) === FALSE) {
        $page_error = "Sorry, an internal database error occured. Your account was NOT created. Wait a while and try again.";
        break;
    }
    // Add membership to the public group
    $q = "INSERT INTO group_members SET group_id=1, user_id='" . $m->escape_string($m->insert_id) . "'";
    @$m->query($q);
    // Login user
    $q = "SELECT * FROM users WHERE username='" . $m->escape_string($_POST["u"]) . "'";
    $r = @$m->query($q);
    $row = $r->fetch_object();
    $r->close();
    $_SESSION["loggedin"] = TRUE;
    $_SESSION["u"] = $row;
    $_SESSION["groups"] = array();
    $q = "SELECT groups.*, group_admin FROM group_members LEFT JOIN groups ON group_id=groups.id WHERE user_id='" . $m->escape_string($row->id) . "'";
    if (($r = @$m->query($q)) !== FALSE) {
        while ($row = $r->fetch_object()) {
            $_SESSION["groups"][$row->id] = array("group" => $row->groupname, "admin" => $row->group_admin);
        }
        $r->close();
    }
    log_event("User " . $_SESSION["u"]->username . " (id " . $_SESSION["u"]->id . ") registered");
    header("Location: {$root_url}");
} while (0);
开发者ID:noahwilliamsson,项目名称:distributedcracking.net-webroot,代码行数:31,代码来源:post-create.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP log_exception函数代码示例发布时间:2022-05-15
下一篇:
PHP log_errors函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap