summaryrefslogtreecommitdiffstats
path: root/settings/Controller/ChangePasswordController.php
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-03-13 07:29:12 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-03-13 09:52:27 +0100
commit044d5a8d01d7a393ebacf22c66bdd0cef67344eb (patch)
tree77323acfdd7339152a42067a27f6bdc8ef235d7c /settings/Controller/ChangePasswordController.php
parent3cae27614932d3cb0780018551b14a4139f980fd (diff)
downloadnextcloud-server-044d5a8d01d7a393ebacf22c66bdd0cef67344eb.tar.gz
nextcloud-server-044d5a8d01d7a393ebacf22c66bdd0cef67344eb.zip
Inject public IGroupManager instead of private GroupManager
The public "IGroupManager" service returned by the dependency injection system is automatically initialized with an "OC\Group\Database" backend. However, no backend is automatically set in private "GroupManager" instances. Therefore, a private "GroupManager" instance does not work as expected when initialized through the dependency injection system. Due to that this commit reverts a previous change in which the public "IGroupManager" was replaced by a private "GroupManager" instance. That change was needed when strict types were set, as "getSubAdmin()" is not part of "IGroupManager" API, so the type had to be changed to "GroupManager". Until a better solution is found strict types are disabled again to be able to inject "IGroupManager" and also use "getSubAdmin()". Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'settings/Controller/ChangePasswordController.php')
-rw-r--r--settings/Controller/ChangePasswordController.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/settings/Controller/ChangePasswordController.php b/settings/Controller/ChangePasswordController.php
index 208178d567d..7dbdbac0239 100644
--- a/settings/Controller/ChangePasswordController.php
+++ b/settings/Controller/ChangePasswordController.php
@@ -1,5 +1,7 @@
<?php
-declare(strict_types=1);
+// FIXME: disabled for now to be able to inject IGroupManager and also use
+// getSubAdmin()
+//declare(strict_types=1);
/**
*
*
@@ -27,12 +29,12 @@ declare(strict_types=1);
*/
namespace OC\Settings\Controller;
-use OC\Group\Manager as GroupManager;
use OC\HintException;
use OC\User\Session;
use OCP\App\IAppManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
+use OCP\IGroupManager;
use OCP\IL10N;
use OCP\IRequest;
use OCP\IUser;
@@ -50,7 +52,7 @@ class ChangePasswordController extends Controller {
/** @var IL10N */
private $l;
- /** @var GroupManager */
+ /** @var IGroupManager */
private $groupManager;
/** @var Session */
@@ -64,7 +66,7 @@ class ChangePasswordController extends Controller {
string $userId,
IUserManager $userManager,
IUserSession $userSession,
- GroupManager $groupManager,
+ IGroupManager $groupManager,
IAppManager $appManager,
IL10N $l) {
parent::__construct($appName, $request);