ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
basicauth.php File Reference

Go to the source code of this file.

Variables

 $userList
 This example shows how to do Basic authentication. More...
 
 $paths
 
foreach($paths as $path) $request = Sapi::getRequest()
 
 $response = new Response()
 
 $basicAuth = new Auth\Basic("Locked down area", $request, $response)
 
if(! $userPass=$basicAuth->getCredentials()) elseif(!isset($userList[$userPass[0]])|| $userList[$userPass[0]] !==$userPass[1]) else
 

Variable Documentation

◆ $basicAuth

$basicAuth = new Auth\Basic("Locked down area", $request, $response)

Definition at line 37 of file basicauth.php.

Referenced by Monolog\Handler\CouchDBHandler\write().

◆ $paths

$paths
Initial value:
= [
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/../../../autoload.php',
__DIR__ . '/vendor/autoload.php',
]

Definition at line 20 of file basicauth.php.

◆ $request

foreach ( $paths as $path) $request = Sapi::getRequest()

Definition at line 34 of file basicauth.php.

◆ $response

$response = new Response()

Definition at line 35 of file basicauth.php.

◆ $userList

$userList
Initial value:
= [
"user1" => "password",
"user2" => "password",
]

This example shows how to do Basic authentication.

Definition at line 10 of file basicauth.php.

◆ else

if(! $userPass=$basicAuth->getCredentials()) elseif (!isset( $userList[ $userPass[0]])||$userList[ $userPass[0]] !==$userPass[1]) else
Initial value:
{
$response->setBody('You are logged in!')
$response
Definition: basicauth.php:35

Definition at line 47 of file basicauth.php.