TYPO3 API  SVNRelease
class.tslib_feuserauth.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00027 /**
00028  * Front End session user. Login and session data
00029  * Included from index_ts.php
00030  *
00031  * $Id: class.tslib_feuserauth.php 10664 2011-02-28 19:37:41Z lolli $
00032  * Revised for TYPO3 3.6 June/2003 by Kasper Skårhøj
00033  *
00034  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00035  * @author  René Fritz <r.fritz@colorcube.de>
00036  */
00037 /**
00038  * [CLASS/FUNCTION INDEX of SCRIPT]
00039  *
00040  *
00041  *
00042  *   79: class tslib_feUserAuth extends t3lib_userAuth
00043  *  143:     function fetchGroupData()
00044  *  233:     function getUserTSconf()
00045  *
00046  *              SECTION: Session data management functions
00047  *  278:     function fetchSessionData()
00048  *  300:     function storeSessionData()
00049  *  326:     function getKey($type,$key)
00050  *  351:     function setKey($type,$key,$data)
00051  *  377:     function record_registration($recs,$maxSizeOfSessionData=0)
00052  *
00053  * TOTAL FUNCTIONS: 7
00054  * (This index is automatically created/updated by the extension "extdeveval")
00055  *
00056  */
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 /**
00072  * Extension class for Front End User Authentication.
00073  *
00074  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00075  * @author  René Fritz <r.fritz@colorcube.de>
00076  * @package TYPO3
00077  * @subpackage tslib
00078  */
00079 class tslib_feUserAuth extends t3lib_userAuth {
00080     var $session_table = 'fe_sessions';         // Table to use for session data.
00081     var $name = 'fe_typo_user';                 // Session/Cookie name
00082     var $get_name = 'ftu';                           // Session/GET-var name
00083 
00084     var $user_table = 'fe_users';                   // Table in database with userdata
00085     var $username_column = 'username';              // Column for login-name
00086     var $userident_column = 'password';             // Column for password
00087     var $userid_column = 'uid';                     // Column for user-id
00088     var $lastLogin_column = 'lastlogin';
00089 
00090     var $enablecolumns = Array (
00091         'deleted' => 'deleted',
00092         'disabled' => 'disable',
00093         'starttime' => 'starttime',
00094         'endtime' => 'endtime'
00095     );
00096     var $formfield_uname = 'user';              // formfield with login-name
00097     var $formfield_uident = 'pass';             // formfield with password
00098     var $formfield_chalvalue = 'challenge';     // formfield with a unique value which is used to encrypt the password and username
00099     var $formfield_status = 'logintype';        // formfield with status: *'login', 'logout'
00100     var $formfield_permanent = 'permalogin';    // formfield with 0 or 1 // 1 = permanent login enabled // 0 = session is valid for a browser session only
00101     var $security_level = '';                   // sets the level of security. *'normal' = clear-text. 'challenged' = hashed password/username from form in $formfield_uident. 'superchallenged' = hashed password hashed again with username.
00102 
00103     var $auth_timeout_field = 6000;             // Server session lifetime. If > 0: session-timeout in seconds. If false or <0: no timeout. If string: The string is a fieldname from the usertable where the timeout can be found.
00104 
00105     var $lifetime = 0;              // Client session lifetime. 0 = Session-cookies. If session-cookies, the browser will stop the session when the browser is closed. Otherwise this specifies the lifetime of a cookie that keeps the session.
00106     protected $sessionDataLifetime = 86400;     // Lifetime of session data in seconds.
00107     var $sendNoCacheHeaders = 0;
00108     var $getFallBack = 1;                       // If this is set, authentication is also accepted by the _GET. Notice that the identification is NOT 128bit MD5 hash but reduced. This is done in order to minimize the size for mobile-devices, such as WAP-phones
00109     var $getMethodEnabled = 1;                  // Login may be supplied by url.
00110 
00111     var $usergroup_column = 'usergroup';
00112     var $usergroup_table = 'fe_groups';
00113     var $groupData = Array(
00114         'title' =>Array(),
00115         'uid' =>Array(),
00116         'pid' =>Array()
00117     );
00118     var $TSdataArray=array();       // Used to accumulate the TSconfig data of the user
00119     var $userTS = array();
00120     var $userTSUpdated=0;
00121     var $showHiddenRecords=0;
00122 
00123         // Session and user data:
00124         /*
00125             There are two types of data that can be stored: UserData and Session-Data. Userdata is for the login-user, and session-data for anyone viewing the pages.
00126             'Keys' are keys in the internal dataarray of the data. When you get or set a key in one of the data-spaces (user or session) you decide the type of the variable (not object though)
00127             'Reserved' keys are:
00128                 - 'recs': Array: Used to 'register' records, eg in a shopping basket. Structure: [recs][tablename][record_uid]=number
00129                 - sys: Reserved for TypoScript standard code.
00130         */
00131     var $sesData = Array();
00132     var $sesData_change = 0;
00133     var $userData_change = 0;
00134     protected $sessionDataTimestamp;
00135 
00136 
00137     /**
00138      * Starts a user session
00139      *
00140      * @return  void
00141      * @see t3lib_userAuth::start()
00142      */
00143     function start() {
00144         if (intval($this->auth_timeout_field)>0 && intval($this->auth_timeout_field) < $this->lifetime) {
00145                 // If server session timeout is non-zero but less than client session timeout: Copy this value instead.
00146             $this->auth_timeout_field = $this->lifetime;
00147         }
00148 
00149         $this->sessionDataLifetime = intval($GLOBALS['TYPO3_CONF_VARS']['FE']['sessionDataLifetime']);
00150         if ($this->sessionDataLifetime <= 0) {
00151             $this->sessionDataLifetime = 86400;
00152         }
00153 
00154         parent::start();
00155     }
00156 
00157     /**
00158      * Returns a new session record for the current user for insertion into the DB.
00159      *
00160      * @return  array       user session record
00161      */
00162     function getNewSessionRecord($tempuser) {
00163         $insertFields = parent::getNewSessionRecord($tempuser);
00164         $insertFields['ses_permanent'] = $this->is_permanent;
00165 
00166         return $insertFields;
00167     }
00168 
00169     /**
00170      * Determine whether a session cookie needs to be set (lifetime=0)
00171      *
00172      * @return  boolean
00173      * @internal
00174      */
00175     function isSetSessionCookie() {
00176         $retVal = ($this->newSessionID || $this->forceSetCookie) && ($this->lifetime==0 || !$this->user['ses_permanent']);
00177         return $retVal;
00178     }
00179 
00180     /**
00181      * Determine whether a non-session cookie needs to be set (lifetime>0)
00182      *
00183      * @return  boolean
00184      * @internal
00185      */
00186     function isRefreshTimeBasedCookie() {
00187         return $this->lifetime > 0 && $this->user['ses_permanent'];
00188     }
00189 
00190     /**
00191      * Returns an info array with Login/Logout data submitted by a form or params
00192      *
00193      * @return  array
00194      * @see t3lib_userAuth::getLoginFormData()
00195      */
00196     function getLoginFormData() {
00197         $loginData = parent::getLoginFormData();
00198         if($GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'] == 0 || $GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'] == 1) {
00199             if ($this->getMethodEnabled)    {
00200                 $isPermanent = t3lib_div::_GP($this->formfield_permanent);
00201             } else {
00202                 $isPermanent = t3lib_div::_POST($this->formfield_permanent);
00203             }
00204             if(strlen($isPermanent) != 1) {
00205                 $isPermanent = $GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'];
00206             } elseif(!$isPermanent) {
00207                 $this->forceSetCookie = true; // To make sure the user gets a session cookie and doesn't keep a possibly existing time based cookie, we need to force seeting the session cookie here
00208             }
00209             $isPermanent = $isPermanent?1:0;
00210         } elseif($GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'] == 2) {
00211             $isPermanent = 1;
00212         } else {
00213             $isPermanent = 0;
00214         }
00215         $loginData['permanent'] = $isPermanent;
00216         $this->is_permanent = $isPermanent;
00217 
00218         return $loginData;
00219     }
00220 
00221     /**
00222      * Will select all fe_groups records that the current fe_user is member of - and which groups are also allowed in the current domain.
00223      * It also accumulates the TSconfig for the fe_user/fe_groups in ->TSdataArray
00224      *
00225      * @return  integer     Returns the number of usergroups for the frontend users (if the internal user record exists and the usergroup field contains a value)
00226      */
00227     function fetchGroupData()   {
00228         $this->TSdataArray = array();
00229         $this->userTS = array();
00230         $this->userTSUpdated = 0;
00231         $this->groupData = Array(
00232             'title' => Array(),
00233             'uid' => Array(),
00234             'pid' => Array()
00235         );
00236 
00237             // Setting default configuration:
00238         $this->TSdataArray[]=$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultUserTSconfig'];
00239 
00240             // get the info data for auth services
00241         $authInfo = $this->getAuthInfoArray();
00242 
00243         if ($this->writeDevLog)     {
00244             if (is_array($this->user))  {
00245                 t3lib_div::devLog('Get usergroups for user: '.t3lib_div::arrayToLogString($this->user, array($this->userid_column,$this->username_column)), 'tslib_feUserAuth');
00246             } else {
00247                 t3lib_div::devLog('Get usergroups for "anonymous" user', 'tslib_feUserAuth');
00248             }
00249         }
00250 
00251         $groupDataArr = array();
00252 
00253             // use 'auth' service to find the groups for the user
00254         $serviceChain='';
00255         $subType = 'getGroups'.$this->loginType;
00256         while (is_object($serviceObj = t3lib_div::makeInstanceService('auth', $subType, $serviceChain)))    {
00257             $serviceChain.=','.$serviceObj->getServiceKey();
00258             $serviceObj->initAuth($subType, array(), $authInfo, $this);
00259 
00260             $groupData = $serviceObj->getGroups($this->user, $groupDataArr);
00261             if (is_array($groupData) && count($groupData))  {
00262                 $groupDataArr = t3lib_div::array_merge($groupDataArr, $groupData);  // Keys in $groupData should be unique ids of the groups (like "uid") so this function will override groups.
00263             }
00264             unset($serviceObj);
00265         }
00266         if ($this->writeDevLog AND $serviceChain)   t3lib_div::devLog($subType.' auth services called: '.$serviceChain, 'tslib_feUserAuth');
00267         if ($this->writeDevLog AND !count($groupDataArr))   t3lib_div::devLog('No usergroups found by services', 'tslib_feUserAuth');
00268         if ($this->writeDevLog AND count($groupDataArr))    t3lib_div::devLog(count($groupDataArr).' usergroup records found by services', 'tslib_feUserAuth');
00269 
00270 
00271             // use 'auth' service to check the usergroups if they are really valid
00272         foreach ($groupDataArr as $groupData)   {
00273                 // by default a group is valid
00274             $validGroup = TRUE;
00275 
00276             $serviceChain='';
00277             $subType = 'authGroups'.$this->loginType;
00278             while (is_object($serviceObj = t3lib_div::makeInstanceService('auth', $subType, $serviceChain))) {
00279                 $serviceChain.=','.$serviceObj->getServiceKey();
00280                 $serviceObj->initAuth($subType, array(), $authInfo, $this);
00281 
00282                 if (!$serviceObj->authGroup($this->user, $groupData)) {
00283                     $validGroup = FALSE;
00284                     if ($this->writeDevLog)     t3lib_div::devLog($subType.' auth service did not auth group: '.t3lib_div::arrayToLogString($groupData, 'uid,title'), 'tslib_feUserAuth', 2);
00285 
00286                     break;
00287                 }
00288                 unset($serviceObj);
00289             }
00290             unset($serviceObj);
00291 
00292             if ($validGroup) {
00293                 $this->groupData['title'][$groupData['uid']]=$groupData['title'];
00294                 $this->groupData['uid'][$groupData['uid']]=$groupData['uid'];
00295                 $this->groupData['pid'][$groupData['uid']]=$groupData['pid'];
00296                 $this->groupData['TSconfig'][$groupData['uid']]=$groupData['TSconfig'];
00297             }
00298         }
00299 
00300         if (count($this->groupData) && count($this->groupData['TSconfig'])) {
00301                 // TSconfig: collect it in the order it was collected
00302             foreach($this->groupData['TSconfig'] as $TSdata)    {
00303                 $this->TSdataArray[]=$TSdata;
00304             }
00305 
00306             $this->TSdataArray[]=$this->user['TSconfig'];
00307 
00308                 // Sort information
00309             ksort($this->groupData['title']);
00310             ksort($this->groupData['uid']);
00311             ksort($this->groupData['pid']);
00312         }
00313 
00314         return count($this->groupData['uid']) ? count($this->groupData['uid']) : 0;
00315     }
00316 
00317     /**
00318      * Returns the parsed TSconfig for the fe_user
00319      * First time this function is called it will parse the TSconfig and store it in $this->userTS. Subsequent requests will not re-parse the TSconfig but simply return what is already in $this->userTS
00320      *
00321      * @return  array       TSconfig array for the fe_user
00322      */
00323     function getUserTSconf()    {
00324         if (!$this->userTSUpdated) {
00325                 // Parsing the user TS (or getting from cache)
00326             $this->TSdataArray = t3lib_TSparser::checkIncludeLines_array($this->TSdataArray);
00327             $userTS = implode(LF.'[GLOBAL]'.LF,$this->TSdataArray);
00328             $parseObj = t3lib_div::makeInstance('t3lib_TSparser');
00329             $parseObj->parse($userTS);
00330             $this->userTS = $parseObj->setup;
00331 
00332             $this->userTSUpdated=1;
00333         }
00334         return $this->userTS;
00335     }
00336 
00337 
00338 
00339 
00340 
00341 
00342 
00343 
00344 
00345 
00346 
00347 
00348 
00349 
00350 
00351 
00352 
00353     /*****************************************
00354      *
00355      * Session data management functions
00356      *
00357      ****************************************/
00358 
00359     /**
00360      * Fetches the session data for the user (from the fe_session_data table) based on the ->id of the current user-session.
00361      * The session data is restored to $this->sesData
00362      * 1/100 calls will also do a garbage collection.
00363      *
00364      * @return  void
00365      * @access private
00366      * @see storeSessionData()
00367      */
00368     function fetchSessionData() {
00369             // Gets SesData if any AND if not already selected by session fixation check in ->isExistingSessionRecord()
00370         if ($this->id && !count($this->sesData)) {
00371             $statement = $GLOBALS['TYPO3_DB']->prepare_SELECTquery(
00372                 '*',
00373                 'fe_session_data',
00374                 'hash = :hash'
00375             );
00376             $statement->execute(array(':hash' => $this->id));
00377             if (($sesDataRow = $statement->fetch()) !== FALSE) {
00378                 $this->sesData = unserialize($sesDataRow['content']);
00379                 $this->sessionDataTimestamp = $sesDataRow['tstamp'];
00380             }
00381             $statement->free();
00382         }
00383     }
00384 
00385     /**
00386      * Will write UC and session data.
00387      * If the flag $this->userData_change has been set, the function ->writeUC is called (which will save persistent user session data)
00388      * If the flag $this->sesData_change has been set, the fe_session_data table is updated with the content of $this->sesData (deleting any old record, inserting new)
00389      *
00390      * @return  void
00391      * @see fetchSessionData(), getKey(), setKey()
00392      */
00393     function storeSessionData() {
00394             // Saves UC and SesData if changed.
00395         if ($this->userData_change) {
00396             $this->writeUC('');
00397         }
00398         if ($this->sesData_change)  {
00399             if ($this->id)  {
00400                 $insertFields = array (
00401                     'hash' => $this->id,
00402                     'content' => serialize($this->sesData),
00403                     'tstamp' => $GLOBALS['EXEC_TIME'],
00404                 );
00405                 $this->removeSessionData();
00406                 $GLOBALS['TYPO3_DB']->exec_INSERTquery('fe_session_data', $insertFields);
00407             }
00408         }
00409     }
00410 
00411     /**
00412      * Removes data of the current session.
00413      *
00414      * @return  void
00415      */
00416     public function removeSessionData() {
00417         $GLOBALS['TYPO3_DB']->exec_DELETEquery(
00418             'fe_session_data',
00419             'hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->id, 'fe_session_data')
00420         );
00421     }
00422 
00423     /**
00424      * Executes the garbage collection of session data and session.
00425      * The lifetime of session data is defined by $TYPO3_CONF_VARS['FE']['sessionDataLifetime'].
00426      *
00427      * @return  void
00428      */
00429     public function gc() {
00430         $timeoutTimeStamp = intval($GLOBALS['EXEC_TIME'] - $this->sessionDataLifetime);
00431         $GLOBALS['TYPO3_DB']->exec_DELETEquery('fe_session_data', 'tstamp < ' . $timeoutTimeStamp);
00432 
00433         parent::gc();
00434     }
00435 
00436     /**
00437      * Returns session data for the fe_user; Either persistent data following the fe_users uid/profile (requires login) or current-session based (not available when browse is closed, but does not require login)
00438      *
00439      * @param   string      Session data type; Either "user" (persistent, bound to fe_users profile) or "ses" (temporary, bound to current session cookie)
00440      * @param   string      Key from the data array to return; The session data (in either case) is an array ($this->uc / $this->sesData) and this value determines which key to return the value for.
00441      * @return  mixed       Returns whatever value there was in the array for the key, $key
00442      * @see setKey()
00443      */
00444     function getKey($type,$key) {
00445         if ($key)   {
00446             switch($type)   {
00447                 case 'user':
00448                     return $this->uc[$key];
00449                 break;
00450                 case 'ses':
00451                     return $this->sesData[$key];
00452                 break;
00453             }
00454         }
00455     }
00456 
00457     /**
00458      * Saves session data, either persistent or bound to current session cookie. Please see getKey() for more details.
00459      * When a value is set the flags $this->userData_change or $this->sesData_change will be set so that the final call to ->storeSessionData() will know if a change has occurred and needs to be saved to the database.
00460      * Notice: The key "recs" is already used by the function record_registration() which stores table/uid=value pairs in that key. This is used for the shopping basket among other things.
00461      * Notice: Simply calling this function will not save the data to the database! The actual saving is done in storeSessionData() which is called as some of the last things in index_ts.php. So if you exit before this point, nothing gets saved of course! And the solution is to call $GLOBALS['TSFE']->storeSessionData(); before you exit.
00462      *
00463      * @param   string      Session data type; Either "user" (persistent, bound to fe_users profile) or "ses" (temporary, bound to current session cookie)
00464      * @param   string      Key from the data array to store incoming data in; The session data (in either case) is an array ($this->uc / $this->sesData) and this value determines in which key the $data value will be stored.
00465      * @param   mixed       The data value to store in $key
00466      * @return  void
00467      * @see setKey(), storeSessionData(), record_registration()
00468      */
00469     function setKey($type,$key,$data)   {
00470         if ($key)   {
00471             switch($type)   {
00472                 case 'user':
00473                     if ($this->user['uid']) {
00474                         $this->uc[$key]=$data;
00475                         $this->userData_change=1;
00476                     }
00477                 break;
00478                 case 'ses':
00479                     $this->sesData[$key]=$data;
00480                     $this->sesData_change=1;
00481                 break;
00482             }
00483         }
00484     }
00485 
00486     /**
00487      * Returns the session data stored for $key.
00488      * The data will last only for this login session since it is stored in the session table.
00489      *
00490      * @param  string  $key
00491      * @return mixed
00492      */
00493     public function getSessionData($key) {
00494         return $this->getKey('ses', $key);
00495     }
00496 
00497     /**
00498      * Saves the tokens so that they can be used by a later incarnation of this class.
00499      *
00500      * @param  string  $key
00501      * @param  mixed   $data
00502      * @return void
00503      */
00504     public function setAndSaveSessionData($key, $data) {
00505         $this->setKey('ses', $key, $data);
00506         $this->storeSessionData();
00507     }
00508 
00509 
00510 
00511     /**
00512      * Registration of records/"shopping basket" in session data
00513      * This will take the input array, $recs, and merge into the current "recs" array found in the session data.
00514      * If a change in the recs storage happens (which it probably does) the function setKey() is called in order to store the array again.
00515      *
00516      * @param   array       The data array to merge into/override the current recs values. The $recs array is constructed as [table]][uid] = scalar-value (eg. string/integer).
00517      * @param   integer     The maximum size of stored session data. If zero, no limit is applied and even confirmation of cookie session is discarded.
00518      * @return  void
00519      */
00520     function record_registration($recs,$maxSizeOfSessionData=0) {
00521 
00522             // Storing value ONLY if there is a confirmed cookie set (->cookieID),
00523             // otherwise a shellscript could easily be spamming the fe_sessions table
00524             // with bogus content and thus bloat the database
00525         if (!$maxSizeOfSessionData || $this->cookieId) {
00526             if ($recs['clear_all']) {
00527                 $this->setKey('ses', 'recs', array());
00528             }
00529             $change=0;
00530             $recs_array=$this->getKey('ses','recs');
00531             foreach ($recs as $table => $data) {
00532                 if (is_array($data))    {
00533                     foreach ($data as $rec_id => $value) {
00534                         if ($value != $recs_array[$table][$rec_id]) {
00535                             $recs_array[$table][$rec_id] = $value;
00536                             $change=1;
00537                         }
00538                     }
00539                 }
00540             }
00541             if ($change && (!$maxSizeOfSessionData || strlen(serialize($recs_array))<$maxSizeOfSessionData))    {
00542                 $this->setKey('ses','recs',$recs_array);
00543             }
00544         }
00545     }
00546 
00547     /**
00548      * Determine whether there's an according session record to a given session_id
00549      * in the database. Don't care if session record is still valid or not.
00550      *
00551      * This calls the parent function but additionally tries to look up the session ID in the "fe_session_data" table.
00552      *
00553      * @param   integer     Claimed Session ID
00554      * @return  boolean     Returns true if a corresponding session was found in the database
00555      */
00556     function isExistingSessionRecord($id) {
00557             // Perform check in parent function
00558         $count = parent::isExistingSessionRecord($id);
00559 
00560             // Check if there are any fe_session_data records for the session ID the client claims to have
00561         if ($count == false) {
00562             $statement = $GLOBALS['TYPO3_DB']->prepare_SELECTquery(
00563                 'content',
00564                 'fe_session_data',
00565                 'hash = :hash'
00566             );
00567             $res = $statement->execute(array(':hash' => $id));
00568             if ($res !== FALSE) {
00569                 if ($sesDataRow = $statement->fetch()) {
00570                     $count = true;
00571                     $this->sesData = unserialize($sesDataRow['content']);
00572                 }
00573                 $statement->free();
00574             }
00575         }
00576 
00577             // @deprecated: Check for commerce basket records. The following lines should be removed once a fixed commerce version is released.
00578             // Extensions like commerce which have their own session table should just put some small bit of data into fe_session_data using $GLOBALS['TSFE']->fe_user->setKey('ses', ...) to make the session stable.
00579         if ($count == false && t3lib_extMgm::isLoaded('commerce')) {
00580             t3lib_div::deprecationLog("EXT:commerce specific code in tslib_feuserauth::isExistingSessionRecord() is deprecated. Will be removed in 4.6");
00581 
00582             $dbres = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
00583                             '*',
00584                             'tx_commerce_baskets',
00585                             'sid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($id, 'tx_commerce_baskets')
00586                         );
00587             if ($dbres !== false) {
00588                 if ($sesDataRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbres)) {
00589                     $count = true;
00590                 }
00591                 $GLOBALS['TYPO3_DB']->sql_free_result($dbres);
00592             }
00593         }
00594 
00595         return $count;
00596     }
00597 }
00598 
00599 
00600 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/class.tslib_feuserauth.php'])) {
00601     include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/class.tslib_feuserauth.php']);
00602 }
00603 
00604 ?>