Sponsorenverwaltung - Team StarCraft e.V.
 All Data Structures Files Functions Variables
LoggedInUser Class Reference

The main structure to store the data of a logged in user. More...

Public Member Functions

 updateLastActivity ()
 
 signupTimeStamp ()
 
 updatePassword ($newPassword)
 
 updateEmail ($newEmail)
 
 checkPermission ($permissionId)
 
 getFullName ()
 
 storeTemporaryResult ($result)
 
 storeFilterResult ($result)
 
 storeSearchResult ($result)
 
 loadResult ($resultIdentifier)
 
 isResultAvailable ($resultIdentifier)
 
 setStoredSession ()
 
 userLogOut ()
 

Data Fields

 $email = NULL
 Holds the email-address of the logged in user. More...
 
 $passwordHash = NULL
 Holds the hashed password of the logged in user. More...
 
 $userId = NULL
 Holds the userid of the current user. More...
 
 $sessionId = NULL
 An id to identify the current session. More...
 
 $username = NULL
 The username of the logged in user. More...
 

Private Member Functions

 storeResult ($result, $resultType)
 

Private Attributes

 $tempReults = array()
 An array to store temporary results e.g. for exports. More...
 
 $searchResults = array()
 An array to store results of a search e.g. for sorting them. More...
 
 $filterResults = array()
 An array to store results of filtering the listview. More...
 

Detailed Description

The main structure to store the data of a logged in user.

The main structure to store the data of a logged in user. Besides storing the information and session identiefiers of a logged in user this class is also responsible for storing temporary results from searching

This class is based on the class loggedInUser from UserCake (Version 2.0.2)

This file depends on inc/common.php.

Version
1.0.0
Author
Usercake (http://usercake.com)
Alexander Vorndran
Daniel Seichter
Date
02.07.2013

Definition at line 37 of file class.user.php.

Member Function Documentation

checkPermission (   $permissionId)

Check if a user has a permission

Parameters
integer$permissionIdthe id of the permission that should be checked
Returns
boolean TRUE if he has the permission FALSE if not

Definition at line 133 of file class.user.php.

References $db, and $mysqli.

getFullName ( )

Returns the full name of the user

Returns
string the full name of the user

Definition at line 165 of file class.user.php.

References fetchUserDetails().

+ Here is the call graph for this function:

isResultAvailable (   $resultIdentifier)

Checks if the resource with the given identifier is still present

Parameters
string$resultIdentifier
Returns
boolean
  • TRUE if it is present
  • FALSE if not

Definition at line 286 of file class.user.php.

Referenced by loadResult().

+ Here is the caller graph for this function:

loadResult (   $resultIdentifier)
Author
Alexander Vorndran Load a result
Parameters
string$resultIdentifier
Returns
mixed the stored result or FALSE if an error occurred

Definition at line 257 of file class.user.php.

References isResultAvailable().

+ Here is the call graph for this function:

setStoredSession ( )

Save the current session-id to database

Definition at line 308 of file class.user.php.

References $db, and $mysqli.

signupTimeStamp ( )

Return the timestamp when the user registered

Returns
integer timestamp of the sign-up

Definition at line 76 of file class.user.php.

References $db, and $mysqli.

storeFilterResult (   $result)
Author
Alexander Vorndran Stores the given result and a the current time into an array. If there are 5 results stored already the oldest will be overwritten
Parameters
array$resultthe result to store
Returns
string an identifier that can be used to access the stored result with the loadResult(...) function

Definition at line 236 of file class.user.php.

References storeResult().

+ Here is the call graph for this function:

storeResult (   $result,
  $resultType 
)
private
Author
Alexander Vorndran
Parameters
array$resultthe result to store
mixed$resultType
  • 1 for search results
  • 2 for filter results
  • 3 for temporary results
Returns
string an identifier that can be used to access the stored result with the loadResult(...) function

Definition at line 179 of file class.user.php.

References $filterResults, $searchResults, $tempReults, and kdsort().

Referenced by storeFilterResult(), storeSearchResult(), and storeTemporaryResult().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

storeSearchResult (   $result)
Author
Alexander Vorndran Stores the given result and a the current time into an array. If there are 5 results stored already the oldest will be overwritten
Parameters
array$resultthe result to store
Returns
string an identifier that can be used to access the stored result with the loadResult(...) function

Definition at line 247 of file class.user.php.

References storeResult().

+ Here is the call graph for this function:

storeTemporaryResult (   $result)
Author
Alexander Vorndran Stores the given result and a the current time into an array. If there are 5 results stored already the oldest will be overwritten
Parameters
array$resultthe result to store
Returns
string an identifier that can be used to access the stored result with the loadResult(...) function

Definition at line 225 of file class.user.php.

References storeResult().

+ Here is the call graph for this function:

updateEmail (   $newEmail)

Update a users email

Parameters
string$newEmailthe new e-mail-address

Definition at line 115 of file class.user.php.

References $db, and $mysqli.

updateLastActivity ( )

Simple function to update the last activity of a user

Definition at line 59 of file class.user.php.

References $db, and $mysqli.

updatePassword (   $newPassword)

Update a users password

Parameters
string$newPasswordthe new password

Definition at line 94 of file class.user.php.

References $db, $mysqli, and generateImprovedHash().

+ Here is the call graph for this function:

userLogOut ( )

Log the user out by reseting his session-id in the database and destroy the session variables

Definition at line 323 of file class.user.php.

References destroySession(), and resetStoredSession().

+ Here is the call graph for this function:

Field Documentation

$email = NULL

Holds the email-address of the logged in user.

Definition at line 40 of file class.user.php.

$filterResults = array()
private

An array to store results of filtering the listview.

Definition at line 54 of file class.user.php.

Referenced by storeResult().

$passwordHash = NULL

Holds the hashed password of the logged in user.

Definition at line 42 of file class.user.php.

$searchResults = array()
private

An array to store results of a search e.g. for sorting them.

Definition at line 52 of file class.user.php.

Referenced by storeResult().

$sessionId = NULL

An id to identify the current session.

Definition at line 46 of file class.user.php.

$tempReults = array()
private

An array to store temporary results e.g. for exports.

Definition at line 50 of file class.user.php.

Referenced by storeResult().

$userId = NULL

Holds the userid of the current user.

Definition at line 44 of file class.user.php.

$username = NULL

The username of the logged in user.

Definition at line 48 of file class.user.php.


The documentation for this class was generated from the following file: