Ryzom Account Management System  1.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions
Users Class Reference

handles basic user registration & management functions (shard related). More...

Inheritance diagram for Users:
WebUsers WebUsers

Public Member Functions

 check_Register ($values)
 checks if entered values before registering are valid.
 checkUser ($username)
 checks if entered username is valid.
 checkPassword ($pass)
 checks if the password is valid.
 checkEmail ($email)
 wrapper to check if the email address is valid.
 validEmail ($email)
 check if the emailaddress structure is valid.
 check_change_password ($values)
 check if the changing of a password is valid.

Static Public Member Functions

static generateSALT ($length=2)
 generate a SALT.
static createUser ($values, $user_id)
 creates a user in the shard.
static createPermissions ($pvalues)
 creates permissions in the shard db for a user.

Protected Member Functions

 checkUserNameExists ($username)
 check if username already exists.
 checkEmailExists ($email)
 check if email already exists.
 checkLoginMatch ($user, $pass)
 check if username and password matches.
 setAmsPassword ($user, $pass)
 sets the shards password.
 setAmsEmail ($user, $mail)
 sets the shards email.

Private Member Functions

 confirmPassword ($pass_result, $pass, $confirmpass)
 checks if the confirmPassword matches the original.

Detailed Description

handles basic user registration & management functions (shard related).

The Users class is the basis class of WebUsers, this class provides functions being used by all CMS's and our own www version. The WebUsers class however needs to be reimplemented by using the CMS's it's funcionality. This class handles the writing to the shard db mainly, and in case it's offline: writing to the ams_querycache.

Author:
Daan Janssens, mentored by Matthew Lagoe

Member Function Documentation

check_change_password ( values)

check if the changing of a password is valid.

a mod/admin doesn't has to fill in the previous password when he wants to change the password, however for changing his own password he has to fill it in.

Parameters:
$valuesan array containing the CurrentPass, ConfirmNewPass, NewPass and adminChangesOthers
Returns:
if it is valid "success will be returned, else an array with errors will be returned.
check_Register ( values)

checks if entered values before registering are valid.

Parameters:
$valuesarray with Username,Password, ConfirmPass and Email.
Returns:
string Info: Returns a string, if input data is valid then "success" is returned, else an array with errors
checkEmail ( email)

wrapper to check if the email address is valid.

Parameters:
$emailthe email address
Returns:
"success", else in case it isn't valid an error will be returned.
checkEmailExists ( email) [protected]

check if email already exists.

This is the base function, it should be overwritten by the WebUsers class.

Parameters:
$emailthe email address
Returns:
string Info: Returns true or false if the email is in the www db.

Reimplemented in WebUsers, and WebUsers.

checkLoginMatch ( user,
pass 
) [protected]

check if username and password matches.

This is the base function, it should be overwritten by the WebUsers class.

Parameters:
$userthe inserted username
$passthe inserted password

Reimplemented in WebUsers, and WebUsers.

checkPassword ( pass)

checks if the password is valid.

Parameters:
$passthe password willing to be used.
Returns:
string Info: Returns a string based on if the password is valid, if valid then "success" is returned
checkUser ( username)

checks if entered username is valid.

Parameters:
$usernamethe username that the user wants to use.
Returns:
string Info: Returns a string based on if the username is valid, if valid then "success" is returned
checkUserNameExists ( username) [protected]

check if username already exists.

This is the base function, it should be overwritten by the WebUsers class.

Parameters:
$usernamethe username
Returns:
string Info: Returns true or false if the user is in the www db.

Reimplemented in WebUsers, and WebUsers.

confirmPassword ( pass_result,
pass,
confirmpass 
) [private]

checks if the confirmPassword matches the original.

Parameters:
$pass_resultthe result of the previous password check.
$passthe original pass.
$confirmpassthe confirmation password.
Returns:
string Info: Verify's $_POST["Password"] is the same as $_POST["ConfirmPass"]
static createPermissions ( pvalues) [static]

creates permissions in the shard db for a user.

incase the shard is offline it will place it in the ams_querycache.

Parameters:
$pvalueswith username
static createUser ( values,
user_id 
) [static]

creates a user in the shard.

incase the shard is offline it will place it in the ams_querycache. You have to create a user first in the CMS/WWW and use the id for this function.

Parameters:
$valueswith name,pass and mail
$user_idthe extern id of the user (the id given by the www/CMS)
Returns:
ok if it's get correctly added to the shard, else return lib offline and put in libDB, if libDB is also offline return liboffline.
static generateSALT ( length = 2) [static]

generate a SALT.

Parameters:
$lengththe length of the SALT which is by default 2
Returns:
a random salt of 2 chars
setAmsEmail ( user,
mail 
) [protected]

sets the shards email.

in case the shard is offline, the entry will be stored in the ams_querycache.

Parameters:
$userthe usersname of the account of which we want to change the emailaddress.
$mailthe new email address
Returns:
ok if it worked, if the lib or shard is offline it will return liboffline or shardoffline.
setAmsPassword ( user,
pass 
) [protected]

sets the shards password.

in case the shard is offline, the entry will be stored in the ams_querycache.

Parameters:
$userthe usersname of the account of which we want to change the password.
$passthe new password.
Returns:
ok if it worked, if the lib or shard is offline it will return liboffline or shardoffline.
validEmail ( email)

check if the emailaddress structure is valid.

Parameters:
$emailthe email address
Returns:
true or false

The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables