TYPO3 CMS  TYPO3_7-6
Auth_Container_ADOdb Class Reference
Inheritance diagram for Auth_Container_ADOdb:

Public Member Functions

 __construct ($dsn)
 
 _connect ($dsn)
 
 _prepare ()
 
 query ($query)
 
 _setDefaults ()
 
 _parseOptions ($array)
 
 fetchData ($username, $password)
 
 listUsers ()
 
 addUser ($username, $password, $additional="")
 
 removeUser ($username)
 

Public Attributes

 $options = array()
 
 $db = null
 
 $dsn = ''
 
 $activeUser = ''
 

Detailed Description

Definition at line 34 of file ADOdb.php.

Constructor & Destructor Documentation

◆ __construct()

Auth_Container_ADOdb::__construct (   $dsn)

Constructor of the container class

Initate connection to the database via PEAR::ADOdb

Parameters
stringConnection data or DB object
Returns
object Returns an error object if something went wrong

Definition at line 66 of file ADOdb.php.

References $dsn, _parseOptions(), and _setDefaults().

Member Function Documentation

◆ _connect()

Auth_Container_ADOdb::_connect (   $dsn)

Connect to database by using the given DSN string

private

Parameters
stringDSN string
Returns
mixed Object on error, otherwise bool

Definition at line 92 of file ADOdb.php.

Referenced by _prepare().

◆ _parseOptions()

Auth_Container_ADOdb::_parseOptions (   $array)

Parse options passed to the container class

private

Parameters
array

Definition at line 191 of file ADOdb.php.

Referenced by __construct().

◆ _prepare()

Auth_Container_ADOdb::_prepare ( )

Prepare database connection

This function checks if we have already opened a connection to the database. If that's not the case, a new connection is opened.

private

Returns
mixed True or a DB error object.

Definition at line 130 of file ADOdb.php.

References _connect().

Referenced by fetchData(), listUsers(), and query().

◆ _setDefaults()

Auth_Container_ADOdb::_setDefaults ( )

Set some default options

private

Returns
void

Definition at line 171 of file ADOdb.php.

Referenced by __construct().

◆ addUser()

Auth_Container_ADOdb::addUser (   $username,
  $password,
  $additional = "" 
)

Add user to the storage container

public

Parameters
stringUsername
stringPassword
mixedAdditional information that are stored in the DB
Returns
mixed True on success, otherwise error object

Definition at line 330 of file ADOdb.php.

References DB\isError(), and query().

◆ fetchData()

Auth_Container_ADOdb::fetchData (   $username,
  $password 
)

Get user information from database

This function uses the given username to fetch the corresponding login data from the database table. If an account that matches the passed username and password is found, the function returns true. Otherwise it returns false.

Parameters
stringUsername
stringPassword
Returns
mixed Error object or boolean

Definition at line 224 of file ADOdb.php.

References _prepare(), and DB\isError().

◆ listUsers()

Auth_Container_ADOdb::listUsers ( )

Definition at line 283 of file ADOdb.php.

References _prepare(), and DB\isError().

◆ query()

Auth_Container_ADOdb::query (   $query)

Prepare query to the database

This function checks if we have already opened a connection to the database. If that's not the case, a new connection is opened. After that the query is passed to the database.

public

Parameters
stringQuery string
Returns
mixed a DB_result object or DB_OK on success, a DB or PEAR error on failure

Definition at line 153 of file ADOdb.php.

References _prepare().

Referenced by addUser(), and removeUser().

◆ removeUser()

Auth_Container_ADOdb::removeUser (   $username)

Remove user from the storage container

public

Parameters
stringUsername
Returns
mixed True on success, otherwise error object

Definition at line 378 of file ADOdb.php.

References DB\isError(), and query().

Member Data Documentation

◆ $activeUser

Auth_Container_ADOdb::$activeUser = ''

Definition at line 54 of file ADOdb.php.

◆ $db

Auth_Container_ADOdb::$db = null

Definition at line 47 of file ADOdb.php.

◆ $dsn

Auth_Container_ADOdb::$dsn = ''

Definition at line 48 of file ADOdb.php.

Referenced by __construct().

◆ $options

Auth_Container_ADOdb::$options = array()

Definition at line 41 of file ADOdb.php.