go-basic
[ class tree: go-basic ] [ index: go-basic ] [ all elements ]

Class: GO_AUTH

Source Location: /classes/base/auth.class.inc.php

Class Overview

base_db
   |
   --db
      |
      --GO_AUTH

Implementation of GroupOffice Authentication. This class provides the login-function for the Group-Office SQL database, which is the default authentication mechanism.


Author(s):

Version:

  • $Id: auth.class.inc.php 1225 2008-10-25 12:30:46Z mschering $

Methods


Inherited Variables

Inherited Methods

Class: db

db::affected_rows()
Gets the number of affected rows in a previous MySQL operatio
db::connect()
Connnects to the database
db::escape()
Escapes a value to make it safe to send to MySQL
db::found_rows()
Returns the number of rows found when you have used SELECT SQL_CALC_FOUND_ROWS
db::free()
Frees the memory associated with a result
db::insert_id()
Returns the auto generated id used in the last query
db::next_record()
Walk the result set from a select query
db::num_fields()
Get the number of fields in a result
db::num_rows()
Return the number of rows found in the last select statement
db::query()
Queries the database
db::set_error()
Sets the error and errno property
db::__wakeup()
When this object is stored in a session it must reconnect when created by the session again.

Class: base_db

base_db::__construct()
Constructor a config object with db_host, db_pass, db_user and db_name may be passed so it can connect to a different database then the default.
base_db::affected_rows()
Gets the number of affected rows in a previous MySQL operatio
base_db::connect()
Connnects to the database
base_db::escape()
Escapes a value to make it safe to send to MySQL
base_db::f()
Fetch a single field from a result record
base_db::found_rows()
Returns the number of rows found when you have used SELECT SQL_CALC_FOUND_ROWS
base_db::free()
Frees the memory associated with a result
base_db::halt()
Halts when an error occurs
base_db::insert_id()
Returns the auto generated id used in the last query
base_db::insert_row()
Inserts a row in a table
base_db::lock()
Lock a table
base_db::nextid()
Get a next unique ID for a table. Used instead of auto increment so that we have better support for different database backends.
base_db::next_record()
Walk the reseult set from a select query
base_db::num_fields()
Get the number of fields in a result
base_db::num_rows()
Return the number of rows found in the last select statement
base_db::p()
Print a single field from a result record.
base_db::query()
Queries the database
base_db::replace_row()
Replaces a row in a table
base_db::set_config()
Set's the connection parameters. A config object with db_host, db_pass, db_user and db_name may be passed so it can connect to a different database then the default.
base_db::set_error()
Sets the error and errno property
base_db::set_parameters()
Set the connection parameters manually
base_db::unlock()
Unlock tables
base_db::update_row()
Updates a row from a table

Class Details

[line 27]
Implementation of GroupOffice Authentication. This class provides the login-function for the Group-Office SQL database, which is the default authentication mechanism.

Tags:

author:  Merijn Schering <mschering@intermesh.nl>
version:  $Id: auth.class.inc.php 1225 2008-10-25 12:30:46Z mschering $
since:  Group-Office 2.17


[ Top ]


Class Methods


constructor __construct [line 30]

GO_AUTH __construct( )

Tags:

access:  public
Overrides base_db::__construct() (Constructor a config object with db_host, db_pass, db_user and db_name may be passed so it can connect to a different database then the default.)
[ Top ]

method is_enabled [line 294]

bool is_enabled( int $user_id)

Check if a given user is enabled.

This function checks, if a given user is enabled (allowed to login) and return a regarding boolean value.

Tags:

return:  true if the user is enabled, false otherwise.
access:  public

Parameters:

int   $user_id   is the userid number the function should check.

[ Top ]

method login [line 226]

bool login( string $username, string $password, [array $params = array()])

This function logs a user in

This function tries to authenticate a given username against the used authentication backend (using the authenticate() function of the active backend - that means from the used child class from this class). The authentication may have two results: successful or failed: * failed: when the authentication was not possible (the reason doesn't matter), this method returns false to indicate the failure. * successful: when the authentication was successful, the method checks if the authenticated user exists in the currently used user management database. If the user doesn't exist there, it is added.

When the user exists in the user management database from the beginning, the method checks if the account is enabled.

Only when the account is in the user management database and is enabled, then the user is registered in the session (using the updateAfterLogin() method) and the function will return true to indicate that the login was successful.

Tags:

return:  true if the login was possible, false otherwise.
access:  public

Parameters:

string   $username  
string   $password  
array   $params   The authentication source specified in auth_sources.inc

[ Top ]


Documentation generated on Thu, 30 Oct 2008 14:13:22 +0100 by phpDocumentor 1.4.0