-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move \OC\User\NoUserException to OCP #33239
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ | |
|
||
use OC\ServerNotAvailableException; | ||
use OC\User\Backend; | ||
use OC\User\NoUserException; | ||
use OCP\User\NoUserException; | ||
use OCA\User_LDAP\Exceptions\NotOnLDAP; | ||
use OCA\User_LDAP\User\OfflineUser; | ||
use OCA\User_LDAP\User\User; | ||
|
@@ -429,7 +429,7 @@ public function deleteUser($uid) { | |
* | ||
* @param string $uid the username | ||
* @return bool|string | ||
* @throws NoUserException | ||
* @throws \OCP\User\NoUserException | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
* @throws \Exception | ||
*/ | ||
public function getHome($uid) { | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -39,7 +39,7 @@ | |||||
|
||||||
use OCP\Cache\CappedMemoryCache; | ||||||
use OC\Files\Mount\MountPoint; | ||||||
use OC\User\NoUserException; | ||||||
use OCP\User\NoUserException; | ||||||
use OCP\EventDispatcher\IEventDispatcher; | ||||||
use OCP\Files\Events\Node\FilesystemTornDownEvent; | ||||||
use OCP\Files\NotFoundException; | ||||||
|
@@ -366,7 +366,7 @@ public static function initMountManager() { | |||||
* Initialize system and personal mount points for a user | ||||||
* | ||||||
* @param string|IUser|null $user | ||||||
* @throws \OC\User\NoUserException if the user is not available | ||||||
* @throws \OCP\User\NoUserException if the user is not available | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
*/ | ||||||
public static function initMountPoints($user = '') { | ||||||
/** @var IUserManager $userManager */ | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ | |
use OC\Files\Utils\PathHelper; | ||
use OC\Files\View; | ||
use OC\Hooks\PublicEmitter; | ||
use OC\User\NoUserException; | ||
use OCP\User\NoUserException; | ||
use OCP\EventDispatcher\IEventDispatcher; | ||
use OCP\Files\Config\IUserMountCache; | ||
use OCP\Files\Events\Node\FilesystemTornDownEvent; | ||
|
@@ -358,7 +358,7 @@ public function getName() { | |
* | ||
* @param string $userId user ID | ||
* @return \OCP\Files\Folder | ||
* @throws NoUserException | ||
* @throws \OCP\User\NoUserException | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
* @throws NotPermittedException | ||
*/ | ||
public function getUserFolder($userId) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright Copyright (c) 2022 Julius Härtl <jus@bitgrid.net> | ||
* | ||
* @author Julius Härtl <jus@bitgrid.net> | ||
* | ||
* @license GNU AGPL version 3 or any later version | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
namespace OCP\User; | ||
|
||
/** | ||
* @since 25.0.0 | ||
*/ | ||
class NoUserException extends \Exception { | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -24,7 +24,7 @@ | |||||
|
||||||
use OC\Files\Mount\MountPoint; | ||||||
use OC\Files\Storage\Temporary; | ||||||
use OC\User\NoUserException; | ||||||
use OCP\User\NoUserException; | ||||||
use OCP\Files\Config\IMountProvider; | ||||||
use OCP\Files\Storage\IStorageFactory; | ||||||
use OCP\IUser; | ||||||
|
@@ -340,16 +340,16 @@ public function testHooks() { | |||||
* | ||||||
*/ | ||||||
public function testLocalMountWhenUserDoesNotExist() { | ||||||
$this->expectException(\OC\User\NoUserException::class); | ||||||
$this->expectException(\OCP\User\NoUserException::class); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
$userId = $this->getUniqueID('user_'); | ||||||
|
||||||
\OC\Files\Filesystem::initMountPoints($userId); | ||||||
} | ||||||
|
||||||
|
||||||
public function testNullUserThrows() { | ||||||
$this->expectException(\OC\User\NoUserException::class); | ||||||
$this->expectException(\OCP\User\NoUserException::class); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
\OC\Files\Filesystem::initMountPoints(null); | ||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not consistent with having a use, you do not need to namespace it here