PHP Класс Auth, huge

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

checkAdminAuthentication() публичный статический метод

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() публичный статический метод

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

checkSessionConcurrency() публичный статический метод

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 ( )