1
0

DummyUserSession.php 1007 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCA\Files_External\Migration;
  8. use OCP\IUser;
  9. use OCP\IUserSession;
  10. class DummyUserSession implements IUserSession {
  11. private ?IUser $user = null;
  12. public function login($uid, $password) {
  13. }
  14. public function logout() {
  15. }
  16. public function setUser($user) {
  17. $this->user = $user;
  18. }
  19. public function setVolatileActiveUser(?IUser $user): void {
  20. $this->user = $user;
  21. }
  22. public function getUser() {
  23. return $this->user;
  24. }
  25. public function isLoggedIn() {
  26. return !is_null($this->user);
  27. }
  28. /**
  29. * get getImpersonatingUserID
  30. *
  31. * @return string|null
  32. * @since 17.0.0
  33. */
  34. public function getImpersonatingUserID() : ?string {
  35. return null;
  36. }
  37. /**
  38. * set setImpersonatingUserID
  39. *
  40. * @since 17.0.0
  41. */
  42. public function setImpersonatingUserID(bool $useCurrentUser = true): void {
  43. //no OP
  44. }
  45. }