Overview

Packages

  • Admin
  • Archive
  • Common
  • DB
  • Express
  • Form
  • Layout
  • Mailer
  • None
  • OpenHomeoDB
  • PDF
    • MC
  • Process
  • Rep
  • RevRep
  • SaveReps
  • Search
  • Session
  • SymRem
  • TreeView
  • UserDB

Classes

  • Session
  • Overview
  • Package
  • Class
  • Tree

Class Session

The Session class is meant to simplify the task of keeping track of logged in users and also guests.

Package: Session
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
Methods summary
public Session
# __construct( )

Class constructor

Class constructor

Returns

Session
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.

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.

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.

Returns

boolean
private
# setSkin( )

setSkin - Set the current skin.

setSkin - Set the current skin.

private
# setLanguage( )

setLanguage - Set the current user-language.

setLanguage - Set the current user-language.

public boolean
# login( string $subuser, string $subpass, boolean $subremember )

login - The user has submitted his username and password through the login form, this function checks the authenticity of that information in the database and creates the session. Effectively logging in the user if all goes well.

login - The user has submitted his username and password through the login form, this function checks the authenticity of that information in the database and creates the session. Effectively logging in the user if all goes well.

Parameters

$subuser
string
$subuser username
$subpass
string
$subpass password
$subremember
boolean
$subremember is true if the user want to stay logged in

Returns

boolean
true if login completed successfully
public
# logout( )

logout - Gets called when the user wants to be logged out of the website. It deletes any cookies that were stored on the users computer as a result of him wanting to be remembered, and also unsets session variables and demotes his user level to guest.

logout - Gets called when the user wants to be logged out of the website. It deletes any cookies that were stored on the users computer as a result of him wanting to be remembered, and also unsets session variables and demotes his user level to guest.

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.

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.

Parameters

$subuser
string
$subuser username
$subpass
string
$subpass password
$subpass2
string
$subpass2 control password
$subemail
string
$subemail email

Returns

integer
0 | 1 | 2
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.

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.

Parameters

$subcurpass
string
$subcurpass current password
$subnewpass
string
$subnewpass new password
$subnewpass2
string
$subnewpass2 verification of the new password
$subemail
string
$subemail email
$real_name
string
$real_name user real name
$extra
string
$extra extra public information about the user
$show_active
integer
$show_active 0 | 1 - 1 if the user wants to see the active users
$hide_email
integer
$hide_email 0 | 1 - 1 if the user wants to hide his email from other users
$skin
string
$skin original | kraque - skin the user uses
$lang
string
$lang de | en - users interface language
$sym_lang
string
$sym_lang de | en - language the user prefers for symptoms

Returns

boolean
true on success
public boolean
# isAdmin( )

isAdmin - Returns true if currently logged in user is an administrator, false otherwise.

isAdmin - Returns true if currently logged in user is an administrator, false otherwise.

Returns

boolean
public boolean
# isEditor( )

isEditor - Returns true if currently logged in user is an editor, false otherwise.

isEditor - Returns true if currently logged in user is an editor, false otherwise.

Returns

boolean
public boolean
# showActive( )

showActiveUsers - Returns true if currently logged in user is an administrator or if he wants to see active users

showActiveUsers - Returns true if currently logged in user is an administrator or if he wants to see active users

Returns

boolean
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.

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.

Returns

string
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.

generateRandStr - Generates a string made up of randomized letters (lower and upper case) and digits, the length is a specified parameter.

Parameters

$length
integer
$length string length

Returns

string
Properties summary
public string $username
#

Username given on sign-up

Username given on sign-up

public string $email
#

email with which the user is registered

email with which the user is registered

public string $userid
#

Random value generated on current login

Random value generated on current login

public integer $id_user
#

ID signed to user by auto_increment

ID signed to user by auto_increment

public integer $userlevel
#

The level to which the user pertains

The level to which the user pertains

public integer $hide_email
#

Is 1, when the user want to hide his email, otherwise 0

Is 1, when the user want to hide his email, otherwise 0

public boolean $logged_in
#

True if user is logged in, false otherwise

True if user is logged in, false otherwise

public array $userinfo array()
#

The array holding all user info

The array holding all user info

public string $url
#

The page url current being viewed

The page url current being viewed

public string $referrer
#

Last recorded site page viewed

Last recorded site page viewed

Note: referrer should really only be considered the actual page referrer in process.php, any other time it may be inaccurate.

public string $skin DEFAULT_SKIN
#

skin the user uses

skin the user uses

public string $lang DEFAULT_LANGUAGE
#

language the user uses

language the user uses

OpenHomeopath PHP code documentation API documentation generated by ApiGen 2.8.0