Example #1
0
 function _initialize()
 {
     header("Content-type:text/html;charset=utf-8");
     import("ORG.File");
     import("ORG.Plugin");
     $model = M('config');
     $list = $model->select();
     foreach ($list as $v) {
         $GLOBALS[$v['varname']] = $v['value'];
     }
     //临时关闭
     if ($GLOBALS['cfg_cmsswitch'] == 0) {
         die($GLOBALS['cfg_cmsswitch_msg']);
     }
     //web主题切换
     if (isset($_GET['theme']) && !empty($_GET['theme']) && is_dir('./Public/Tpl/' . $_GET['theme'])) {
         cookie('theme', $_GET['theme']);
     }
     if (isset($_GET['theme'])) {
         if (empty($_GET['theme']) or !is_dir('./Public/Tpl/' . $_GET['theme'])) {
             cookie('theme', null);
         }
     }
     $theme = cookie('theme');
     if (!empty($theme)) {
         $GLOBALS['cfg_df_style'] = $theme;
     }
     //网站根路径绝对地址
     $GLOBALS['cfg_cmsurl'] = $GLOBALS['cfg_basehost'] . $GLOBALS['cfg_indexurl'];
     $tplpath = __ROOT__ . '/Public/Tpl/' . $GLOBALS['cfg_df_style'];
     //相对路径
     $ctplpath = './Public/Tpl/' . $GLOBALS['cfg_df_style'];
     if ($GLOBALS['cfg_mobile'] != 1) {
         //移动端自动识别
         $OS = getOS();
         $mode = isset($_GET['mode']) ? $_GET['mode'] : '';
         if (in_array($OS, array('iphone', 'android'))) {
             if ($mode != 'wap') {
                 $Delimiter = empty($_SERVER['QUERY_STRING']) ? '?' : '&';
                 $request_uri = isset($_GET['mode']) ? strtr($_SERVER['REQUEST_URI'], array('&mode=' . $_GET['mode'] => '', '?mode=' . $_GET['mode'] => '')) : $_SERVER['REQUEST_URI'];
                 header('location:' . $request_uri . $Delimiter . 'mode=wap');
             }
         }
         if ($mode == 'wap') {
             $GLOBALS['_parameter'] = '?mode=wap';
             $GLOBALS['_mode'] = 'wap';
             $tplpath = __ROOT__ . '/Public/Wap/' . $GLOBALS['cfg_wap_tpl_default'];
             $ctplpath = './Public/Wap/' . $GLOBALS['cfg_wap_tpl_default'];
         }
     }
     defined('__THEME__') or define('__THEME__', $tplpath);
     C('TMPL_PARSE_STRING.__THEME__', __THEME__);
     C('TMPL_PARSE_STRING.__SEARCH__', url('search'));
     if (file_exists($ctplpath . '/theme.php')) {
         $GLOBALS['_tplvars'] = F('theme', '', $ctplpath . '/');
     }
     //登录判断
     defined('USER_LOGINED') or define('USER_LOGINED', $this->isLogin());
     defined('ADMIN_LOGINED') or define('ADMIN_LOGINED', $this->isAdmin());
 }
Example #2
0
 /**
  * 显示命令行指令
  */
 static function start($startFunction)
 {
     if (empty(self::$pidFile)) {
         throw new \Exception("require pidFile.");
     }
     $pid_file = self::$pidFile;
     if (is_file($pid_file)) {
         $server_pid = file_get_contents($pid_file);
     } else {
         $server_pid = 0;
     }
     if (!self::$optionKit) {
         self::$optionKit = new GetOptionKit();
     }
     $kit = self::$optionKit;
     foreach (self::$defaultOptions as $k => $v) {
         //解决Windows平台乱码问题
         if (PHP_OS == 'WINNT') {
             $v = iconv('utf-8', 'gbk', $v);
         }
         $kit->add($k, $v);
     }
     global $argv;
     $opt = $kit->parse($argv);
     if (empty($argv[1]) or isset($opt['help'])) {
         goto usage;
     } elseif ($argv[1] == 'reload') {
         if (empty($server_pid)) {
             exit("Server is not running");
         }
         if (self::$beforeReloadCallback) {
             call_user_func(self::$beforeReloadCallback, $opt);
         }
         getOS()->kill($server_pid, SIGUSR1);
         exit;
     } elseif ($argv[1] == 'stop') {
         if (empty($server_pid)) {
             exit("Server is not running\n");
         }
         if (self::$beforeStopCallback) {
             call_user_func(self::$beforeStopCallback, $opt);
         }
         getOS()->kill($server_pid, SIGTERM);
         exit;
     } elseif ($argv[1] == 'start') {
         //已存在ServerPID,并且进程存在
         if (!empty($server_pid) and getOS()->kill($server_pid, 0)) {
             exit("Server is already running.\n");
         }
     } else {
         usage:
         $kit->specs->printOptions("php {$argv[0]} start|stop|reload");
         exit;
     }
     self::$options = $opt;
     $startFunction($opt);
 }
$header_img = tfuse_page_options('game_header');
?>
       <div class="slider-full">
       
     <ul id="fullslider">
     <li class="slide-item" <?php 
echo !empty($header_img) ? 'style="background-image: url(' . $header_img . ')"' : '';
?>
>
                <div class="slide-content"  ">
                    
                    <div class="ani-item fadeInUp animated">
           				 <div class="play-links">
                    
	                    <?php 
$osType = getOS();
$isAndroid = strcmp($osType, 'Android') == 0 ? true : false;
$isIOS = strcmp($osType, 'iOS') == 0 ? true : false;
$url = tfuse_page_options('android_link');
if (!$isIOS && !(ctype_space($url) || empty($url))) {
    ?>
							 <a class="android-link" href="<?php 
    echo $url;
    ?>
">
							 	<img src="<?php 
    echo tfuse_options('google_play_img');
    ?>
" >
						 	</a>
		 					 
Example #4
0
include_once "lib/ini.setting.php";
include_once "ini.config.php";
include_once "ini.dbstring.php";
include_once "ini.functions.php";
sec_session_start();
include_once "mod.order.php";
include_once "mod.login.php";
include_once "mod.optional.php";
include_once "ctrl.order.php";
include_once "ctrl.client.php";
include_once "ctrl.login.php";
// check user  authentication
checkSession($_SESSION['sess_user_id']);
checkOrderSession($_SESSION['sess_order_type'], $_SESSION['sess_client']);
$rf = getRf($db);
$os = getOS($db);
$app = getApp($db);
$showclient = getClient($db);
?>
<html lang="en-US">
<head>
    <meta charset="utf-8">
    <link href="<?php 
echo CSS;
?>
import.css" type="text/css" rel="stylesheet"/>
    <link href="<?php 
echo CSS;
?>
style.css" type="text/css" rel="stylesheet"/>
    <script src="<?php 
Example #5
0
<?php

/**
 * Created by PhpStorm.
 * User: spider-ninja
 * Date: 4/19/16
 * Time: 4:42 PM
 */
$input = json_decode(file_get_contents("php://input"));
$header = json_encode($_SERVER);
$url = $_SERVER['REQUEST_URI'];
$timeTaken = time() - $scriptStartTime;
$os = getOS();
$ip = $_SERVER['REMOTE_ADDR'];
$sql = "INSERT INTO `request_logs`.`raw_logs` (id, input, header, url,time_taken,ip,os)\n\t\t\t\tVALUES (NULL,\n\t\t\t\t\t'" . json_encode($input) . "',\n\t\t\t\t\t'" . $header . "',\n\t\t\t\t\t'" . $url . "',\n\t\t\t\t\t'" . $timeTaken . "',\n\t\t\t\t\t'" . $ip . "',\n\t\t\t\t\t'" . $os . "'\n\t\t\t\t\t);";
$user = mysqli_query($db_handle, $sql);
    if (preg_match('/windows/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'windows';
    } elseif (preg_match('/macintosh|mac os x/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'mac';
    } elseif (preg_match('/ubuntu/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'ubuntu';
    } elseif (preg_match('/debian/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'debian';
    } elseif (preg_match('/archlinux/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'arch';
    } elseif (preg_match('/linux/i', $_SERVER['HTTP_USER_AGENT'])) {
        $os = 'linux' . getArch();
    }
    return $os;
}
$osstring = getOS();
?>
<!DOCTYPE html>
<html>
    <head>
        <!-- meta info -->
        <meta charset="utf-8">
        <title>Nightingale - The tune of life, the tune of yours</title>
        <?php 
include "../static.getnightingale.com/php/head.php";
?>

        <!-- structured data -->
        <script type="application/ld+json">
        {
          "@context": "http://schema.org",
Example #7
0
function getBrowserInfo()
{
    $u_agent = $_SERVER['HTTP_USER_AGENT'];
    $bname = 'Unknown';
    $platform = 'Unknown';
    $version = "";
    //First get the platform?
    if (preg_match('/linux/i', $u_agent)) {
        $platform = 'Linux';
    } elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {
        $platform = 'Mac';
    } elseif (preg_match('/windows|win32/i', $u_agent)) {
        $platform = 'Windows';
    }
    // Next get the name of the useragent yes seperately and for good reason
    if (preg_match('/MSIE/i', $u_agent) && !preg_match('/Opera/i', $u_agent)) {
        $bname = 'Internet Explorer';
        $ub = "MSIE";
    } elseif (preg_match('/Firefox/i', $u_agent)) {
        $bname = 'Mozilla Firefox';
        $ub = "Firefox";
    } elseif (preg_match('/Chrome/i', $u_agent)) {
        $bname = 'Google Chrome';
        $ub = "Chrome";
    } elseif (preg_match('/Safari/i', $u_agent)) {
        $bname = 'Apple Safari';
        $ub = "Safari";
    } elseif (preg_match('/Opera/i', $u_agent)) {
        $bname = 'Opera';
        $ub = "Opera";
    } elseif (preg_match('/Netscape/i', $u_agent)) {
        $bname = 'Netscape';
        $ub = "Netscape";
    } else {
        $bname = 'unkown';
        $ub = "unkown";
    }
    // finally get the correct version number
    $known = array('Version', $ub, 'other');
    $pattern = '#(?<browser>' . join('|', $known) . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
    if (!preg_match_all($pattern, $u_agent, $matches)) {
        // we have no matching number just continue
    }
    // see how many we have
    $i = count($matches['browser']);
    if ($i != 1) {
        //we will have two since we are not using 'other' argument yet
        //see if version is before or after the name
        if (strripos($u_agent, "Version") < strripos($u_agent, $ub)) {
            $version = $matches['version'][0];
        } else {
            $version = $matches['version'][1];
        }
    } else {
        $version = $matches['version'][0];
    }
    // check if we have a number
    if ($version == null || $version == "") {
        $version = "?";
    }
    return array('user-agent' => $_SERVER['HTTP_USER_AGENT'], 'browser' => getBrowser($_SERVER['HTTP_USER_AGENT']), 'version' => $version, 'platform' => getOS($_SERVER['HTTP_USER_AGENT']), 'pattern' => $pattern);
}
Example #8
0
            $PHP_directive_Objects[$i]->setRecommendedValue(mysql_result($directives, $i, 'recomendedvalue'));
            $PHP_directive_Objects[$i]->setCurrentValue($PHP_directive_Objects[$i]->getCurrentValue($PHP_directive_Objects[$i]->getDirectiveName(), $phpini_path));
            $PHP_directive_Objects[$i]->setDescription(mysql_result($directives, $i, 'description'));
            $PHP_directive_Objects[$i]->setRemark(mysql_result($directives, $i, 'remark'));
            $PHP_directive_Objects[$i]->setPossibleValues("this is an array that comes from values table per each directive");
        }
    }
    ?>
    
    <table cellpadding="0" cellspacing="0">
        <tr> <td align="right"><b>Mode Selected:</b></td> <td><?php 
    echo $mode;
    ?>
</td> </tr>
        <tr> <td align="right"><b>Operating System:</b></td> <td><?php 
    echo getOS();
    ?>
</td> </tr>
        <tr> <td align="right"><b>PHP Version:</b></td> <td><?php 
    echo getPHPVersion();
    ?>
</td> </tr>

    </table>
    <br />
     <form name="changeForm" method="POST" action="change.php">
     <table border="1" cellspacing="0" cellpadding="0" >
         <th bgcolor="white" colspan="7"><h1>PHP Security Configuration Directives for <?php 
    echo $mode;
    ?>
</h1></th>
Example #9
0
        if (MEMBER && $userinfo["user_perm"] == "3") {
            return true;
        } else {
            return false;
        }
    }
}
// Update ip+ last activity
if (MEMBER) {
    if ($_SERVER["REMOTE_ADDR"] != $userinfo["user_ip"]) {
        dbquery("UPDATE bg_users SET user_oldip='" . $userinfo["user_ip"] . "' WHERE user_id='" . $userinfo["user_id"] . "'");
        dbquery("UPDATE bg_users SET user_ip='" . $_SERVER["REMOTE_ADDR"] . "' WHERE user_id='" . $userinfo["user_id"] . "'");
    }
    dbquery("UPDATE bg_users SET user_lastactivity='" . time() . "' WHERE user_id='" . $userinfo["user_id"] . "'");
    dbquery("UPDATE bg_users SET user_browser='" . getBrowser() . "' WHERE user_id='" . $userinfo["user_id"] . "'");
    dbquery("UPDATE bg_users SET user_os='" . getOS() . "' WHERE user_id='" . $userinfo["user_id"] . "'");
}
// favorite
function fav($id, $type = "A", $link = "")
{
    if (MEMBER) {
        global $userinfo;
        $favr = dbquery("SELECT * FROM bg_favorite WHERE fav_userid = '" . $userinfo["user_id"] . "' AND fav_type='" . $type . "' AND fav_pageid='" . $id . "'");
        $fav = dbarray($favr);
        $favuser = dbrows($favr);
        if ($favuser != "1") {
            if (isset($_GET['oblubene'])) {
                dbquery("INSERT INTO bg_favorite(fav_userid, fav_pageid, fav_type, fav_time) VALUES('" . $userinfo["user_id"] . "','" . $id . "','" . $type . "', '" . time() . "')");
                if ($link == "") {
                    redirect("/clanok/" . $_GET["id"] . "/" . strip_tags($_GET["n"]));
                } else {
Example #10
0
function eol($repeat = 1)
{
    $OS = getOS();
    if ($OS === 'WIN') {
        $eol = "\r\n";
    } elseif ($OS === 'MAC') {
        $eol = "\r";
    } else {
        $eol = "\n";
    }
    return str_repeat($eol, $repeat);
}
Example #11
0
 if (isset($_POST['cislo']) && isset($_SESSION['spamkiller']) && $_POST['cislo'] == $_SESSION['spamkiller']) {
     if (isset($_POST['podmienky']) == "1") {
         $user = dbescape(StrTr(strip_tags($_POST["meno"]), "ÁÄČÇĎÉĚËÍŇÓÖŘŠŤÚŮÜÝŽáäčçďéěëíňóöřšťúůüýž ", "AACCDEEEINOORSTUUUYZaaccdeeeinoorstuuuyz-"));
         $email = dbescape(strip_tags($_POST["email"]));
         $pass = md5(md5(md5($_POST["heslo"])));
         $pass2 = md5(md5(md5($_POST["heslo2"])));
         if ($pass == $pass2) {
             $result5 = dbquery("SELECT * FROM bg_users WHERE user_nick='" . $user . "'");
             $result55 = dbquery("SELECT * FROM bg_users WHERE user_email='" . $email . "'");
             $rows5 = dbrows($result5);
             $rows55e = dbrows($result55);
             if ($rows5 == 0 && $rows55e == 0 && $user != "") {
                 if (preg_match("/^[^@]*@[^@]*\\.[^@]*\$/", $email)) {
                     if (strlen($user) >= 4 and strlen($email) >= 4) {
                         if (strlen($pass) >= 6) {
                             dbquery("INSERT INTO bg_users(user_nick, user_password,user_email,user_active,user_datereg,user_lastactivity,user_ip,user_browser,user_os)\n     VALUES('" . $user . "','" . $pass . "','" . $email . "','1','" . time() . "','" . time() . "','" . $_SERVER["REMOTE_ADDR"] . "','" . getBrowser() . "','" . getOS() . "')");
                             echo '<div class="alert alert-success">Registrácia prebehla úspešne. Teraz sa môžete prihlásiť.</div>';
                         } else {
                             echo '<div class="alert alert-warning">Minimálna dĺžka hesla je 6 znakov.</div>';
                         }
                     } else {
                         echo '<div class="alert alert-warning">Minimálna dĺžka mena a emailu sú 4 znaky.</div>';
                     }
                 } else {
                     echo '<div class="alert alert-warning">Prosím zadajte správny email.</div>';
                 }
             } else {
                 echo '<div class="alert alert-danger">Zadané meno alebo email už existuje.</div>';
             }
         } else {
             echo '<div class="alert alert-warning">Heslá sa nezhodujú.</div>';
Example #12
0
        $num_directives = mysql_num_rows($directives);
        for ($i = 0; $i < $num_directives; $i++) {
            $MySQL_directive_objects[$i] = new MySQLDirective();
            $MySQL_directive_objects[$i]->setDirectiveName(mysql_result($directives, $i, 'directivename'));
            $MySQL_directive_objects[$i]->setRecommendedValue(mysql_result($directives, $i, 'recomendedvalue'));
            $MySQL_directive_objects[$i]->setCurrentValue($MySQL_directive_objects[$i]->getCurrentValue($MySQL_directive_objects[$i]->getDirectiveName(), $phpini_path));
            $MySQL_directive_objects[$i]->setDescription(mysql_result($directives, $i, 'description'));
            $MySQL_directive_objects[$i]->setRemark(mysql_result($directives, $i, 'remark'));
            $MySQL_directive_objects[$i]->setPossibleValues("this is an array that comes from values table per each directive");
        }
    }
    ?>
    
    <table cellpadding="0" cellspacing="0">
        <tr> <td align="right"><b>Operating System:</b></td> <td><?php 
    echo " " . getOS();
    ?>
</td> </tr>
        <tr> <td align="right"><b>MySQL Version:</b></td> <td><?php 
    echo " MySQL " . getMySQLversion();
    ?>
</td> </tr>

    </table>
    <br />
     <form name="changeForm" method="POST" action="change.php">
     <table border="1" cellspacing="0" cellpadding="0" >
         <th bgcolor="white" colspan="7"><h1>MySQL Server Security Configuration Details</h1></th>

         <tr bgcolor="white">
Example #13
0
<?php

define("_PL_OS_SEP", "/");
if (function_exists('php_uname')) {
    define("_CUR_OS", substr(php_uname(), 0, 7) == "Windows" ? "Win" : "_Nix");
} else {
    define("_CUR_OS", getOS());
}
function getOS()
{
    $user_agent = $_SERVER['HTTP_USER_AGENT'];
    $os_platform = "_Nix";
    if (preg_match("/" . 'windows' . "/i", $user_agent)) {
        $os_platform = 'Windows';
    }
    return $os_platform;
}
function checkCurrentOS($_OS)
{
    if (strcmp($_OS, _CUR_OS) == 0) {
        return true;
    }
    return false;
}
function isRelative($_dir)
{
    if (checkCurrentOS("Win")) {
        return preg_match("/^\\w+:/", $_dir) <= 0;
    } else {
        return preg_match("/^\\//", $_dir) <= 0;
    }
Example #14
0
function userBrowerInfo()
{
    $returnArr['OS'] = getOS();
    $returnArr['Browser'] = getBrowse();
    return $returnArr;
}
Example #15
0
<?php

##################################################
#                                                #
# getBrowserOS.php by Joe Mottershaw             #
# Cloud Eight - http://www.cloud-eight.com       #
#                                                #
##################################################
// Include getBrowserOS
include 'getBrowserOS.php';
// Assign values to variables
$operatingSystem = getOS();
$browser = getBrowser();
// Output
echo '<strong>Operating System: </strong>' . $operatingSystem . '<br />', '<strong>Browser: </strong>' . $browser;
/*
    Example:
        Operating System: Windows 8
        Browser: Internet Explorer
*/
Example #16
0
/**
 * Write an error log
 *
 * @param string $msg text to write
 * @param string $file
 * @param string $line
 * @param bool $debug_override
 * @author Mauri Kujala <*****@*****.**>
 */
function write_log($msg, $file = "", $line = "", $debug_override = false)
{
    global $settings, $system_time;
    if (isset($settings["debug"]) && $settings["debug"] == "true" || $debug_override !== false) {
        // write user info file if not exists
        $lfile = $_SERVER["DOCUMENT_ROOT"] . "/edtb_log_info.txt";
        if (!file_exists($lfile)) {
            $ua = getBrowser();
            $debug_info = "Browser: " . $ua['name'] . " " . $ua['version'] . " (" . $ua['platform'] . ")" . PHP_EOL;
            $debug_info .= "Platform: " . getOS() . PHP_EOL;
            $debug_info .= "Reported as: " . $_SERVER["HTTP_USER_AGENT"] . PHP_EOL;
            $debug_info .= "HTTP_HOST: " . $_SERVER["HTTP_HOST"] . PHP_EOL;
            $debug_info .= "SERVER_SOFTWARE: " . $_SERVER["SERVER_SOFTWARE"] . PHP_EOL;
            $debug_info .= "SERVER_NAME: " . $_SERVER["SERVER_NAME"] . PHP_EOL;
            $debug_info .= "SERVER_ADDR: " . $_SERVER["SERVER_ADDR"] . PHP_EOL;
            $debug_info .= "SERVER_PORT: " . $_SERVER["SERVER_PORT"] . PHP_EOL;
            $debug_info .= "DOCUMENT_ROOT: " . $_SERVER["DOCUMENT_ROOT"] . PHP_EOL;
            file_put_contents($lfile, $debug_info);
        }
        $logfile = $_SERVER["DOCUMENT_ROOT"] . "/edtb_log.txt";
        $fd = fopen($logfile, "a");
        if (isset($file)) {
            $on_line = $line == "" ? "" : " on line " . $line;
            $where = "[" . $file . "" . $on_line . "] ";
        }
        $str = "[" . date("d.m.Y H:i:s", time() + $system_time * 60 * 60) . "]" . $where . $msg;
        fwrite($fd, $str . PHP_EOL);
        fclose($fd);
    }
}
Example #17
0
<?php

//database connection
define("DBUSER", "root");
define("DBNAME", "pharmacy_app");
getOS() == 'Ubuntu' ? define("DBPASS", "athlonamd") : define("DBPASS", "");
define("DBHOST", "localhost");
define("BASEURL", "http://localhost/pharmacy_app/backend/");
//define("BASEURL", "http://$_SERVER[HTTP_HOST]/backend/");
/*
define("DBHOST", "localhost");
define("DBUSER", "a92619sb_pharm");
define("DBNAME", "a92619sb_pharm");
define("DBPASS", "and123ros");
define("BASEURL", "http://a92619.sb1.dev.codeanywhere.net/pharmacy_app/");
*/
/**************************************************************************************/
//If the server is not supporting mysqli, echo a message
if (!function_exists('mysqli_init') && !extension_loaded('mysqli')) {
    echo 'We don\'t have mysqli!!!';
    exit;
}
/**************************************************************************************/
//Database Connection
$db = new MysqliDb(DBHOST, DBUSER, DBPASS, DBNAME);
/**************************************************************************************/
function check_for_notifications($msg, $res)
{
    if (isset($_SESSION['result']) && $_SESSION['result'] != '') {
        ?>
		<script type="text/javascript">
Example #18
0
    } elseif (eregi('Firefox', $_SERVER['HTTP_USER_AGENT'])) {
        $browser = 'Firefox';
    } elseif (eregi('Konqueror', $_SERVER['HTTP_USER_AGENT'])) {
        $browser = 'Konqueror';
    } elseif (eregi('Safari', $_SERVER['HTTP_USER_AGENT'])) {
        $browser = 'Safari';
    } elseif (eregi('AOL', $_SERVER['HTTP_USER_AGENT'])) {
        $browser = 'AOL Browser';
    } elseif (eregi('links', $_SERVER['HTTP_USER_AGENT']) or eregi('lynx', $_SERVER['HTTP_USER_AGENT']) or eregi('w3m', $_SERVER['HTTP_USER_AGENT'])) {
        $browser = 'Linux Textbrowser';
    } else {
        $browser = 'unknown';
    }
    return $browser;
}
$system = getOS();
$browser = getBrowser();
switch ($system) {
    case 'Macintosh':
        $insertstats['statsSystem'] = 1;
        break;
    case 'Linux':
        $insertstats['statsSystem'] = 2;
        break;
    case 'FreeBSD':
        $insertstats['statsSystem'] = 3;
        break;
    case 'SunOS':
        $insertstats['statsSystem'] = 4;
        break;
    case 'BeOS':
Example #19
0
<?php

/**
 * Created by PhpStorm.
 * User: anton.vityazev
 * Date: 03.11.2015
 * Time: 17:36
 */
if (isset($_GET['test'])) {
    require_once 'info_getters.php';
    require_once __DIR__ . '/../models/routing_model.php';
    $ip = get_ip();
    $os = getOS($_SERVER['HTTP_USER_AGENT']);
    $browser = getBrowser($_SERVER['HTTP_USER_AGENT']);
    if (!isset($_COOKIE['guid'])) {
        $guid = com_create_guid();
        setcookie('guid', $guid, time() + 86400 * 30, "/");
    } else {
        $guid = $_COOKIE['guid'];
    }
    $referer = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
    $db = new Routing_model();
    $info = $db->get_redirect_info(str_replace('?test', '', "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"));
    if ($info[0]['type'] == 'Ротатор') {
        include 'rotator.php';
    } else {
        header('Location: /landings/lands/' . $info[0]['to']);
    }
}
</a> 									
												
											</td>
										</tr>
									</table><!-- /column 1 -->	
									
									<!-- column 2 -->
									<table align="left" class="column">
										<tr>
											<td>				
																			
												<h5 class=""></h5>												
												<p><strong>
													<?php 
print_r($yourbrowser);
echo ' on ' . getOS();
?>
</strong><br/>
                
											</td>
										</tr>
									</table><!-- /column 2 -->
									
									<span class="clear"></span>	
									
								</td>
							</tr>
						</table><!-- /social & contact -->
						
					</td>
				</tr>
Example #21
0
        }
        if ($KEY == 'return') {
            $RETURN = $VALUE;
        }
    }
}
if (!$UID) {
    $TASKS_OUTPUT = base64_encode('|ERROR_NOT_IN_DB|') . "\n" . $TASKS_OUTPUT;
}
if ($TYPE == 'on_exec') {
    $EXISTS = mysql_num_rows(mysql_query('SELECT id FROM botlist WHERE botid = \'' . $UID . '\' LIMIT 1;')) != 0;
    if (!$EXISTS) {
        mysql_query('DELETE FROM botlist WHERE ip = \'' . $_SERVER['REMOTE_ADDR'] . '\';');
        mysql_query('INSERT INTO botlist SET ' . 'botid=\'' . mysql_real_escape_string($UID) . '\', ' . 'newbot=\'' . mysql_real_escape_string($NEW) . '\', ' . 'country=\'' . mysql_real_escape_string($country[0]) . '\', ' . 'country_code=\'' . mysql_real_escape_string($country[1]) . '\', ' . 'ip=\'' . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . '\', ' . 'os=\'' . getOS($OS) . '\', ' . 'cpu=\'' . ($ARCH == 'x64' ? '0' : '1') . '\', ' . 'type=\'' . ($GEND == 'laptop' ? '0' : '1') . '\', ' . 'cores=\'' . mysql_real_escape_string($CORES) . '\', ' . 'version=\'' . mysql_real_escape_string($VER) . '\', ' . 'net=\'' . mysql_real_escape_string($NET) . '\', ' . 'admin=\'' . ($PRIV == 'admin' ? '1' : '0') . '\', ' . 'busy=\'' . ($BUSY == 'true' ? '1' : '0') . '\', ' . 'lastseen=\'' . $TIME . '\';');
    } else {
        mysql_query('UPDATE botlist SET ' . 'ip=\'' . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . '\', ' . 'newbot=\'' . mysql_real_escape_string($NEW) . '\', ' . 'country=\'' . mysql_real_escape_string($country[0]) . '\', ' . 'country_code=\'' . mysql_real_escape_string($country[1]) . '\', ' . 'os=\'' . getOS($OS) . '\', ' . 'cpu=\'' . ($ARCH == 'x64' ? '0' : '1') . '\', ' . 'type=\'' . ($GEND == 'laptop' ? '0' : '1') . '\', ' . 'cores=\'' . mysql_real_escape_string($CORES) . '\', ' . 'version=\'' . mysql_real_escape_string($VER) . '\', ' . 'net=\'' . mysql_real_escape_string($NET) . '\', ' . 'admin=\'' . ($PRIV == 'admin' ? '1' : '0') . '\', ' . 'busy=\'' . ($BUSY == 'true' ? '1' : '0') . '\', ' . 'lastseen=\'' . $TIME . '\' ' . 'WHERE botid=\'' . mysql_real_escape_string($UID) . '\';');
    }
} else {
    if ($TYPE == 'repeat') {
        $EXISTS = mysql_num_rows(mysql_query('SELECT id FROM botlist WHERE botid = \'' . $UID . '\' LIMIT 1;')) != 0;
        if (!$EXISTS) {
            $TASKS_OUTPUT = base64_encode('|ERROR_NOT_IN_DB|') . "\n" . $TASKS_OUTPUT;
        }
        mysql_query('UPDATE botlist SET ' . 'ip=\'' . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . '\', ' . 'country=\'' . mysql_real_escape_string($country[0]) . '\', ' . 'country_code=\'' . mysql_real_escape_string($country[1]) . '\', ' . 'ram=\'' . mysql_real_escape_string($RAM) . '\', ' . 'botskilled=\'' . mysql_real_escape_string($KILLED) . '\', ' . 'files=\'' . mysql_real_escape_string($FILES) . '\', ' . 'regkey=\'' . mysql_real_escape_string($REGKEY) . '\', ' . 'busy=\'' . ($BUSY == 'true' ? '1' : '0') . '\', ' . 'lastseen=\'' . $TIME . '\' ' . 'WHERE botid=\'' . mysql_real_escape_string($UID) . '\';');
    } else {
        if ($TYPE == 'response') {
            $result = mysql_query('SELECT task FROM tasks WHERE id = \'' . mysql_real_escape_string($TASKID) . '\' LIMIT 1;');
            if ($result) {
                $row = mysql_fetch_array($result);
                if ($row['task'] == '!uninstall' || $row['task'] == '!download.update') {
                    mysql_query('DELETE FROM botlist WHERE botid = \'' . mysql_real_escape_string($UID) . '\';');
Example #22
0
    die("Connection failed: " . mysqli_connect_error());
}
$servername = mysqli_real_escape_string($link, $_REQUEST['servername']);
$ip = mysqli_real_escape_string($link, $_REQUEST['ip']);
$fuser = mysqli_real_escape_string($link, $_REQUEST['fuser']);
$fpass = mysqli_real_escape_string($link, $_REQUEST['fpass']);
$fserver = mysqli_real_escape_string($link, $_REQUEST['fserver']);
$pass = mysqli_real_escape_string($link, $_REQUEST['pass']);
$sshp = mysqli_real_escape_string($link, $_REQUEST['sshp']);
//$OS = mysqli_real_escape_string($link, $_POST['OS']);
//$lsbresult   = array();
//$lsbcmd    = exec("ssh root@$ip 'lsb_release -as'",$lsbresult );
//print_r(exec("ssh root@$ip 'lsb_release -as'",$lsbresult ));
//$response = array();
//print_r($lsbresult);
@(list($OS, $version, $releasever) = getOS($pass));
//if(!empty($lsbresult)) {
//	$OS        = $lsbresult[0];
//	$version  = $lsbresult[3];
//	$releasever = $lsbresult[2];
//}
//$version = mysqli_real_escape_string($link, $_POST['version']);
$sql = "INSERT INTO Servers (servername,ip,fuser,fpass,fserver,OS,sshp) VALUES ('{$servername}','{$ip}','{$fuser}','{$fpass}','{$fserver}','{$OS}','{$sshp}')";
if (mysqli_query($link, $sql)) {
    echo "New Server created successfully";
    //header( "Location: index.php" );
} else {
    echo "Error: " . $sql . "<br>" . mysqli_error($link);
    die("Server already exists");
}
// $resultp=mysqli_query($link, $sql);
Example #23
0
                $template = 'index_finisch.tpl';
            } else {
                $template = 'index2.tpl';
            }
            break;
        default:
            $template = 'index.tpl';
    }
}
// static page messages
$tpl->assign(array('TR_PAGE_TITLE' => 'EasySCP - Setup'));
if ($template == 'index.tpl') {
    $tpl->assign(array('DB_HOST' => isset($_POST['DB_HOST']) ? trim($_POST['DB_HOST']) : $xml->{'DB_HOST'}, 'DB_DATABASE' => isset($_POST['DB_DATABASE']) ? trim($_POST['DB_DATABASE']) : $xml->{'DB_DATABASE'}, 'DB_USER' => isset($_POST['DB_USER']) ? trim($_POST['DB_USER']) : $xml->{'DB_USER'}, 'DB_PASSWORD' => isset($_POST['DB_PASSWORD']) ? trim($_POST['DB_PASSWORD']) : $xml->{'DB_PASSWORD'}, 'DB_PASSWORD2' => isset($_POST['DB_PASSWORD2']) ? trim($_POST['DB_PASSWORD2']) : $xml->{'DB_PASSWORD2'}));
}
if ($template == 'index2.tpl') {
    $tpl->assign(array('HOST_OS' => getOS($xml), 'HOST_FQHN' => isset($_POST['HOST_FQHN']) ? trim($_POST['HOST_FQHN']) : gethostbyaddr(gethostbyname($_SERVER['SERVER_NAME'])), 'HOST_IP' => isset($_POST['HOST_IP']) ? trim($_POST['HOST_IP']) : gethostbyname($_SERVER['SERVER_NAME']), 'HOST_IPv6' => isset($_POST['HOST_IPv6']) ? trim($_POST['HOST_IPv6']) : $xml->{'HOST_IPv6'}, 'HOST_NAME' => isset($_POST['HOST_NAME']) ? trim($_POST['HOST_NAME']) : gethostbyaddr(gethostbyname($_SERVER['SERVER_NAME'])), 'PANEL_ADMIN' => isset($_POST['PANEL_ADMIN']) ? trim($_POST['PANEL_ADMIN']) : $xml->{'PANEL_ADMIN'}, 'PANEL_PASS' => isset($_POST['PANEL_PASS']) ? trim($_POST['PANEL_PASS']) : $xml->{'PANEL_PASS'}, 'PANEL_PASS2' => isset($_POST['PANEL_PASS2']) ? trim($_POST['PANEL_PASS2']) : $xml->{'PANEL_PASS2'}, 'PANEL_MAIL' => isset($_POST['PANEL_MAIL']) ? trim($_POST['PANEL_MAIL']) : $xml->{'PANEL_MAIL'}, 'Secondary_DNS' => isset($_POST['Secondary_DNS']) ? trim($_POST['Secondary_DNS']) : $xml->{'Secondary_DNS'}, 'Timezone' => isset($_POST['Timezone']) ? trim($_POST['Timezone']) : date_default_timezone_get()));
    if (isset($_POST['LocalNS'])) {
        $tpl->assign(array('LocalNS_yes' => $_POST['LocalNS'] == '_yes_' ? 'checked="checked"' : '', 'LocalNS_no' => $_POST['LocalNS'] == '_no_' ? 'checked="checked"' : ''));
    } else {
        $tpl->assign(array('LocalNS_yes' => 'checked="checked"', 'LocalNS_no' => ''));
    }
    if (isset($_POST['MySQL_Prefix'])) {
        $tpl->assign(array('MySQL_infront' => $_POST['MySQL_Prefix'] == 'infront' ? 'checked="checked"' : '', 'MySQL_behind' => $_POST['MySQL_Prefix'] == 'behind' ? 'checked="checked"' : '', 'MySQL_none' => $_POST['MySQL_Prefix'] == 'none' ? 'checked="checked"' : ''));
    } else {
        $tpl->assign(array('MySQL_infront' => '', 'MySQL_behind' => '', 'MySQL_none' => 'checked="checked"'));
    }
    /*
    if(isset($_POST['AWStats'])){
    	$tpl->assign(
    		array(
    			'AWStats_yes'	=> ($_POST['AWStats'] == '_yes_' ) ? 'checked="checked"' : '',
Example #24
0
            $os_platform = $value;
        }
    }
    return $os_platform;
}
function getBrowser()
{
    global $user_agent;
    $browser = "Unknown Browser";
    $browser_array = array('/msie/i' => 'Internet Explorer', '/firefox/i' => 'Firefox', '/safari/i' => 'Safari', '/chrome/i' => 'Chrome', '/opera/i' => 'Opera', '/netscape/i' => 'Netscape', '/maxthon/i' => 'Maxthon', '/konqueror/i' => 'Konqueror', '/mobile/i' => 'Handheld Browser');
    foreach ($browser_array as $regex => $value) {
        if (preg_match($regex, $user_agent)) {
            $browser = $value;
        }
    }
    return $browser;
}
$user_os = getOS();
$user_browser = getBrowser();
$_SESSION['browser'] = $user_browser;
$_SESSION['operating_system'] = $user_os;
date_default_timezone_set('GMT');
$temp = strtotime("+5 hours 30 minutes");
$login_time = date("Y-m-d H:i:s", $temp);
//echo $date;
//$login_time= date("Y-m-d H:i:s");
//echo $login_time;
$_SESSION['login_time'] = $login_time;
//$device_details =   "<strong>Browser: </strong>".$user_browser."<br /><strong>Operating System: </strong>".$user_os."";
//print_r($device_details);
//echo("<br /><br /><br />".$_SERVER['HTTP_USER_AGENT']."");
Example #25
0
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    return $os;
}
$Agent = $_SERVER['HTTP_USER_AGENT'];
$met_sever1 = $_SERVER['SERVER_SOFTWARE'];
$xitong = getOS($Agent);
$css_url = "../templates/" . $met_skin . "/css";
$img_url = "../templates/" . $met_skin . "/images";
$admin_list = $db->get_one("SELECT * FROM {$met_admin_table} WHERE admin_id='{$metinfo_admin_name}'");
foreach ($admin_list as $_key => $_value) {
    if ($_key != 'lang') {
        ${$_key} = daddslashes($_value);
    }
}
//start
$st = statime("Y-m-d");
$et = statime("Y-m-d");
$query = "select * from {$met_visit_summary} WHERE stattime ='{$st}' and stattime ='{$et}'";
$visit = $db->get_one($query);
$visit[pv] = $visit[pv] ? $visit[pv] : 0;
$visit[alone] = $visit[alone] ? $visit[alone] : 0;
Example #26
0
    echo $onload;
    ?>
"<?php 
}
?>
 class="b-page <?php 
echo cssClassBody($body_class);
?>
 <?php 
echo BROWSER_NAME;
?>
 <?php 
echo $body_additional_class;
?>
 <?php 
if (getOS() == 'Macintosh') {
    ?>
mac<?php 
}
?>
">
        <?php 
// подарки и переводы
if ($_SESSION['uid'] && !$no_personal) {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/present.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/account.php";
    $gifts = present::GetLastGiftByUid($_SESSION['uid']);
    $accountCredited = 0;
    foreach ($gifts as $gift) {
        if ($gift['op_code'] == 23) {
            //перевод средств от пользователя
Example #27
0
ini_set('post_max_size', '20M');
ini_set('upload_max_filesize', '2M');
ini_set('max_execution_time', '3600');
include 'nav.php';
echo CNavigation::GenerateMenu($menu);
// Create connection
$conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
$id = $_GET['id'];
$ip = $_GET['ip'];
$servername = $_GET['servername'];
$company = $_GET['company'];
list($OS, $version, $releasever) = getOS();
$sqlnew = "UPDATE servers SET OS = '{$OS}', version = '{$version}' , releasever = '{$releasever}' WHERE id = {$id}";
exec("ssh sysad@{$ip} \"echo 'SELECT package , oversion, security, upgrade, date, md5, cversion, rc, ii, changelog FROM Packages;'|sqlite3 /home/sysad/manage/synx.db \" ", $lines);
$sql = "REPLACE INTO packages (package, version, security, upgrade, servers, servername, date, md5, nversion, rc, ii, changelog) VALUES";
$sep = '';
$package = null;
$packages = array();
$changelogs = array();
foreach ($lines as $line) {
    if (strpos($line, '|') !== false) {
        $p = explode('|', $line);
        if (sizeof($p) < 10) {
            $changelogs[] = $line;
            continue;
        } else {
            if (isset($package)) {