PHP Class Auth, huge

Show file Open project: panique/huge Class Usage Examples

Public Methods

Method Description
checkAdminAuthentication ( ) The admin authentication flow, just check if the user is logged in (by looking into the session) AND has user role type 7 (currently there's only type 1 (normal user), type 2 (premium user) and 7 (admin)).
checkAuthentication ( ) The normal authentication flow, just check if the user is logged in (by looking into the session).
checkSessionConcurrency ( ) Detects if there is concurrent session (i.e. another user logged in with the same current user credentials), If so, then logout.

Method Details

checkAdminAuthentication() public static method

If user is not, then he will be redirected to login page and the application is hard-stopped via exit(). Using this method makes only sense in controllers that should only be used by admins.
public static checkAdminAuthentication ( )

checkAuthentication() public static method

If user is not, then he will be redirected to login page and the application is hard-stopped via exit().
public static checkAuthentication ( )

checkSessionConcurrency() public static method

Detects if there is concurrent session (i.e. another user logged in with the same current user credentials), If so, then logout.
public static checkSessionConcurrency ( )