function pageController() { $data = []; $adjectives = ['adament', 'endemic', 'fulsome', 'Incendiary', 'Mordant', 'obtuse', 'puckish', 'strident', 'voluble', 'zealous']; $noun = ['people', 'way', 'art', 'world', 'computer', 'meat', 'music', 'data', 'law', 'power']; $data['serverName'] = getServerName($noun, $adjectives); return $data; }
function pageController() { $data = []; $data['adjective'] = randomAdjective(); $data['name'] = getServerName(); $data['number'] = randomNumber(); return $data; }
function add_hyper_column($column_value, $model) { $row_content = ""; if (!$model->isRunning()) { $row_content = "<a href='/clientbest/web/st_data/playback.php?id=" . $column_value . "' onclick=\"return confirm('您将要在服务器" . getServerName($model->getPressServer()) . "上运行" . $model->getToolName() . ",您确定要进行回放吗?');\">测试回放</a>"; } else { $row_content = "<a target=_blank href='/clientbest/web/st_monitor/monitor.php?id=" . $column_value . " '>监控</a>"; } array_push($this->columns, $row_content); }
function pageController() { // Initialize an empty data array. $adjectives = array('pretty', 'funny', 'silly', 'cute', 'ugly', 'sweet', 'happy', 'sad', 'hungry', 'beautiful'); $nouns = array('hill', 'girl', 'boy', 'laptop', 'dollar', 'store', 'playground', 'computer', 'television', 'woman'); $data = array(); // Add data to be used in the html view. $data['serverName'] = getServerName($adjectives, $nouns); // Return the completed data array. return $data; }
function domain_deployment() { $isadmin = 'admin' == substr($this->get[0], 0, 5); if ($isadmin) { if (config::ADMIN_DOMAIN != getServerName()) { $this->notfound('您所访问的页面不存在!'); } } else { if (config::FRONT_DOMAIN != getServerName()) { $curPageURL = curPageURL(); strpos($curPageURL, 'http://') !== false && ($curPageURL = str_replace('http://', '', $curPageURL)); strpos($curPageURL, '/') !== false && ($curPageURL = str_replace('/', '', $curPageURL)); if ($curPageURL == config::ADMIN_DOMAIN) { header("Location: " . url('admin_main/', true)); exit; } else { if ($this->get[0] != 'attach') { $this->notfound('您所访问的页面不存在!'); } } } } }
function send_AIC($requestrul = '', $message = '', $messagetype = 1, $shortmessage = '') { $data_AIC = array('ServerIP' => $_SERVER["SERVER_ADDR"], 'ClientIP' => $_SERVER["REMOTE_ADDR"], 'RequestURL' => $requestrul, 'Message' => $message, 'MessageType' => $messagetype, 'ShortMessage' => $shortmessage, 'Domain' => getServerName()); $json = sprintf("aicdata=%s", json_encode($data_AIC, true)); topen("http://searchmonitor.5173esb.com:888/AicSimple.ashx", 15, $json); }
function getUploadToken() { requireRequestMethod("POST"); /* FIXME: token should expire, based on server request? */ /* FIXME: what if upload size is not known in time? transcode web service for example... */ $absPath = $this->validatePath(getRequest('relativePath', TRUE), FTS_PARENT); /* make sure the uploaded file name is unique */ $absPath = $this->getUniqueName($absPath); /* verify fileSize * * NOTE: fileSize *is* required, but 0 is a valid file size, but also * seen as "empty" by PHP, so we work around it like this... */ $fileSize = (int) getRequest('fileSize', FALSE, 0); if ($fileSize < 0) { throw new Exception("invalid filesize"); } $token = generateToken(); try { $stmt = $this->dbh->prepare("INSERT INTO uploadTokens (token, filePath, fileSize) VALUES (:token, :filePath, :fileSize)"); $stmt->bindParam(':token', $token); $stmt->bindParam(':filePath', $absPath); $stmt->bindParam(':fileSize', $fileSize); $stmt->execute(); $uploadLocation = getProtocol() . getServerName() . $_SERVER['PHP_SELF'] . "?action=uploadFile&token={$token}"; return array("uploadLocation" => $uploadLocation, "absPath" => $absPath); } catch (Exception $e) { throw new Exception("database query failed"); } }
*/ require_once 'config.php'; require_once 'utils.php'; if (!isset($config) || !is_array($config)) { die("broken or missing configuration file?"); } date_default_timezone_set(getConfig($config, 'time_zone', FALSE, 'Europe/Amsterdam')); set_include_path(get_include_path() . PATH_SEPARATOR . getConfig($config, "smarty_lib_dir", TRUE)); $view = getRequest('fmt', FALSE, 'html'); if (!in_array($view, array('html', 'os'))) { die("invalid view"); } require_once "Smarty.class.php"; $smarty = new Smarty(); $smarty->template_dir = 'tpl'; $smarty->compile_dir = 'tpl_c'; $smarty->assign('css_url', getProtocol() . getServerName() . dirname($_SERVER['PHP_SELF']) . '/s/style.css'); $smarty->assign('js_url', getProtocol() . getServerName() . dirname($_SERVER['PHP_SELF']) . '/j/' . $view . '.js'); $smarty->assign('js_common_url', getProtocol() . getServerName() . dirname($_SERVER['PHP_SELF']) . '/j/common.js'); $smarty->assign('protocol', getProtocol()); $content = $smarty->fetch('content.tpl'); $smarty->assign('content', $content); if ($view === "os") { /* Disable Caching */ header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past header("Content-Type: text/xml"); } $smarty->display($view . '.tpl');
function sendTicket() { global $mysql; $title = mysql_html($_POST['title']); $msg = mysql_html($_POST['message']); $user_id = intval($_SESSION['uid']); $unique_key = generateRandomKey(30); $username = mysql_html($_SESSION['name']); $panelAdmins = getPanelAdministrators(); $time = time(); if (isset($_POST['sendTicket'])) { $query = "INSERT INTO 1fx_tickets (user_id, title, ticket_status, unique_key, lastaction) VALUES ('{$user_id}', '{$title}', '1', '{$unique_key}', '{$time}')"; $getTicketid = "SELECT ticket_id FROM 1fx_tickets WHERE unique_key='{$unique_key}'"; mysqli_query($mysql, $query); $ticketId = mysqli_fetch_array(mysqli_query($mysql, $getTicketid))['ticket_id']; $sendMessage = "INSERT INTO 1fx_tickets_messages (ticket_id, user_id, user_ip, time, message) VALUES ('{$ticketId}', '{$user_id}', '" . getUserIP() . "', '{$time}', '{$msg}')"; mysqli_query($mysql, $sendMessage); foreach ($panelAdmins as $panelAdmin) { $query = "INSERT INTO 1fx_tickets_map (ticket_id, user_id) VALUES ('{$ticketId}', '" . $panelAdmin['id'] . "')"; mysqli_query($mysql, $query); if (intval($panelAdmin['id']) == $user_id) { continue; } $pAdminId[] = $panelAdmin['id']; sendEmail($panelAdmin['fullname'], $panelAdmin['email'], "New support ticket | " . substr($_SESSION['panel'], 0, -3), "Hello " . $panelAdmin['fullname'] . ",<br><br>You got a new support ticket from user {$username}, please check it on <a href='" . getProtocol() . "://" . $_SERVER['SERVER_NAME'] . "/support/tickets/details/?id={$ticketId}'>" . substr($_SESSION['panel'], 0, -3) . "</a>.<br><br>Best regards!", 0, $panelAdmin['id']); } newNotification($pAdminId, "2", "You have a new support ticket from user {$username}", "fa-warning", "1", "/tickets/details/?id={$ticketId}"); } else { $serverid = intval(mysql_html($_POST['server'])); $serverAdmin = getServerAdministrators($serverid); $query = "INSERT INTO 1fx_tickets (user_id, title, ticket_status, unique_key, lastaction) VALUES ('{$user_id}', '{$title}', '1', '{$unique_key}', '{$time}')"; $getTicketid = "SELECT ticket_id FROM 1fx_tickets WHERE unique_key='{$unique_key}'"; mysqli_query($mysql, $query); $ticketId = mysqli_fetch_array(mysqli_query($mysql, $getTicketid))['ticket_id']; $serverName = getServerName($serverid); $sendMessage = "INSERT INTO 1fx_tickets_messages (ticket_id, user_id, user_ip, time, message) VALUES ('{$ticketId}', '{$user_id}', '" . getUserIP() . "', '{$time}', 'Server - {$serverName}<br><br>{$msg}')"; mysqli_query($mysql, $sendMessage); foreach ($panelAdmins as $panelAdmin) { $query = "INSERT INTO 1fx_tickets_map (ticket_id, user_id) VALUES ('{$ticketId}', '" . $panelAdmin['id'] . "')"; mysqli_query($mysql, $query); if (intval($panelAdmin['id']) == $user_id) { continue; } $pAdminId[] = $panelAdmin['id']; sendEmail($panelAdmin['fullname'], $panelAdmin['email'], "New support ticket | " . substr($_SESSION['panel'], 0, -3), "Hello " . $panelAdmin['fullname'] . ",<br><br>You got a new support ticket from user {$username}, please check it on <a href='" . getProtocol() . "://" . $_SERVER['SERVER_NAME'] . "/support/tickets/details/?id={$ticketId}'>" . substr($_SESSION['panel'], 0, -3) . "</a>.<br><br>Best regards!", 0, $panelAdmin['id']); } foreach ($serverAdmin as $panelAdmin) { $query = "INSERT INTO 1fx_tickets_map (ticket_id, user_id) VALUES ('{$ticketId}', '" . $panelAdmin['id'] . "')"; mysqli_query($mysql, $query); if (intval($panelAdmin['id']) == $user_id) { continue; } $pAdminId[] = $panelAdmin['id']; sendEmail($panelAdmin['fullname'], $panelAdmin['email'], "New support ticket | " . substr($_SESSION['panel'], 0, -3), "Hello " . $panelAdmin['fullname'] . ",<br><br>You got a new support ticket from user {$username}, please check it on <a href='" . getProtocol() . "://" . $_SERVER['SERVER_NAME'] . "/support/tickets/details/?id={$ticketId}'>" . substr($_SESSION['panel'], 0, -3) . "</a>.<br><br>Best regards!", 0, $panelAdmin['id']); } newNotification($pAdminId, "2", "You have a new support ticket from user {$username}", "fa-warning", "1", "/tickets/details/?id={$ticketId}"); } }
function sys_error_handle() { $sys_error_btn = $this->db->result_first("SELECT v FROM " . DB_TABLEPRE . "setting WHERE k='sys_error_btn'"); if ($sys_error_btn) { if (config::FRONT_DOMAIN == getServerName()) { if ($this->get[0] == 'question' && $this->get[1] == 'ask') { header("Location: http://ask.5173.com/Question.aspx?t="); } else { header("Location: http://ask.5173.com/"); } } } }
function getFullScriptURL() { $i_hostname = getServerName(); if ($i_hostname != false) { $i_protocol = (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://'; $i_url_prefix = $i_protocol . $i_hostname; return $i_url_prefix . getScriptURL(); } else { return false; } }