1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- declare(strict_types=1);
- namespace OCP\User\Backend;
- use OC\User\Backend;
- use OCP\IUserBackend;
- use OCP\UserInterface;
- abstract class ABackend implements IUserBackend, UserInterface {
-
- 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);
- }
- }
|