当前位置: 首页>>代码示例>>PHP>>正文


PHP Constants::loggedIN方法代码示例

本文整理汇总了PHP中Constants::loggedIN方法的典型用法代码示例。如果您正苦于以下问题:PHP Constants::loggedIN方法的具体用法?PHP Constants::loggedIN怎么用?PHP Constants::loggedIN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Constants的用法示例。


在下文中一共展示了Constants::loggedIN方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSession

 private function getSession($userkey = NULL)
 {
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, 'traceID' => "getSession");
     //----------------------------------------------------------
     if (is_null($userkey)) {
         $userkey = $_COOKIE['user'];
     }
     //----------------------------------------------------------
     if (isset($userkey)) {
         $userKeyArr = explode("-", $userkey);
         //----------------------------------------------------------
         if (session_id() == '') {
             session_start();
         }
         //------------------------------------------------------
         $session_id = GenFun::encrypt(session_id() . $this->salt . $userKeyArr[0]);
         //-------------------------------------------------------
         $queryString = "SELECT * \n\t\t\tFROM accounts,sessionLog\n\t\t\t\n\t\t\tWHERE sessionLog.accounts_id = accounts.id \n\t\t\t\n\t\t\tAnd sessionLog.userKey='" . $userkey . "' \n\t\t\t\n\t\t\tAND sessionLog.session_id='" . $session_id . "' \n\t\t\t\n\t\t\tAND sessionLog.disabled='0' \n\t\t\t\n\t\t\tAND accounts.email='" . $userKeyArr[0] . "'";
         //---------------------------------------------------
         $chk = Result::go($queryString, array("greaterZero" => true));
         //---------------------------------------------------
     } else {
         $chk['bool'] = false;
     }
     //-------------------------------------------------------
     if (!$chk['bool'] && !$chk['error']) {
         $chk['message'] = 'user not logged in';
     }
     //-------------------------------------------------------
     Constants::$getSession = $chk;
     //-------------------------------------------------------
     if ($chk['bool']) {
         Constants::$loggedIN = $chk['result'][0];
     }
     //-------------------------------------------------------
     return $chk;
 }
开发者ID:awwthentic1234,项目名称:hey,代码行数:40,代码来源:Account_v0.php

示例2: getSession

 private function getSession($userkey = NULL)
 {
     Trace::output($this->traceID, "getSession", func_get_args());
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, 'traceID' => "getSession");
     //----------------------------------------------------------
     if (is_null($userkey)) {
         $userkey = $_COOKIE[$this->cookiePrefix . 'user'];
     }
     //----------------------------------------------------------
     if (isset($userkey)) {
         $userKeyArr = explode("-", $userkey);
         //----------------------------------------------------------
         if (session_id() == '') {
             session_start();
         }
         //------------------------------------------------------
         //$session_id = GenFun::encrypt(session_id().$this->salt.$userKeyArr[0]);
         //-------------------------------------------------------
         $queryString = "SELECT ";
         $queryString .= "accounts.*, ";
         $queryString .= "CONCAT('" . ProjectGlobal::$filesPath . "', files.name) as img_url ";
         $queryString .= "FROM ";
         $queryString .= "accounts, ";
         $queryString .= "files, ";
         $queryString .= "sessionLog ";
         $queryString .= "WHERE ";
         $queryString .= "sessionLog.accounts_id = accounts.id ";
         $queryString .= "AND files.id = accounts.profile_files_id ";
         $queryString .= "AND sessionLog.userKey='" . urldecode($userkey) . "' ";
         $queryString .= "AND sessionLog.disabled IS NULL ";
         $queryString .= "AND accounts.email='" . urldecode($userKeyArr[0]) . "'";
         //---------------------------------------------------
         $chk = Result::go($queryString, array("greaterZero" => true));
         //---------------------------------------------------
     } else {
         $chk['bool'] = false;
     }
     //-------------------------------------------------------
     if (!$chk['bool'] && !$chk['error']) {
         $chk['message'] = 'user not logged in';
     }
     //-------------------------------------------------------
     Constants::$getSession = $chk;
     //-------------------------------------------------------
     if ($chk['bool']) {
         Constants::$loggedIN = $chk['result'][0];
     }
     //-------------------------------------------------------
     return $chk;
 }
开发者ID:awwthentic1234,项目名称:hey,代码行数:53,代码来源:Account_v0.php

示例3: array

header('Access-Control-Allow-Origin: *');
require_once 'Constants.php';
//-----------------------------------------------------------------------------
//init var
//-----------------------------------------------------------------------------
$chk = array("bool" => true);
//-----------------------------------------------------------------------------
require_once Import::$uber_src_path . "server/werm/utils/SetPublicProp.php";
//-----------------------------------------------------------------------------
if (Constants::$loginCHK) {
    require Import::$uber_src_path . "server/werm/services/Account_v0.php";
}
//-----------------------------------------------------------------------------
if (Constants::$loginCHK && isset($_COOKIE["user"])) {
    Constants::$loggedIN = Account_v0::getUserSession($_COOKIE["user"]);
}
//-----------------------------------------------------------------------------
$_OBJ = isset($_GET["service"]) ? $_GET : $_POST;
//-----------------------------------------------------------------------------
indexExist($_OBJ, array('service', 'functionName'));
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//imports
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
constExist("Constants", array("HOST", "PASS", "USER"));
//----------------------------------------------------------
require_once Import::$uber_src_path . "server/werm/utils/GenFun.php";
//----------------------------------------------------------
$classPath = GenFun::constCHK($_OBJ['service']);
开发者ID:awwthentic1234,项目名称:hey,代码行数:30,代码来源:service.php

示例4: array

$orig_functionName = $_OBJ['functionName'];
//----------------------------------------------------------
$_OBJ['functionName'] = $object['string'];
//----------------------------------------------------------
$object = $object['class'];
//----------------------------------------------------------
//if (!file_exists($classPath) && is_null($object)) die($classPath." does not exist!!!!");
//----------------------------------------------------------
if (isset($_OBJ['prop'])) {
    SetPublicProp::go($object, $_OBJ['prop']);
}
//----------------------------------------------------------
if (Constants::$loginCHK && isset($_COOKIE[Account_v0::getPrefix() . "user"])) {
    $loggedIN = Account_v0::getUserSession();
    if (!$loggedIN['bool']) {
        Constants::$loggedIN = NULL;
    }
}
//-----------------------------------------------------------------------------
if (!isset($_OBJ['params'])) {
    $_OBJ['params'] = array();
}
//----------------------------------------------------------
if (!method_exists($object, $_OBJ['functionName'])) {
    $chk['bool'] = false;
    $chk['message'] = $orig_functionName . " does not exist in " . $_OBJ['service'];
}
//----------------------------------------------------------
$chk = $chk["bool"] ? call_service($object, $_OBJ['functionName'], $_OBJ['params']) : $chk;
//----------------------------------------------------------
if (!isset($_OBJ['returnType'])) {
开发者ID:awwthentic1234,项目名称:hey,代码行数:31,代码来源:service.php


注:本文中的Constants::loggedIN方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。