Wikimedia SlimApp
Common classes to help with creating an application using the Slim micro framework and Twig template engine.
Loading...
Searching...
No Matches
Wikimedia\Slimapp\Auth\AuthManager Class Reference

Manage authentication and authorization. More...

+ Collaboration diagram for Wikimedia\Slimapp\Auth\AuthManager:

Public Member Functions

 __construct (UserManager $manager)
 
 getUserData ()
 Get the current user's information.
 
 getUserId ()
 Get the current user's Id.
 
 setUser (UserData $user)
 Store the user's information.
 
 isAuthenticated ()
 Is the user authenticated?
 
 isAnonymous ()
 Is the user anonymous?
 
 authenticate ( $uname, $password)
 Attempt to authenticate a user.
 
 login (UserData $user)
 Add authentication.
 
 logout ()
 Remove authentication.
 

Public Attributes

const NEXTPAGE_SESSION_KEY = 'AUTH_NEXTPAGE'
 

Protected Attributes

 $manager
 

Detailed Description

Manage authentication and authorization.

Author
Bryan Davis bd808.nosp@m.@wik.nosp@m.imedi.nosp@m.a.or.nosp@m.g

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Slimapp\Auth\AuthManager::__construct ( UserManager $manager)
Parameters
UserManager$manager

Member Function Documentation

◆ authenticate()

Wikimedia\Slimapp\Auth\AuthManager::authenticate ( $uname,
$password )

Attempt to authenticate a user.

Parameters
string$unameUsername
string$passwordPassword
Returns
bool True if authentication is successful, false otherwise

◆ getUserData()

Wikimedia\Slimapp\Auth\AuthManager::getUserData ( )

Get the current user's information.

Returns
UserData User information or null if not available

◆ getUserId()

Wikimedia\Slimapp\Auth\AuthManager::getUserId ( )

Get the current user's Id.

Returns
int|bool Numeric user id or false if not available

◆ isAnonymous()

Wikimedia\Slimapp\Auth\AuthManager::isAnonymous ( )

Is the user anonymous?

Returns
bool True if the user is not authenticated, false otherwise

◆ isAuthenticated()

Wikimedia\Slimapp\Auth\AuthManager::isAuthenticated ( )

Is the user authenticated?

Returns
bool True if authenticated, false otherwise

◆ login()

Wikimedia\Slimapp\Auth\AuthManager::login ( UserData $user)

Add authentication.

Parameters
UserData$user

◆ setUser()

Wikimedia\Slimapp\Auth\AuthManager::setUser ( UserData $user)

Store the user's information.

Parameters
UserData$userUser information

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