Class AutoLogin
- TableAccess
- AutoLogin
License: GNU General Public License v2.0 only **********************************************************************************************
Brief:
Handle auto login with Admidio and manage it in the database
The class search in the database table @b adm_auto_login for the session id. If there is an entry for that id then it reads the user id and set this user to the current session. Now the current session has become a valid user that is automatically login.
Class: AutoLogin
Code:
// create a valid user login for a Admidio session from auto login $autoLogin = new AutoLogin($gDb, $gSessionId); $autoLogin->setValidLogin($gCurrentSession, $_COOKIE['ADMIDIO_ID']);@endcode
Code:
// delete an auto login $autoLogin = new AutoLogin($gDb, $gSessionId); $autoLogin->delete(); @endcode
Par: Examples
Located at autologin.php
Methods summary
public
|
#
__construct(
Constructor that will create an object of a recordset of the table adm_auto_login. If the id is set than the specific auto login will be loaded. |
public
string
|
|
public
boolean
|
#
save( boolean $updateFingerPrint = true )
Save all changed columns of the recordset in table of database. Therefore the class remembers if it's a new record or if only an update is necessary. The update statement will only update the changed columns. If the table has columns for creator or editor than these column with their timestamp will be updated. The current organization, last login and ip adress will be set per default. |
public
|
#
tableCleanup( )
Method will clean the database table @b adm_auto_login. All login that had their last login one year ago will be deleted. All counted wrong auto login ids from this user will be reset. |
Methods inherited from TableAccess
__sleep()
,
clear()
,
connectAdditionalTable()
,
countAllRecords()
,
delete()
,
getValue()
,
hasColumnsValueChanged()
,
isNewRecord()
,
readData()
,
readDataByColumns()
,
readDataById()
,
setArray()
,
setDatabase()
,
setValue()
Properties summary
Properties inherited from TableAccess
$additionalTables
,
$columnPrefix
,
$columnsInfos
,
$columnsValueChanged
,
$db
,
$dbColumns
,
$keyColumnName
,
$new_record
,
$tableName