Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

BaseUser Class Reference
[Base Objects]

Inheritance diagram for BaseUser:

MyObject BaseObject MyModule BaseModule List of all members.

Detailed Description

BaseUser is a class that handles the basics (and advanced's) of having users on your site.

BaseUser does a whole heck of a lot of things. It provides functions to handles users associated with a database. Additionally, it provides hooks to determine if the user is an admin, handles logins, authentication, logouts, password creation, registration, lost passwords, profiles, email prefs, account prefs, confirmation/activation, and much more.

Definition at line 12 of file base-user.inc.php.

Public Member Functions

 __construct ($data=null, $table= 'users')
 Our constructor.
 isAdmin ()
 are we an admin or not?
 initLoginPage ()
 Initialize our login page...
 initViewPage ()
 initialize our view page...
 drawLoginPage ()
 draw our login page (form and links to register / lost pass)
 processLoginForm ($form)
 process our login form.
 createLoginForm ($redirect=null)
 create our login form.
 initLogoutPage ()
 init our logout page.
 drawLogoutPage ()
 placeholder for drawlogout
 initRegisterPage ()
 Inits our registration page.
 createRegisterForm ()
 Create our registration form.
 drawRegisterPage ()
 draw our registration page.
 accountExists ($email)
 checks to see if an account exists.
 initEditPage ()
 init our edit page.
 editFormValidate ($form)
 validate our edit form.
 editFormAddFields ($form)
 adds fields to edit form.
 editPagePostSaveSync ($form)
 syncs our edit form.
 canEdit ()
 who can edit...
 initLostPassPage ()
 init our lost password page.
 createLostPassForm ()
 create our lost pass form...
 drawLostpassPage ()
 draw and handle lost pass form.
 createEditPassForm ()
 create our edit pass form.
 initEditPassPage ()
 our edit pass page...
 drawEditPassPage ()
 draw and parse our edit pass page.
 emailPassChanged ()
 Email the user to let them know that they (or someone) changed their password.
 authenticate ($username=null, $password=null, $rememberMe=null)
 our authentication function!!!
 tryAuthCode ($code, $checkCache=true)
 this function takes an auth code and verifies that it is valid for that user.
 generateHash ()
 this function generates a hash thats unique for each user.
 loginProcess ($user, $pass, $rememberMe=true)
 attempt to log a user in!
 doLogin ($rememberMe=true, $login=true)
 this function actually logs in a user...
 createSession ($login=false)
 (re)create our user session.
 logoutProcess ()
 fully destroy the users session...
 confirmUser ()
 confirm that the user is legitimate.
 mail ($subject, $body, $html=null)
 email the user a message.
 addAlert ($url, $text)
 add an alert to the user
 requestPassReset ($email)
 initiate a password reset request
 tryPassReset ()
 attempt to reset our pass.
 isMe ()
 determines if a user object is $me, the logged in user.
 getPagesXml ()
 add in our user pages:
 initPrefsPage ()
 initialize our prefs page...
 drawPrefsPage ()
 draw our prefs page...
 initEmailPrefsPage ()
 initialize our email prefs page.
 drawEmailPrefsPage ()
 draws and handles our form.
 createEmailPrefsForm ()
 creates our email prefs Form.
 emailPrefsFormAddFields ($form)
 adds the fields in that BaseUser uses...
 saveEmailPrefs ($form)
 save our email prefs.
 getLastLogin ()
 get the date of our last login.
 getMemberSince ()
 get the date we registered.
 drawActivatePage ()
 draw our activation page.
 initActivateHelpPage ()
 initialize our activation help page.
 drawActivateHelpPage ()
 draw and parse our activation help page.
 createActivateHelpForm ()
 create our account activation help form.
 sendActivationEmail ()
 send activation email to user.
 drawDeletePage ()
 draw our delete page.
 createDeleteForm ()
 create the confirmation delete form
 initDeleteMePage ()
 This is the page to really delete your account.
 drawDeleteMePage ()
 do our delete me page.
 canDelete ()
 can we delete the user? only admins or me can.
 getTicket ($url, $html=null)
 get this user a ticket to automatically login.
 formatDate ($date)
 format a date nicely.
 formatDateTime ($date)
 format our datetime stamp nicely
 getPublicData ()
 gets our public data.
 getName ($link=false, $icon=null)
 get the name of the user.
 getTextName ()
 get the user's name as text for BaseUser::getName()
 getIcon ($type= 'tiny')
 get our user icon.
 lookupData ($deep=true)
 lookup our data.
 getDataToCache ($deep=true)
 get data for caching.
 setDataFromCache ($data, $deep=true)
 set data from cache
 setProfileImage ($imageId)
 set our profile image
 initSetImagePage ()
 prep our set image page
 drawSetImagePage ()
 do/draw our set image page
 getCreateFieldsArray ()
 get an array of fields in the table that stores the users
 getCreateIndexesArray ()
 get an array of indexes on fields in the users table

Static Public Member Functions

 makePassword ($len=8)
 Creates a pronounceable random password.

Public Attributes

 $their
 the english word for their.
 $pronoun
 the english pronoun for the person.
 $profileImage = null
 our profile image object

Static Public Attributes

 $authCacheLife = 86400
 how long to cache their auth stuff for...

Protected Member Functions

 loginFormAddUsernameField ($form)
 add the username to the login form.
 registerFormAddFields ($form)
 add fields to the register form.
 validateRegistration ($form)
 validate the registration form
 usernameExists ($username)
 determine if the username is unique
 registrationPostSuccess ($form)
 do our post processing after successful registration.
 checkAuthCache ($code)
 this function checks our cache system for the user.
 getAuthWhereSql ($user, $pass)
 get extra sql for authorization.
 updateSession ()
 this is where you should do any sort of stuff you want recreated or saved when BaseUser::createSession is called.
 saveSession ()
 this saves our session to cache.
 deletePost ()
 draw the delete post page.
 emailDeleteConfirmation ()
 email the delete confirmation email to the user.


Member Function Documentation

BaseUser::__construct data = null,
table = 'users'
 

Our constructor.

See also:
BaseObject::__construct for more info.

Reimplemented from BaseObject.

Definition at line 41 of file base-user.inc.php.

References Config::get().

BaseUser::accountExists email  ) 
 

checks to see if an account exists.

Parameters:
$email the account email to check
Returns:
false if it doesnt exist, account data array if it does exist.

Definition at line 490 of file base-user.inc.php.

References dbFetchAssoc(), and dbQuery().

Referenced by editFormValidate(), processLoginForm(), requestPassReset(), and validateRegistration().

BaseUser::addAlert url,
text
 

add an alert to the user

Parameters:
$url the url to send the user to
$text the text of the alert

Definition at line 1171 of file base-user.inc.php.

BaseUser::authenticate username = null,
password = null,
rememberMe = null
 

our authentication function!!!

this checks their credentials, and sets them up to be good to go. if user/pass are passed... it passes it off to login process. otherwise, check the user session. if that doesnt work, check out the cookies for a token.

Parameters:
$username the username to check. pass in for login
$password the password. pass in for login.
$rememberMe do we want to set a longterm cookie to remember person.
Returns:
true on success, false on failure

Definition at line 827 of file base-user.inc.php.

References loginProcess(), and tryAuthCode().

Referenced by processLoginForm().

BaseUser::canDelete  ) 
 

can we delete the user? only admins or me can.

Returns:
true if we can, false if we cant.

Reimplemented from BaseObject.

Definition at line 1776 of file base-user.inc.php.

BaseUser::canEdit  ) 
 

who can edit...

only user or admins.

See also:
BaseObject::canEdit()

Reimplemented from BaseObject.

Definition at line 649 of file base-user.inc.php.

References isMe().

Referenced by initEditPage().

BaseUser::checkAuthCache code  )  [protected]
 

this function checks our cache system for the user.

if theres a cache, then they've been logged in. it will set the $me user to them

Parameters:
$code the hash code from User::generateHash()
Returns:
boolean if the user was found or not.

Definition at line 905 of file base-user.inc.php.

References CacheBot::get().

Referenced by tryAuthCode().

BaseUser::confirmUser  ) 
 

confirm that the user is legitimate.

Todo:
make it parameter based.
Returns:
true on success, false on failure.

Definition at line 1116 of file base-user.inc.php.

References dbFetchAssoc(), dbGetNumRows(), and dbQuery().

BaseUser::createActivateHelpForm  ) 
 

create our account activation help form.

they can request a new activation email be sent.

Returns:
form used on page.

Definition at line 1578 of file base-user.inc.php.

References BaseModule::getUrl().

Referenced by drawActivateHelpPage().

BaseUser::createDeleteForm  ) 
 

create the confirmation delete form

Returns:
the Form to use.

Definition at line 1687 of file base-user.inc.php.

References BaseModule::getUrl().

Referenced by drawDeletePage().

BaseUser::createEditPassForm  ) 
 

create our edit pass form.

pretty basic.

Returns:
form to use.

Definition at line 733 of file base-user.inc.php.

References BaseModule::getUrl().

Referenced by drawEditPassPage().

BaseUser::createEmailPrefsForm  ) 
 

creates our email prefs Form.

calls BaseUser::emailPrefsFormAddFields() to add fields. also sets data.

Returns:
email prefs form for use.

Definition at line 1399 of file base-user.inc.php.

References emailPrefsFormAddFields(), and BaseModule::getUrl().

Referenced by drawEmailPrefsPage().

BaseUser::createLoginForm redirect = null  ) 
 

create our login form.

username, pass, redirect url

Parameters:
$redirect Optional url to redirect to.
Returns:
Form object to display

Definition at line 188 of file base-user.inc.php.

References BaseModule::getUrl(), and loginFormAddUsernameField().

Referenced by drawLoginPage().

BaseUser::createLostPassForm  ) 
 

create our lost pass form...

email and submit

Returns:
lost pass Form.

Definition at line 676 of file base-user.inc.php.

References BaseModule::getUrl().

Referenced by drawLostpassPage().

BaseUser::createRegisterForm  ) 
 

Create our registration form.

email, name, password, birthday, tos, and legal age.

Returns:
Form suitable for display or parsing.

Definition at line 305 of file base-user.inc.php.

References BaseModule::getUrl(), and registerFormAddFields().

Referenced by drawRegisterPage().

BaseUser::createSession login = false  ) 
 

(re)create our user session.

call this on a user object to create a session for them. call this when data stored in the session changes. it will call User::updateSession() automatically.

Parameters:
$userId the id of the user to create session for.
$login do we mark this as a new login?
Returns:
the newly created user object!

Definition at line 1037 of file base-user.inc.php.

References BaseObject::hasField(), lookupData(), BaseObject::save(), saveSession(), and updateSession().

Referenced by doLogin().

BaseUser::deletePost  )  [protected]
 

draw the delete post page.

current behaviour is to send them a confirmation email and then follow that. its behaviour that should be configurable.

Todo:
make behaviour configurable

Definition at line 1666 of file base-user.inc.php.

References emailDeleteConfirmation(), getName(), and isMe().

Referenced by drawDeletePage().

BaseUser::doLogin rememberMe = true,
login = true
 

this function actually logs in a user...

creates session, sets cookies, etc. pretty handy.

Parameters:
$rememberMe do we want to set the cookie for a year or a day? boolean.

Definition at line 984 of file base-user.inc.php.

References createSession(), and generateHash().

Referenced by drawEditPassPage(), and registrationPostSuccess().

BaseUser::drawActivateHelpPage  ) 
 

draw and parse our activation help page.

Definition at line 1518 of file base-user.inc.php.

References createActivateHelpForm().

BaseUser::drawActivatePage  ) 
 

draw our activation page.

if they got here... they're legit.

Definition at line 1491 of file base-user.inc.php.

References Util::redirect().

BaseUser::drawDeleteMePage  ) 
 

do our delete me page.

used for email delete confirmation.

Todo:
make this a confirmation form page

Definition at line 1732 of file base-user.inc.php.

References Linkify::email().

BaseUser::drawDeletePage  ) 
 

draw our delete page.

they must check a box to assure that they really want to delete the user... its pretty big.

Definition at line 1637 of file base-user.inc.php.

References createDeleteForm(), and deletePost().

BaseUser::drawEditPassPage  ) 
 

draw and parse our edit pass page.

Definition at line 764 of file base-user.inc.php.

References createEditPassForm(), doLogin(), emailPassChanged(), BaseObject::hasField(), and BaseObject::save().

BaseUser::drawEmailPrefsPage  ) 
 

draws and handles our form.

Definition at line 1372 of file base-user.inc.php.

References createEmailPrefsForm(), and saveEmailPrefs().

BaseUser::drawLoginPage  ) 
 

draw our login page (form and links to register / lost pass)

Definition at line 121 of file base-user.inc.php.

References createLoginForm(), BaseModule::getLink(), and processLoginForm().

BaseUser::drawLogoutPage  ) 
 

placeholder for drawlogout

Definition at line 282 of file base-user.inc.php.

BaseUser::drawLostpassPage  ) 
 

draw and handle lost pass form.

email them a link and if they can follow it let them reset pass.

Definition at line 697 of file base-user.inc.php.

References createLostPassForm(), and requestPassReset().

BaseUser::drawPrefsPage  ) 
 

draw our prefs page...

this is a listing of all the pages where you can edit account info.

Definition at line 1341 of file base-user.inc.php.

BaseUser::drawRegisterPage  ) 
 

draw our registration page.

parses the reg form and such.

Definition at line 366 of file base-user.inc.php.

References createRegisterForm(), BaseModule::params(), registrationPostSuccess(), and validateRegistration().

BaseUser::drawSetImagePage  ) 
 

do/draw our set image page

Definition at line 2005 of file base-user.inc.php.

References BaseModule::getLink().

BaseUser::editFormAddFields form  ) 
 

adds fields to edit form.

first name, is admin, email, birthday, gender, website, blah blah blah.

See also:
BaseObject::editFormAddFields()
Parameters:
$form the edit Form object

Reimplemented from BaseObject.

Definition at line 554 of file base-user.inc.php.

References BaseObject::hasField().

BaseUser::editFormValidate form  ) 
 

validate our edit form.

checks to see if the account exists if they change their name.

See also:
BaseObject::editFormValidate()
Parameters:
$form the edit Form to validate

Reimplemented from BaseObject.

Definition at line 534 of file base-user.inc.php.

References accountExists().

BaseUser::editPagePostSaveSync form  ) 
 

syncs our edit form.

name handling, lat/lon lookup, session creation.

Parameters:
$form the edit Form

Reimplemented from BaseObject.

Definition at line 626 of file base-user.inc.php.

References BaseObject::hasField().

Referenced by registrationPostSuccess().

BaseUser::emailDeleteConfirmation  )  [protected]
 

email the delete confirmation email to the user.

Definition at line 1747 of file base-user.inc.php.

References Config::get(), BaseModule::getLink(), BaseModule::getUrl(), and mail().

Referenced by deletePost().

BaseUser::emailPassChanged  ) 
 

Email the user to let them know that they (or someone) changed their password.

Definition at line 800 of file base-user.inc.php.

References Config::get(), getName(), and mail().

Referenced by drawEditPassPage().

BaseUser::emailPrefsFormAddFields form  ) 
 

adds the fields in that BaseUser uses...

email_comments, email_comment_replies, birthday, if they exist.

Parameters:
$form the form to add to.
Returns:
the form with fields added.

Definition at line 1424 of file base-user.inc.php.

References BaseObject::hasField().

Referenced by createEmailPrefsForm().

BaseUser::formatDate date  ) 
 

format a date nicely.

Parameters:
$date the date to format.
Returns:
the pretty date.

Definition at line 1821 of file base-user.inc.php.

BaseUser::formatDateTime date  ) 
 

format our datetime stamp nicely

Parameters:
the datetime to format.
Returns:
the nicely formatted datetime

Definition at line 1842 of file base-user.inc.php.

BaseUser::generateHash  ) 
 

this function generates a hash thats unique for each user.

it consists of the user id in plaintext, a dash, then the string of the user id, password, and our secret auth string all run through sha1. this is used by the authentication system to check to see if the code passed in is valid for our user.

Returns:
the hash string for this user.

Definition at line 937 of file base-user.inc.php.

Referenced by doLogin().

BaseUser::getAuthWhereSql user,
pass
[protected]
 

get extra sql for authorization.

here we add the activation key requirement.

Parameters:
$user the login string passed in.
$pass the password
Returns:
the auth string from where on.

Definition at line 1013 of file base-user.inc.php.

References Config::get().

Referenced by loginProcess().

BaseUser::getCreateFieldsArray  ) 
 

get an array of fields in the table that stores the users

Returns:
an array of field definitions with keys that are the same as the field name.

Reimplemented from BaseObject.

Definition at line 2023 of file base-user.inc.php.

BaseUser::getCreateIndexesArray  ) 
 

get an array of indexes on fields in the users table

Returns:
a keyed array with keys as the field/index name and values as the index creation sql.

Reimplemented from BaseObject.

Definition at line 2046 of file base-user.inc.php.

BaseUser::getDataToCache deep = true  ) 
 

get data for caching.

originally an object would be cached with all its data for easy lookups of objects. turned out to be a big PITA and not optimal.

Parameters:
$deep do deep lookups
this is getting replaced in v2.2

Reimplemented from BaseObject.

Definition at line 1942 of file base-user.inc.php.

BaseUser::getIcon type = 'tiny'  ) 
 

get our user icon.

Parameters:
$type which image type to use. See BaseImage for more info.
Returns:
the image icon markup

Definition at line 1914 of file base-user.inc.php.

Referenced by getName().

BaseUser::getLastLogin  ) 
 

get the date of our last login.

Returns:
the formatted date of last login.

Definition at line 1469 of file base-user.inc.php.

BaseUser::getMemberSince  ) 
 

get the date we registered.

Returns:
the formatted date we regged.

Definition at line 1481 of file base-user.inc.php.

BaseUser::getName link = false,
icon = null
 

get the name of the user.

Parameters:
$link do we link the name?
$icon do we link the icon?
Returns:
the name, possibly linked w/ icon

Reimplemented from BaseObject.

Definition at line 1884 of file base-user.inc.php.

References getIcon(), getTextName(), and BaseObject::hasField().

Referenced by deletePost(), emailPassChanged(), and sendActivationEmail().

BaseUser::getPagesXml  ) 
 

add in our user pages:

register - register a new user account activate - user activation page activatehelp - activation help / resend code lostpass - lost pass page editpass - change user password login - login an get credentials logout - logout and destroy credentials prefs - main preferences page emailprefs - email preferences page deleteme - delete my user account

Todo:
remove deleteme
Returns:
xml string of pages.

Reimplemented from BaseObject.

Definition at line 1289 of file base-user.inc.php.

BaseUser::getPublicData  ) 
 

gets our public data.

adds login_count and last_login see BaseObject::getPublicData()

Reimplemented from BaseObject.

Definition at line 1864 of file base-user.inc.php.

BaseUser::getTextName  ) 
 

get the user's name as text for BaseUser::getName()

Definition at line 1902 of file base-user.inc.php.

Referenced by getName().

BaseUser::getTicket url,
html = null
 

get this user a ticket to automatically login.

Parameters:
$url the url to redirect to.
$html the text to link. optional.
Returns:
the url. if html was given, wrapped in an tag

Definition at line 1793 of file base-user.inc.php.

References BaseModule::getUrl().

Referenced by requestPassReset().

BaseUser::initActivateHelpPage  ) 
 

initialize our activation help page.

Definition at line 1510 of file base-user.inc.php.

BaseUser::initDeleteMePage  ) 
 

This is the page to really delete your account.

Todo:
change this to a delete page w/ confirmation. this could be maliciously used to have people delete their accounts.

Definition at line 1713 of file base-user.inc.php.

References BaseModule::assertLogin(), BaseObject::initDeletePage(), and isMe().

BaseUser::initEditPage  ) 
 

init our edit page.

profile editing

Definition at line 505 of file base-user.inc.php.

References BaseModule::assertLogin(), canEdit(), and BaseModule::params().

BaseUser::initEditPassPage  ) 
 

our edit pass page...

must be logged in.

Definition at line 754 of file base-user.inc.php.

References BaseModule::assertLogin().

BaseUser::initEmailPrefsPage  ) 
 

initialize our email prefs page.

this is when we get emails. login required.

Definition at line 1363 of file base-user.inc.php.

References BaseModule::assertLogin().

BaseUser::initLoginPage  ) 
 

Initialize our login page...

show our status message.

Definition at line 84 of file base-user.inc.php.

References BaseModule::addStatus(), and BaseModule::params().

BaseUser::initLogoutPage  ) 
 

init our logout page.

calls logoutProcess and redirects.

Definition at line 269 of file base-user.inc.php.

References Util::redirect().

BaseUser::initLostPassPage  ) 
 

init our lost password page.

Definition at line 661 of file base-user.inc.php.

BaseUser::initPrefsPage  ) 
 

initialize our prefs page...

gotta be logged in.

Definition at line 1330 of file base-user.inc.php.

References BaseModule::assertLogin().

BaseUser::initRegisterPage  ) 
 

Inits our registration page.

Doesnt let logged in users reg.

Definition at line 290 of file base-user.inc.php.

BaseUser::initSetImagePage  ) 
 

prep our set image page

Definition at line 1995 of file base-user.inc.php.

References BaseModule::assertLogin().

BaseUser::initViewPage  ) 
 

initialize our view page...

profiles.

Definition at line 100 of file base-user.inc.php.

References BaseModule::assertLogin(), BaseModule::params(), and BaseModule::setParam().

BaseUser::isAdmin  ) 
 

are we an admin or not?

Returns:
bool if we are an admin

Reimplemented from BaseObject.

Definition at line 76 of file base-user.inc.php.

BaseUser::isMe  ) 
 

determines if a user object is $me, the logged in user.

Returns:
true if the user is me, false if they arent.

Definition at line 1262 of file base-user.inc.php.

Referenced by canEdit(), deletePost(), and initDeleteMePage().

BaseUser::loginFormAddUsernameField form  )  [protected]
 

add the username to the login form.

Parameters:
$form the login Form object

Definition at line 223 of file base-user.inc.php.

Referenced by createLoginForm().

BaseUser::loginProcess user,
pass,
rememberMe = true
 

attempt to log a user in!

Parameters:
$user the username of our user.
$pass the password of the user.
$rememberMe whether we want a long term cookie to remember them by.
Returns:
true on success, false on failure.

Definition at line 957 of file base-user.inc.php.

References dbFetchAssoc(), dbQuery(), and getAuthWhereSql().

Referenced by authenticate().

BaseUser::logoutProcess  ) 
 

fully destroy the users session...

cookies, session, all of it.

Definition at line 1100 of file base-user.inc.php.

References CacheBot::delete().

BaseUser::lookupData deep = true  ) 
 

lookup our data.

for a complete object

Parameters:
$deep do a deep lookup to get child objects

Reimplemented from BaseObject.

Definition at line 1924 of file base-user.inc.php.

Referenced by createSession().

BaseUser::mail subject,
body,
html = null
 

email the user a message.

Parameters:
$subject the subject of the message.
$body the body of the message.
$html the body of the message as html.

Definition at line 1160 of file base-user.inc.php.

References Mail::send().

Referenced by emailDeleteConfirmation(), emailPassChanged(), requestPassReset(), and sendActivationEmail().

BaseUser::makePassword len = 8  )  [static]
 

Creates a pronounceable random password.

Parameters:
string $len, optional length (default 8) string the generated password

Definition at line 238 of file base-user.inc.php.

BaseUser::processLoginForm form  ) 
 

process our login form.

if its submitted, check for error. if it goes well, redirect them on, otherwise set the error on the form.

Definition at line 141 of file base-user.inc.php.

References accountExists(), authenticate(), Config::get(), and Util::redirect().

Referenced by drawLoginPage().

BaseUser::registerFormAddFields form  )  [protected]
 

add fields to the register form.

by default it adds email, username, password 1 and 2, birthday, tos, and age verification

Parameters:
the Form object to add fields to

Definition at line 323 of file base-user.inc.php.

References BaseModule::getUrl(), and BaseObject::hasField().

Referenced by createRegisterForm().

BaseUser::registrationPostSuccess form  )  [protected]
 

do our post processing after successful registration.

Parameters:
$form the registration Form

Definition at line 461 of file base-user.inc.php.

References doLogin(), editPagePostSaveSync(), Config::get(), Util::redirect(), and sendActivationEmail().

Referenced by drawRegisterPage().

BaseUser::requestPassReset email  ) 
 

initiate a password reset request

Parameters:
$email the email/username of the account.
Returns:
true on success, false on failure.

Definition at line 1192 of file base-user.inc.php.

References accountExists(), Config::get(), getTicket(), mail(), and BaseObject::save().

Referenced by drawLostpassPage().

BaseUser::saveEmailPrefs form  ) 
 

save our email prefs.

we need to cast the form data to an int because its a checkbox. then save.

Todo:
fix in form class.

Definition at line 1455 of file base-user.inc.php.

References BaseObject::save().

Referenced by drawEmailPrefsPage().

BaseUser::saveSession  )  [protected]
 

this saves our session to cache.

called from BaseUser::createSession() no need to call directly.

Definition at line 1088 of file base-user.inc.php.

References CacheBot::set().

Referenced by createSession().

BaseUser::sendActivationEmail  ) 
 

send activation email to user.

Definition at line 1595 of file base-user.inc.php.

References Linkify::email(), Config::get(), BaseModule::getLink(), getName(), BaseModule::getUrl(), mail(), and BaseObject::save().

Referenced by registrationPostSuccess().

BaseUser::setDataFromCache data,
deep = true
 

set data from cache

originally an object would be cached with all its data for easy lookups of objects. turned out to be a big PITA and not optimal.

Parameters:
$deep do deep lookups
this is getting replaced in v2.2

Reimplemented from BaseObject.

Definition at line 1961 of file base-user.inc.php.

BaseUser::setProfileImage imageId  ) 
 

set our profile image

Parameters:
$imageId the id of our image object

Definition at line 1975 of file base-user.inc.php.

References BaseObject::save().

BaseUser::tryAuthCode code,
checkCache = true
 

this function takes an auth code and verifies that it is valid for that user.

if its not then it returns false. if it is valid, it logs the user in and creates their session.

Parameters:
$code - the auth code to use. generated from User::generateHash()
Returns:
boolean of whether the code was valid or not.

Definition at line 858 of file base-user.inc.php.

References checkAuthCache().

Referenced by authenticate().

BaseUser::tryPassReset  ) 
 

attempt to reset our pass.

Todo:
check if its depreciated.

Definition at line 1233 of file base-user.inc.php.

References dbGetNumRows(), and dbQuery().

BaseUser::updateSession  )  [protected]
 

this is where you should do any sort of stuff you want recreated or saved when BaseUser::createSession is called.

Definition at line 1079 of file base-user.inc.php.

Referenced by createSession().

BaseUser::usernameExists username  )  [protected]
 

determine if the username is unique

Parameters:
$username the username to check
Returns:
boolean if it exists or not

Definition at line 447 of file base-user.inc.php.

References dbGetNumRows(), and dbQuery().

Referenced by validateRegistration().

BaseUser::validateRegistration form  )  [protected]
 

validate the registration form

Parameters:
$form the registration Form

Definition at line 394 of file base-user.inc.php.

References accountExists(), Config::get(), and usernameExists().

Referenced by drawRegisterPage().


Member Data Documentation

BaseUser::$authCacheLife = 86400 [static]
 

how long to cache their auth stuff for...

defaults to 1 day.

Definition at line 34 of file base-user.inc.php.

BaseUser::$profileImage = null
 

our profile image object

Definition at line 29 of file base-user.inc.php.

BaseUser::$pronoun
 

the english pronoun for the person.

eg he for male, she for female, and they for unknown. used to personalize site a bit more

Definition at line 24 of file base-user.inc.php.

BaseUser::$their
 

the english word for their.

eg. his for a male, her for a female, or their for unknown. used to personalize info a bit better

Definition at line 18 of file base-user.inc.php.


The documentation for this class was generated from the following file:
Generated on Fri Oct 27 12:26:41 2006 for BaseJumper by doxygen 1.3.9.1