Documentation TYPO3 par Ameos

t3lib_userAuth Class Reference

Inheritance diagram for t3lib_userAuth:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 start ()
 check_authentication ()
 redirect ()
 logoff ()
 gc ()
 user_where_clause ()
 ipLockClause ()
 ipLockClause_remoteIPNumber ($parts)
 hashLockClause ()
 hashLockClause_getHashInt ()
 writeUC ($variable='')
 writelog ($type, $action, $error, $details_nr, $details, $data, $tablename, $recuid, $recpid)
 checkLogFailures ()
 unpack_uc ($theUC='')
 pushModuleData ($module, $data, $noSave=0)
 getModuleData ($module, $type='')
 getSessionData ($key)
 setAndSaveSessionData ($key, $data)
 setBeUserByUid ($uid)
 setBeUserByName ($name)
 start ()
 check_authentication ()
 redirect ()
 logoff ()
 gc ()
 user_where_clause ()
 ipLockClause ()
 ipLockClause_remoteIPNumber ($parts)
 hashLockClause ()
 hashLockClause_getHashInt ()
 writeUC ($variable='')
 writelog ($type, $action, $error, $details_nr, $details, $data, $tablename, $recuid, $recpid)
 checkLogFailures ()
 unpack_uc ($theUC='')
 pushModuleData ($module, $data, $noSave=0)
 getModuleData ($module, $type='')
 getSessionData ($key)
 setAndSaveSessionData ($key, $data)
 setBeUserByUid ($uid)
 setBeUserByName ($name)

Public Attributes

 $global_database = ''
 $session_table = ''
 $name = ''
 $get_name = ''
 $user_table = ''
 $username_column = ''
 $userident_column = ''
 $userid_column = ''
 $lastLogin_column = ''
 $enablecolumns
 $formfield_uname = ''
 $formfield_uident = ''
 $formfield_chalvalue = ''
 $formfield_status = ''
 $security_level = ''
 $auth_include = ''
 $auth_timeout_field = 0
 $lifetime = 0
 $gc_time = 24
 $gc_probability = 1
 $writeStdLog = 0
 $writeAttemptLog = 0
 $sendNoCacheHeaders = 1
 $getFallBack = 0
 $hash_length = 32
 $getMethodEnabled = 0
 $lockIP = 4
 $lockHashKeyWords = 'useragent'
 $warningEmail = ''
 $warningPeriod = 3600
 $warningMax = 3
 $checkPid = 1
 $checkPid_value = 0
 $id
 $cookieId
 $loginSessionStarted = 0
 $user
 $get_URL_ID = ''
 $forceSetCookie = 0
 $dontSetCookie = 0

Detailed Description

Definition at line 89 of file class.t3lib_userauth.php.


Member Function Documentation

t3lib_userAuth::check_authentication  ) 
 

Checks if a submission of username and password is present

Returns:
string Returns "login" if login, "logout" if logout, or empty if $F_status was none of these values.

Definition at line 261 of file class.t3lib_userauth.php.

References t3lib_div::_GP(), t3lib_div::_POST(), checkLogFailures(), t3lib_div::getIndpEnv(), hashLockClause_getHashInt(), ipLockClause_remoteIPNumber(), logoff(), and writelog().

t3lib_userAuth::check_authentication  ) 
 

Checks if a submission of username and password is present

Returns:
string Returns "login" if login, "logout" if logout, or empty if $F_status was none of these values.

Definition at line 261 of file class.t3lib_userauth.php.

References t3lib_div::_GP(), t3lib_div::_POST(), checkLogFailures(), t3lib_div::getIndpEnv(), hashLockClause_getHashInt(), ipLockClause_remoteIPNumber(), logoff(), and writelog().

Referenced by start().

t3lib_userAuth::checkLogFailures  ) 
 

DUMMY: Check login failures (in some extension classes)

Returns:
void

Definition at line 567 of file class.t3lib_userauth.php.

t3lib_userAuth::checkLogFailures  ) 
 

DUMMY: Check login failures (in some extension classes)

Returns:
void

Definition at line 567 of file class.t3lib_userauth.php.

Referenced by check_authentication().

t3lib_userAuth::gc  ) 
 

Garbage collector, removing old expired sessions.

Returns:
void

Definition at line 441 of file class.t3lib_userauth.php.

t3lib_userAuth::gc  ) 
 

Garbage collector, removing old expired sessions.

Returns:
void

Definition at line 441 of file class.t3lib_userauth.php.

Referenced by start().

t3lib_userAuth::getModuleData module,
type = ''
 

Gets module data for a module (from a loaded ->uc array)

Parameters:
string $module is the name of the module ($MCONF['name'])
string If $type = 'ses' then module data is returned only if it was stored in the current session, otherwise data from a previous session will be returned (if available).
Returns:
mixed The module data if available: $this->uc['moduleData'][$module];

Definition at line 605 of file class.t3lib_userauth.php.

t3lib_userAuth::getModuleData module,
type = ''
 

Gets module data for a module (from a loaded ->uc array)

Parameters:
string $module is the name of the module ($MCONF['name'])
string If $type = 'ses' then module data is returned only if it was stored in the current session, otherwise data from a previous session will be returned (if available).
Returns:
mixed The module data if available: $this->uc['moduleData'][$module];

Definition at line 605 of file class.t3lib_userauth.php.

t3lib_userAuth::getSessionData key  ) 
 

Returns the session data stored for $key. The data will last only for this login session since it is stored in the session table.

Parameters:
string Pointer to an associative key in the session data array which is stored serialized in the field "ses_data" of the session table.
Returns:
mixed

Definition at line 618 of file class.t3lib_userauth.php.

t3lib_userAuth::getSessionData key  ) 
 

Returns the session data stored for $key. The data will last only for this login session since it is stored in the session table.

Parameters:
string Pointer to an associative key in the session data array which is stored serialized in the field "ses_data" of the session table.
Returns:
mixed

Definition at line 618 of file class.t3lib_userauth.php.

t3lib_userAuth::hashLockClause  ) 
 

This returns the where-clause needed to lock a user to a hash integer

Returns:
string private

Definition at line 508 of file class.t3lib_userauth.php.

t3lib_userAuth::hashLockClause  ) 
 

This returns the where-clause needed to lock a user to a hash integer

Returns:
string private

Definition at line 508 of file class.t3lib_userauth.php.

t3lib_userAuth::hashLockClause_getHashInt  ) 
 

Creates hash integer to lock user to. Depends on configured keywords

Returns:
integer Hash integer private

Definition at line 519 of file class.t3lib_userauth.php.

References t3lib_div::inList(), and t3lib_div::md5int().

t3lib_userAuth::hashLockClause_getHashInt  ) 
 

Creates hash integer to lock user to. Depends on configured keywords

Returns:
integer Hash integer private

Definition at line 519 of file class.t3lib_userauth.php.

References t3lib_div::inList(), and t3lib_div::md5int().

Referenced by check_authentication().

t3lib_userAuth::ipLockClause  ) 
 

This returns the where-clause needed to lock a user to the IP address

Returns:
string private

Definition at line 469 of file class.t3lib_userauth.php.

t3lib_userAuth::ipLockClause  ) 
 

This returns the where-clause needed to lock a user to the IP address

Returns:
string private

Definition at line 469 of file class.t3lib_userauth.php.

t3lib_userAuth::ipLockClause_remoteIPNumber parts  ) 
 

Returns the IP address to lock to. The IP address may be partial based on $parts.

Parameters:
integer 1-4: Indicates how many parts of the IP address to return. 4 means all, 1 means only first number.
Returns:
string (Partial) IP address for REMOTE_ADDR private

Definition at line 487 of file class.t3lib_userauth.php.

References t3lib_div::getIndpEnv(), and t3lib_div::intInRange().

t3lib_userAuth::ipLockClause_remoteIPNumber parts  ) 
 

Returns the IP address to lock to. The IP address may be partial based on $parts.

Parameters:
integer 1-4: Indicates how many parts of the IP address to return. 4 means all, 1 means only first number.
Returns:
string (Partial) IP address for REMOTE_ADDR private

Definition at line 487 of file class.t3lib_userauth.php.

References t3lib_div::getIndpEnv(), and t3lib_div::intInRange().

Referenced by check_authentication().

t3lib_userAuth::logoff  ) 
 

Log out current user! Removes the current session record, sets the internal ->user array to a blank string; Thereby the current user (if any) is effectively logged out!

Returns:
void

Definition at line 426 of file class.t3lib_userauth.php.

t3lib_userAuth::logoff  ) 
 

Log out current user! Removes the current session record, sets the internal ->user array to a blank string; Thereby the current user (if any) is effectively logged out!

Returns:
void

Definition at line 426 of file class.t3lib_userauth.php.

Referenced by check_authentication(), and start().

t3lib_userAuth::pushModuleData module,
data,
noSave = 0
 

Stores data for a module. The data is stored with the session id so you can even check upon retrieval if the module data is from a previous session or from the current session.

Parameters:
string $module is the name of the module ($MCONF['name'])
mixed $data is the data you want to store for that module (array, string, ...)
boolean If $noSave is set, then the ->uc array (which carries all kinds of user data) is NOT written immediately, but must be written by some subsequent call.
Returns:
void

Definition at line 592 of file class.t3lib_userauth.php.

t3lib_userAuth::pushModuleData module,
data,
noSave = 0
 

Stores data for a module. The data is stored with the session id so you can even check upon retrieval if the module data is from a previous session or from the current session.

Parameters:
string $module is the name of the module ($MCONF['name'])
mixed $data is the data you want to store for that module (array, string, ...)
boolean If $noSave is set, then the ->uc array (which carries all kinds of user data) is NOT written immediately, but must be written by some subsequent call.
Returns:
void

Definition at line 592 of file class.t3lib_userauth.php.

t3lib_userAuth::redirect  ) 
 

Redirect to somewhere. Obsolete, depreciated etc.

Returns:
void

Definition at line 413 of file class.t3lib_userauth.php.

t3lib_userAuth::redirect  ) 
 

Redirect to somewhere. Obsolete, depreciated etc.

Returns:
void

Definition at line 413 of file class.t3lib_userauth.php.

Referenced by start().

t3lib_userAuth::setAndSaveSessionData key,
data
 

Sets the session data ($data) for $key and writes all session data (from ->user['ses_data']) to the database. The data will last only for this login session since it is stored in the session table.

Parameters:
string Pointer to an associative key in the session data array which is stored serialized in the field "ses_data" of the session table.
mixed The variable to store in index $key
Returns:
void

Definition at line 631 of file class.t3lib_userauth.php.

t3lib_userAuth::setAndSaveSessionData key,
data
 

Sets the session data ($data) for $key and writes all session data (from ->user['ses_data']) to the database. The data will last only for this login session since it is stored in the session table.

Parameters:
string Pointer to an associative key in the session data array which is stored serialized in the field "ses_data" of the session table.
mixed The variable to store in index $key
Returns:
void

Definition at line 631 of file class.t3lib_userauth.php.

t3lib_userAuth::setBeUserByName name  ) 
 

Raw initialization of the be_user with username=$name

Parameters:
string The username to look up.
Returns:
void
See also:
t3lib_userAuth::setBeUserByUid()

Definition at line 663 of file class.t3lib_userauth.php.

t3lib_userAuth::setBeUserByName name  ) 
 

Raw initialization of the be_user with username=$name

Parameters:
string The username to look up.
Returns:
void
See also:
t3lib_userAuth::setBeUserByUid()

Definition at line 663 of file class.t3lib_userauth.php.

Referenced by t3lib_beUserAuth::checkCLIuser().

t3lib_userAuth::setBeUserByUid uid  ) 
 

Raw initialization of the be_user with uid=$uid This will circumvent all login procedures and select a be_users record from the database and set the content of ->user to the record selected. Thus the BE_USER object will appear like if a user was authenticated - however without a session id and the fields from the session table of course. Will check the users for disabled, start/endtime, etc. ($this->user_where_clause())

Parameters:
integer The UID of the backend user to set in ->user
Returns:
void integer 'uid' of be_users record to select and set.

Definition at line 650 of file class.t3lib_userauth.php.

t3lib_userAuth::setBeUserByUid uid  ) 
 

Raw initialization of the be_user with uid=$uid This will circumvent all login procedures and select a be_users record from the database and set the content of ->user to the record selected. Thus the BE_USER object will appear like if a user was authenticated - however without a session id and the fields from the session table of course. Will check the users for disabled, start/endtime, etc. ($this->user_where_clause())

Parameters:
integer The UID of the backend user to set in ->user
Returns:
void integer 'uid' of be_users record to select and set.

Definition at line 650 of file class.t3lib_userauth.php.

t3lib_userAuth::start  ) 
 

Starts a user session Typical configurations will: a) check if session cookie was set and if not, set one, b) check if a password/username was sent and if so, try to authenticate the user c) Lookup a session attached to a user and check timeout etc. d) Garbage collection, setting of no-cache headers. If a user is authenticated the database record of the user (array) will be set in the ->user internal variable.

Returns:
void

Definition at line 159 of file class.t3lib_userauth.php.

References $id, t3lib_div::_GET(), check_authentication(), gc(), t3lib_div::intInRange(), logoff(), and redirect().

t3lib_userAuth::start  ) 
 

Starts a user session Typical configurations will: a) check if session cookie was set and if not, set one, b) check if a password/username was sent and if so, try to authenticate the user c) Lookup a session attached to a user and check timeout etc. d) Garbage collection, setting of no-cache headers. If a user is authenticated the database record of the user (array) will be set in the ->user internal variable.

Returns:
void

Definition at line 159 of file class.t3lib_userauth.php.

References $id, t3lib_div::_GET(), check_authentication(), gc(), t3lib_div::intInRange(), logoff(), and redirect().

t3lib_userAuth::unpack_uc theUC = ''  ) 
 

Sets $theUC as the internal variable ->uc IF $theUC is an array. If $theUC is false, the 'uc' content from the ->user array will be unserialized and restored in ->uc

Parameters:
mixed If an array, then set as ->uc, otherwise load from user record
Returns:
void

Definition at line 576 of file class.t3lib_userauth.php.

t3lib_userAuth::unpack_uc theUC = ''  ) 
 

Sets $theUC as the internal variable ->uc IF $theUC is an array. If $theUC is false, the 'uc' content from the ->user array will be unserialized and restored in ->uc

Parameters:
mixed If an array, then set as ->uc, otherwise load from user record
Returns:
void

Definition at line 576 of file class.t3lib_userauth.php.

Referenced by t3lib_beUserAuth::backendSetUC().

t3lib_userAuth::user_where_clause  ) 
 

This returns the where-clause needed to select the user with respect flags like deleted, hidden, starttime, endtime

Returns:
string private

Reimplemented in local_beUserAuth.

Definition at line 455 of file class.t3lib_userauth.php.

t3lib_userAuth::user_where_clause  ) 
 

This returns the where-clause needed to select the user with respect flags like deleted, hidden, starttime, endtime

Returns:
string private

Reimplemented in local_beUserAuth.

Definition at line 455 of file class.t3lib_userauth.php.

t3lib_userAuth::writelog type,
action,
error,
details_nr,
details,
data,
tablename,
recuid,
recpid
 

DUMMY: Writes to log database table (in some extension classes)

Parameters:
integer $type: denotes which module that has submitted the entry. This is the current list: 1=tce_db; 2=tce_file; 3=system (eg. sys_history save); 4=modules; 254=Personal settings changed; 255=login / out action: 1=login, 2=logout, 3=failed login (+ errorcode 3), 4=failure_warning_email sent
integer 
action
denotes which specific operation that wrote the entry (eg. 'delete', 'upload', 'update' and so on...). Specific for each
type. Also used to trigger update of the interface. (see the log-module for the meaning of each number !!)
integer $error: flag. 0 = message, 1 = error (user problem), 2 = System Error (which should not happen), 3 = security notice (admin)
integer 
details_nr
The message number. Specific for each
type and $action. in the future this will make it possible to translate errormessages to other languages
string $details: Default text that follows the message
array $data: Data that follows the log. Might be used to carry special information. If an array the first 5 entries (0-4) will be sprintf'ed the details-text...
string 
tablename
Special field used by tce_main.php. These (
tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
integer 
recuid
Special field used by tce_main.php. These (
tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
integer 
recpid
Special field used by tce_main.php. These (
tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
Returns:
void
See also:
t3lib_userauthgroup::writelog()

Definition at line 558 of file class.t3lib_userauth.php.

t3lib_userAuth::writelog type,
action,
error,
details_nr,
details,
data,
tablename,
recuid,
recpid
 

DUMMY: Writes to log database table (in some extension classes)

Parameters:
integer $type: denotes which module that has submitted the entry. This is the current list: 1=tce_db; 2=tce_file; 3=system (eg. sys_history save); 4=modules; 254=Personal settings changed; 255=login / out action: 1=login, 2=logout, 3=failed login (+ errorcode 3), 4=failure_warning_email sent
integer 
action
denotes which specific operation that wrote the entry (eg. 'delete', 'upload', 'update' and so on...). Specific for each
type. Also used to trigger update of the interface. (see the log-module for the meaning of each number !!)
integer $error: flag. 0 = message, 1 = error (user problem), 2 = System Error (which should not happen), 3 = security notice (admin)
integer 
details_nr
The message number. Specific for each
type and $action. in the future this will make it possible to translate errormessages to other languages
string $details: Default text that follows the message
array $data: Data that follows the log. Might be used to carry special information. If an array the first 5 entries (0-4) will be sprintf'ed the details-text...
string 
tablename
Special field used by tce_main.php. These (
tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
integer 
recuid
Special field used by tce_main.php. These (
tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
integer 
recpid
Special field used by tce_main.php. These (
tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
Returns:
void
See also:
t3lib_userauthgroup::writelog()

Definition at line 558 of file class.t3lib_userauth.php.

Referenced by check_authentication().

t3lib_userAuth::writeUC variable = ''  ) 
 

This writes $variable to the user-record. This is a way of providing session-data. You can fetch the data again through $this->uc in this class! If $variable is not an array, $this->uc is saved!

Parameters:
array An array you want to store for the user as session data. If $variable is not supplied (is blank string), the internal variable, ->uc, is stored by default
Returns:
void

Definition at line 535 of file class.t3lib_userauth.php.

t3lib_userAuth::writeUC variable = ''  ) 
 

This writes $variable to the user-record. This is a way of providing session-data. You can fetch the data again through $this->uc in this class! If $variable is not an array, $this->uc is saved!

Parameters:
array An array you want to store for the user as session data. If $variable is not supplied (is blank string), the internal variable, ->uc, is stored by default
Returns:
void

Definition at line 535 of file class.t3lib_userauth.php.

Referenced by t3lib_beUserAuth::backendSetUC(), and t3lib_tsfeBeUserAuth::extSaveFeAdminConfig().


Member Data Documentation

t3lib_userAuth::$enablecolumns
 

Initial value:

 Array (
                'rootLevel' => '',                      // Boolean: If true, 'AND pid=0' will be a part of the query...
                'disabled' => '',
                'starttime' => '',
                'endtime' => '',
                'deleted' => ''
        )

Reimplemented in t3lib_beUserAuth, and tslib_feUserAuth.

Definition at line 101 of file class.t3lib_userauth.php.


The documentation for this class was generated from the following files:


Généré par TYPO3 Ameos avec  doxygen 1.4.6