Пример #1
0
function checkAuth()
{
    if (!isset($_SESSION['userId']) || !isset($_SESSION['data']) || getSessionData($_SESSION['userId']) != $_SESSION['data']) {
        if (!isset($_POST['username']) || !isset($_POST['password'])) {
            return 0;
        }
        $username = mysql_real_escape_string($_POST['username']);
        $query = "SELECT `user_id`,`user_name`,`user_password` FROM `digifort_users` WHERE `user_name`='{$username}'";
        $result = mysql_query($query);
        $row = mysql_fetch_array($result);
        if ($row['user_password'] == md5($_POST['password'])) {
            $_SESSION['userId'] = $row['user_id'];
            $_SESSION['data'] = getSessionData($row['user_id']);
            $query = "UPDATE `digifort_users` SET `user_lastlogin`=NOW() WHERE `user_id` ='{$row['user_id']}'";
            mysql_query($query) or die(mysql_error() . " in login.lib.L:111");
            return $row['user_id'];
        }
        return 0;
    }
    $userid = $_SESSION['userId'];
    $query = "SELECT * FROM `pragyan10`.`form_regdata` where `page_modulecomponentid`=31 and user_id={$userid}";
    $resource = mysql_query($query) or die(mysql_error());
    if (mysql_num_rows($resource) != 1) {
        return 0;
    }
    return $_SESSION['userId'];
}
Пример #2
0
<?php

ini_set('display_errors', '0');
ini_set('max_execution_time', '60');
require_once '../include/temp_share.php';
// login user info
$userinfo = getSessionData("userinfo");
// DB接続
$db = connectDB();
if ($userinfo == null) {
    $tx = $_REQUEST["tx"];
    $userinfo = loginTX($db, $tx);
}
if ($userinfo == null) {
    responseData(false, "permission error");
    exit;
}
$login_id = $userinfo["agentid"];
try {
    $func = $_REQUEST["func"];
    switch ($func) {
        case 'get_treeview_data':
            $sql = "\r\n\t\t\t\t\tselect order_no, id as storeid, concat(id, '-', 0) as object_id, name as text, name as storename, 1 as nodetype from tbl_agent_store where delete_flag=0 " . ($userinfo["agentstoreid"] != null ? " and id = " . $userinfo["agentstoreid"] : "") . "\r\n\t\t\t\t\tunion\r\n\t\t\t\t\tselect a.order_no, a.id as storeid, concat(a.id, '-', b.id) as object_id, concat(b.name, ' (', b.agentid, ')') as text, a.name as storename, (case b.type when 1 then 2 else 3 end) as nodetype\r\n\t\t\t\t\tfrom tbl_agent_store a, tbl_agent_emp b \r\n\t\t\t\t\twhere a.id=b.agentstoreid and a.delete_flag=0 and b.delete_flag=0 " . ($userinfo["agentstoreid"] != null ? " and a.id = " . $userinfo["agentstoreid"] : "") . ($userinfo["type"] == 2 ? " and b.id = " . $userinfo["id"] : "") . "\r\n\t\t\t\t\torder by order_no, nodetype, object_id\r\n\t\t\t\t";
            $result = querySQL($db, $sql);
            $data = array();
            $store = null;
            while ($row = mysql_fetch_assoc($result)) {
                if ($row["nodetype"] == 1) {
                    $row["cls"] = "store_node";
                    $row["children"] = array();
                    $store =& $row["children"];
Пример #3
0
   mysql.inc
   install-texts.inc
*/
if ($_SESSION["session_ok"] != 1) {
    header("Location:?");
}
if ($_SESSION["installType"] == "BASIC") {
    header("Location:?page=3");
}
/*********************************************************
  This script is used to autogenerate the ADVANCE pages
*********************************************************/
include "lib/parameters.inc";
$group = isset($_POST["group"]) && $_POST["group"] > 0 && $_POST["group"] < sizeof($parameters) ? $_POST["group"] : 0;
$msg = "";
getSessionData($parameters[$group]["parameters"]);
if (isset($_POST['option']) && $_POST['option'] != "") {
    if ($_POST['option'] != 'Back') {
        getPostVariables($parameters[$group - 1]["parameters"]);
        setSessionData($parameters[$group - 1]["parameters"]);
        if ($_POST['option'] == "Finish") {
            header("Location:?page=3");
        }
    }
}
$withAdvanced = 0;
while (!$withAdvanced) {
    $estruct = $parameters[$group]["parameters"];
    $title = $GLOBALS["I18N"]->get($parameters[$group]['name']);
    $HTMLElements = getHTMLElements($estruct, "ADVANCED");
    $JSElements = getJSValidations($estruct, "ADVANCED");
Пример #4
0
function getSessionSaveData($dataname, $timeout)
{
    $session_lasttime = getSessionData("session_lasttime_" . $dataname);
    $session_data = getSessionData("session_" . $dataname);
    if ($session_lasttime == null || $session_data == null || microtime(true) - $session_lasttime > $timeout) {
        return null;
    }
    return $session_data;
}
Пример #5
0
        $this->load->view('header', array('currentMenu' => $currentMenu));
        ?>
			<?php 
    }
    ?>
			<!-- ---------------- -->	
			
			<?php 
    if (($errorMsg = getSessionData('view_error_message')) !== false) {
        $errorMsg = is_array($errorMsg) ? implode("<br/>", $errorMsg) : trim($errorMsg);
        //echo '<div id = "exception_container">'.$errorMsg.'</div>';
        echo '<div class="alert alert-danger alert-dismissible" role="alert">
							<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' . $errorMsg . '</div>';
        clearSessionData('view_error_message');
    } else {
        if (($successMsg = getSessionData('view_success_message')) !== false) {
            $successMsg = is_array($successMsg) ? implode("<br/>", $successMsg) : trim($successMsg);
            //echo '<div id = "success_container">'.$successMsg.'</div>';
            echo '<div class="alert alert-success alert-dismissible" role="alert">' . $successMsg . '</div>';
            clearSessionData('view_success_message');
        }
    }
    ?>
			
			<div class = "container">
				<?php 
    if (!isset($data) || !is_array($data)) {
        $data = array();
    }
    $this->load->view($source, $data);
    ?>
Пример #6
0
function firstTimeGetUserId()
{
    global $cookieSupported;
    if ($cookieSupported) {
        if (isset($_SESSION['userId'])) {
            $user_id = $_SESSION['userId'];
            $sessionData = getSessionData($user_id);
            if ($_SESSION['data'] == $sessionData) {
                if (!isset($_GET['fileget'])) {
                    global $cookie_timeout, $cookie_path;
                    setcookie('PHPSESSID', $_COOKIE['PHPSESSID'], time() + $cookie_timeout, $cookie_path);
                }
                return $user_id;
            } else {
                resetAuth();
            }
            return 0;
        } else {
            resetAuth();
        }
        return 0;
    } else {
        resetAuth();
    }
    return 0;
}
Пример #7
0
<?php

session_start();
if (isset($_GET['action']) && !empty($_GET['action'])) {
    $action = $_GET['action'];
    switch ($action) {
        case 'getSessionData':
            getSessionData();
            break;
        case 'destroySession':
            destroySession();
            break;
    }
}
function getSessionData()
{
    if (array_key_exists("user", $_SESSION)) {
        echo json_encode(array("userNames" => $_SESSION["user"], "userEmail" => $_SESSION["userEmail"]));
    } else {
        echo "null";
    }
}
function destroySession()
{
    session_destroy();
    echo "deleted";
}
Пример #8
0
        $inTheSame = 1;
        echo "<!-- AFTER getting HTML elements: " . __FILE__ . " -->\n";
        $msg = $GLOBALS["I18N"]->get("Connection refused, check your host, user or password");
    } else {
        setSessionData($bounce_def);
        //$_SESSION["bounce_envelope"] = $bm_mail;
        //$_SESSION["bounce_host"]     = $bm_host;
        //$_SESSION["bounce_user"]     = $bm_user;
        //$_SESSION["bounce_pass"]     = $bm_pass;
        $inTheSame = 0;
        header("Location:?page=" . ($page + 1));
    }
} else {
    $msg = "";
    $inTheSame = 1;
    getSessionData($bounce_def);
    $HTMLElements = getHTMLElements($bounce_def);
    $JSElements = getJSValidations($bounce_def, $_SESSION["installType"]);
}
include "installer/lib/js_nextPage.inc";
$mailacc = $GLOBALS["I18N"]->get($GLOBALS['strJsMailAccount']);
$mailvalidacc = $GLOBALS["I18N"]->get($GLOBALS['strJsMailValidAccount']);
$mailhost = $GLOBALS["I18N"]->get($GLOBALS['strJsMailHost']);
$mailuser = $GLOBALS["I18N"]->get($GLOBALS['strJsMailUser']);
$mailpass = $GLOBALS["I18N"]->get($GLOBALS['strJsMailPass']);
?>
<br>
<br>
<div class="wrong"><?php 
echo $msg;
?>
Пример #9
0
    $errno = check_connection($database_host, $database_user, $database_password, $database_name);
    $errno_arr = explode("|", $errno);
    $msg = $errno_arr[1];
    $_SESSION['dbCreatedSuccesfully'] = $errno_arr[2];
    if ($errno_arr[0] > 0) {
        $HTMLElements = getHTMLElements($database_def);
        $inTheSame = 1;
    } else {
        setSessionData($database_def);
        $inTheSame = 0;
        header("Location:?page=" . ($page + 1));
    }
} else {
    $msg = "";
    $inTheSame = 1;
    getSessionData($database_def);
    $HTMLElements = getHTMLElements($database_def, "BASIC");
}
include "installer/lib/js_nextPage.inc";
$dbname = $GLOBALS["I18N"]->get($GLOBALS['strJsDbName']);
$dbhost = $GLOBALS["I18N"]->get($GLOBALS['strJsDbHost']);
$dbuser = $GLOBALS["I18N"]->get($GLOBALS['strJsDbUser']);
$dbpass = $GLOBALS["I18N"]->get($GLOBALS['strJsDbPass']);
?>

<br>
<br>
<div class="wrong"><?php 
echo $msg;
?>
</div>
Пример #10
0
             $server_channel_list[$s["id"]][$ch["id"]] = $ch["status"];
         }
         $row["type" . $no] = "server-control";
     } else {
         $server_channel_list[$s["id"]] = null;
         $row["type" . $no] = "server-none";
     }
     $no++;
 }
 $data[] = $row;
 $sql = "\r\n\t\t\t\t\tselect\r\n\t\t\t\t\t\ta.*\r\n\t\t\t\t\tfrom\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tselect \r\n\t\t\t\t\t\t\ta.id as channelid, a.channel_hashid, a.channelid as chno, concat(a.channelid, ' - ', a.name) as channelname, a.piecelength,\r\n\t\t\t\t\t\t\tb.id as serverid, b.name as servername, b.ip, b.order_no, a.grouptype\r\n\t\t\t\t\t\tfrom tbl_channel a, tbl_server b  \r\n\t\t\t\t\t\twhere a.delete_flag=0 and a.grouptype>0 and b.delete_flag=0 and b.visible_flag=1\r\n\t\t\t\t\t) a\r\n\t\t\t\t\torder by cast(a.chno as unsigned), a.order_no\r\n\t\t\t\t";
 $result = querySQL($db, $sql);
 $curch = null;
 $item = null;
 $session_new_abi = array();
 $session_abi = getSessionData('abi_list');
 $server_info_list = array();
 while ($row = mysql_fetch_assoc($result)) {
     // get peer_id
     if (!isset($server_info_list[$row['ip']]) && $memcached != null) {
         $server_info_id = 'server_info_' . $row['ip'];
         $server_info = $memcached->get($server_info_id);
         if ($server_info != null) {
             $server_info_list[$row['ip']] = $server_info["channels"];
         }
     }
     $peer_id = null;
     if (isset($server_info_list[$row['ip']])) {
         $peerlist = $server_info_list[$row['ip']][$row["channel_hashid"]];
         if (isset($peerlist)) {
             $peer_id = array_pop($peerlist);