Sitellite Application Framework
Class Tree         Index         All Elements

Class: SessionSource_Database

Source Location: Program_Root/Session/Source/Database.php

Class Overview

SessionSource
   |
   --SessionSource_Database

This is the Database source driver package for saf.Session.


Author(s)

Version

  • 1.2, 2003-04-23, $Id: Database.php,v 1.3 2005/08/23 06:21:23 lux Exp $

Copyright

  • Copyright (C) 2001-2003, Simian Systems Inc.

Variables

Methods


Inherited Variables

Inherited Methods

Class: SessionSource

SessionSource::SessionSource()
Constructor method.
SessionSource::add()
Adds a new user.
SessionSource::authorize()
Authorizes the user against the data source.
SessionSource::close()
Closes the session with the source.
SessionSource::delete()
Removes the specified user.
SessionSource::getActive()
Retrieves the total number of active (ie. currently logged in) users.
SessionSource::getList()
Retrieves a list of users.
SessionSource::getRole()
Returns the role of the current user.
SessionSource::getTeam()
Returns the team of the current user.
SessionSource::getTeams()
Returns the list of teams whose documents are accessible by the current user.
SessionSource::getTotal()
Retrieves the total number of users. $role and $team allow you to retrieve a total for specific roles and teams. $public allows you to specify whether to limit it to public users or not.
SessionSource::getUser()
Retrieves a user by their username. Returns all of the user's data as an object.
SessionSource::getUserByEmail()
Retrieves a user by their email address. Returns just the username.
SessionSource::isDisabled()
Returns the whether or not the current user account is disabled.
SessionSource::isValidKey()
Determines whether the specified verification key is valid.
SessionSource::setProperties()
Sets the properties of this object.
SessionSource::update()
Updates the data of the specified user.

Class Details

[line 62]
This is the Database source driver package for saf.Session.

New in 1.2:

  • Added the getRole(), getTeam(), and isDisabled() methods.
  • Added an $encryptionMethod property that allows the method of password encryption to be changed.
  • Added the $rolecolumn, $teamcolumn, and $disabledcolumn properties.

1 <?php
2
3 $s = new SessionSource_Database;
4
5 $s->setProperties (array (
6 'foo' => 'bar',
7 ));
8
9 if ($s->authorize ($user, $pass, $id)) {
10 // in
11 } else {
12 // out
13 }
14
15 ? >




Tags:

access:  public
version:  1.2, 2003-04-23, $Id: Database.php,v 1.3 2005/08/23 06:21:23 lux Exp $
license:  http://www.sitellite.org/index/license
copyright:  Copyright (C) 2001-2003, Simian Systems Inc.
author:  John Luxford <mailto:lux@simian.ca>


[ Top ]


Class Variables

$disabledcolumn =  'disabled'

[line 144]

The name of the disabled column in the database.

Defaults to 'disabled'.




Tags:

access:  public

Type:   mixed


[ Top ]

$encryptionMethod =  'better_crypt_compare'

[line 169]

The method to use to compare the password to the

encrypted copy from the source. Defaults to 'better_crypt_compare', which uses a modification of the crypt() function. $encryptionMethod must be any valid value that can be passed as a first parameter to the call_user_func() PHP function. The specified function must accept the challenging password as a first parameter, and the source password as a second. This makes it easy to write alternate encryption methods, such as MD5.




Tags:

access:  public

Type:   mixed


[ Top ]

$passwordcolumn =  'password'

[line 90]

The name of the password column in the database.

Defaults to 'password'.




Tags:

access:  public

Type:   mixed


[ Top ]

$publiccolumn =  'public'

[line 153]

The name of the public column in the database.

Defaults to 'public'.




Tags:

access:  public

Type:   mixed


[ Top ]

$rolecolumn =  'role'

[line 117]

The name of the role column in the database.

Defaults to 'role'.




Tags:

access:  public

Type:   mixed


[ Top ]

$sessionidcolumn =  'session_id'

[line 99]

The name of the session id column in the database.

Defaults to 'session_id'.




Tags:

access:  public

Type:   mixed


[ Top ]

$tablename =  'sitellite_user'

[line 72]

The name of the database table that contains the users.

Defaults to 'sitellite_user'.




Tags:

access:  public

Type:   mixed


[ Top ]

$teamcolumn =  'team'

[line 126]

The name of the team column in the database.

Defaults to 'team'.




Tags:

access:  public

Type:   mixed


[ Top ]

$teamscolumn =  'teams'

[line 135]

The name of the teams column in the database.

Defaults to 'team'.




Tags:

access:  public

Type:   mixed


[ Top ]

$timeoutcolumn =  'expires'

[line 108]

The name of the timeout column in the database.

Defaults to 'expires'.




Tags:

access:  public

Type:   mixed


[ Top ]

$usernamecolumn =  'username'

[line 81]

The name of the username column in the database.

Defaults to 'username'.




Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


method add [line 436]

void add( mixed $data)

Adds a new user.



Tags:

access:  public


Overrides SessionSource::add() (Adds a new user.)

[ Top ]

method authorize [line 181]

boolean authorize( string $username, string $password, string $id)

Authorizes the user against the database.



Tags:

access:  public


Overrides SessionSource::authorize() (Authorizes the user against the data source.)

Parameters:

string   $username  
string   $password  
string   $id  

[ Top ]

method close [line 305]

void close( )

Closes the session with the source. In this case, explicitly removes the user's session info from the database.



Tags:

access:  public


Overrides SessionSource::close() (Closes the session with the source.)

[ Top ]

method delete [line 525]

void delete( mixed $user)

Removes the specified user.



Tags:

access:  public


Overrides SessionSource::delete() (Removes the specified user.)

[ Top ]

method getActive [line 579]

void getActive( )

Retrieves the total number of active (ie. currently logged in) users.



Tags:

access:  public


Overrides SessionSource::getActive() (Retrieves the total number of active (ie. currently logged in) users.)

[ Top ]

method getList [line 592]

void getList( mixed $offset, mixed $limit, mixed $order, mixed $ascdesc, mixed $role, mixed $team, mixed $name, mixed $disabled, mixed $public, mixed $teams)

Retrieves a list of users.



Tags:

access:  public


Overrides SessionSource::getList() (Retrieves a list of users.)

[ Top ]

method getRole [line 337]

void getRole( )

Returns the role of the current user.



Tags:

access:  public


Overrides SessionSource::getRole() (Returns the role of the current user.)

[ Top ]

method getTeam [line 351]

void getTeam( )

Returns the team of the current user.



Tags:

access:  public


Overrides SessionSource::getTeam() (Returns the team of the current user.)

[ Top ]

method getTeams [line 366]

void getTeams( )

Returns the list of teams whose documents are accessible by the current user.



Tags:

access:  public


Overrides SessionSource::getTeams() (Returns the list of teams whose documents are accessible by the current user.)

[ Top ]

method getTotal [line 548]

void getTotal( mixed $role, mixed $team, mixed $public)

Retrieves the total number of users. $role and $team allow you to retrieve a total for specific roles and teams.



Tags:

access:  public


Overrides SessionSource::getTotal() (Retrieves the total number of users. $role and $team allow you to retrieve a total for specific roles and teams. $public allows you to specify whether to limit it to public users or not.)

[ Top ]

method getUser [line 397]

void getUser( mixed $user)

Retrieves a user by their username.



Tags:

access:  public


Overrides SessionSource::getUser() (Retrieves a user by their username. Returns all of the user's data as an object.)

[ Top ]

method getUserByEmail [line 407]

void getUserByEmail( mixed $email)

Retrieves a user by their email address.



Tags:

access:  public


Overrides SessionSource::getUserByEmail() (Retrieves a user by their email address. Returns just the username.)

[ Top ]

method isDisabled [line 381]

void isDisabled( )

Returns the whether or not the current user account is disabled.



Tags:

access:  public


Overrides SessionSource::isDisabled() (Returns the whether or not the current user account is disabled.)

[ Top ]

method isValidKey [line 417]

void isValidKey( mixed $user, mixed $key)

Determines whether the specified verification key is valid.



Tags:

access:  public


Overrides SessionSource::isValidKey() (Determines whether the specified verification key is valid.)

[ Top ]

method update [line 483]

void update( mixed $data, mixed $user)

Updates the data of the specified user.



Tags:

access:  public


Overrides SessionSource::update() (Updates the data of the specified user.)

[ Top ]


Copyright © 2007, SIMIAN systems Inc.
All rights reserved. Privacy policy
Documentation generated on Tue, 13 Feb 2007 17:17:10 -0600 by Sitellite AppDoc and phpDocumentor 1.2.2