1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace OC\User;
- use OCP\IConfig;
- use OCP\IUserBackend;
- use OCP\User\Backend\IGetHomeBackend;
- class PartiallyDeletedUsersBackend extends Backend implements IGetHomeBackend, IUserBackend {
- public function __construct(
- private IConfig $config,
- ) {
- }
- public function deleteUser($uid): bool {
-
- return true;
- }
- public function getBackendName(): string {
- return 'deleted users';
- }
- public function userExists($uid) {
- return $this->config->getUserValue($uid, 'core', 'deleted') === 'true';
- }
- public function getHome(string $uid): string|false {
- return $this->config->getUserValue($uid, 'core', 'deleted.home-path') ?: false;
- }
- public function getUsers($search = '', $limit = null, $offset = null) {
- return $this->config->getUsersForUserValue('core', 'deleted', 'true');
- }
-
- public function unmarkUser(string $userId): void {
- $this->config->deleteUserValue($userId, 'core', 'deleted');
- $this->config->deleteUserValue($userId, 'core', 'deleted.home-path');
- }
- }
|