2017-03-07 23:01:13 +00:00
|
|
|
<?php
|
2017-11-17 01:23:18 +00:00
|
|
|
/** @license MIT
|
|
|
|
* Copyright 2017 J. King, Dustin Wilson et al.
|
|
|
|
* See LICENSE and AUTHORS files for details */
|
|
|
|
|
2017-03-07 23:01:13 +00:00
|
|
|
declare(strict_types=1);
|
2017-03-28 04:12:12 +00:00
|
|
|
namespace JKingWeb\Arsse\User\Internal;
|
2017-03-07 23:01:13 +00:00
|
|
|
|
2017-07-15 20:44:06 +00:00
|
|
|
final class Driver implements \JKingWeb\Arsse\User\Driver {
|
2017-03-07 23:01:13 +00:00
|
|
|
use InternalFunctions;
|
|
|
|
|
|
|
|
protected $db;
|
|
|
|
protected $functions = [
|
2017-07-15 20:44:06 +00:00
|
|
|
"auth" => self::FUNC_INTERNAL,
|
|
|
|
"userList" => self::FUNC_INTERNAL,
|
|
|
|
"userExists" => self::FUNC_INTERNAL,
|
|
|
|
"userAdd" => self::FUNC_INTERNAL,
|
|
|
|
"userRemove" => self::FUNC_INTERNAL,
|
|
|
|
"userPasswordSet" => self::FUNC_INTERNAL,
|
|
|
|
"userPropertiesGet" => self::FUNC_INTERNAL,
|
|
|
|
"userPropertiesSet" => self::FUNC_INTERNAL,
|
|
|
|
"userRightsGet" => self::FUNC_INTERNAL,
|
|
|
|
"userRightsSet" => self::FUNC_INTERNAL,
|
2017-03-07 23:01:13 +00:00
|
|
|
];
|
|
|
|
|
2017-08-29 14:50:31 +00:00
|
|
|
public static function driverName(): string {
|
2017-07-17 11:47:57 +00:00
|
|
|
return Arsse::$lang->msg("Driver.User.Internal.Name");
|
2017-03-07 23:01:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function driverFunctions(string $function = null) {
|
2017-08-29 14:50:31 +00:00
|
|
|
if ($function===null) {
|
2017-07-21 02:40:09 +00:00
|
|
|
return $this->functions;
|
|
|
|
}
|
2017-08-29 14:50:31 +00:00
|
|
|
if (array_key_exists($function, $this->functions)) {
|
2017-03-07 23:01:13 +00:00
|
|
|
return $this->functions[$function];
|
|
|
|
} else {
|
2017-07-15 20:44:06 +00:00
|
|
|
return self::FUNC_NOT_IMPLEMENTED;
|
2017-03-07 23:01:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// see InternalFunctions.php for bulk of methods
|
2017-08-29 14:50:31 +00:00
|
|
|
}
|