Example #1
0
 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('" . GlobalMas::$filesPath_web . "', files.hash,'/', 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';
     }
     //-------------------------------------------------------
     GlobalMas::$getSession = $chk;
     //-------------------------------------------------------
     if ($chk['bool']) {
         GlobalMas::$loggedIN = $chk['result'][0];
     }
     //-------------------------------------------------------
     return $chk;
 }
Example #2
0
$orig_functionName = $_REQUEST['functionName'];
//----------------------------------------------------------
$_REQUEST['functionName'] = $object['string'];
//----------------------------------------------------------
$object = $object['class'];
//----------------------------------------------------------
//if (!file_exists($classPath) && is_null($object)) die($classPath." does not exist!!!!");
//----------------------------------------------------------
if (isset($_REQUEST['prop'])) {
    SetPublicProp::go($object, $_REQUEST['prop']);
}
//----------------------------------------------------------
if (GlobalMas::$loginCHK && isset($_COOKIE[Account_v0::getPrefix() . "user"])) {
    $loggedIN = Account_v0::getUserSession();
    if (!$loggedIN['bool']) {
        GlobalMas::$loggedIN = NULL;
    }
}
//-----------------------------------------------------------------------------
if (!isset($_REQUEST['params'])) {
    $_REQUEST['params'] = array();
}
//----------------------------------------------------------
if (!method_exists($object, $_REQUEST['functionName'])) {
    $chk['bool'] = false;
    $chk['message'] = $orig_functionName . " does not exist in " . $_REQUEST['service'];
}
//----------------------------------------------------------
$chk = $chk["bool"] ? call_service($object, $_REQUEST['functionName'], $_REQUEST['params']) : $chk;
//----------------------------------------------------------
if (!isset($_REQUEST['returnType'])) {