PHP Класс sspmod_consent_Consent_Store_Cookie, simplesamlphp

This class implements a consent store which stores the consent information in cookies on the users computer. Example - Consent module with cookie store: 'authproc' => array( array( 'consent:Consent', 'store' => 'consent:Cookie', ), ),
Автор: Olav Morken ([email protected])
Наследование: extends sspmod_consent_Store
Показать файл Открыть проект

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

Метод Описание
deleteAllConsents ( string $userId ) : void Delete consent.
deleteConsent ( string $userId, string $destinationId ) : void Delete consent.
getConsents ( string $userId ) : array Retrieve consents.
hasConsent ( string $userId, string $destinationId, string $attributeSet ) : boolean Check for consent.
saveConsent ( string $userId, string $destinationId, string $attributeSet ) : void Save consent.

Приватные методы

Метод Описание
_getCookieName ( string $userId, string $destinationId ) : string Get cookie name.
_setConsentCookie ( string $name, string | null $value ) : void Helper function for setting a cookie.
_sign ( string $data ) : string Calculate a signature of some data.
_verify ( string $signedData ) : string | false Verify signed data.

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

deleteAllConsents() публичный Метод

Delete consent.
public deleteAllConsents ( string $userId ) : void
$userId string The hash identifying the user at an IdP.
Результат void This method does not return.

deleteConsent() публичный Метод

Called when a user revokes consent for a given destination.
public deleteConsent ( string $userId, string $destinationId ) : void
$userId string The hash identifying the user at an IdP.
$destinationId string A string which identifies the destination.
Результат void

getConsents() публичный Метод

This function should return a list of consents the user has saved.
public getConsents ( string $userId ) : array
$userId string The hash identifying the user at an IdP.
Результат array Array of all destination ids the user has given consent for.

hasConsent() публичный Метод

This function checks whether a given user has authorized the release of the attributes identified by $attributeSet from $source to $destination.
public hasConsent ( string $userId, string $destinationId, string $attributeSet ) : boolean
$userId string The hash identifying the user at an IdP.
$destinationId string A string which identifies the destination.
$attributeSet string A hash which identifies the attributes.
Результат boolean True if the user has given consent earlier, false if not (or on error).

saveConsent() публичный Метод

Called when the user asks for the consent to be saved. If consent information for the given user and destination already exists, it should be overwritten.
public saveConsent ( string $userId, string $destinationId, string $attributeSet ) : void
$userId string The hash identifying the user at an IdP.
$destinationId string A string which identifies the destination.
$attributeSet string A hash which identifies the attributes.
Результат void