Class Session
The Session class is meant to simplify the task of keeping track of logged in users and also guests.
Category: Login
Copyright: 2007-2014 Henri Schumacher
License: GNU Affero General Public License v3
Author: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
Author: Henri Schumacher <henri.hulski@gazeta.pl>
Located at include/classes/login/session.php
public
|
|
private
|
#
startSession( )
startSession performs all the actions necessary to initialize this session object. Tries to determine if the the user has logged in already, and sets the variables accordingly. Also takes advantage of this page load to update the active visitors tables. |
private
boolean
|
#
checkLogin( )
checkLogin - Checks if the user has already previously logged in, and a session with the user has already been established. Also checks to see if user has been remembered. If so, the database is queried to make sure of the user's authenticity. Returns true if the user has logged in. |
private
|
|
private
|
|
public
boolean
|
|
public
|
|
public
integer
|
#
register( string $subuser, string $subpass, string $subpass2, string $subemail )
register - Gets called when the user has just submitted the registration form. Determines if there were any errors with the entry fields, if so, it records the errors and returns 1. If no errors were found, it registers the new user and returns 0. Returns 2 if registration failed. |
public
boolean
|
#
editAccount( string $subcurpass, string $subnewpass, string $subnewpass2, string $subemail, string $real_name, string $extra, integer $show_active, integer $hide_email, string $skin, string $lang, string $sym_lang )
editAccount - Attempts to edit the user's account information including the password, which it first makes sure is correct if entered, if so and the new password is in the right format, the change is made. All other fields are changed automatically. |
public
boolean
|
|
public
boolean
|
|
public
boolean
|
#
showActive( )
showActiveUsers - Returns true if currently logged in user is an administrator or if he wants to see active users |
public
string
|
#
generateRandID( )
generateRandID - Generates a string made up of randomized letters (lower and upper case) and digits and returns the md5 hash of it to be used as a userid. |
public
string
|
#
generateRandStr( integer $length )
generateRandStr - Generates a string made up of randomized letters (lower and upper case) and digits, the length is a specified parameter. |
public
string
|
$username |
|
#
Username given on sign-up |
public
string
|
|
#
email with which the user is registered |
|
public
string
|
$userid |
|
#
Random value generated on current login |
public
integer
|
$id_user |
|
#
ID signed to user by auto_increment |
public
integer
|
$userlevel |
|
#
The level to which the user pertains |
public
integer
|
$hide_email |
|
#
Is 1, when the user want to hide his email, otherwise 0 |
public
boolean
|
$logged_in |
|
#
True if user is logged in, false otherwise |
public
array
|
$userinfo | array() |
#
The array holding all user info |
public
string
|
$url |
|
#
The page url current being viewed |
public
string
|
$referrer |
|
#
Last recorded site page viewed |
public
string
|
$skin | DEFAULT_SKIN |
#
skin the user uses |
public
string
|
$lang | DEFAULT_LANGUAGE |
#
language the user uses |