Public Member Functions | |
| fetchGroupData () | |
| Will select all fe_groups records that the current fe_user is member of - and which groups are also allowed in the current domain. | |
| getUserTSconf () | |
| Returns the parsed TSconfig for the fe_user First time this function is called it will parse the TSconfig and store it in $this->userTS. | |
| fetchSessionData () | |
| Fetches the session data for the user (from the fe_session_data table) based on the ->id of the current user-session. | |
| storeSessionData () | |
| Will write UC and session data. | |
| getKey ($type, $key) | |
| 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). | |
| setKey ($type, $key, $data) | |
| Saves session data, either persistent or bound to current session cookie. | |
| record_registration ($recs) | |
| Registration of records/"shopping basket" in session data This will take the input array, $recs, and merge into the current "recs" array found in the session data. | |
Public Attributes | |
| $session_table = 'fe_sessions' | |
| $name = 'fe_typo_user' | |
| $get_name = 'ftu' | |
| $user_table = 'fe_users' | |
| $username_column = 'username' | |
| $userident_column = 'password' | |
| $userid_column = 'uid' | |
| $lastLogin_column = 'lastlogin' | |
| $enablecolumns | |
| $formfield_uname = 'user' | |
| $formfield_uident = 'pass' | |
| $formfield_chalvalue = 'challenge' | |
| $formfield_status = 'logintype' | |
| $security_level = '' | |
| $auth_include = '' | |
| $auth_timeout_field = 6000 | |
| $lifetime = 0 | |
| $sendNoCacheHeaders = 0 | |
| $getFallBack = 1 | |
| $hash_length = 10 | |
| $getMethodEnabled = 1 | |
| $usergroup_column = 'usergroup' | |
| $usergroup_table = 'fe_groups' | |
| $groupData | |
| $TSdataArray = array() | |
| $userTS = array() | |
| $userTSUpdated = 0 | |
| $showHiddenRecords = 0 | |
| $sesData = Array() | |
| $sesData_change = 0 | |
| $userData_change = 0 | |
|
|
Will select all fe_groups records that the current fe_user is member of - and which groups are also allowed in the current domain. It also accumulates the TSconfig for the fe_user/fe_groups in ->TSdataArray
Definition at line 141 of file class.tslib_feuserauth.php. 00141 {
00142 $this->TSdataArray = array();
00143 $this->userTS = array();
00144 $this->userTSUpdated = 0;
00145
00146 // Setting default configuration:
00147 $this->TSdataArray[]=$GLOBALS['TYPO3_CONF_VARS']['FE']['defaultUserTSconfig'];
00148
00149 if (is_array($this->user) && $this->user['usergroup']) {
00150 $groups = t3lib_div::intExplode(',',$this->user['usergroup']);
00151 $list = implode(',',$groups);
00152 $lockToDomain_SQL = ' AND (lockToDomain="" OR lockToDomain="'.t3lib_div::getIndpEnv('HTTP_HOST').'")';
00153 if (!$this->showHiddenRecords) $hiddenP = 'AND NOT hidden ';
00154
00155 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $this->usergroup_table, 'NOT deleted '.$hiddenP.'AND uid IN ('.$list.')'.$lockToDomain_SQL);
00156 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
00157 $this->groupData['title'][$row['uid']] = $row['title'];
00158 $this->groupData['uid'][$row['uid']] = $row['uid'];
00159 $this->groupData['pid'][$row['uid']] = $row['pid'];
00160 $this->groupData['TSconfig'][$row['uid']] = $row['TSconfig'];
00161 }
00162
00163 if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
00164 $GLOBALS['TYPO3_DB']->sql_free_result($res);
00165 // TSconfig:
00166 reset($groups);
00167 while(list(,$TSuid)=each($groups)) {
00168 $this->TSdataArray[]=$this->groupData['TSconfig'][$TSuid];
00169 }
00170 $this->TSdataArray[]=$this->user['TSconfig'];
00171
00172 // Sort information
00173 ksort($this->groupData['title']);
00174 ksort($this->groupData['uid']);
00175 ksort($this->groupData['pid']);
00176 return count($this->groupData['uid']);
00177 } else {
00178 return 0;
00179 }
00180 }
00181 }
|
|
|
Fetches the session data for the user (from the fe_session_data table) based on the ->id of the current user-session. The session data is restored to $this->sesData 1/100 calls will also do a garbage collection.
Definition at line 234 of file class.tslib_feuserauth.php. 00234 {
00235 // Gets SesData if any
00236 if ($this->id) {
00237 $dbres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'fe_session_data', 'hash="'.$GLOBALS['TYPO3_DB']->quoteStr($this->id, 'fe_session_data').'"');
00238 if ($sesDataRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbres)) {
00239 $this->sesData = unserialize($sesDataRow['content']);
00240 }
00241 }
00242 // delete old data:
00243 if ((rand()%100) <= 1) { // a possibility of 1 % for garbage collection.
00244 $GLOBALS['TYPO3_DB']->exec_DELETEquery('fe_session_data', 'tstamp < '.intval(time()-3600*24)); // all data older than 24 hours are deleted.
00245 }
00246 }
|
|
||||||||||||
|
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).
Definition at line 282 of file class.tslib_feuserauth.php. 00282 {
00283 if ($key) {
00284 switch($type) {
00285 case 'user':
00286 return $this->uc[$key];
00287 break;
00288 case 'ses':
00289 return $this->sesData[$key];
00290 break;
00291 }
00292 }
00293 }
|
|
|
Returns the parsed TSconfig for the fe_user 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
Definition at line 189 of file class.tslib_feuserauth.php. References checkIncludeLines_array(). 00189 {
00190 if (!$this->userTSUpdated) {
00191 // Parsing the user TS (or getting from cache)
00192 $this->TSdataArray = t3lib_TSparser::checkIncludeLines_array($this->TSdataArray);
00193 $userTS = implode(chr(10).'[GLOBAL]'.chr(10),$this->TSdataArray);
00194 $parseObj = t3lib_div::makeInstance('t3lib_TSparser');
00195 $parseObj->parse($userTS);
00196 $this->userTS = $parseObj->setup;
00197
00198 $this->userTSUpdated=1;
00199 }
00200 return $this->userTS;
00201 }
|
|
|
Registration of records/"shopping basket" in session data This will take the input array, $recs, and merge into the current "recs" array found in the session data. If a change in the recs storage happens (which it probably does) the function setKey() is called in order to store the array again.
Definition at line 332 of file class.tslib_feuserauth.php. References getKey(), and table(). 00332 {
00333 if ($recs['clear_all']) {
00334 $this->setKey('ses','recs','');
00335 }
00336 $change=0;
00337 $recs_array=$this->getKey('ses','recs');
00338 reset($recs);
00339 while(list($table,$data)=each($recs)) {
00340 if (is_array($data)) {
00341 reset($data);
00342 while(list($rec_id,$value)=each($data)) {
00343 if ($value != $recs_array[$table][$rec_id]) {
00344 $recs_array[$table][$rec_id] = $value;
00345 $change=1;
00346 }
00347 }
00348 }
00349 }
00350 if ($change) {
00351 $this->setKey('ses','recs',$recs_array);
00352 }
00353 }
|
|
||||||||||||||||
|
Saves session data, either persistent or bound to current session cookie. Please see getKey() for more details. 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. 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. 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.
Definition at line 307 of file class.tslib_feuserauth.php. 00307 {
00308 if ($key) {
00309 switch($type) {
00310 case 'user':
00311 if ($this->user['uid']) {
00312 $this->uc[$key]=$data;
00313 $this->userData_change=1;
00314 }
00315 break;
00316 case 'ses':
00317 $this->sesData[$key]=$data;
00318 $this->sesData_change=1;
00319 break;
00320 }
00321 }
00322 }
|
|
|
Will write UC and session data. If the flag $this->userData_change has been set, the function ->writeUC is called (which will save persistent user session data) 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)
Definition at line 256 of file class.tslib_feuserauth.php. 00256 {
00257 // Saves UC and SesData if changed.
00258 if ($this->userData_change) {
00259 $this->writeUC('');
00260 }
00261 if ($this->sesData_change) {
00262 if ($this->id) {
00263 $insertFields = array (
00264 'hash' => $this->id,
00265 'content' => serialize($this->sesData),
00266 'tstamp' => time()
00267 );
00268 $GLOBALS['TYPO3_DB']->exec_DELETEquery('fe_session_data', 'hash="'.$GLOBALS['TYPO3_DB']->quoteStr($this->id, 'fe_session_data').'"');
00269 $GLOBALS['TYPO3_DB']->exec_INSERTquery('fe_session_data', $insertFields);
00270 }
00271 }
00272 }
|
|
|
Reimplemented from t3lib_userAuth. Definition at line 100 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 102 of file class.tslib_feuserauth.php. |
|
|
Initial value: Array (
'deleted' => 'deleted',
'disabled' => 'disable',
'starttime' => 'starttime',
'endtime' => 'endtime'
)
Reimplemented from t3lib_userAuth. Definition at line 88 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 96 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 97 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 95 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 94 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 80 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 106 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 108 of file class.tslib_feuserauth.php. |
|
|
Initial value: Array(
'title' =>Array(),
'uid' =>Array(),
'pid' =>Array()
)
Definition at line 112 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 107 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 86 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 104 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 79 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 98 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 105 of file class.tslib_feuserauth.php. |
|
|
Definition at line 130 of file class.tslib_feuserauth.php. |
|
|
Definition at line 131 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 78 of file class.tslib_feuserauth.php. |
|
|
Definition at line 120 of file class.tslib_feuserauth.php. |
|
|
Definition at line 117 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 82 of file class.tslib_feuserauth.php. |
|
|
Definition at line 132 of file class.tslib_feuserauth.php. |
|
|
Definition at line 110 of file class.tslib_feuserauth.php. |
|
|
Definition at line 111 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 85 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 84 of file class.tslib_feuserauth.php. |
|
|
Reimplemented from t3lib_userAuth. Definition at line 83 of file class.tslib_feuserauth.php. |
|
|
Definition at line 118 of file class.tslib_feuserauth.php. |
|
|
Definition at line 119 of file class.tslib_feuserauth.php. |
1.3.8-20040913