Auth
[ class tree: Auth ] [ index: Auth ] [ all elements ]

Class: Auth_Container_DB

Source Location: /Auth-1.3.0r4/Container/DB.php

Class Overview

Auth_Container
   |
   --Auth_Container_DB

Storage driver for fetching login data from a database


Author(s):

Version:

  • $Revision: 1.52 $

Variables

Methods


Inherited Variables

Inherited Methods

Class: Auth_Container

Auth_Container::Auth_Container()
Constructor
Auth_Container::addUser()
Add a new user to the storage container
Auth_Container::changePassword()
Change password for user in the storage container
Auth_Container::fetchData()
Fetch data from storage container
Auth_Container::getCryptType()
Returns the crypt current crypt type of the container
Auth_Container::getUser()
Returns a user assoc array
Auth_Container::listUsers()
List all users that are available from the storage container
Auth_Container::removeUser()
Remove user from the storage container
Auth_Container::supportsChallengeResponse()
Returns true if the container supports Challenge Response
Auth_Container::verifyPassword()
Crypt and verfiy the entered password

Class Details

[line 35]
Storage driver for fetching login data from a database

This storage driver can use all databases which are supported by the PEAR DB abstraction layer to fetch login data.

  • Author: Martin Jansen <mj@php.net>
  • Version: $Revision: 1.52 $


[ Top ]


Class Variables

$activeUser =  ''

[line 55]

User that is currently selected from the DB.

Type:   string
Overrides:   Array


[ Top ]

$db =  null

[line 48]

DB object

Type:   object


[ Top ]

$dsn =  ''

[line 49]


Type:   mixed


[ Top ]

$options = array()

[line 42]

Additional options for the storage container

Type:   array


[ Top ]



Method Detail

Auth_Container_DB (Constructor)   [line 67]

object Returns Auth_Container_DB( string $dsn)

Constructor of the container class

Initate connection to the database via PEAR::DB

  • Return: an error object if something went wrong

Parameters:

string   $dsn   —  Connection data or DB object

[ Top ]

addUser   [line 343]

mixed addUser( string $username, string $password, [mixed $additional = ""])

Add user to the storage container
  • Return: True on success, otherwise error object
  • Access: public

Overrides Auth_Container::addUser() (Add a new user to the storage container)

Parameters:

string   $username   —  Username
string   $password   —  Password
mixed   $additional   —  Additional information that are stored in the DB

[ Top ]

changePassword   [line 415]

void changePassword( string $username, string $password)

Change password for user in the storage container

Overrides Auth_Container::changePassword() (Change password for user in the storage container)

Parameters:

string   $username   —  Username
string   $password   —  The new password (plain text)

[ Top ]

fetchData   [line 216]

mixed fetchData( string $username, string $password, [boolean $isChallengeResponse = false])

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.

  • Return: Error object or boolean

Overrides Auth_Container::fetchData() (Fetch data from storage container)

Parameters:

string   $username   —  Username
string   $password   —  Password
boolean   $isChallengeResponse   —  If true password is secured using a md5 hash the frontend and auth are responsible for making sure the container supports challenge response password authentication

[ Top ]

getCryptType   [line 459]

void getCryptType( )

Returns the selected crypt type for this container

Overrides Auth_Container::getCryptType() (Returns the crypt current crypt type of the container)
[ Top ]

listUsers   [line 300]

mixed listUsers( )

Returns a list of users from the container
  • Access: public

Overrides Auth_Container::listUsers() (List all users that are available from the storage container)
[ Top ]

query   [line 151]

mixed query( string $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.

  • Return: a DB_result object or DB_OK on success, a DB or PEAR error on failure
  • Access: public

Parameters:

string   $query   —  Query string

[ Top ]

removeUser   [line 392]

mixed removeUser( string $username)

Remove user from the storage container
  • Return: True on success, otherwise error object
  • Access: public

Overrides Auth_Container::removeUser() (Remove user from the storage container)

Parameters:

string   $username   —  Username

[ Top ]

supportsChallengeResponse   [line 451]

bool supportsChallengeResponse( )

Determine if this container supports password authentication with challenge response
  • Access: public

Overrides Auth_Container::supportsChallengeResponse() (Returns true if the container supports Challenge Response)
[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:36:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.