The Hubzilla
 All Classes Namespaces Files Functions Variables Pages
Zotlabs\Storage\BasicAuth Class Reference

Authentication backend class for DAV. More...

Inheritance diagram for Zotlabs\Storage\BasicAuth:
[legend]

Public Member Functions

 check (RequestInterface $request, ResponseInterface $response)
 
 setCurrentUser ($name)
 
 getCurrentUser ()
 
 setTimezone ($timezone)
 Sets the timezone from the channel in BasicAuth. More...
 
 getTimezone ()
 Returns the timezone. More...
 
 setBrowserPlugin ($browser)
 Set browser plugin for SabreDAV. More...
 
 log ()
 Prints out all BasicAuth variables to logger(). More...
 

Public Attributes

int $channel_id = 0
 channel_id of the current channel of the logged-in account. More...
 
string $channel_hash = ''
 channel_hash of the current channel of the logged-in account. More...
 
string $observer = ''
 Set in mod/cloud.php to observer_hash. More...
 
Sabre DAV Browser Plugin $browser
 
int $owner_id = 0
 channel_id of the current visited path. Set in Directory::getDir(). More...
 
string $owner_nick = ''
 
 $module_disabled = false
 

Protected Member Functions

 validateUserPass ($username, $password)
 Validates a username and password. More...
 
 setAuthenticated ($r)
 Sets variables and session parameters after successfull authentication. More...
 
 check_module_access ($channel_id)
 

Protected Attributes

string null $channel_name = null
 This variable holds the currently logged-in channel_address. More...
 
string $timezone = ''
 

Detailed Description

Authentication backend class for DAV.

This class also contains some data which is not necessary for authentication like timezone settings.

\DAV\Auth\Backend\AbstractBasic

License: http://opensource.org/licenses/mit-license.php The MIT License (MIT)

Member Function Documentation

Zotlabs\Storage\BasicAuth::check ( RequestInterface  $request,
ResponseInterface  $response 
)

When this method is called, the backend must check if authentication was successful.

The returned value must be one of the following

[true, "principals/username"] [false, "reason for failure"]

If authentication was successful, it's expected that the authentication backend returns a so-called principal url.

Examples of a principal url:

principals/admin principals/user1 principals/users/joe principals/uid/123457

If you don't use WebDAV ACL (RFC3744) we recommend that you simply return a string such as:

principals/users/[username]

Parameters
RequestInterface$request
ResponseInterface$response
Returns
array
Zotlabs\Storage\BasicAuth::check_module_access (   $channel_id)
protected
Zotlabs\Storage\BasicAuth::getCurrentUser ( )

Returns information about the currently logged-in channel.

If nobody is currently logged in, this method should return null.

See Also
\Sabre\DAV\Auth\Backend\AbstractBasic::getCurrentUser
Returns
string|null
Zotlabs\Storage\BasicAuth::getTimezone ( )

Returns the timezone.

Returns
string Return the channel's timezone.
Zotlabs\Storage\BasicAuth::log ( )

Prints out all BasicAuth variables to logger().

Returns
void
Zotlabs\Storage\BasicAuth::setAuthenticated (   $r)
protected

Sets variables and session parameters after successfull authentication.

Parameters
array$rArray with the values for the authenticated channel.
Returns
bool
Zotlabs\Storage\BasicAuth::setBrowserPlugin (   $browser)

Set browser plugin for SabreDAV.

See Also
RedBrowser::set_writeable()
Parameters
\Sabre\DAV\Browser\Plugin$browser
Zotlabs\Storage\BasicAuth::setCurrentUser (   $name)

Sets the channel_name from the currently logged-in channel.

Parameters
string$nameThe channel's name
Zotlabs\Storage\BasicAuth::setTimezone (   $timezone)

Sets the timezone from the channel in BasicAuth.

Set in mod/cloud.php if the channel has a timezone set.

Parameters
string$timezoneThe channel's timezone.
Returns
void
Zotlabs\Storage\BasicAuth::validateUserPass (   $username,
  $password 
)
protected

Validates a username and password.

See Also
\Sabre\DAV\Auth\Backend\AbstractBasic::validateUserPass
Parameters
string$username
string$password
Returns
bool

Member Data Documentation

Sabre DAV Browser Plugin Zotlabs\Storage\BasicAuth::$browser
string Zotlabs\Storage\BasicAuth::$channel_hash = ''

channel_hash of the current channel of the logged-in account.

$channel_hash

int Zotlabs\Storage\BasicAuth::$channel_id = 0

channel_id of the current channel of the logged-in account.

$channel_id

string null Zotlabs\Storage\BasicAuth::$channel_name = null
protected

This variable holds the currently logged-in channel_address.

It is used for building path in filestorage/.

$channel_name

Zotlabs\Storage\BasicAuth::$module_disabled = false
string Zotlabs\Storage\BasicAuth::$observer = ''

Set in mod/cloud.php to observer_hash.

$observer

int Zotlabs\Storage\BasicAuth::$owner_id = 0

channel_id of the current visited path. Set in Directory::getDir().

$owner_id

string Zotlabs\Storage\BasicAuth::$owner_nick = ''

channel_name of the current visited path. Set in Directory::getDir().

Used for creating the path in cloud/

$owner_nick

string Zotlabs\Storage\BasicAuth::$timezone = ''
protected

Timezone from the visiting channel's channel_timezone.

Used in Browser

$timezone


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