function send_password($email, $email_from_address, $website_address, $new_user = false) { $query_passwordcheck = "SELECT * FROM users WHERE user_email = '" . $email . "'"; $passwordcheck = mysql_query($query_passwordcheck) or die(mysql_error()); $row_passwordcheck = mysql_fetch_assoc($passwordcheck); $totalRows_passwordcheck = mysql_num_rows($passwordcheck); $new_password = gen_password(8); update_profile($email, $new_password); if ($totalRows_passwordcheck == 1) { error_log("Sending password email to: " . $email); //SEND EMAIL WITH PASSWORD $password = $row_passwordcheck['user_password']; $name = "Donor Track"; $subject = $new_user ? "Welcome to Donor Track" : "Your New Password"; $message = "Your password is {$new_password}."; $emailto = $row_passwordcheck['user_email']; if ($new_user) { $message .= " Your username is {$email}."; } else { $message = "A password reset request was submitted for your account. " . $message; } $message .= " \nYou can login at: {$website_address}/login.php"; error_log($message); return mail($emailto, $subject, $message, "From: {$name} <" . $email_from_address . ">\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1"); //END SEND EMAIL } else { if ($totalRows_passwordcheck < 1) { return false; } } }
function init_nodes() { /* Init CURRENT NODE ID */ if (defined('ZBX_NODES_INITIALIZED')) { return; } global $USER_DETAILS; global $ZBX_LOCALNODEID, $ZBX_LOCMASTERID, $ZBX_CURRENT_NODEID, $ZBX_CURMASTERID, $ZBX_NODES, $ZBX_NODES_IDS, $ZBX_AVAILABLE_NODES, $ZBX_VIEWED_NODES, $ZBX_WITH_ALL_NODES; $ZBX_AVAILABLE_NODES = array(); $ZBX_NODES_IDS = array(); $ZBX_NODES = array(); $ZBX_CURRENT_NODEID = $ZBX_LOCALNODEID; $ZBX_WITH_ALL_NODES = !defined('ZBX_NOT_ALLOW_ALL_NODES'); if (!defined('ZBX_PAGE_NO_AUTHERIZATION') && ZBX_DISTRIBUTED) { if ($USER_DETAILS['type'] == USER_TYPE_SUPER_ADMIN) { $sql = 'SELECT DISTINCT n.nodeid,n.name,n.masterid FROM nodes n '; } else { $sql = 'SELECT DISTINCT n.nodeid,n.name,n.masterid ' . ' FROM nodes n, groups hg,rights r, users_groups g ' . ' WHERE r.id=hg.groupid ' . ' AND r.groupid=g.usrgrpid ' . ' AND g.userid=' . $USER_DETAILS['userid'] . ' AND n.nodeid=' . DBid2nodeid('hg.groupid'); } $db_nodes = DBselect($sql); while ($node = DBfetch($db_nodes)) { $ZBX_NODES[$node['nodeid']] = $node; $ZBX_NODES_IDS[$node['nodeid']] = $node['nodeid']; } $ZBX_AVAILABLE_NODES = get_accessible_nodes_by_user($USER_DETAILS, PERM_READ_LIST, PERM_RES_IDS_ARRAY, $ZBX_NODES_IDS); $ZBX_VIEWED_NODES = get_viewed_nodes(); $ZBX_CURRENT_NODEID = $ZBX_VIEWED_NODES['selected']; if ($node_data = DBfetch(DBselect('SELECT masterid FROM nodes WHERE nodeid=' . $ZBX_CURRENT_NODEID))) { $ZBX_CURMASTERID = $node_data['masterid']; } if (!isset($ZBX_NODES[$ZBX_CURRENT_NODEID])) { $ZBX_CURRENT_NODEID = $ZBX_LOCALNODEID; $ZBX_CURMASTERID = $ZBX_LOCMASTERID; } if (isset($_REQUEST['select_nodes'])) { update_profile('web.nodes.selected', $ZBX_VIEWED_NODES['nodeids'], PROFILE_TYPE_ARRAY_ID); } if (isset($_REQUEST['switch_node'])) { update_profile('web.nodes.switch_node', $ZBX_VIEWED_NODES['selected'], PROFILE_TYPE_ID); } } else { $ZBX_CURRENT_NODEID = $ZBX_LOCALNODEID; $ZBX_CURMASTERID = $ZBX_LOCMASTERID; } // zbx_set_post_cookie('zbx_current_nodeid', $ZBX_CURRENT_NODEID); define('ZBX_NODES_INITIALIZED', 1); }
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY, get_current_nodeid(true)); $items = get_request('items', array()); asort_by_key($items, 'sortorder'); foreach ($items as $gitem) { if (!($host = DBfetch(DBselect('SELECT h.* FROM hosts h,items i WHERE h.hostid=i.hostid AND i.itemid=' . $gitem['itemid'])))) { fatal_error(S_NO_ITEM_DEFINED); } if (!isset($available_hosts[$host['hostid']])) { access_deny(); } } $effectiveperiod = navigation_bar_calc(); if (count($items) == 1) { $_REQUEST['period'] = get_request('period', get_profile('web.item.graph.period', ZBX_PERIOD_DEFAULT, null, $items['itemid'])); if ($_REQUEST['period'] >= ZBX_MIN_PERIOD) { update_profile('web.item.graph.period', $_REQUEST['period'], PROFILE_TYPE_INT, $items['itemid']); } } $graph = new CPie(get_request('graphtype', GRAPH_TYPE_NORMAL)); $graph->setHeader($host['host'] . ':' . get_request('name', '')); $graph3d = get_request('graph3d', 0); $legend = get_request('legend', 0); if ($graph3d == 1) { $graph->switchPie3D(); } $graph->switchLegend($legend); unset($host); if (isset($_REQUEST['period'])) { $graph->SetPeriod($_REQUEST['period']); } if (isset($_REQUEST['from'])) {
require_once 'include/services.inc.php'; require_once 'include/triggers.inc.php'; require_once 'include/html.inc.php'; $page["title"] = "S_CONFIGURATION_OF_IT_SERVICES"; $page["file"] = "services.php"; $page['scripts'] = array('services.js'); $page['hist_arg'] = array(); include_once "include/page_header.php"; //---------------------------------- CHECKS ------------------------------------ // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields = array("msg" => array(T_ZBX_STR, O_OPT, null, null, NULL), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, IN("'hat'"), NULL), 'favid' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), 'state' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})')); check_fields($fields); /* AJAX */ if (isset($_REQUEST['favobj'])) { if ('hat' == $_REQUEST['favobj']) { update_profile('web.services.hats.' . $_REQUEST['favid'] . '.state', $_REQUEST['state'], PROFILE_TYPE_INT); } } if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) { exit; } //-------- //-------------------------------------------------------------------------- $available_triggers = get_accessible_triggers(PERM_READ_ONLY, array(), PERM_RES_IDS_ARRAY); $query = 'SELECT DISTINCT s.serviceid, sl.servicedownid, sl_p.serviceupid as serviceupid, s.triggerid, ' . ' s.name as caption, s.algorithm, t.description, t.expression, s.sortorder, sl.linkid, s.showsla, s.goodsla, s.status ' . ' FROM services s ' . ' LEFT JOIN triggers t ON s.triggerid = t.triggerid ' . ' LEFT JOIN services_links sl ON s.serviceid = sl.serviceupid and NOT(sl.soft=0) ' . ' LEFT JOIN services_links sl_p ON s.serviceid = sl_p.servicedownid and sl_p.soft=0 ' . ' WHERE ' . DBin_node('s.serviceid') . ' AND (t.triggerid IS NULL OR ' . DBcondition('t.triggerid', $available_triggers) . ') ' . ' ORDER BY s.sortorder, sl_p.serviceupid, s.serviceid'; $result = DBSelect($query); $services = array(); $row = array('id' => 0, 'serviceid' => 0, 'serviceupid' => 0, 'caption' => S_ROOT_SMALL, 'status' => SPACE, 'algorithm' => SPACE, 'description' => SPACE, 'soft' => 0, 'linkid' => ''); $services[0] = $row; while ($row = DBFetch($result)) { $row['id'] = $row['serviceid'];
require_once 'include/hosts.inc.php'; require_once 'include/html.inc.php'; $page["title"] = "S_SEARCH"; $page['file'] = 'search.php'; $page['hist_arg'] = array(); $page['scripts'] = array('pmaster.js', 'menu_scripts.js', 'showhint.js', 'scriptaculous.js?load=effects'); $page['type'] = detect_page_type(PAGE_TYPE_HTML); include_once 'include/page_header.php'; // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields = array('type' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1'), NULL), 'search' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, NULL, NULL), 'favid' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})'), 'favcnt' => array(T_ZBX_INT, O_OPT, null, null, NULL), 'action' => array(T_ZBX_STR, O_OPT, P_ACT, IN("'add','remove'"), NULL), 'state' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj}) && ("hat"=={favobj})')); check_fields($fields); // ACTION ///////////////////////////////////////////////////////////////////////////// if (isset($_REQUEST['favobj'])) { $_REQUEST['pmasterid'] = get_request('pmasterid', 'mainpage'); if ('hat' == $_REQUEST['favobj']) { update_profile('web.dashboard.hats.' . $_REQUEST['favid'] . '.state', $_REQUEST['state'], PROFILE_TYPE_INT); } if ('refresh' == $_REQUEST['favobj']) { switch ($_REQUEST['favid']) { case 'hat_syssum': $syssum = make_system_summary(); $syssum->show(); break; case 'hat_stszbx': $stszbx = make_status_of_zbx(); $stszbx->show(); break; } } } if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) {
add_audit($audit_action, AUDIT_RESOURCE_USER_GROUP, 'Group name [' . $group['name'] . ']'); unset($_REQUEST['usrgrpid']); } unset($_REQUEST['form']); } } } } } } } } } } $_REQUEST['filter_usrgrpid'] = get_request('filter_usrgrpid', get_profile('web.users.filter.usrgrpid', 0)); update_profile('web.users.filter.usrgrpid', $_REQUEST['filter_usrgrpid'], PROFILE_TYPE_ID); $frmForm = new CForm(); $frmForm->SetMethod('get'); $cmbConf = new CComboBox('config', $_REQUEST['config'], 'submit()'); $cmbConf->AddItem(0, S_USERS); $cmbConf->AddItem(1, S_USER_GROUPS); $frmForm->AddItem($cmbConf); if (0 == $_REQUEST['config']) { $cmbUGrp = new CComboBox('filter_usrgrpid', $_REQUEST['filter_usrgrpid'], 'submit()'); $cmbUGrp->AddItem(0, S_ALL_S); $result = DBselect('SELECT usrgrpid, name FROM usrgrp WHERE ' . DBin_node('usrgrpid') . ' ORDER BY name'); while ($usrgrp = DBfetch($result)) { $cmbUGrp->AddItem($usrgrp['usrgrpid'], $usrgrp['name']); } $frmForm->AddItem(array(SPACE . SPACE, S_USER_GROUP, $cmbUGrp)); }
array_push($options, 'only_current_node'); } $params = array(); foreach ($options as $option) { $params[$option] = 1; } $PAGE_GROUPS = get_viewed_groups(PERM_READ_ONLY, $params); $PAGE_HOSTS = get_viewed_hosts(PERM_READ_ONLY, $PAGE_GROUPS['selected'], $params); validate_group_with_host($PAGE_GROUPS, $PAGE_HOSTS); //SDI($_REQUEST['groupid'].' : '.$_REQUEST['hostid']); $available_groups = $PAGE_GROUPS['groupids']; $available_hosts = $PAGE_HOSTS['hostids']; $available_graphs = get_accessible_graphs(PERM_READ_LIST, $available_hosts, PERM_RES_IDS_ARRAY, get_current_nodeid(true)); if ($_REQUEST['graphid'] > 0 && ($row = DBfetch(DBselect('SELECT DISTINCT graphid, name FROM graphs WHERE graphid=' . $_REQUEST['graphid'])))) { if (!graph_accessible($_REQUEST['graphid'])) { update_profile('web.charts.graphid', 0); access_deny(); } array_push($h1, $row['name']); } else { $_REQUEST['graphid'] = 0; array_push($h1, S_SELECT_GRAPH_TO_DISPLAY); } $p_elements = array(); $r_form = new CForm(); $r_form->setMethod('get'); $r_form->addVar('fullscreen', $_REQUEST['fullscreen']); $cmbGroups = new CComboBox('groupid', $PAGE_GROUPS['selected'], 'javascript: submit();'); $cmbHosts = new CComboBox('hostid', $PAGE_HOSTS['selected'], 'javascript: submit();'); foreach ($PAGE_GROUPS['groups'] as $groupid => $name) { $cmbGroups->addItem($groupid, get_node_name_by_elid($groupid) . $name);
} $_REQUEST['hostid'] = $clone_hostid; } $result = DBend($result); if ($result) { update_profile('HOST_PORT', $_REQUEST['port'], PROFILE_TYPE_INT); DBstart(); delete_host_profile($hostid); if (get_request('useprofile', 'no') == 'yes') { add_host_profile($hostid, $_REQUEST['devicetype'], $_REQUEST['name'], $_REQUEST['os'], $_REQUEST['serialno'], $_REQUEST['tag'], $_REQUEST['macaddress'], $_REQUEST['hardware'], $_REQUEST['software'], $_REQUEST['contact'], $_REQUEST['location'], $_REQUEST['notes']); } $result = DBend($result); } //HOSTS PROFILE EXTANDED Section if ($result) { update_profile('HOST_PORT', $_REQUEST['port'], PROFILE_TYPE_INT); DBstart(); delete_host_profile_ext($hostid); $useprofile_ext = get_request('useprofile_ext', 'no'); $ext_host_profiles = get_request('ext_host_profiles', array()); if ($useprofile_ext == 'yes' && !empty($ext_host_profiles)) { $result = add_host_profile_ext($hostid, $ext_host_profiles); } $result = DBend($result); } //HOSTS PROFILE EXTANDED Section show_messages($result, $msg_ok, $msg_fail); if ($result) { /* add_audit($audit_action,AUDIT_RESOURCE_HOST, 'Host ['.$_REQUEST['host'].'] IP ['.$_REQUEST['ip'].'] '. 'Status ['.$_REQUEST['status'].']');*/
function validate_sort_and_sortorder($sort = NULL, $sortorder = ZBX_SORT_UP) { global $page; $_REQUEST['sort'] = get_request('sort', get_profile('web.' . $page["file"] . '.sort', $sort)); $_REQUEST['sortorder'] = get_request('sortorder', get_profile('web.' . $page["file"] . '.sortorder', $sortorder)); if (!is_null($_REQUEST['sort'])) { $_REQUEST['sort'] = eregi_replace('[^a-z\\.\\_]', '', $_REQUEST['sort']); update_profile('web.' . $page["file"] . '.sort', $_REQUEST['sort']); } if (!str_in_array($_REQUEST['sortorder'], array(ZBX_SORT_DOWN, ZBX_SORT_UP))) { $_REQUEST['sortorder'] = ZBX_SORT_UP; } update_profile('web.' . $page["file"] . '.sortorder', $_REQUEST['sortorder']); }
$username = self_name(); $char_id = self_char_id(); // Password and email changing systems exist in account.php (& account.tpl). $char = new Player($char_id); $profile_max_length = 500; // Should match the limit in limitStatChars.js - ajv: No, limitStatChars.js should be dynamically generated with this number from a common location - $successMessage = null; $description = post('description', $char->description()); $goals = post('goals', $char->goals()); $instincts = post('instincts', $char->instincts()); $beliefs = post('beliefs', $char->beliefs()); $traits = post('traits', $char->traits()); if ($changedetails) { // Limit the profile length. if ($newprofile != '') { $profile_changed = update_profile($char_id, $newprofile); } else { $error = 'Cannot enter a blank profile.'; } assert((bool) $description); assert((bool) $goals); // Check that the text features don't differ $char->set_description($description); $char->set_goals($goals); $char->set_instincts($instincts); $char->set_beliefs($beliefs); $char->set_traits($traits); /* foreach(['description', 'goals', 'instincts', 'beliefs', 'traits'] as $type){ if($$type && isset($char->vo)){ $method = 'set_'.$type;
if (empty($_POST['mode'])) { echo 'アクセスルートが不正です。もう一度トップページからやり直してください<br>'; //URLで直接アクセスした場合にエラーをログに出力する処理を追加 log_error('アクセスルートが不正です。'); } elseif ($_POST['mode'] == "KOUSHIN_RESULT") { //入力項目が不足している場合にエラーが表示される処理の追加 if (!empty($_POST['name']) && !empty($_POST['year']) && !empty($_POST['month']) && !empty($_POST['day']) && !empty($_POST['type']) && !empty($_POST['tell']) && !empty($_POST['comment'])) { //POSTの取得を追加 $name = $_POST['name']; $type = $_POST['type']; $tell = $_POST['tell']; $comment = $_POST['comment']; //月日を2桁に変更して格納 $birthday = $_POST['year'] . '-' . sprintf('%02d', $_POST['month']) . '-' . sprintf('%02d', $_POST['day']); //関数の引数を追加 $result = update_profile($_GET['id'], $name, $birthday, $type, $tell, $comment); //エラーが発生しなければ表示を行う if (!isset($result)) { //データを更新した場合にログに出力する処理を追加 log_syori('データを更新しました。名前:' . $name); ?> <h1>更新確認</h1><br> <!--更新内容の表示処理を追加--> 名前:<?php echo $name; ?> <br> 生年月日:<?php echo $birthday; ?> <br>
$page["type"] = PAGE_TYPE_XML; $page["file"] = "zabbix_export.xml"; } else { $page["title"] = "S_EXPORT_IMPORT"; $page["file"] = "exp_imp.php"; $page['hist_arg'] = array('config', 'groupid'); } include_once "include/page_header.php"; $_REQUEST["config"] = get_request("config", get_profile("web.exp_imp.config", 0)); $fields = array("config" => array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), null), "groupid" => array(T_ZBX_INT, O_OPT, null, DB_ID, null), "hosts" => array(T_ZBX_INT, O_OPT, null, DB_ID, null), "templates" => array(T_ZBX_INT, O_OPT, null, DB_ID, null), "items" => array(T_ZBX_INT, O_OPT, null, DB_ID, null), "triggers" => array(T_ZBX_INT, O_OPT, null, DB_ID, null), "graphs" => array(T_ZBX_INT, O_OPT, null, DB_ID, null), "update" => array(T_ZBX_INT, O_OPT, null, DB_ID, null), "rules" => array(T_ZBX_INT, O_OPT, null, DB_ID, null), "preview" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "export" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "import" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL)); check_fields($fields); validate_sort_and_sortorder('h.host', ZBX_SORT_UP); $preview = isset($_REQUEST['preview']) ? true : false; $config = get_request('config', 0); $update = get_request('update', null); update_profile("web.exp_imp.config", $config, PROFILE_TYPE_INT); if ($config == 1) { $rules = get_request('rules', array()); foreach (array('host', 'template', 'item', 'trigger', 'graph') as $key) { if (!isset($rules[$key]['exist'])) { $rules[$key]['exist'] = 0; } if (!isset($rules[$key]['missed'])) { $rules[$key]['missed'] = 0; } } } else { $params = array(); $options = array('only_current_node'); foreach ($options as $option) { $params[$option] = 1;
if (str_in_array($srctbl, array('help_items'))) { $itemtype = get_request('itemtype', get_profile('web.popup.itemtype', 0)); $cmbTypes = new CComboBox('itemtype', $itemtype, 'javascript: submit();'); foreach ($allowed_item_types as $type) { $cmbTypes->addItem($type, item_type2str($type)); } $frmTitle->addItem(array(S_TYPE, SPACE, $cmbTypes)); } if (str_in_array($srctbl, array('triggers', 'logitems', 'items', 'applications', 'graphs', 'simple_graph', 'plain_text'))) { $hostid = $PAGE_HOSTS['selected']; $cmbHosts = new CComboBox('hostid', $hostid, 'javascript: submit();'); foreach ($PAGE_HOSTS['hosts'] as $tmp_hostid => $name) { $cmbHosts->addItem($tmp_hostid, get_node_name_by_elid($tmp_hostid) . $name); } $frmTitle->addItem(array(SPACE, S_HOST, SPACE, $cmbHosts)); update_profile('web.popup.hostid', $hostid); } if (str_in_array($srctbl, array('triggers', 'hosts'))) { $btnEmpty = new CButton('empty', S_EMPTY, get_window_opener($dstfrm, $dstfld1, 0) . get_window_opener($dstfrm, $dstfld2, '') . (isset($_REQUEST['reference']) && $_REQUEST['reference'] == 'dashboard' ? "window.opener.setTimeout('add2favorites();', 1000);" : '') . " close_window(); return false;"); $frmTitle->addItem(array(SPACE, $btnEmpty)); } } show_table_header($page['title'], $frmTitle); if ($srctbl == 'hosts') { $table = new CTableInfo(S_NO_HOSTS_DEFINED); $table->setHeader(array(S_HOST, S_DNS, S_IP, S_PORT, S_STATUS, S_AVAILABILITY)); $sql_from = ''; $sql_where = ''; if ($groupid > 0) { $sql_from .= ',hosts_groups hg '; $sql_where .= ' AND hg.groupid=' . $groupid . ' AND h.hostid=hg.hostid ';
<?php //session_save_path('../tmp'); include_once "db.php"; session_start(); if (isset($_SESSION["user"])) { $type = $_GET["type"]; $userid = $_SESSION["user"]["userid"]; if ($type == "updateprofile") { $data = $_GET["data"]; $result = update_profile($userid, $data); echo $result; } else { if ($type == "rating") { submit_your_rating($userid, $_GET["composerid"], $_GET["rating"]); echo "submitted rating!"; } else { echo "submitted wrong type!"; } } } else { echo "Cannot submit rating when not logged in."; }
**/ require_once "include/config.inc.php"; require_once "include/screens.inc.php"; require_once "include/forms.inc.php"; require_once "include/maps.inc.php"; $page["title"] = "S_SCREENS"; $page["file"] = "screenconf.php"; $page['hist_arg'] = array('config'); include_once "include/page_header.php"; $_REQUEST['config'] = get_request('config', get_profile('web.screenconf.config', 0)); // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields = array("config" => array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), null), "screenid" => array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '(isset({config})&&({config}==0))&&(isset({form})&&({form}=="update"))'), "hsize" => array(T_ZBX_INT, O_OPT, null, BETWEEN(1, 100), '(isset({config})&&({config}==0))&&isset({save})'), "vsize" => array(T_ZBX_INT, O_OPT, null, BETWEEN(1, 100), '(isset({config})&&({config}==0))&&isset({save})'), "slideshowid" => array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '(isset({config})&&({config}==1))&&(isset({form})&&({form}=="update"))'), "name" => array(T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({save})'), "delay" => array(T_ZBX_INT, O_OPT, null, BETWEEN(1, 86400), '(isset({config})&&({config}==1))&&isset({save})'), "steps" => array(null, O_OPT, null, null, null), "new_step" => array(null, O_OPT, null, null, null), "move_up" => array(T_ZBX_INT, O_OPT, P_ACT, BETWEEN(0, 65534), null), "move_down" => array(T_ZBX_INT, O_OPT, P_ACT, BETWEEN(0, 65534), null), "edit_step" => array(T_ZBX_INT, O_OPT, P_ACT, BETWEEN(0, 65534), null), "add_step" => array(T_ZBX_STR, O_OPT, P_ACT, null, null), "cancel_step" => array(T_ZBX_STR, O_OPT, P_ACT, null, null), "sel_step" => array(T_ZBX_INT, O_OPT, P_ACT, BETWEEN(0, 65534), null), "del_sel_step" => array(T_ZBX_STR, O_OPT, P_ACT, null, null), "clone" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), "save" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), "delete" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), "cancel" => array(T_ZBX_STR, O_OPT, P_SYS, null, null), "form" => array(T_ZBX_STR, O_OPT, P_SYS, null, null), "form_refresh" => array(T_ZBX_INT, O_OPT, null, null, null)); check_fields($fields); validate_sort_and_sortorder('s.name', ZBX_SORT_UP); $config = $_REQUEST['config'] = get_request('config', 0); update_profile('web.screenconf.config', $_REQUEST['config'], PROFILE_TYPE_INT); if (0 == $config) { if (isset($_REQUEST["screenid"])) { if (!screen_accessible($_REQUEST["screenid"], PERM_READ_WRITE)) { access_deny(); } } if (isset($_REQUEST['clone']) && isset($_REQUEST['screenid'])) { unset($_REQUEST['screenid']); $_REQUEST['form'] = 'clone'; } else { if (isset($_REQUEST['save'])) { if (isset($_REQUEST["screenid"])) { // TODO check permission by new value. $result = update_screen($_REQUEST["screenid"], $_REQUEST["name"], $_REQUEST["hsize"], $_REQUEST["vsize"]); $audit_action = AUDIT_ACTION_UPDATE;
make_refresh_menu('mainpage', $_REQUEST['favid'], $_REQUEST['favcnt'], array('elementid' => $elementid), $menu, $submenu); print 'page_menu["menu_' . $_REQUEST['favid'] . '"] = ' . zbx_jsvalue($menu['menu_' . $_REQUEST['favid']]) . ';'; } } } if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) { exit; } $config = $_REQUEST['config']; $_REQUEST['elementid'] = get_request('elementid', get_profile('web.screens.elementid', null)); if (2 != $_REQUEST['fullscreen']) { update_profile('web.screens.elementid', $_REQUEST['elementid']); } $_REQUEST['period'] = get_request('period', get_profile('web.screens.period', ZBX_PERIOD_DEFAULT, null, $_REQUEST['elementid'])); if ($_REQUEST['period'] >= ZBX_MIN_PERIOD) { update_profile('web.screens.period', $_REQUEST['period'], PROFILE_TYPE_INT, $_REQUEST['elementid']); } $slides_wdgt = new CWidget('hat_slides'); $elementid = get_request('elementid', null); if ($elementid <= 0) { $elementid = null; } $text = S_SLIDESHOWS; $form = new CForm(); $form->setMethod('get'); $form->addVar('config', S_SLIDESHOWS); $form->addVar('fullscreen', $_REQUEST['fullscreen']); if (isset($_REQUEST['period'])) { $form->addVar('period', $_REQUEST['period']); } if (isset($_REQUEST['stime'])) {
// Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. include 'includes/sc-includes.php'; $pagetitle = "Profile"; //UPDATE PROFILE if ($_POST['email']) { update_profile($_POST['email'], $_POST['password'], $_POST['home']); set_msg('Profile Updated'); $_SESSION['user'] = $_POST['email']; header('Location: profile.php'); die; } mysql_select_db($database_contacts, $contacts); $query_profile = "SELECT * FROM users WHERE user_id = " . $row_userinfo['user_id']; $profile = mysql_query($query_profile, $contacts) or die(mysql_error()); $row_profile = mysql_fetch_assoc($profile); $totalRows_profile = mysql_num_rows($profile); $title_text = "Update Profile"; include 'includes/header.php'; ?> <div class="container"> <div class="leftcolumn">
$_REQUEST['nav_time'] = time(); $_REQUEST['triggerid'] = 0; $_REQUEST['show_unknown'] = 0; } $_REQUEST['nav_time'] = get_request('nav_time', get_profile('web.events.filter.nav_time', time())); $_REQUEST['triggerid'] = get_request('triggerid', get_profile('web.events.filter.triggerid', 0)); $show_unknown = get_request('show_unknown', get_profile('web.events.filter.show_unknown', 0)); if (isset($_REQUEST['filter_set']) || isset($_REQUEST['filter_rst'])) { update_profile('web.events.filter.nav_time', $_REQUEST['nav_time'], PROFILE_TYPE_INT); update_profile('web.events.filter.triggerid', $_REQUEST['triggerid']); update_profile('web.events.filter.show_unknown', $show_unknown, PROFILE_TYPE_INT); } // -------------- validate_sort_and_sortorder('e.clock', ZBX_SORT_DOWN); $source = get_request('source', EVENT_SOURCE_TRIGGERS); update_profile('web.events.source', $source, PROFILE_TYPE_INT); $source = get_request('source', EVENT_SOURCE_TRIGGERS); $r_form = new CForm(); $r_form->setMethod('get'); $r_form->setAttribute('name', 'events_menu'); $r_form->addVar('fullscreen', $_REQUEST['fullscreen']); // $r_form->addVar('nav_time',$_REQUEST['nav_time']); if (EVENT_SOURCE_TRIGGERS == $source) { if (isset($_REQUEST['triggerid']) && $_REQUEST['triggerid'] > 0) { $sql = 'SELECT DISTINCT hg.groupid, hg.hostid ' . ' FROM hosts_groups hg, functions f, items i' . ' WHERE i.itemid=f.itemid ' . ' AND hg.hostid=i.hostid ' . ' AND f.triggerid=' . $_REQUEST['triggerid']; if ($host_group = DBfetch(DBselect($sql, 1))) { $_REQUEST['groupid'] = $host_group['groupid']; $_REQUEST['hostid'] = $host_group['hostid']; } else { unset($_REQUEST['triggerid']); }
//入力されてるか確認する if (empty($name) || empty($_POST['year']) || empty($_POST['month']) || empty($_POST['day']) || empty($type) || empty($tell) || empty($comment)) { echo "入力されてない項目があります。"; ?> <form action="<?php echo UPDATE; ?> ?id=<?php echo $_GET['id']; ?> " method="POST"> <input type="submit" value="編集画面に戻る"> </form> <?php } else { $result = update_profile($id, $name, $birthday, $type, $tell, $comment); //エラーが発生しなければ表示を行う if (!isset($result)) { ?> <h1>更新確認</h1> 以上の内容で更新しました。<br> <?php } else { echo 'データの更新に失敗しました。次記のエラーにより処理を中断します:' . $result; } } echo return_top(); ?> </body> </html>
} else { if (HTTPTEST_STATE_UNKNOWN == $httptest_data['curstate']) { $status['msg'] = S_UNKNOWN; $status['style'] = 'unknown'; } else { if ($httptest_data['lastfailedstep'] > 0) { $status['msg'] = S_FAIL . ' - ' . S_ERROR . ': ' . $httptest_data['error']; $status['style'] = 'disabled'; } } } $table->AddRow(array(new CCol(S_TOTAL_BIG, 'bold'), new CCol(SPACE, 'bold'), new CCol(format_lastvalue($total_data[HTTPSTEP_ITEM_TYPE_TIME]), 'bold'), new CCol(SPACE, 'bold'), new CCol(new CSpan($status['msg'], $status['style']), 'bold'))); $table->Show(); echo SBR; if (isset($_REQUEST['period']) && $_REQUEST['period'] != ZBX_MIN_PERIOD) { update_profile('web.httptest.period', $_REQUEST['period'], PROFILE_TYPE_INT, $_REQUEST['httptestid']); } $_REQUEST['period'] = get_profile('web.httptest.period', ZBX_PERIOD_DEFAULT, PROFILE_TYPE_INT, $_REQUEST['httptestid']); show_table_header(array(S_HISTORY . ' "', bold($httptest_data['name']), '"')); $form = new CTableInfo(); $form->AddOption('id', 'graph'); $form->AddRow(array(bold(S_SPEED), new CCol(get_dynamic_chart('graph_1', 'chart3.php?' . url_param('period') . url_param('from') . url_param($httptest_data['name'], false, 'name') . url_param(150, false, 'height') . url_param(get_request('stime', 0), false, 'stime') . url_param($items[HTTPSTEP_ITEM_TYPE_IN], false, 'items') . url_param(GRAPH_TYPE_STACKED, false, 'graphtype'), '-128'), 'center'))); $form->AddRow(array(bold(S_RESPONSE_TIME), new CCol(get_dynamic_chart('graph_2', 'chart3.php?' . url_param('period') . url_param('from') . url_param($httptest_data['name'], false, 'name') . url_param(150, false, 'height') . url_param(get_request('stime', 0), false, 'stime') . url_param($items[HTTPSTEP_ITEM_TYPE_TIME], false, 'items') . url_param(GRAPH_TYPE_STACKED, false, 'graphtype'), '-128'), 'center'))); $form->Show(); $period = get_request('period', 3600); //SDI(get_min_itemclock_by_itemid($items[HTTPSTEP_ITEM_TYPE_IN][0]['itemid'])); $mstime = min(get_min_itemclock_by_itemid($items[HTTPSTEP_ITEM_TYPE_IN][0]['itemid']), get_min_itemclock_by_itemid($items[HTTPSTEP_ITEM_TYPE_TIME][0]['itemid'])); $stime = $mstime ? $mstime : 0; $bstime = time() - $period; if (isset($_REQUEST['stime'])) { $bstime = $_REQUEST['stime'];
<head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>TP</title> <link rel="stylesheet" href="../css/custom.css"> <link rel="stylesheet" href="../css/jquery-ui.min.css"> </head> <body> <div class="profil"> <?php // Besoin de $_SESSION, pour récupérer user_id (cf login.php) session_start(); // Si l'utilisateur à cliquer sur mettre à jour son profil et validé le form if (isset($_POST['submit'])) { // On update le profil avec les champs remplis update_profile($_POST); } // Si l'utilisateur ne se logge pas (login.php) et a direct sur profil.php // user_id n'existe pas, donc affichage du profil interdit if (!isset($_SESSION['user_id'])) { echo "Vous n'êtes pas connecté !"; } else { // Sinon, on récupère son identifiant en BDD, et on récupère toutes ses infos // On stocke dans $user $user = fetch_user($_SESSION['user_id']); ?> <header> <div class="avatar"> <img src="../images/<?php echo $user['avatar']; ?>
$rs_occupation = ""; $rs_phoneNumber = ""; $rs_birthDate = ""; if ($_REQUEST['name']) { $rs_name = $_REQUEST['name']; } if ($_REQUEST['birthDate']) { $rs_birthDate = $_REQUEST['birthDate']; } if ($_REQUEST['occupation']) { $rs_occupation = $_REQUEST['occupation']; } if ($_REQUEST['phoneNumber']) { $rs_phoneNumber = $_REQUEST['phoneNumber']; } $result = update_profile($rs_name, $rs_birthDate, $rs_occupation, $rs_phoneNumber); if (!$result) { echo "<div class='alert alert-block alert-danger fade in'>Lỗi! Không lưu được.</div>"; } else { update_session(); echo "<div class='alert alert-block alert-success fade in'>Cập nhật thành công.</div>"; } } if (isset($_REQUEST['doimatkhau'])) { $rs_mkcu = ""; $rs_mkmoi = ""; $rs_remk = ""; if ($_REQUEST['oldpassword']) { $rs_mkcu = $_REQUEST['oldpassword']; } if ($_REQUEST['newpassword']) {
} else { if (isset($_REQUEST['close'])) { if (!isset($_REQUEST['applicationid'])) { $_REQUEST['applications'] = array(); } else { if (($i = array_search($_REQUEST['applicationid'], $_REQUEST['applications'])) !== FALSE) { unset($_REQUEST['applications'][$i]); } } } } /* limit opened application count */ while (count($_REQUEST['applications']) > 25) { array_shift($_REQUEST['applications']); } update_profile('web.latest.applications', $_REQUEST['applications'], PROFILE_TYPE_ARRAY_ID); if (isset($show_all_apps)) { $url = '?close=1' . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'); $link = new CLink(new CImg('images/general/opened.gif'), $url); // $link = new CLink(new CImg('images/general/opened.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); } else { $url = '?open=1' . url_param('groupid') . url_param('hostid') . url_param('applications') . url_param('select'); $link = new CLink(new CImg('images/general/closed.gif'), $url); // $link = new CLink(new CImg('images/general/closed.gif'),$url,null,"javascript: return updater.onetime_update('".ZBX_PAGE_MAIN_HAT."','".$url."');"); } $table = new CTableInfo(); $table->SetHeader(array(is_show_subnodes() ? make_sorting_link(S_NODE, 'h.hostid') : null, $_REQUEST['hostid'] == 0 ? make_sorting_link(S_HOST, 'h.host') : NULL, array($link, SPACE, make_sorting_link(S_DESCRIPTION, 'i.description')), make_sorting_link(S_LAST_CHECK, 'i.lastclock'), S_LAST_VALUE, S_CHANGE, S_HISTORY)); // $table->ShowStart(); $db_apps = array(); $db_appids = array(); $sql_where .= $_REQUEST['hostid'] > 0 ? ' AND h.hostid=' . $_REQUEST['hostid'] : '';
$fields = array('groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'view_style' => array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), NULL), 'type' => array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), NULL), 'fullscreen' => array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1"), NULL), 'favobj' => array(T_ZBX_STR, O_OPT, P_ACT, NULL, 'isset({favid})'), 'favid' => array(T_ZBX_STR, O_OPT, P_ACT, NOT_EMPTY, NULL), 'state' => array(T_ZBX_INT, O_OPT, P_ACT, NOT_EMPTY, 'isset({favobj})')); check_fields($fields); /* AJAX */ if (isset($_REQUEST['favobj'])) { if ('hat' == $_REQUEST['favobj']) { update_profile('web.overview.hats.' . $_REQUEST['favid'] . '.state', $_REQUEST['state'], PROFILE_TYPE_INT); } } if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) { exit; } //-------- $_REQUEST['view_style'] = get_request('view_style', get_profile('web.overview.view.style', STYLE_TOP)); update_profile('web.overview.view.style', $_REQUEST['view_style'], PROFILE_TYPE_INT); $_REQUEST['type'] = get_request('type', get_profile('web.overview.type', SHOW_TRIGGERS)); update_profile('web.overview.type', $_REQUEST['type'], PROFILE_TYPE_INT); $options = array('allow_all_hosts', 'monitored_hosts', 'with_monitored_items'); if ($_REQUEST['type'] == SHOW_TRIGGERS) { array_push($options, 'with_monitored_triggers'); } if (!$ZBX_WITH_ALL_NODES) { array_push($options, 'only_current_node'); } //SDI($_REQUEST['groupid']); $params = array(); foreach ($options as $option) { $params[$option] = 1; } $PAGE_GROUPS = get_viewed_groups(PERM_READ_ONLY, $params); $PAGE_HOSTS = get_viewed_hosts(PERM_READ_ONLY, $PAGE_GROUPS['selected'], $params); validate_group($PAGE_GROUPS, $PAGE_HOSTS);
function rm4favorites($favobj, $favid, $favcnt = null, $source = null) { $favorites = get_favorites($favobj, get_current_nodeid(true)); $favcnt = is_null($favcnt) ? 0 : $favcnt; if ($favid == 0) { $favcnt = ZBX_FAVORITES_ALL; } foreach ($favorites as $key => $favorite) { if ((bccomp($favid, $favorite['value']) == 0 || $favid == 0) && $favorite['source'] == $source) { if ($favcnt < 1) { unset($favorites[$key]); if ($favcnt > ZBX_FAVORITES_ALL) { break; } // foreach } } $favcnt--; } $result = update_profile($favobj, $favorites, PROFILE_TYPE_ARRAY_ID); return $result; }
$_REQUEST['resourcetype'] = -1; $_REQUEST['nav_time'] = time(); } $_REQUEST['userid'] = get_request('userid', get_profile('web.audit.filter.userid', 0)); $_REQUEST['action'] = get_request('action', get_profile('web.audit.filter.action', -1)); $_REQUEST['resourcetype'] = get_request('resourcetype', get_profile('web.audit.filter.resourcetype', -1)); $_REQUEST['nav_time'] = get_request('nav_time', get_profile('web.audit.filter.nav_time', time())); if (isset($_REQUEST['filter_set']) || isset($_REQUEST['filter_rst'])) { update_profile('web.audit.filter.userid', $_REQUEST['userid']); update_profile('web.audit.filter.action', $_REQUEST['action'], PROFILE_TYPE_INT); update_profile('web.audit.filter.resourcetype', $_REQUEST['resourcetype'], PROFILE_TYPE_INT); update_profile('web.audit.filter.nav_time', $_REQUEST['nav_time'], PROFILE_TYPE_INT); } // -------------- $config = $_REQUEST['config']; update_profile('web.audit.config', $_REQUEST['config'], PROFILE_TYPE_INT); // Navigation initialization $nav_time = $_REQUEST['nav_time']; $time_end = null; $prev_clock = get_request('prev_clock', array()); $next_clock = get_request('next_clock', null); $curr_clock = get_request('curr_clock', $nav_time); $prev_page = get_request('prev_page', false); $next_page = get_request('next_page', false); //SDI(array($prev_page, $next_page, $nav_time)); //SDI(array($prev_clock, $curr_clock, $next_clock)); if ($next_page) { $prev_clock[] = $curr_clock; $time_end = $next_clock; } else { if ($prev_page) {
hesk_load_database_functions(); hesk_session_start(); hesk_dbConnect(); hesk_isLoggedIn(); /* Check permissions */ $can_view_tickets = hesk_checkPermission('can_view_tickets', 0); $can_reply_tickets = hesk_checkPermission('can_reply_tickets', 0); $can_view_unassigned = hesk_checkPermission('can_view_unassigned', 0); /* Update profile? */ if (!empty($_POST['action'])) { // Demo mode if (defined('HESK_DEMO')) { hesk_process_messages($hesklang['sdemo'], 'profile.php', 'NOTICE'); } // Update profile update_profile(); } else { $res = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `id` = '" . intval($_SESSION['id']) . "' LIMIT 1"); $tmp = hesk_dbFetchAssoc($res); foreach ($tmp as $k => $v) { if ($k == 'pass') { if ($v == '499d74967b28a841c98bb4baaabaad699ff3c079') { define('WARN_PASSWORD', true); } continue; } elseif ($k == 'categories') { continue; } $_SESSION['new'][$k] = $v; } }
$_REQUEST['go'] = get_request('go', 'none'); /* AJAX */ // for future use if (isset($_REQUEST['favobj'])) { if ('filter' == $_REQUEST['favobj']) { update_profile('web.audit.filter.state', $_REQUEST['state'], PROFILE_TYPE_INT); } } if (PAGE_TYPE_JS == $page['type'] || PAGE_TYPE_HTML_BLOCK == $page['type']) { exit; } //-------- if (isset($_REQUEST['actionid']) && !action_accessible($_REQUEST['actionid'], PERM_READ_WRITE)) { access_deny(); } update_profile('web.actionconf.eventsource', $_REQUEST['eventsource'], PROFILE_TYPE_INT); if (inarr_isset(array('clone', 'actionid'))) { unset($_REQUEST['actionid']); $_REQUEST['form'] = 'clone'; } else { if (isset($_REQUEST['cancel_new_condition'])) { unset($_REQUEST['new_condition']); } else { if (isset($_REQUEST['cancel_new_operation'])) { unset($_REQUEST['new_operation']); } else { if (isset($_REQUEST['cancel_new_opcondition'])) { unset($_REQUEST['new_opcondition']); } else { if (isset($_REQUEST['save'])) { if (!count(get_accessible_nodes_by_user($USER_DETAILS, PERM_READ_WRITE, PERM_RES_IDS_ARRAY))) {
saveplugins($sid, $fam, $cve, $saveplugins, $AllPlugins, $NonDOS, $DisableAll); break; case "saveprefs": saveprefs($sid); break; case "update": $stype = ""; if (intval($user) != -1) { $stype = $user; } elseif (intval($entity) != -1) { $stype = $entity; } if ($stype == "") { $stype = Session::get_session_user(); } update_profile($sid, $sname, $sdescription, $stype, $sautoenable, $auto_cat_status, $auto_fam_status, $tracker); break; case "updateusers": update_users($sid, $users); break; case "viewconfig": view_config($sid); break; default: select_profile(); break; } echo " </td></tr>"; echo " </table>"; echo "</td></tr>"; echo "</table>";
} if ($_REQUEST['show_events'] == EVENTS_OPTION_NOFALSEFORB && $_REQUEST['show_triggers'] != TRIGGERS_OPTION_NOFALSEFORB) { $_REQUEST['show_events'] = EVENTS_OPTION_NOEVENT; } if (EVENT_ACK_DISABLED == $config['event_ack_enable'] && !str_in_array($_REQUEST['show_events'], array(EVENTS_OPTION_NOEVENT, EVENTS_OPTION_ALL))) { $_REQUEST['show_events'] = EVENTS_OPTION_NOEVENT; } //-- if (isset($_REQUEST['filter_set']) || isset($_REQUEST['filter_rst'])) { update_profile('web.tr_status.filter.show_actions', $_REQUEST['show_actions'], PROFILE_TYPE_INT); update_profile('web.tr_status.filter.show_details', $_REQUEST['show_details'], PROFILE_TYPE_INT); update_profile('web.tr_status.filter.show_triggers', $_REQUEST['show_triggers'], PROFILE_TYPE_INT); update_profile('web.tr_status.filter.show_events', $_REQUEST['show_events'], PROFILE_TYPE_INT); update_profile('web.tr_status.filter.show_severity', $_REQUEST['show_severity'], PROFILE_TYPE_INT); update_profile('web.tr_status.filter.txt_select', $_REQUEST['txt_select'], PROFILE_TYPE_STR); update_profile('web.tr_status.filter.inverse_select', $_REQUEST['inverse_select'], PROFILE_TYPE_INT); } $show_triggers = $_REQUEST['show_triggers']; $show_events = $_REQUEST['show_events']; $show_severity = $_REQUEST['show_severity']; $show_events_status = $_REQUEST['show_events_status']; // -------------- validate_sort_and_sortorder('t.lastchange', ZBX_SORT_DOWN); //SDI($_REQUEST['groupid'].' : '.$_REQUEST['hostid']); $params = array(); $options = array('allow_all_hosts', 'monitored_hosts', 'with_monitored_items'); if (!$ZBX_WITH_ALL_NODES) { array_push($options, 'only_current_node'); } foreach ($options as $option) { $params[$option] = 1;