2017-03-07 23:01:13 +00:00
|
|
|
<?php
|
|
|
|
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
|
|
|
];
|
|
|
|
|
|
|
|
static public 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-07-21 02:40:09 +00:00
|
|
|
if($function===null) {
|
|
|
|
return $this->functions;
|
|
|
|
}
|
2017-03-07 23:01:13 +00:00
|
|
|
if(array_key_exists($function, $this->functions)) {
|
|
|
|
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
|
|
|
|
}
|