Documentation » API Reference

Application:

Class: SessionSource_Database extends SessionSource



Properties


$access = array ()


$status = array ()


$roles = array ()


$teams = array ()


$resources = array ()


$user = array ()


$prefs = array ()


$_prefs = array ()


$path


$realm


$cancelmessage 'You do not have permission to access this resource.'


$cookiename 'sitellite_session_id'

  • Access: public

Name of the cookie. Defaults to 'sitellite_session_id'.


$cookieexpires 0

  • Access: public

Expiration of cookie. Defaults to 0, which means the cookie
will expire when the browser closes.


$cookiedomain

  • Access: public

Domain value of the cookie.


$cookiepath '/'

  • Access: public

Path value of the cookie. Defaults to '/'.


$cookiesecure 0

  • Access: public

Secure value of the cookie. May be 1 or 0, and defaults to 0.


$usernamefield 'username'

  • Access: public

The name of the username field in the form (uses saf.MailForm)
created by sendAuthRequest(). Defaults to 'username'.


$passwordfield 'password'

  • Access: public

The name of the password field in the form
created by sendAuthRequest(). Defaults to 'password'.


$hiddenfields = array ()

  • Access: public

A list of hidden form fields and their values.


$usernametext 'Username'

  • Access: public

The alt text of the username field in the form
created by sendAuthRequest(). Defaults to 'Username'.


$passwordtext 'Password'

  • Access: public

The alt text of the password field in the form
created by sendAuthRequest(). Defaults to 'Password'.


$submittext 'Sign In'

  • Access: public

The alt text of the submit button in the form
created by sendAuthRequest(). Defaults to 'Sign In'.


$formtemplate false

  • Access: public

The template of the form created by sendAuthRequest().
Defaults to false (no template).


$usernamerules = array ()

  • Access: public

A list of rules for the username form field. The keys are
the rules and the values are the invalid messages.


$passwordrules = array ()

  • Access: public

A list of rules for the password form field. The keys are
the rules and the values are the invalid messages.


$formmessage 'Please enter your username and password.'

  • Access: public

The welcome message of the form. Defaults to
'Please enter your username and password.'


$invalidmessage 'Sorry, the password you specified was invalid. Please try again.'

  • Access: public

The invalid message of the form. Defaults to
'Sorry, the password you specified was invalid. Please try again.'


$timeoutmessage 'Sorry, your session has timed out.  Please sign in again to continue.'

  • Access: public

The timeout message of the form. Defaults to
'Sorry, your session has timed out. Please sign in again to continue.'


$sessObj

  • Access: public

A reference to the main session object, in case it's
needed by a specific handler.


$error false

  • Access: public

Contains the error message if any error occurs within
this class, the handler or the source drivers, or false if no
error has occurred.


$total

Number of users.


$dir 'inc/conf/auth/roles'

Directory to store info.


$data = array ()

Parsed data from file.


$file 'inc/conf/auth/resources/index.php'

File to store resource info.


$id

  • Access: public

The session id value.


$valid false

  • Access: public

Says whether this session is valid.


$username

  • Access: public

Contains the username of the user.


$password

  • Access: public

Contains the password of the user.


$useID true

  • Access: public

Specifies whether or not to use a session id. Some handlers or
sources may not support session ids (ie. the Basic handler), and so they
may be disabled.


$timeout 3600

  • Access: public

Specifies a length in seconds that the session may be inactive
for before automatically logging the user out. This is also optional,
as some handlers or sources may not support it.


$autoSave true

  • Access: public

Specifies whether calls to set() should also call save()
automatically. Defaults to true, since for most intents and purposes
this is a nice way of not having to think about it.


$handler

  • Access: public

The handler driver object.


$source

  • Access: public

The source driver object.


$store

  • Access: public

The store driver object.


$tablename 'sitellite_user'

  • Access: public

The name of the database table that contains the users.
Defaults to 'sitellite_user'.


$usernamecolumn 'username'

  • Access: public

The name of the username column in the database.
Defaults to 'username'.


$passwordcolumn 'password'

  • Access: public

The name of the password column in the database.
Defaults to 'password'.


$sessionidcolumn 'session_id'

  • Access: public

The name of the session id column in the database.
Defaults to 'session_id'.


$timeoutcolumn 'expires'

  • Access: public

The name of the timeout column in the database.
Defaults to 'expires'.


$rolecolumn 'role'

  • Access: public

The name of the role column in the database.
Defaults to 'role'.


$teamcolumn 'team'

  • Access: public

The name of the team column in the database.
Defaults to 'team'.


$teamscolumn 'teams'

  • Access: public

The name of the teams column in the database.
Defaults to 'team'.


$disabledcolumn 'disabled'

  • Access: public

The name of the disabled column in the database.
Defaults to 'disabled'.


$publiccolumn 'public'

  • Access: public

The name of the public column in the database.
Defaults to 'public'.


$encryptionMethod 'better_crypt_compare'

  • Access: public

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.

Return to Top



Methods


authorize ($username$password$id

  • Access: public
  • Return: boolean

Authorizes the user against the database.


close () 

  • Access: public

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


getRole () 

  • Access: public

Returns the role of the current user.


getTeam () 

  • Access: public

Returns the team of the current user.


getTeams () 

  • Access: public

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


isDisabled () 

  • Access: public

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


getUser ($user

  • Access: public

Retrieves a user by their username.


getUserByEmail ($email

  • Access: public

Retrieves a user by their email address.


isValidKey ($user$key

  • Access: public

Determines whether the specified verification key is valid.


add ($data

  • Access: public

Adds a new user.


_add ($data

  • Access: private

Joins the list of data into a piece of SQL.


update ($data$user

  • Access: public

Updates the data of the specified user.


_update ($data

  • Access: private

Joins the list of data into a piece of SQL.


delete ($user

  • Access: public

Removes the specified user.


getTotal ($role$team$public

  • Access: public

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


getActive () 

  • Access: public

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


getList ($offset$limit$order$ascdesc$role$team$name$disabled$public$teams

  • Access: public

Retrieves a list of users.

Return to Top