function show_page($page) { $template = "view/templates/default_template.php"; if (file_exists($template) && is_file($template)) { require_once $template; } else { require_once "view/templates/default_template.php"; } echo get_document_head(); echo get_header_start(); if (is_logged_in()) { echo get_logout(); } else { } echo get_header_end(); if (is_logged_in()) { echo get_menu(); } else { echo get_guest_menu(); } if (is_logged_in()) { if ($page == "startpage") { echo "startpage"; } else { if ($page == "fileupload") { echo get_fileupload(); } else { if ($page == "nyheter") { echo get_news(); } else { if ($page == "flowing") { echo get_flowing(); } else { if ($page == "event") { echo get_event(); } else { if ($page == "profile") { $user_id = 1; echo get_profile($user_id); } else { echo get_default(""); } } } } } } } else { echo get_login(); } echo get_footer(); echo get_document_end(); }
function genImage($typwykresu) { global $SMARTY, $AUTH, $chart, $host_ipaddr, $LMS, $PROFILE; $czas = time(); if ($oldtime = get_profile('monit_tmp_win_time')) { @unlink(TMP_DIR . '/tmp.' . $AUTH->id . '.' . $oldtime . '.chartwin.png'); } $objResponse = new xajaxResponse(); switch ($typwykresu) { case 'ping': $LMS->RRD_CreatePingImage($chart['type'] . '.' . $chart['id'], "Ping " . $host_ipaddr . ' Last 24h', '-1d', 'now', 600, 310, 'tmp.' . $AUTH->id . '.' . $czas . '.chartwin'); break; case 'signal': $LMS->RRD_CreateSignalImage($chart['type'] . '.' . $chart['id'], "Signal " . $host_ipaddr . ' Last 24h', '-1d', 'now', 600, 310, 'tmp.' . $AUTH->id . '.' . $czas . '.chartwin', $chart['signal_exp_test']); break; case 'packets': $LMS->RRD_CreatePacketsImage($chart['type'] . '.' . $chart['id'], "Pakiety " . $host_ipaddr . " Last 24h", '-1d', 'now', 600, 310, 'tmp.' . $AUTH->id . '.' . $czas . '.chartwin'); break; case 'bits': $LMS->RRD_CreateBitsImage($chart['type'] . '.' . $chart['id'], "Bity " . $host_ipaddr . " Last 24h", '-1d', 'now', 600, 310, 'tmp.' . $AUTH->id . '.' . $czas . '.chartwin'); break; } $PROFILE->nowsave('monit_tmp_win_time', $czas); $objResponse->assign("id_wykres", "innerHTML", "<img src='tmp/" . "tmp." . $AUTH->id . "." . $czas . ".chartwin.png' border='0'>"); return $objResponse; }
function curr_file($file_id) { global $db, $tpf, $settings, $code; $file = $db->fetch_one_array("select * from {$tpf}files where file_id='{$file_id}'"); if (!$file) { $file['is_del'] = 1; } else { $file['dl'] = create_down_url($file); $in_extract = $code == md5($file['file_key']) ? 1 : 0; $file['username'] = $file['p_name'] = @$db->result_first("select username from {$tpf}users where userid='{$file['userid']}' limit 1"); $rs = $db->fetch_one_array("select folder_id,folder_name from {$tpf}folders where userid='{$file['userid']}' and folder_id='{$file['folder_id']}'"); $file['file_category'] = $rs['folder_name'] ? '<a href="' . urr("space", "username="******"&folder_id=" . $rs['folder_id']) . '" target="_blank">' . $rs['folder_name'] . '</a>' : '- ' . __('uncategory') . ' -'; $file_key = trim($file['file_key']); $tmp_ext = $file['file_extension'] ? '.' . $file['file_extension'] : ""; $file_extension = $file['file_extension']; $file_ext = get_real_ext($file_extension); $file['file_description'] = str_replace('<br>', LF, $file[file_description]); $file['a_space'] = urr("space", "username="******"Y-m-d", $file['file_time']); $file['credit_down'] = $file['file_credit'] ? (int) $file['file_credit'] : (int) $settings['credit_down']; $file['username'] = $file[user_hidden] ? __('hidden') : ($file['username'] ? '<a href="' . $file['a_space'] . '">' . $file['username'] . '</a>' : __('hidden')); $file['file_downs'] = $file['stat_hidden'] ? __('hidden') : get_discount($file[userid], $file['file_downs']); $file['file_views'] = $file['stat_hidden'] ? __('hidden') : get_discount($file[userid], $file['file_views']); $file['file_url'] = $settings['phpdisk_url'] . urr("viewfile", "file_id={$file['file_id']}"); if (get_plans(get_profile($file[userid], 'plan_id'), 'open_second_page') == 3) { $file['a_downfile'] = urr("download", "file_id={$file_id}&key=" . random(32)); $file['a_downfile2'] = urr("download", "file_id={$file_id}&key=" . random(32)); } } return $file; }
function View() { $this->named_vars = array(); $this->header_sent = false; global $db; global $request; $env =& environment(); if (isset($request->resource)) { $this->collection = new Collection($request->resource); } else { $this->collection = new Collection(null); } $this->named_vars['db'] =& $db; $this->named_vars['request'] =& $request; $this->named_vars['collection'] =& $this->collection; $this->named_vars['response'] =& $this; if (get_profile_id()) { $this->named_vars['profile'] =& get_profile(); } else { $this->named_vars['profile'] = false; } if (isset($request->resource) && $request->resource != 'introspection') { $this->named_vars['resource'] =& $db->get_table($request->resource); } else { $this->named_vars['resource'] = false; } $this->named_vars['prefix'] = $db->prefix; $this->controller = $request->controller; load_apps(); $controller_path = controller_path(); // check for a controller file in controllers/[resource].php if (isset($request->resource)) { $cont = $controller_path . $request->resource . ".php"; if (file_exists($cont)) { $this->controller = $request->resource . ".php"; } elseif (isset($request->templates_resource[$request->resource]) && file_exists($controller_path . $request->templates_resource[$request->resource] . ".php")) { $this->controller = $request->templates_resource[$request->resource] . ".php"; } else { if (isset($GLOBALS['PATH']['apps'])) { foreach ($GLOBALS['PATH']['apps'] as $k => $v) { if (file_exists($v['controller_path'] . $request->resource . ".php")) { $this->controller = $request->resource . ".php"; $controller_path = $v['controller_path']; } } } } } if (is_file($controller_path . $this->controller)) { require_once $controller_path . $this->controller; } else { trigger_error('Sorry, the controller was not found at ' . $controller_path . $this->controller, E_USER_ERROR); } if (!isset($env['content_types'])) { trigger_error('Sorry, the content_types array was not found in the configuration file', E_USER_ERROR); } $this->negotiator = HTTP_Negotiate::choose($env['content_types']); }
public function profile () { checkLogin(); include_once(RPC_ROOT . 'includes/lib_transaction_ec.php'); $user_id = intval($_SESSION['user_id']); $user_profile = get_profile($user_id); $user_profile['user_id'] = $user_id; //var_dump($user_profile);exit; jsonExit($user_profile); }
function profile() { include_once ROOT_PATH . 'includes/lib_transaction.php'; switch ($_SERVER['REQUEST_METHOD']) { case 'GET': return get_profile($_SESSION['user_id']); break; default: return 'This API can not support ' . $_SERVER['REQUEST_METHOD'] . ' method'; break; } }
function post(&$vars) { extract($vars); if (!get_profile_id()) { trigger_error('Sorry, the setting could not be saved', E_USER_ERROR); } $request->set_param(array('setting', 'profile_id'), get_profile_id()); if (strpos($request->params['setting']['name'], 'password') !== false) { $request->set_param(array('setting', 'value'), md5_encrypt($request->params['setting']['value'], $db->dbname)); } $settingname = $request->params['setting']['name']; $set = split('\\.', $settingname); if (is_array($set) && $set[0] == 'config') { if (!member_of('administrators')) { trigger_error('Sorry, you must be an administrator to do that', E_USER_ERROR); } $s = $Setting->find_by('name', $settingname); if ($s) { $db->delete_record($s); } } if ($settingname == 'app') { $do_install = false; $app = $settingname; $sources = environment('remote_sources'); $remote_list = array(); foreach ($sources as $name => $url) { $p = get_profile(); $url = "http://" . $url . "&p=" . urlencode($p->profile_url) . "&a=" . urlencode($app); $curl = curl_init($url); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($curl); if ($result) { if (trim($result) == 'install') { $do_install = true; } continue; } curl_close($curl); } if (!$do_install) { trigger_error('Sorry, you are not authorized to install ' . $app, E_USER_ERROR); } } $resource->insert_from_post($request); header_status('201 Created'); redirect_to($request->resource); }
function on_wp_login($who) { //TODO: standardize the USER-META behavoir global $wp_version; $langs = wp_native_dashboard_collect_installed_languages(); if (!isset($_POST['wp_native_dashboard_language']) || !in_array($_POST['wp_native_dashboard_language'], $langs)) { return; } if (version_compare($wp_version, '3.0', '>=')) { $user = get_user_by('login', $who); update_user_meta((int) $user->ID, 'wp_native_dashboard_language', $_POST['wp_native_dashboard_language']); } else { update_usermeta(get_profile('ID', $who), 'wp_native_dashboard_language', $_POST['wp_native_dashboard_language']); } }
function get_discount($uid, $src, $op = 'asc', $dot = 0) { global $db, $tpf, $settings; $discount_rate = @$db->result_first("select discount_rate from {$tpf}users where userid='{$uid}'"); if (!$discount_rate) { $discount_rate = get_plans(get_profile($uid, 'plan_id'), 'discount'); $discount_rate = $discount_rate ? $discount_rate : ($settings[discount_rate] ? $settings[discount_rate] : 0); } if ($dot) { if ($op == 'asc') { return @round($src * (1 - $discount_rate / 100), 4); } elseif ($op == 'desc') { return @round($src / (1 - $discount_rate / 100), 4); } } else { if ($op == 'asc') { return ceil($src * (1 - $discount_rate / 100)); } elseif ($op == 'desc') { return ceil($src / (1 - $discount_rate / 100)); } } }
function show_user_table($members, $offset, $numToDisplay, $cols) { echo "<table class=bordered border=1 cellpadding=5>\n"; $rows = ceil($numToDisplay / $cols); $count = $offset; $numMembers = count($members); for ($row = 0; $row < $rows; $row++) { if ($count >= $numMembers) { break; } echo "<tr>\n"; for ($col = 0; $col < $cols; $col++) { if ($count < $numMembers) { $profile = get_profile($members[$count]); if (!$profile) { $numMembers--; continue; } echo "<td class=bordered width=7% height=64><center>"; $show_picture = $profile->has_picture; if (profile_screening() && $profile->verification != 1) { $show_picture = false; } if ($show_picture) { echo "<a href=\"" . URL_BASE . "view_profile.php?userid={$members[$count]}\"><img src=\"" . URL_BASE . IMAGE_URL . "{$members[$count]}_sm.jpg\"></a>"; } else { echo " "; } echo "</center></td><td class=bordered width=33% height=64>\n", get_profile_summary($profile), "</td>"; $count++; } else { echo "<td width=7% height=64></td><td width=33% height=64></td>"; } } echo "</tr>\n"; } echo "</table>\n"; }
$fields = array('period' => array(T_ZBX_INT, O_OPT, P_NZERO, BETWEEN(ZBX_MIN_PERIOD, ZBX_MAX_PERIOD), null), 'from' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'stime' => array(T_ZBX_INT, O_OPT, P_NZERO, null, null), 'border' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'name' => array(T_ZBX_STR, O_OPT, NULL, null, null), 'width' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), null), 'height' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), null), 'graphtype' => array(T_ZBX_INT, O_OPT, NULL, IN('2,3'), null), 'graph3d' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'legend' => array(T_ZBX_INT, O_OPT, P_NZERO, IN('0,1'), null), 'items' => array(T_ZBX_STR, O_OPT, NULL, null, null)); check_fields($fields); $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']);
$result['html'] = $smarty->fetch('library/member_info.lbi'); } $result['error'] = 1; $result['content'] = $_LANG['login_failure']; } die($json->encode($result)); } elseif ($action == 'logout') { if ((!isset($back_act) || empty($back_act)) && isset($GLOBALS['_SERVER']['HTTP_REFERER'])) { $back_act = strpos($GLOBALS['_SERVER']['HTTP_REFERER'], 'user.php') ? './index.php' : $GLOBALS['_SERVER']['HTTP_REFERER']; } $user->logout(); $ucdata = empty($user->ucdata) ? "" : $user->ucdata; show_message($_LANG['logout'] . $ucdata, array($_LANG['back_up_page'], $_LANG['back_home_lnk']), array($back_act, 'index.php'), 'info'); } elseif ($action == 'profile') { include_once ROOT_PATH . 'includes/lib_transaction.php'; $user_info = get_profile($user_id); /* 取出注册扩展字段 */ $sql = 'SELECT * FROM ' . $ecs->table('reg_fields') . ' WHERE type < 2 AND display = 1 ORDER BY dis_order, id'; $extend_info_list = $db->getAll($sql); $sql = 'SELECT reg_field_id, content ' . 'FROM ' . $ecs->table('reg_extend_info') . " WHERE user_id = {$user_id}"; $extend_info_arr = $db->getAll($sql); $temp_arr = array(); foreach ($extend_info_arr as $val) { $temp_arr[$val['reg_field_id']] = $val['content']; } foreach ($extend_info_list as $key => $val) { switch ($val['id']) { case 1: $extend_info_list[$key]['content'] = $user_info['msn']; break; case 2:
$log .= '<? exit; ?>SERVER:' . var_export($_SERVER) . LF; $log .= '------------------------------' . LF; write_file(PHPDISK_ROOT . 'system/buy_vip.log.php', $log, 'ab+'); } if (!$task || !$money || !$vip_id) { die(__('money_or_payment_method_not_select')); } else { if (!$money) { $error = false; $sysmsg[] = __('money_invalid'); } $money = $money ? $money : 1; } if ($task == 'mywealth') { form_auth(gpc('formhash', 'P', ''), formhash()); if (get_profile($pd_uid, 'wealth') < $money) { $error = true; $sysmsg[] = __('mywealth_too_small'); } if (!$error) { $my_order = 'm' . get_order_number(); $num = @$db->result_first("select count(*) from {$tpf}vip_orders where order_number='{$my_order}' and pay_method='{$task}' and userid='{$pd_uid}'"); if (!$num) { $ins = array('pay_method' => $task, 'userid' => $pd_uid, 'vip_id' => $vip_id, 'order_number' => $my_order, 'total_fee' => $money, 'pay_status' => 'pendding', 'in_time' => $timestamp, 'ip' => $onlineip); $db->query_unbuffered("insert into {$tpf}vip_orders set " . $db->sql_array($ins) . ";"); } $db->query_unbuffered("update {$tpf}users set wealth=wealth-{$money} where userid='{$pd_uid}'"); $md5_sign = md5($my_order . $money . $pd_uid . $task); echo '<div align="center">' . __('buy_vip_doing') . '</div>'; echo '<script>document.location="' . urr("payment", "action={$task}&order_number={$my_order}&sign={$md5_sign}") . '";</script>'; } else {
if (isset($services[$row['serviceid']])) { $services[$row['serviceid']] = array_merge($services[$row['serviceid']], $row); } else { $services[$row['serviceid']] = $row; } if (isset($row['serviceupid'])) { $services[$row['serviceupid']]['childs'][] = array('id' => $row['serviceid'], 'soft' => 0, 'linkid' => 0); } if (isset($row['servicedownid'])) { $services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']); } } $treeServ = array(); createShowServiceTree($services, $treeServ); //return into $treeServ parametr //permission issue $treeServ = del_empty_nodes($treeServ); $tree = new CTree($treeServ, array('caption' => bold(S_SERVICE), 'status' => bold(S_STATUS), 'reason' => bold(S_REASON), 'sla' => bold(S_SLA_LAST_7_DAYS), 'sla2' => bold(nbsp(S_SLA)), 'graph' => bold(S_GRAPH))); if ($tree) { $url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1'); $fs_icon = new CDiv(SPACE, 'fullscreen'); $fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN); $fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';")); $tab = create_hat(S_IT_SERVICES_BIG, $tree->getHTML(), null, 'hat_services', get_profile('web.srv_status.hats.hat_services.state', 1)); $tab->Show(); unset($tab); } else { error('Can not format Tree. Check logik structure in service links'); } } include_once "include/page_footer.php";
<?php include "header.php"; include "Queries.php"; include "utils.php"; if (!isset($_SESSION['username'])) { die; } $username = $_SESSION['username']; if (isset($_GET['id'])) { $username = $_GET['id']; } $user_profile = get_profile($username); if ($user_profile == null) { die("Could not get user profile"); } if (isset($_GET['action'])) { if ($_GET['action'] == "addmoderator") { if (!isset($_GET['id'])) { die("Must specify id for this action"); } make_moderator($_GET['id']); } else { if ($_GET['action'] == "removemoderator") { if (!isset($_GET['id'])) { die("Must specify id for this action"); } remove_moderator($_GET['id']); } else { if ($_GET['action'] == "delete") { delete_user($_SESSION['username']);
function action_account_security() { // 获取全局变量 $user = $GLOBALS['user']; $_CFG = $GLOBALS['_CFG']; $_LANG = $GLOBALS['_LANG']; $smarty = $GLOBALS['smarty']; $db = $GLOBALS['db']; $ecs = $GLOBALS['ecs']; $user_id = $_SESSION['user_id']; include_once ROOT_PATH . 'includes/lib_transaction.php'; $user_info = get_profile($user_id); $smarty->assign('info', $user_info); $smarty->display('user_transaction.dwt'); }
$icon->addAction('onclick', new CScript("javascript: rm4favorites('graphid','" . $_REQUEST['graphid'] . "',0);")); } else { $icon = new CDiv(SPACE, 'iconplus'); $icon->addOption('title', S_ADD_TO . ' ' . S_FAVORITES); $icon->addAction('onclick', new CScript("javascript: add2favorites('graphid','" . $_REQUEST['graphid'] . "');")); } $icon->addOption('id', 'addrm_fav'); $url = '?graphid=' . $_REQUEST['graphid'] . ($_REQUEST['fullscreen'] ? '' : '&fullscreen=1'); $fs_icon = new CDiv(SPACE, 'fullscreen'); $fs_icon->addOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN); $fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';")); $rst_icon = new CDiv(SPACE, 'iconreset'); $rst_icon->addOption('title', S_RESET); $rst_icon->addAction('onclick', new CScript("javascript: graphload(SCROLL_BAR.dom_graphs, " . (time() + 100000000) . ", 3600, false);")); } $charts_hat = create_hat(S_GRAPHS_BIG, $p_elements, array($icon, $rst_icon, $fs_icon), 'hat_charts', get_profile('web.charts.hats.hat_charts.state', 1)); $charts_hat->show(); if ($_REQUEST['graphid'] > 0) { // NAV BAR $stime = get_min_itemclock_by_graphid($_REQUEST['graphid']); $stime = is_null($stime) ? 0 : $stime; $bstime = time() - $effectiveperiod; if (isset($_REQUEST['stime'])) { $bstime = $_REQUEST['stime']; $bstime = mktime(substr($bstime, 8, 2), substr($bstime, 10, 2), 0, substr($bstime, 4, 2), substr($bstime, 6, 2), substr($bstime, 0, 4)); } $script = 'scrollinit(0,' . $effectiveperiod . ',' . $stime . ',0,' . $bstime . '); showgraphmenu("graph");'; if ($graphtype == GRAPH_TYPE_NORMAL || $graphtype == GRAPH_TYPE_STACKED) { $script .= 'graph_zoom_init("' . $dom_graph_id . '",' . $bstime . ',' . $effectiveperiod . ',ZBX_G_WIDTH,' . $graph_height . ',true);'; } zbx_add_post_js($script);
function old__construct($section = 'profile') { global $path_site; global $meta_desc; global $meta_addtl; global $meta_keywords; global $title; global $_REQUEST; global $states; global $ccExpMM; global $ccExpYY; global $cl; global $profnav; @($method = $_REQUEST['method']); @($action = $_REQUEST['action']); @($call = $_REQUEST['call']); // a call is an ajax call. // SETUP PAGE OUTPUT VARIABLES START \\ $returnmsg = NULL; $disabled = NULL; $returnmsg_addAddr = NULL; $contentOutput = NULL; // PROFILE HOME \\ if ($section == 'profile') { // PROF LEFT NAV ACTIVE START \\ $profnav['acctinfo'] = 'active'; // PROF LEFT NAV ACTIVE END \\ if (!isset($_SESSION['user']['id'])) { redirect($path_site . 'profile/login.php'); } // INIT OBJECTS \\ $returnmsg_prof = NULL; if (isset($_REQUEST['submitupdate'])) { // check for errors if ($errors = $this->checkProfile($_REQUEST)) { $returnmsg_prof = replace_output(ERROR_PROFILE2, array('errors' => $errors)); } else { // no errors, Login user and start session. if ($this->submitUser($_REQUEST, 'profile')) { // move user back to last $returnmsg_prof = CONF_MSG_1; unset($_REQUEST); } else { $returnmsg_prof = ERROR_MSG_CONTACT2; } } } // Get Profile Information $info = get_profile($_SESSION['user']['id']); // check if newsletter is selected. @($info['agreeNewsletter'] == 1) ? $data_nl = ' checked="checked"' : ($data_nl = NULL); $txtStates = NULL; $addStates = NULL; foreach ($states as $key => $value) { $sel = NULL; $selAdd = NULL; if (stripslashes($info['state']) == $key) { $sel = ' selected="selected"'; } if (@$_REQUEST['addState'] == $key) { $selAdd = ' selected="selected"'; } $txtStates .= '<option value="' . $key . '"' . $sel . '>' . $value . '</option>'; $addStates .= '<option value="' . $key . '"' . $selAdd . '>' . $value . '</option>'; } // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/cb/acctProfile.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => $path_site, 'return_msg' => $returnmsg_prof, 'data_un' => stripslashes($info['username']), 'data_em' => stripslashes($info['email']), 'data_fn' => stripslashes($info['firstName']), 'data_mi' => stripslashes($info['mi']), 'data_ln' => stripslashes($info['lastName']), 'data_addr1' => stripslashes($info['addr1']), 'data_addr2' => stripslashes($info['addr2']), 'data_city' => stripslashes($info['city']), 'states' => $txtStates, 'data_zc1' => substr(stripslashes($info['zip']), 0, 5), 'data_zc2' => substr(stripslashes($info['zip']), 5, 4), 'data_phone1' => substr(stripslashes($info['mainPhone']), 0, 3), 'data_phone2' => substr(stripslashes($info['mainPhone']), 3, 3), 'data_phone3' => substr(stripslashes($info['mainPhone']), 6, 4), 'data_phone4' => substr(stripslashes($info['altPhone']), 0, 3), 'data_phone5' => substr(stripslashes($info['altPhone']), 3, 3), 'data_phone6' => substr(stripslashes($info['altPhone']), 6, 4), 'data_nl' => $data_nl, 'site_baseurl' => SITE_BASEURL_SECURE)); // Call the output $contentOutput .= $returnOutput->output; // GET TEMP HEADER $temp_notif_output = get_profile_notif(); // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/tpl/profile_body.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'site_baseurl' => SITE_BASEURL_SECURE, 'return_msg' => $returnmsg, 'profile_nav' => $cl->compile_profileNav($profnav), 'box_four' => $temp_notif_output . replace_output(file_get_contents($path_site . 'inc/cb/box_four.inc'), array('path_site' => SITE_BASEURL_SECURE, 'header_style' => 'nav', 'list' => replace_output(HH_PM_PROF_NAV1, array('path_site' => SITE_BASEURL_SECURE)), 'content' => $contentOutput)))); // Call the output $this->output .= $returnOutput->output; } else { if ($section == 'forgot') { // see if someone visits the registration page, but it already logged in, send them to thier profile homepage if (isset($_SESSION['user']['id'])) { redirect($path_site . 'profile/'); } // else, now check if they're registering or we're processing a registration. $returnmsg = NULL; if (isset($_REQUEST['submitforgot'])) { // check for errors if ($errors = $this->checkForgot($_REQUEST)) { $returnmsg = replace_output(ERROR_PROFILE2, array('errors' => $errors)); } else { // no errors, Login user and start session. if ($this->submitUser($_REQUEST, 'forgot')) { // move user back to last $returnmsg = CONF_PROFILE_FORGOT1; $meta_addtl .= replace_output(META_REDIRECT, array('path_site' => $path_site, 'secs' => '10')); $disabled = ' disabled="disabled"'; unset($_REQUEST['email']); } else { $returnmsg = ERROR_PROFILE_FORGOT1; } } } // landing page for forgot // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/cb/acctForgot.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => $path_site, 'disabled' => $disabled, 'return_msg' => $returnmsg, 'data_em' => $_REQUEST['user_email'])); // Call the output $this->output = $returnOutput->output; } else { if ($section == 'login') { // SETUP PAGE OUTPUT VARIABLES START # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $error = null; // see if someone visits the registration page, but it already logged in, send them to thier profile homepage if (isset($_SESSION['user']['id'])) { redirect($path_site . 'profile/'); } // else, now check if they're registering or we're processing a registration. $returnmsg = null; if (isset($_REQUEST['submit_login'])) { // check for errors if ($errors = $this->checkLogin($_REQUEST)) { $returnmsg = replace_output(ERROR_PROFILE1, array('errors' => $errors)); } else { // no errors, Login user and start session. if ($this->submitUser($_REQUEST, 'login')) { // move user back to last // print $last; if (isset($_SESSION['last'])) { redirect($_SESSION['last']); } else { redirect(SITE_BASEURL); } unset($_REQUEST, $_SESSION['last']); exit; } else { $returnmsg = ERROR_EMAIL_VERIFICATION; } } } // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/cb/acctLogin.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => $path_site, 'return_msg' => $returnmsg, 'site_title' => SITE_TITLE, 'captcha' => recaptcha_get_html(CX_CAPTCHA_PUBLIC_KEY, $error, TRUE), 'data_un' => $_REQUEST['username'])); // Call the output $contentOutput .= $returnOutput->output; // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/cb/box_four.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'site_baseurl' => SITE_BASEURL_SECURE, 'return_msg' => $returnmsg, 'header_style' => 'banner', 'list' => replace_output(HH_PM_DHDR_LOGIN_NAV1, array('path_site' => SITE_BASEURL_SECURE)), 'content' => $contentOutput)); // Call the output $this->output .= $returnOutput->output; // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/cb/acctLogin_tip.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE)); // Call the output $this->output2 .= $returnOutput->output; } else { if ($section == 'logout') { session_destroy(); redirect(SITE_BASEURL); } else { if ($section == 'register') { // VERIFICATION if (isset($_REQUEST['verify'])) { if ($this->submitUser($_REQUEST, 'verify')) { redirect(SITE_BASEURL_SECURE . 'profile/'); } else { redirect(SITE_BASEURL_); } } //CONFIRM if ($action == 'confirm') { if ($_SESSION['registration']['complete'] && $_SESSION['registration']['type'] == 'regular') { // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/cb/acctRegister_confirm.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'returnmsg' => $returnmsg)); // Call the output $contentOutput .= $returnOutput->output; unset($_SESSION['registration']); } else { redirect(SITE_BASEURL_SECURE . 'profile/'); } } else { // see if someone visits the registration page, but it already logged in, send them to thier profile homepage if (isset($_SESSION['user']['id'])) { redirect($path_site . 'profile/'); } // SETUP PAGE OUTPUT VARIABLES START # the response from reCAPTCHA $resp = null; # the error code from reCAPTCHA, if any $error = null; isset($_REQUEST['agree']) && $_REQUEST['agree'] == '1' ? $data_ag = ' checked="checked"' : ($data_ag = null); // (isset($_REQUEST['newsletter']) and $_REQUEST['newsletter'] == '1')? $data_nl=' checked="checked"' : $data_nl=NULL ; // SETUP PAGE OUTPUT VARIABLES END // Check if they're registering or we're processing a registration. if (isset($_REQUEST['submit'])) { // check for errors $errors = $this->checkReg($_REQUEST); if ($errors) { $returnmsg = replace_output(ERROR_PROFILE1, array('errors' => $errors)); } else { // no errors, add user to database, and start session. if ($this->submitUser($_REQUEST, 'reg')) { $_SESSION['registration']['complete'] = TRUE; $_SESSION['registration']['type'] = 'regular'; unset($_REQUEST); redirect(SITE_BASEURL_SECURE . 'profile/register.php?action=confirm'); exit; } else { $returnmsg = ERROR_MSG_CRITICAL1; } } } // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/cb/acctRegister.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => $path_site, 'return_msg' => $returnmsg, 'data_un' => $_REQUEST['user_name'], 'data_em' => $_REQUEST['user_email'], 'data_fn' => $_REQUEST['user_fname'], 'data_ln' => $_REQUEST['user_lname'], 'data_ag' => $data_ag, 'site_title' => SITE_TITLE, 'captcha' => recaptcha_get_html(CX_CAPTCHA_PUBLIC_KEY, $error, TRUE), 'disabled' => $disabled)); // Call the output $contentOutput .= $returnOutput->output; } // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/cb/box_four.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'site_baseurl' => SITE_BASEURL_SECURE, 'return_msg' => $returnmsg, 'header_style' => 'banner', 'list' => replace_output(HH_PM_DHDR_REG_NAV1, array('path_site' => SITE_BASEURL_SECURE)), 'content' => $contentOutput)); // Call the output $this->output .= $returnOutput->output; // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/cb/acctRegister_tip.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE)); // Call the output $this->output2 .= $returnOutput->output; } else { if ($section == 'pubProf') { // PROF LEFT NAV ACTIVE START \\ $profnav['pubprof'] = 'active'; // PROF LEFT NAV ACTIVE END \\ if (!isset($_SESSION['user']['id'])) { redirect($path_site . 'profile/login.php'); } // INIT OBJECTS \\ $returnmsg_pp = NULL; if (isset($_REQUEST['submitupdate'])) { // check for errors if ($errors = $this->check('pubProf')) { $returnmsg_pp = replace_output(ERROR_PROFILE2, array('errors' => $errors)); } else { // no errors if ($this->submit('pubProf')) { $returnmsg_pp = CONF_MSG_1; unset($_REQUEST); } else { $returnmsg_pp = ERROR_MSG_CONTACT2; } } } // Get Profile Information $info = get_public_profile($_SESSION['user']['id']); $image = get_public_profile_image($info['id']); $c = get_colors(); $colors = NULL; foreach ($c as $k => $v) { if ($k == '5') { $colors .= '</div><div class="left" style="width: 70px;">'; } $sel = NULL; if ($info['colorid'] == $k) { $sel = ' checked="checked"'; } $colors .= replace_output(HH_PM_PUBPROF_COLOR, array('check' => $sel, 'id' => $k, 'class' => $v)); } // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/cb/acctPublic_profile.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'return_msg' => $returnmsg_pp, 'data_img' => SITE_BASEURL_SECURE . $image, 'data_blogurl' => stripslashes($info['urlBlog']), 'data_fburl' => stripslashes($info['urlFb']), 'data_liurl' => stripslashes($info['urlLi']), 'data_twtrurl' => stripslashes($info['urlTwtr']), 'data_yturl' => stripslashes($info['urlYt']), 'data_stmnt' => stripslashes($info['statement']), 'data_name' => stripslashes($info['name']), 'data_title' => stripslashes($info['title']), 'data_colors' => $colors)); // Call the output $contentOutput .= $returnOutput->output; // CALL CONTENT AND REPLACE TAGS INSIDE $content = $path_site . 'inc/tpl/profile_body.inc'; $returnOutput = new main_output($content); // replace tags from template @$returnOutput->replace_tags(array('path_site' => SITE_BASEURL_SECURE, 'site_baseurl' => SITE_BASEURL_SECURE, 'return_msg' => $returnmsg, 'profile_nav' => $cl->compile_profileNav($profnav), 'box_four' => get_profile_notif() . replace_output(file_get_contents($path_site . 'inc/cb/box_four.inc'), array('path_site' => SITE_BASEURL_SECURE, 'header_style' => 'nav', 'list' => replace_output(HH_PM_DHDR_PUBPROF_NAV, array('path_site' => SITE_BASEURL_SECURE)), 'content' => $contentOutput)))); // Call the output $this->output .= $returnOutput->output; } } } } } } }
// $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&applicationid=0' . 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."');"); } $col = new CCol(array($link, SPACE, bold(S_MINUS_OTHER_MINUS), SPACE . '(' . $db_host['item_cnt'] . SPACE . S_ITEMS . ')')); $col->SetColSpan(5); $table->AddRow(array(get_node_name_by_elid($db_host['hostid']), $_REQUEST['hostid'] > 0 ? NULL : $db_host['host'], $col)); foreach ($app_rows as $row) { $table->AddRow($row); } } $p_elements[] = $table; /* // Refresh tab $refresh_tab = array( array('id' => ZBX_PAGE_MAIN_HAT, 'interval' => $USER_DETAILS['refresh'], 'url' => zbx_empty($_SERVER['QUERY_STRING'])?'':'?'.$_SERVER['QUERY_STRING'], ) ); //*/ $url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1'); $fs_icon = new CDiv(SPACE, 'fullscreen'); $fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN); $fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';")); $latest_hat = create_hat(S_LATEST_DATA_BIG, $p_elements, array($fs_icon), ZBX_PAGE_MAIN_HAT, get_profile('web.latest.hats.hat_latest.state', 1)); $latest_hat->Show(); // add_refresh_objects($refresh_tab); include_once 'include/page_footer.php';
"); }else{ alert("<?php echo __('not_ie_copy_tips'); ?> "); } } } </script> <?php } ?> </div> <!-- end not action --> <?php } ?> <div class="clear"></div> </div> <?php if (!$pd_uid || !$settings['open_vip']) { echo stripslashes(base64_decode(get_plans(get_profile($file[userid], 'plan_id'), 'viewfile_code'))); } elseif ($settings['open_vip'] && get_profile($pd_uid, 'vip_end_time') < $timestamp || get_vip(get_profile($pd_uid, 'vip_id'), 'pop_ads')) { echo stripslashes(base64_decode(get_plans(get_profile($file[userid], 'plan_id'), 'viewfile_code'))); } if (get_profile($file[userid], 'open_custom_stats') && get_profile($file[userid], 'check_custom_stats')) { echo stripslashes(get_stat_code($file[userid])); } ?> <br /><br />
$audit_action = $_REQUEST['set_users_status'] == GROUP_STATUS_ENABLED ? AUDIT_ACTION_ENABLE : AUDIT_ACTION_DISABLE; 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));
$plans = array(); while ($rs = $db->fetch_array($q)) { $plans[] = $rs; } $db->free($q); unset($rs); $q = $db->query("select subject,vip_id from {$tpf}vips order by vip_id asc"); $vips = array(); while ($rs = $db->fetch_array($q)) { $vips[] = $rs; } $db->free($q); unset($rs); $vip_end_time = get_profile($uid, 'vip_end_time'); $vip_end_time_txt = $vip_end_time ? date('Y-m-d H:i:s', $vip_end_time) : ''; $myinfo = get_profile($uid); $user = $db->fetch_one_array("select * from {$tpf}users where userid='{$uid}' limit 1"); if ($user) { $user[stat_code] = $user[stat_code] ? stripslashes(base64_decode($user[stat_code])) : ''; if ($user[plan_id]) { $user[plan_subject] = $db->result_first("select subject from {$tpf}plans where plan_id='{$user['plan_id']}'"); $user[readonly] = 'readonly'; } else { $user[plan_subject] = __('not_set'); $user[readonly] = ''; } $q = $db->query("select u.username,u.userid from {$tpf}buddys b,{$tpf}users u where b.touserid=u.userid and b.userid='{$user['userid']}'"); $buddy_list = array(); while ($rs = $db->fetch_array($q)) { $rs['a_user_edit'] = urr(ADMINCP, "item=users&menu=user&action=user_edit&uid={$rs['userid']}"); $buddy_list[] = $rs;
?> </a></td> </tr> <?php } ?> <?php if (is_vip($pd_uid) && $auth[open_downline2]) { ?> <tr> <td>系统指定下线数量:</td> <td><?php echo $downline_num; ?> / <?php echo get_vip(get_profile($pd_uid, 'vip_id'), 'downline_num'); ?> </td> </tr> <?php } ?> <tr> <td><?php echo __('contact_qq'); ?> :</td> <td><?php echo $pd_email; ?> </td>
function cfct_username_to_id($username) { return get_profile('ID', $username); }
echo __('file_menu'); ?> </div> <ul id="nav_1"> <li><a href="<?php echo urr("mydisk", "item=profile&action=multi_upload"); ?> " id="n_multi_upload"><img src="images/upload_file_icon.gif" align="absmiddle" border="0" /><?php echo __('multi_upload'); ?> </a></li> <?php show_ext_menu('forum_upload'); ?> <?php if ($settings[global_open_custom_stats] && get_profile($pd_uid, 'open_custom_stats')) { ?> <?php show_ext_menu('mod_stat'); ?> <?php } ?> <li><a href="<?php echo urr("mydisk", "item=profile&action=files"); ?> " id="n_files"><img src="images/ico_home.gif" align="absmiddle" border="0" /><?php echo __('manage_file'); ?> </a></li> </ul>
$fs_icon = new CDiv(SPACE, 'fullscreen'); $fs_icon->addOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN); $fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';")); //------- $left_tab = new CTable(); $left_tab->setCellPadding(3); $left_tab->setCellSpacing(3); $left_tab->addOption('border', 0); $left_tab->addRow(create_hat(S_EVENT . SPACE . S_SOURCE . SPACE . S_DETAILS, make_trigger_details($_REQUEST['triggerid'], $trigger_data), null, 'hat_triggerdetails')); $left_tab->addRow(create_hat(S_EVENT_DETAILS, make_event_details($_REQUEST['eventid']), null, 'hat_eventdetails')); $right_tab = new CTable(); $right_tab->setCellPadding(3); $right_tab->setCellSpacing(3); $right_tab->addOption('border', 0); $right_tab->addRow(create_hat(S_ACKNOWLEDGES, make_acktab_by_eventid($_REQUEST['eventid']), null, 'hat_eventack', get_profile('web.tr_events.hats.hat_eventack.state', 1))); $right_tab->addRow(create_hat(S_MESSAGE_ACTIONS, get_action_msgs_for_event($_REQUEST['eventid']), null, 'hat_eventactionmsgs', get_profile('web.tr_events.hats.hat_eventactionmsgs.state', 1))); $right_tab->addRow(create_hat(S_COMMAND_ACTIONS, get_action_cmds_for_event($_REQUEST['eventid']), null, 'hat_eventactioncmds', get_profile('web.tr_events.hats.hat_eventactioncmds.state', 1))); $right_tab->addRow(create_hat(S_EVENTS . SPACE . S_LIST . SPACE . '[' . S_LAST . ' 20]', make_small_eventlist($_REQUEST['triggerid'], $trigger_data), null, 'hat_eventlist', get_profile('web.tr_events.hats.hat_eventlist.state', 1))); $td_l = new CCol($left_tab); $td_l->addOption('valign', 'top'); $td_r = new CCol($right_tab); $td_r->addOption('valign', 'top'); $outer_table = new CTable(); $outer_table->addOption('border', 0); $outer_table->setCellPadding(1); $outer_table->setCellSpacing(1); $outer_table->addRow(array($td_l, $td_r)); $p_elements[] = $outer_table; $latest_hat = create_hat($text, $p_elements, array($fs_icon), 'hat_tr_events', get_profile('web.tr_events.hats.hat_tr_events.state', 1)); $latest_hat->show(); include_once 'include/page_footer.php';
echo upload_company_logo($_POST, $_FILES); } else { if (strpos($uri, '/uci') !== false) { echo upload_company_image($_POST, $_FILES); } else { if (strpos($uri, '/ucsi') !== false) { echo upload_company_skill_image($_POST, $_FILES); } else { if (strpos($uri, '/remove_company_images') !== false) { echo remove_company_images($_POST); } else { if (strpos($uri, '/remove_company_skills_images') !== false) { echo remove_company_skills_images($_POST); } else { if (strpos($uri, '/profiles') !== false) { echo get_profile($_GET); } else { if (strpos($uri, '/profile_reviews') !== false) { echo get_profile_review($_GET); } else { if (strpos($uri, '/add_profile_review') !== false) { echo add_profile_review($_POST); } else { if (strpos($uri, '/edit_profile') !== false) { echo edit_profile($_POST); } else { if (strpos($uri, '/uprpic') !== false) { echo upload_edit_profile_picture($_POST, $_FILES); } else { if (strpos($uri, '/add_product_to_favorite') !== false) { echo add_product_to_favorite($_GET);
function get_triggers_overview($hostids, $view_style = null) { $available_triggers = get_accessible_triggers(PERM_READ_ONLY, $hostids); if (is_null($view_style)) { $view_style = get_profile('web.overview.view.style', STYLE_TOP); } $table = new CTableInfo(S_NO_TRIGGERS_DEFINED); $result = DBselect('SELECT DISTINCT t.triggerid,t.description,t.expression,t.value,t.priority,t.lastchange,h.hostid,h.host' . ' FROM hosts h,items i,triggers t, functions f ' . ' WHERE h.status=' . HOST_STATUS_MONITORED . ' AND h.hostid=i.hostid ' . ' AND i.itemid=f.itemid ' . ' AND f.triggerid=t.triggerid' . ' AND ' . DBcondition('t.triggerid', $available_triggers) . ' AND t.status=' . TRIGGER_STATUS_ENABLED . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' ORDER BY t.description'); unset($triggers); unset($hosts); $triggers = array(); while ($row = DBfetch($result)) { if (trigger_dependent($row['triggerid'])) { continue; } $row['host'] = get_node_name_by_elid($row['hostid']) . $row['host']; $row['description'] = expand_trigger_description_constants($row['description'], $row); $hosts[strtolower($row['host'])] = $row['host']; // A little tricky check for attempt to overwrite active trigger (value=1) with // inactive or active trigger with lower priority. if (!isset($triggers[$row['description']][$row['host']]) || ($triggers[$row['description']][$row['host']]['value'] == TRIGGER_VALUE_FALSE && $row['value'] == TRIGGER_VALUE_TRUE || ($triggers[$row['description']][$row['host']]['value'] == TRIGGER_VALUE_FALSE || $row['value'] == TRIGGER_VALUE_TRUE) && $row['priority'] > $triggers[$row['description']][$row['host']]['priority'])) { $triggers[$row['description']][$row['host']] = array('hostid' => $row['hostid'], 'triggerid' => $row['triggerid'], 'value' => $row['value'], 'lastchange' => $row['lastchange'], 'priority' => $row['priority']); } } if (!isset($hosts)) { return $table; } ksort($hosts); if ($view_style == STYLE_TOP) { $header = array(new CCol(S_TRIGGERS, 'center')); foreach ($hosts as $hostname) { $header = array_merge($header, array(new CImg('vtext.php?text=' . $hostname))); } $table->setHeader($header, 'vertical_header'); foreach ($triggers as $descr => $trhosts) { $table_row = array(nbsp($descr)); foreach ($hosts as $hostname) { $table_row = get_trigger_overview_cells($table_row, $trhosts, $hostname); } $table->AddRow($table_row); } } else { $header = array(new CCol(S_HOSTS, 'center')); foreach ($triggers as $descr => $trhosts) { $descr = array(new CImg('vtext.php?text=' . $descr)); array_push($header, $descr); } $table->SetHeader($header, 'vertical_header'); foreach ($hosts as $hostname) { $table_row = array(nbsp($hostname)); foreach ($triggers as $descr => $trhosts) { $table_row = get_trigger_overview_cells($table_row, $trhosts, $hostname); } $table->AddRow($table_row); } } return $table; }
$result['html'] = $smarty->fetch('library/member_info.lbi'); } $result['error'] = 1; $result['content'] = $_LANG['login_failure']; } die($json->encode($result)); } elseif ($action == 'logout') { if (!isset($back_act) && isset($GLOBALS['_SERVER']['HTTP_REFERER'])) { $back_act = strpos($GLOBALS['_SERVER']['HTTP_REFERER'], 'user.php') ? './index.php' : $GLOBALS['_SERVER']['HTTP_REFERER']; } $user->logout(); $ucdata = empty($user->ucdata) ? "" : $user->ucdata; show_message($_LANG['logout'] . $ucdata, array($_LANG['back_up_page'], $_LANG['back_home_lnk']), array($back_act, 'index.php'), 'info'); } elseif ($action == 'profile') { include_once ROOT_PATH . 'includes/lib_transaction.php'; $smarty->assign('profile', get_profile($user_id)); $smarty->display('user_transaction.dwt'); } elseif ($action == 'act_edit_profile') { include_once ROOT_PATH . 'includes/lib_transaction.php'; $birthday = trim($_POST['birthdayYear']) . '-' . trim($_POST['birthdayMonth']) . '-' . trim($_POST['birthdayDay']); $email = trim($_POST['email']); $msn = trim($_POST['other']['msn']); $qq = trim($_POST['other']['qq']); $mobile_phone = trim($_POST['other']['mobile_phone']); $office_phone = $_POST['other']['office_phone']; $home_phone = $_POST['other']['home_phone']; if (!empty($office_phone) && !preg_match('/^[\\d|\\_|\\-|\\s]+$/', $office_phone)) { show_message($_LANG['passport_js']['office_phone_invalid']); } if (!empty($home_phone) && !preg_match('/^[\\d|\\_|\\-|\\s]+$/', $home_phone)) { show_message($_LANG['passport_js']['home_phone_invalid']);
** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. **/ require_once 'include/config.inc.php'; require_once 'include/hosts.inc.php'; require_once 'include/maintenances.inc.php'; require_once 'include/forms.inc.php'; $page['title'] = "S_HOSTS"; $page['file'] = 'hosts.php'; $page['hist_arg'] = array('groupid', 'config', 'hostid'); $page['scripts'] = array('menu_scripts.js', 'calendar.js'); include_once 'include/page_header.php'; $_REQUEST['config'] = get_request('config', get_profile('web.hosts.config', 0)); $available_groups = get_accessible_groups_by_user($USER_DETAILS, PERM_READ_WRITE); $available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_WRITE); if (isset($_REQUEST['groupid']) && $_REQUEST['groupid'] > 0 && !isset($available_groups[$_REQUEST['groupid']])) { access_deny(); } if (isset($_REQUEST['hostid']) && $_REQUEST['hostid'] > 0 && !isset($available_hosts[$_REQUEST['hostid']])) { access_deny(); } if (isset($_REQUEST['apphostid']) && $_REQUEST['apphostid'] > 0 && !isset($available_hosts[$_REQUEST['apphostid']])) { access_deny(); } // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields = array('config' => array(T_ZBX_INT, O_OPT, P_SYS, IN('0,1,2,3,4,5,6'), NULL), 'hosts' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'groups' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'hostids' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'groupids' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'applications' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({config})&&({config}==0||{config}==5||{config}==2)&&isset({form})&&({form}=="update")'), 'host' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({config})&&({config}==0||{config}==3||{config}==5)&&isset({save})&&!isset({massupdate})'), 'proxy_hostid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({config})&&({config}==0)&&isset({save})&&!isset({massupdate})'), 'dns' => array(T_ZBX_STR, O_OPT, NULL, NULL, '(isset({config})&&({config}==0))&&isset({save})&&!isset({massupdate})'), 'useip' => array(T_ZBX_STR, O_OPT, NULL, IN('0,1'), '(isset({config})&&({config}==0))&&isset({save})&&!isset({massupdate})'), 'ip' => array(T_ZBX_IP, O_OPT, NULL, NULL, '(isset({config})&&({config}==0))&&isset({save})&&!isset({massupdate})'), 'port' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), '(isset({config})&&({config}==0))&&isset({save})&&!isset({massupdate})'), 'status' => array(T_ZBX_INT, O_OPT, NULL, IN('0,1,3'), '(isset({config})&&({config}==0))&&isset({save})&&!isset({massupdate})'), 'newgroup' => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), 'templates' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, NULL), 'clear_templates' => array(T_ZBX_INT, O_OPT, NULL, DB_ID, NULL), 'useipmi' => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), 'ipmi_ip' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useipmi})&&!isset({massupdate})'), 'ipmi_port' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0, 65535), 'isset({useipmi})&&!isset({massupdate})'), 'ipmi_authtype' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(-1, 6), 'isset({useipmi})&&!isset({massupdate})'), 'ipmi_privilege' => array(T_ZBX_INT, O_OPT, NULL, BETWEEN(1, 5), 'isset({useipmi})&&!isset({massupdate})'), 'ipmi_username' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useipmi})&&!isset({massupdate})'), 'ipmi_password' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useipmi})&&!isset({massupdate})'), 'useprofile' => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), 'devicetype' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'name' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'os' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'serialno' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'tag' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'macaddress' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'hardware' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'software' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'contact' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'location' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'notes' => array(T_ZBX_STR, O_OPT, NULL, NULL, 'isset({useprofile})&&!isset({massupdate})'), 'useprofile_ext' => array(T_ZBX_STR, O_OPT, NULL, NULL, NULL), 'ext_host_profiles' => array(T_ZBX_STR, O_OPT, P_UNSET_EMPTY, NULL, NULL), 'massupdate' => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), 'visible' => array(T_ZBX_STR, O_OPT, null, null, null), 'groupid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, '(isset({config})&&({config}==1))&&(isset({form})&&({form}=="update"))'), 'gname' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, '(isset({config})&&({config}==1))&&isset({save})'), 'applicationid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, '(isset({config})&&({config}==4))&&(isset({form})&&({form}=="update"))'), 'appname' => array(T_ZBX_STR, O_NO, NULL, NOT_EMPTY, '(isset({config})&&({config}==4))&&isset({save})'), 'apphostid' => array(T_ZBX_INT, O_OPT, NULL, DB_ID . '{}>0', '(isset({config})&&({config}==4))&&isset({save})'), 'apptemplateid' => array(T_ZBX_INT, O_OPT, NULL, DB_ID, NULL), 'tname' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({config})&&({config}==2)&&isset({save})'), 'maintenanceid' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, '(isset({config})&&({config}==6))&&(isset({form})&&({form}=="update"))'), 'maintenanceids' => array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, NULL), 'mname' => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, '(isset({config})&&({config}==6))&&isset({save})'), 'maintenance_type' => array(T_ZBX_INT, O_OPT, null, null, '(isset({config})&&({config}==6))&&isset({save})'), 'description' => array(T_ZBX_STR, O_OPT, NULL, null, '(isset({config})&&({config}==6))&&isset({save})'), 'active_since' => array(T_ZBX_INT, O_OPT, null, BETWEEN(1, time() * 2), '(isset({config})&&({config}==6))&&isset({save})'), 'active_till' => array(T_ZBX_INT, O_OPT, null, BETWEEN(1, time() * 2), '(isset({config})&&({config}==6))&&isset({save})'), 'new_timeperiod' => array(T_ZBX_STR, O_OPT, null, null, 'isset({add_timeperiod})'), 'timeperiods' => array(T_ZBX_STR, O_OPT, null, null, null), 'g_timeperiodid' => array(null, O_OPT, null, null, null), 'edit_timeperiodid' => array(null, O_OPT, P_ACT, DB_ID, null), 'add_timeperiod' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'del_timeperiod' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'cancel_new_timeperiod' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, null, null), 'activate' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'disable' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'add_to_group' => array(T_ZBX_INT, O_OPT, P_SYS | P_ACT, DB_ID, NULL), 'delete_from_group' => array(T_ZBX_INT, O_OPT, P_SYS | P_ACT, DB_ID, NULL), 'unlink' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'unlink_and_clear' => 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), 'clone' => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), 'full_clone' => 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), 'delete_and_clear' => 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_STR, O_OPT, NULL, NULL, NULL)); check_fields($fields); validate_sort_and_sortorder('h.host', ZBX_SORT_UP);