From 21d31c67ff08963ae812589a8fe2b67f42602a14 Mon Sep 17 00:00:00 2001 From: "holger.trampe" Date: Tue, 27 Jul 2021 00:05:26 +0200 Subject: [PATCH] groupname change by django --- appinfo/routes.php | 1 + lib/AppInfo/Application.php | 1 - lib/Controller/MigrateController.php | 10 ++++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index 6f3ab63..5524426 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -17,5 +17,6 @@ return [ # DEVELOPMENT ['name' => 'migrate#startMigration', 'url' => '/startmigration', 'verb' => 'PUT'], ['name' => 'migrate#getcurrentuser', 'url' => '/getcurrentuser', 'verb' => 'POST'], + ['name' => 'migrate#renameGroup', 'url' => '/regr', 'verb' => 'POST'], ] ]; diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 4ea22ee..f09fb3a 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -52,7 +52,6 @@ class UserChangedByNC extends Controller { ] ]; $context = stream_context_create($opts); - #$file = file_get_contents($this->nclink.'/api/uschanged/'.$this->session->getUser()->getUID(), false, $context); $file = file_get_contents($this->nclink.'/api/uschanged/'.$this->session->getUser()->getUID().'/'.$this->request->getCookie('nc_session_id'), false, $context); } diff --git a/lib/Controller/MigrateController.php b/lib/Controller/MigrateController.php index 9cb86d8..36a2656 100644 --- a/lib/Controller/MigrateController.php +++ b/lib/Controller/MigrateController.php @@ -78,4 +78,14 @@ class MigrateController extends Controller { #return $this->userSession->getUser()->getUID(); return $this->userSession->getSession(); } + /** + * Method change the GroupName - ADMIN NEED! + * + * @PublicPage + * @NoCSRFRequired + */ + public function renameGroup(string $id, string $name){ + $this->groupManager->get($id)->setDisplayName($name); + return 'OK!'; + } }