Inheritance diagram for BaseUser:
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. |
|
Our constructor.
Reimplemented from BaseObject. Definition at line 41 of file base-user.inc.php. References Config::get(). |
|
checks to see if an account exists.
Definition at line 490 of file base-user.inc.php. References dbFetchAssoc(), and dbQuery(). Referenced by editFormValidate(), processLoginForm(), requestPassReset(), and validateRegistration(). |
|
add an alert to the user
Definition at line 1171 of file base-user.inc.php. |
|
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.
Definition at line 827 of file base-user.inc.php. References loginProcess(), and tryAuthCode(). Referenced by processLoginForm(). |
|
can we delete the user? only admins or me can.
Reimplemented from BaseObject. Definition at line 1776 of file base-user.inc.php. |
|
who can edit... only user or admins.
Reimplemented from BaseObject. Definition at line 649 of file base-user.inc.php. References isMe(). Referenced by initEditPage(). |
|
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
Definition at line 905 of file base-user.inc.php. References CacheBot::get(). Referenced by tryAuthCode(). |
|
confirm that the user is legitimate.
Definition at line 1116 of file base-user.inc.php. References dbFetchAssoc(), dbGetNumRows(), and dbQuery(). |
|
create our account activation help form. they can request a new activation email be sent.
Definition at line 1578 of file base-user.inc.php. References BaseModule::getUrl(). Referenced by drawActivateHelpPage(). |
|
create the confirmation delete form
Definition at line 1687 of file base-user.inc.php. References BaseModule::getUrl(). Referenced by drawDeletePage(). |
|
create our edit pass form. pretty basic.
Definition at line 733 of file base-user.inc.php. References BaseModule::getUrl(). Referenced by drawEditPassPage(). |
|
creates our email prefs Form. calls BaseUser::emailPrefsFormAddFields() to add fields. also sets data.
Definition at line 1399 of file base-user.inc.php. References emailPrefsFormAddFields(), and BaseModule::getUrl(). Referenced by drawEmailPrefsPage(). |
|
create our login form. username, pass, redirect url
Definition at line 188 of file base-user.inc.php. References BaseModule::getUrl(), and loginFormAddUsernameField(). Referenced by drawLoginPage(). |
|
create our lost pass form... email and submit
Definition at line 676 of file base-user.inc.php. References BaseModule::getUrl(). Referenced by drawLostpassPage(). |
|
Create our registration form. email, name, password, birthday, tos, and legal age.
Definition at line 305 of file base-user.inc.php. References BaseModule::getUrl(), and registerFormAddFields(). Referenced by drawRegisterPage(). |
|
(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.
Definition at line 1037 of file base-user.inc.php. References BaseObject::hasField(), lookupData(), BaseObject::save(), saveSession(), and updateSession(). Referenced by doLogin(). |
|
draw the delete post page. current behaviour is to send them a confirmation email and then follow that. its behaviour that should be configurable.
Definition at line 1666 of file base-user.inc.php. References emailDeleteConfirmation(), getName(), and isMe(). Referenced by drawDeletePage(). |
|
this function actually logs in a user... creates session, sets cookies, etc. pretty handy.
Definition at line 984 of file base-user.inc.php. References createSession(), and generateHash(). Referenced by drawEditPassPage(), and registrationPostSuccess(). |
|
draw and parse our activation help page.
Definition at line 1518 of file base-user.inc.php. References createActivateHelpForm(). |
|
draw our activation page. if they got here... they're legit. Definition at line 1491 of file base-user.inc.php. References Util::redirect(). |
|
do our delete me page. used for email delete confirmation.
Definition at line 1732 of file base-user.inc.php. References Linkify::email(). |
|
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(). |
|
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(). |
|
draws and handles our form.
Definition at line 1372 of file base-user.inc.php. References createEmailPrefsForm(), and saveEmailPrefs(). |
|
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(). |
|
placeholder for drawlogout
Definition at line 282 of file base-user.inc.php. |
|
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(). |
|
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. |
|
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(). |
|
do/draw our set image page
Definition at line 2005 of file base-user.inc.php. References BaseModule::getLink(). |
|
adds fields to edit form. first name, is admin, email, birthday, gender, website, blah blah blah.
Reimplemented from BaseObject. Definition at line 554 of file base-user.inc.php. References BaseObject::hasField(). |
|
validate our edit form. checks to see if the account exists if they change their name.
Reimplemented from BaseObject. Definition at line 534 of file base-user.inc.php. References accountExists(). |
|
syncs our edit form. name handling, lat/lon lookup, session creation.
Reimplemented from BaseObject. Definition at line 626 of file base-user.inc.php. References BaseObject::hasField(). Referenced by registrationPostSuccess(). |
|
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(). |
|
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(). |
|
adds the fields in that BaseUser uses... email_comments, email_comment_replies, birthday, if they exist.
Definition at line 1424 of file base-user.inc.php. References BaseObject::hasField(). Referenced by createEmailPrefsForm(). |
|
format a date nicely.
Definition at line 1821 of file base-user.inc.php. |
|
format our datetime stamp nicely
Definition at line 1842 of file base-user.inc.php. |
|
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.
Definition at line 937 of file base-user.inc.php. Referenced by doLogin(). |
|
get extra sql for authorization. here we add the activation key requirement.
Definition at line 1013 of file base-user.inc.php. References Config::get(). Referenced by loginProcess(). |
|
get an array of fields in the table that stores the users
Reimplemented from BaseObject. Definition at line 2023 of file base-user.inc.php. |
|
get an array of indexes on fields in the users table
Reimplemented from BaseObject. Definition at line 2046 of file base-user.inc.php. |
|
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.
Reimplemented from BaseObject. Definition at line 1942 of file base-user.inc.php. |
|
get our user icon.
Definition at line 1914 of file base-user.inc.php. Referenced by getName(). |
|
get the date of our last login.
Definition at line 1469 of file base-user.inc.php. |
|
get the date we registered.
Definition at line 1481 of file base-user.inc.php. |
|
get the name of the user.
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(). |
|
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
Reimplemented from BaseObject. Definition at line 1289 of file base-user.inc.php. |
|
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. |
|
get the user's name as text for BaseUser::getName()
Definition at line 1902 of file base-user.inc.php. Referenced by getName(). |
|
get this user a ticket to automatically login.
Definition at line 1793 of file base-user.inc.php. References BaseModule::getUrl(). Referenced by requestPassReset(). |
|
initialize our activation help page.
Definition at line 1510 of file base-user.inc.php. |
|
This is the page to really delete your account.
Definition at line 1713 of file base-user.inc.php. References BaseModule::assertLogin(), BaseObject::initDeletePage(), and isMe(). |
|
init our edit page. profile editing Definition at line 505 of file base-user.inc.php. References BaseModule::assertLogin(), canEdit(), and BaseModule::params(). |
|
our edit pass page... must be logged in. Definition at line 754 of file base-user.inc.php. References BaseModule::assertLogin(). |
|
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(). |
|
Initialize our login page... show our status message. Definition at line 84 of file base-user.inc.php. References BaseModule::addStatus(), and BaseModule::params(). |
|
init our logout page. calls logoutProcess and redirects. Definition at line 269 of file base-user.inc.php. References Util::redirect(). |
|
init our lost password page.
Definition at line 661 of file base-user.inc.php. |
|
initialize our prefs page... gotta be logged in. Definition at line 1330 of file base-user.inc.php. References BaseModule::assertLogin(). |
|
Inits our registration page. Doesnt let logged in users reg. Definition at line 290 of file base-user.inc.php. |
|
prep our set image page
Definition at line 1995 of file base-user.inc.php. References BaseModule::assertLogin(). |
|
initialize our view page... profiles. Definition at line 100 of file base-user.inc.php. References BaseModule::assertLogin(), BaseModule::params(), and BaseModule::setParam(). |
|
are we an admin or not?
Reimplemented from BaseObject. Definition at line 76 of file base-user.inc.php. |
|
determines if a user object is $me, the logged in user.
Definition at line 1262 of file base-user.inc.php. Referenced by canEdit(), deletePost(), and initDeleteMePage(). |
|
add the username to the login form.
Definition at line 223 of file base-user.inc.php. Referenced by createLoginForm(). |
|
attempt to log a user in!
Definition at line 957 of file base-user.inc.php. References dbFetchAssoc(), dbQuery(), and getAuthWhereSql(). Referenced by authenticate(). |
|
fully destroy the users session... cookies, session, all of it. Definition at line 1100 of file base-user.inc.php. References CacheBot::delete(). |
|
lookup our data. for a complete object
Reimplemented from BaseObject. Definition at line 1924 of file base-user.inc.php. Referenced by createSession(). |
|
email the user a message.
Definition at line 1160 of file base-user.inc.php. References Mail::send(). Referenced by emailDeleteConfirmation(), emailPassChanged(), requestPassReset(), and sendActivationEmail(). |
|
Creates a pronounceable random password.
Definition at line 238 of file base-user.inc.php. |
|
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(). |
|
add fields to the register form. by default it adds email, username, password 1 and 2, birthday, tos, and age verification
Definition at line 323 of file base-user.inc.php. References BaseModule::getUrl(), and BaseObject::hasField(). Referenced by createRegisterForm(). |
|
do our post processing after successful registration.
Definition at line 461 of file base-user.inc.php. References doLogin(), editPagePostSaveSync(), Config::get(), Util::redirect(), and sendActivationEmail(). Referenced by drawRegisterPage(). |
|
initiate a password reset request
Definition at line 1192 of file base-user.inc.php. References accountExists(), Config::get(), getTicket(), mail(), and BaseObject::save(). Referenced by drawLostpassPage(). |
|
save our email prefs. we need to cast the form data to an int because its a checkbox. then save.
Definition at line 1455 of file base-user.inc.php. References BaseObject::save(). Referenced by drawEmailPrefsPage(). |
|
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(). |
|
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(). |
|
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.
Reimplemented from BaseObject. Definition at line 1961 of file base-user.inc.php. |
|
set our profile image
Definition at line 1975 of file base-user.inc.php. References BaseObject::save(). |
|
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.
Definition at line 858 of file base-user.inc.php. References checkAuthCache(). Referenced by authenticate(). |
|
attempt to reset our pass.
Definition at line 1233 of file base-user.inc.php. References dbGetNumRows(), and dbQuery(). |
|
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(). |
|
determine if the username is unique
Definition at line 447 of file base-user.inc.php. References dbGetNumRows(), and dbQuery(). Referenced by validateRegistration(). |
|
validate the registration form
Definition at line 394 of file base-user.inc.php. References accountExists(), Config::get(), and usernameExists(). Referenced by drawRegisterPage(). |
|
how long to cache their auth stuff for... defaults to 1 day. Definition at line 34 of file base-user.inc.php. |
|
our profile image object
Definition at line 29 of file base-user.inc.php. |
|
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. |
|
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. |