Packageindex Classtrees Modulegroups Elementlist Report XML Files

XName -

User

User

general functions regarding users & logins

 

public class User

general functions regarding users & logins

 

Public Method Summary

void

User(string $dbase, string $login, string $password, string $sessionID)

Class constructor
string

generateIDSession()

Call randomID() recursively until an ID not already in DB is found
int

logout(string $idsession)

Log out user by deleting entry from dns_session & reseting user vars
int

userCreate(string $login, string $password, string $email)

Create new user with given login, pass & email
int

changeLogin(string $login)

Change login name for current user
int

updatePassword(string $password)

Change password for current user
array

listallzones()

list all zones owned by same user
string

Retrievemail()

Return email from current user
string

getEmail(string $login)

Return email from specified user, even if not logged in
int

Changemail(string $email)

Change email address for current user
string

Retrievepassword()

Return password for current user
string

generateIDEmail()

Return generated ID for dns_waitingreply not already present (recursive)
int

validateIDEmail(string $id)

Validate email corresponding to given ID (implies that user
string

generateIDRecovery()

Generate unique ID for account recovery
int

storeIDRecovery(string $login, string $id)

store login and new ID (generated with generateIDRecovery)
int

validateIDRecovery(string $id)

Validate ID from dns_recovery, and modify current userid
string

RetrieveLogin(string $id)

Return login matching given userid

Private Method Summary

int

cleanId(string $table, string $fieldname)

Delete IDs from given table if they are older than 30 mn
int

checkidsession(string $idsession)

Check if session ID is valid, not expired, & update timestamp to now
int

Login(string $login, string $password)

Try to log in user, after calling $this->Exists to check if user exists
int

Exists(string $login)

Check if user exists or not
int

storeIDEmail(string $userid, string $email, string $id)

store userid, email and new ID (generated with generateIDEmail)

Private Field Summary

unknown

$db

unknown

$login

unknown

$email

unknown

$authenticated

unknown

$idsession

unknown

$password

unknown

$valid

unknown

$userid

Public Method Details

User

public void User( string $dbase, string $login, string $password, string $sessionID )

  Class constructor

Parameter
string $dbase
database to use
string $login
XName login, may be null
string $password
XName password
string $sessionID
current session ID, if user already logged in
Returns void


generateIDSession

public string generateIDSession( )

  Call randomID() recursively until an ID not already in DB is found

Returns string

ID


logout

public int logout( string $idsession )

  Log out user by deleting entry from dns_session & reseting user vars

Parameter
string $idsession
session ID to reset
Returns int

1 if success, 0 if error


userCreate

public int userCreate( string $login, string $password, string $email )

  Create new user with given login, pass & email

Parameter
string $login
login
string $password
password
string $email
email
Returns int

1 if success, 0 if error


changeLogin

public int changeLogin( string $login )

  Change login name for current user

Parameter
string $login
login
Returns int

1 if success, 0 if error


updatePassword

public int updatePassword( string $password )

  Change password for current user

Parameter
string $password
password
Returns int

1 if success, 0 if error


listallzones

public array listallzones( )

  list all zones owned by same user

Returns array

array of all zones/zonestypes owned by user or 0 if error


Retrievemail

public string Retrievemail( )

  Return email from current user

Returns string

email address or 0 if error


getEmail

public string getEmail( string $login )

  Return email from specified user, even if not logged in

Parameter
string $login
login to retrieve mail for
Returns string

email address or 0 if error


Changemail

public int Changemail( string $email )

  Change email address for current user

Parameter
string $email
new email address
Returns int

1 if success, 0 if error


Retrievepassword

public string Retrievepassword( )

  Return password for current user

Returns string

current password or 0 if error


generateIDEmail

public string generateIDEmail( )

  Return generated ID for dns_waitingreply not already present (recursive)

Returns string

ID generated or 0 if error


validateIDEmail

public int validateIDEmail( string $id )

  Validate email corresponding to given ID (implies that user
have received email with validating ID)

Parameter
string $id
ID
Returns int

1 if success, 0 if error


generateIDRecovery

public string generateIDRecovery( )

  Generate unique ID for account recovery

Returns string

ID if success, 0 if error


storeIDRecovery

public int storeIDRecovery( string $login, string $id )

  store login and new ID (generated with generateIDRecovery)
in dns_recovery, to wait for request of lost password

Parameter
string $login
login
string $id
generated ID to store
Returns int

1 if success, 0 if error


validateIDRecovery

public int validateIDRecovery( string $id )

  Validate ID from dns_recovery, and modify current userid
to the one from dns_recovery

Parameter
string $id
ID
Returns int

1 if success, 0 if error


RetrieveLogin

public string RetrieveLogin( string $id )

  Return login matching given userid

Parameter
string $id
user ID
Returns string

login or 0 if error


Private Method Details

cleanId

private int cleanId( string $table, string $fieldname )

  Delete IDs from given table if they are older than 30 mn

Parameter
string $table
Table to clean
string $fieldname
field from table containing timestamp
Returns int

1 if success, 0 if error


checkidsession

private int checkidsession( string $idsession )

  Check if session ID is valid, not expired, & update timestamp to now

Parameter
string $idsession
Session ID to validate
Returns int

0 if error, else return 1


Login

private int Login( string $login, string $password )

  Try to log in user, after calling $this->Exists to check if user exists

Parameter
string $login
login
string $password
password
Returns int

1 if success, 0 if error or not present


Exists

private int Exists( string $login )

  Check if user exists or not

Parameter
string $login
login to check
Returns int

1 if present, 0 else - or on error


storeIDEmail

private int storeIDEmail( string $userid, string $email, string $id )

  store userid, email and new ID (generated with generateIDEmail)
in dns_waitingreply, to wait for validation of new email address

Parameter
string $userid
user ID
string $email
user email address
string $id
unique ID for dns_waitingreply
Returns int

1 if success, 0 if error


Private Field Details

$db

private unknown $db

>><<



$login

private unknown $login

>><<



$email

private unknown $email

>><<



$authenticated

private unknown $authenticated

>><<



$idsession

private unknown $idsession

>><<



$password

private unknown $password

>><<



$valid

private unknown $valid

>><<



$userid

private unknown $userid

>><<




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta