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

Class: libAuth

Source Location: /lib/auth.php

Class Overview


An class which groups authentication functions


Methods



Class Details

[line 28]
An class which groups authentication functions



[ Top ]


Class Methods


static method authenticate [line 40]

static string authenticate( string $username, string $password)

Generate a key code from a username and password. If the username and password do not match a notice will be displayed and the script will be stopped.



Tags:

return:  A key
access:  public


Parameters:

string   $username   A username
string   $password   The corresponding password

[ Top ]

static method is_valid_email_address [line 254]

static bool is_valid_email_address( string $email)

##################################################################################

  • The following function was originally posted at
  • http://www.iamcal.com/publish/articles/php/parsing_email/
  • RFC(2)822 Email Parser
  • By Cal Henderson <cal@iamcal.com>
  • This code is licensed under a Creative Commons Attribution-ShareAlike 2.5 License
  • http://creativecommons.org/licenses/by-sa/2.5/
  • Revision 4
  • #################################################################################




Tags:

return:  True if valid, false if invalid
access:  private


Parameters:

string   $email   The e-mail address to check

[ Top ]

static method key_check [line 81]

static int|bool key_check( string $key)

Check a given session key to see if it is valid



Tags:

return:  The user ID if valid, false if invalid
access:  private


Parameters:

string   $key   The key to check

[ Top ]

static method key_generate [line 71]

static string key_generate( int $userID)

Generate a session key for a given user ID using the config secret



Tags:

return:  A session key
access:  private


Parameters:

int   $userID   The user ID to generate for

[ Top ]

static method key_logon [line 129]

static User key_logon( string $key, [bool[optional] $session = false])

Logon as a user with a key. Display a notice and terminate if there is a problem, otherwise return a $User object corresponding to the given key.

Will also attempt to use legacy keys




Tags:

return:  A user object
access:  public


Parameters:

string   $key   The auth key (/legacy cookie)
bool[optional]   $session   Should the user be logged on only for the session true/false

[ Top ]

static method key_set [line 108]

static void key_set( int $userID, bool $session)

Generate and set an authentication cookie



Tags:

access:  private


Parameters:

int   $userID   The authenticated user ID to provide a session key for
bool   $session   True if the user should only log on for a session, false if the user should log on permeanently

[ Top ]

static method key_wipe [line 96]

static void key_wipe( )

Wipe the session keys



Tags:

access:  public


[ Top ]

static method legacy_key_check [line 181]

static int|bool legacy_key_check( string $key)

Check a given key to see if it's just an older key which can still be used and updated



Tags:

return:  The user ID if valid, false if invalid
access:  private


Parameters:

string   $key   The key to check

[ Top ]

static method validate_email [line 231]

static bool validate_email( string $email)

Validate an e-mail address by checking its MX records and its format.



Tags:

return:  True if valid, false if not valid.
access:  public


Parameters:

string   $email   The e-mail address to check

[ Top ]


Documentation generated on Thu, 13 Nov 2008 18:14:49 +0900 by phpDocumentor 1.4.1