User management for the world wide web

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

GenieGate_UserAccount Class Reference

This is the logic class for user accounts. More...

List of all members.

Public Member Functions

 GenieGate_UserAccount (&$dbh)
 Constructor.

 addListener (&$listener)
 Add a listener.

 createUserAccount (&$fields, &$mview)
 Creates user account.

 createConfirmedUserAccount (&$fields)
 Like createUserAccount except that it will confirm it automatically.

 updateUserAccount ($uid, &$fields)
 Update the user info.

 getUserStats ()
 Obtain statistics from the database.

 scanUsers ($keyword)
 Does a general scan of useful fields in users.

 searchUsers ($email, $name, $from, $to)
 Search users.

 removeUser ($uid, $password="", $confirm=TRUE)
 This function removes the user.

 confirmUserAccount ($uid, $conf_no)
 Update the users account.

 expungeNonConfirmed ($all=FALSE)
 Remove all members who have not confirmed their email address.

 fireSetupUserAccount (&$fields, $conf_id)
 fire the setupUser() method on all the listeners.

 fireRemoveUser ($uid, &$fields)
 Fire off the remove user.

 firePreConfirmUserAccount (&$fields, $conf_id, &$errors)
 fire the preConfirm() method on all listeners.

 fireCheckUserAccount (&$fields, &$errors)
 Fire the preCheck() method on all the listeners.

 checkNewUserFields (&$fields, $is_new=TRUE)
 Checks $fields for any errors.

 lookupUid ($uid)
 Look up the given user ID.

 lookupEmail ($email)
 Checks to see if the given email address exists, returns fields.


Public Attributes

 $DBH
 mysql database link.


Detailed Description

This is the logic class for user accounts.

Definition at line 6 of file UserAccount.php.


Constructor & Destructor Documentation

GenieGate_UserAccount &$  dbh  ) 
 

Constructor.

Parameters:
$dbh - The database link.

Definition at line 20 of file UserAccount.php.


Member Function Documentation

addListener &$  listener  ) 
 

Add a listener.

This (and the other listeners) are used for the plugins.

Parameters:
$listener - Object that extends GenieGate_Api_Plugin

Definition at line 30 of file UserAccount.php.

checkNewUserFields &$  fields,
is_new = TRUE
 

Checks $fields for any errors.

Parameters:
$fields - Fields of this user.
$is_new - Does special checks for new accounts.
Returns:
An array of errors.

Definition at line 320 of file UserAccount.php.

References lookupEmail(), and lookupUid().

Referenced by createConfirmedUserAccount(), and createUserAccount().

confirmUserAccount uid,
conf_no
 

Update the users account.

This sets the flag that states the email address has been confirmed.

Parameters:
$uid - The user ID.
$conf_no - The confirmation number that was emailed to them.
Returns:
A list of error messages, (if empty, there were no errors)

Definition at line 231 of file UserAccount.php.

References firePreConfirmUserAccount(), fireSetupUserAccount(), and lookupUid().

createConfirmedUserAccount &$  fields  ) 
 

Like createUserAccount except that it will confirm it automatically.

(Since there are problems with passing FALSE by reference in createUserAccount())

Parameters:
&$fields - associative array of fields.
Returns:
list of errors (if any)

Definition at line 81 of file UserAccount.php.

References checkNewUserFields(), fireCheckUserAccount(), and fireSetupUserAccount().

createUserAccount &$  fields,
&$  mview
 

Creates user account.

Parameters:
$fields - The database fields to use.
$mview - View to set parameters on (Confirmation code)
Returns:
- List of error messages. (if any)

Definition at line 42 of file UserAccount.php.

References checkNewUserFields(), fireCheckUserAccount(), and fireSetupUserAccount().

expungeNonConfirmed all = FALSE  ) 
 

Remove all members who have not confirmed their email address.

New signups that have not confirmed their email address are removed (except for members who are signing up today)

Optional $all parameter says to expunge ALL non-cirmed accounts, (including people who are in the process of signing up)

Parameters:
$all - Whether or not to remove all unconfirmed accounts.

Definition at line 266 of file UserAccount.php.

getUserStats  ) 
 

Obtain statistics from the database.

Keys are: signup_newest, signup_oldest, total_users, registered_users

Returns:
associative array of statistics.

Definition at line 128 of file UserAccount.php.

lookupEmail email  ) 
 

Checks to see if the given email address exists, returns fields.

Parameters:
$email - Email address of user to lookup.
Returns:
User info, same as lookupUid($uid)
See also:
lookupUid($uid)

Definition at line 376 of file UserAccount.php.

Referenced by checkNewUserFields().

lookupUid uid  ) 
 

Look up the given user ID.

See also:
lookupEmail($email)
Parameters:
$uid - The User ID.
Returns:
The info for the user. (associative array)

Definition at line 356 of file UserAccount.php.

Referenced by checkNewUserFields(), confirmUserAccount(), removeUser(), and updateUserAccount().

removeUser uid,
password = "",
confirm = TRUE
 

This function removes the user.

Parameters:
$uid - The user ID.
$password - The users password.
$confirm - TRUE or FALSE, if TRUE, users password is checked to ensure it's OK to remove.
Returns:
TRUE if user removed, FALSE if there was an error.

Definition at line 207 of file UserAccount.php.

References fireRemoveUser(), and lookupUid().

scanUsers keyword  ) 
 

Does a general scan of useful fields in users.

Parameters:
$keyword - Keyword to use. (allows wildcard *)
Returns:
an array of associative arrays with the search results.

Definition at line 151 of file UserAccount.php.

searchUsers email,
name,
from,
to
 

Search users.

This is similiar to scanUsers() except the start/end dates are allowed, and it does a search on the individual email, name fields.

Parameters:
$email - Keywords for email address.
$name - Name to search for.
$from - Starting date.
$to - Ending date.
Returns:
an array of associative arrays containing the user info.

Definition at line 179 of file UserAccount.php.

updateUserAccount uid,
&$  fields
 

Update the user info.

Parameters:
$uid - the UserID
$fields - the user information.

Definition at line 107 of file UserAccount.php.

References lookupUid().


The documentation for this class was generated from the following file:
DoxyGen Documentation generated by DoxyGen