38 lines
750 B
PHP
38 lines
750 B
PHP
<?php
|
|
|
|
namespace davina\overwrites;
|
|
|
|
require_once('vendor/autoload.php');
|
|
require_once(DIR_LOGIC . '/sources/_interface.php');
|
|
require_once(DIR_LOGIC . '/overwrites/auths/none.php');
|
|
require_once(DIR_LOGIC . '/overwrites/auths/basic.php');
|
|
|
|
|
|
/**
|
|
*/
|
|
function make_auth_backend(
|
|
\davina\sources\interface_source $source,
|
|
array $descriptor
|
|
) : \Sabre\DAV\Auth\Backend\BackendInterface
|
|
{
|
|
switch ($descriptor['kind'])
|
|
{
|
|
case 'none':
|
|
{
|
|
return (new \davina\overwrites\class_auth_backend_none());
|
|
break;
|
|
}
|
|
case 'basic':
|
|
{
|
|
return (new \davina\overwrites\class_auth_backend_basic($source));
|
|
break;
|
|
}
|
|
default:
|
|
{
|
|
throw (new \Exception(\sprintf('unhandled auth backend kind: %s', $descriptor['kind'])));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
?>
|