2018-03-22 04:15:19 -04:00
|
|
|
<?php
|
2019-12-03 13:57:53 -05:00
|
|
|
|
2018-03-22 04:15:19 -04:00
|
|
|
declare(strict_types=1);
|
2019-12-03 13:57:53 -05:00
|
|
|
|
2018-03-22 04:15:19 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2019-12-03 13:57:53 -05:00
|
|
|
*/
|
2018-03-22 04:15:19 -04:00
|
|
|
namespace OCP\User\Backend;
|
|
|
|
|
|
|
|
|
|
use OC\User\Backend;
|
|
|
|
|
use OCP\IUserBackend;
|
|
|
|
|
use OCP\UserInterface;
|
|
|
|
|
|
2018-03-22 05:53:29 -04:00
|
|
|
/**
|
|
|
|
|
* @since 14.0.0
|
|
|
|
|
*/
|
2018-03-22 10:49:07 -04:00
|
|
|
abstract class ABackend implements IUserBackend, UserInterface {
|
2018-03-22 05:53:29 -04:00
|
|
|
/**
|
|
|
|
|
* @deprecated 14.0.0
|
2023-01-17 04:47:22 -05:00
|
|
|
* @since 14.0.0
|
2018-03-22 10:54:55 -04:00
|
|
|
*
|
|
|
|
|
* @param int $actions The action to check for
|
|
|
|
|
* @return bool
|
2018-03-22 05:53:29 -04:00
|
|
|
*/
|
2018-03-22 04:15:19 -04:00
|
|
|
public function implementsActions($actions): bool {
|
|
|
|
|
$implements = 0;
|
|
|
|
|
|
|
|
|
|
if ($this instanceof ICreateUserBackend) {
|
|
|
|
|
$implements |= Backend::CREATE_USER;
|
|
|
|
|
}
|
|
|
|
|
if ($this instanceof ISetPasswordBackend) {
|
|
|
|
|
$implements |= Backend::SET_PASSWORD;
|
|
|
|
|
}
|
|
|
|
|
if ($this instanceof ICheckPasswordBackend) {
|
|
|
|
|
$implements |= Backend::CHECK_PASSWORD;
|
|
|
|
|
}
|
|
|
|
|
if ($this instanceof IGetHomeBackend) {
|
|
|
|
|
$implements |= Backend::GET_HOME;
|
|
|
|
|
}
|
|
|
|
|
if ($this instanceof IGetDisplayNameBackend) {
|
|
|
|
|
$implements |= Backend::GET_DISPLAYNAME;
|
|
|
|
|
}
|
|
|
|
|
if ($this instanceof ISetDisplayNameBackend) {
|
|
|
|
|
$implements |= Backend::SET_DISPLAYNAME;
|
|
|
|
|
}
|
|
|
|
|
if ($this instanceof IProvideAvatarBackend) {
|
|
|
|
|
$implements |= Backend::PROVIDE_AVATAR;
|
|
|
|
|
}
|
|
|
|
|
if ($this instanceof ICountUsersBackend) {
|
|
|
|
|
$implements |= Backend::COUNT_USERS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (bool)($actions & $implements);
|
|
|
|
|
}
|
|
|
|
|
}
|