From fc3c53d86a16f6b2633470198346b679a3c186b6 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 22 Feb 2026 09:10:07 -0500 Subject: [PATCH 1/8] chore: replace deprecated QB execute() calsl in AdminController Signed-off-by: Josh --- lib/Controller/AdminController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index 1669b704..4f17d2a4 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -59,7 +59,7 @@ public function addAdditionalAdmin(string $name):JSONResponse { $query = $this->dbConnection->getQueryBuilder(); $query->insert('privacy_admins') ->setValue('displayname', $query->createNamedParameter($name)) - ->execute(); + ->executeStatement(); $id = $query->getLastInsertId(); @@ -78,7 +78,7 @@ public function deleteAdditionalAdmin(int $id):JSONResponse { $query = $this->dbConnection->getQueryBuilder(); $query->delete('privacy_admins') ->where($query->expr()->eq('id', $query->createNamedParameter($id))) - ->execute(); + ->executeStatement(); return new JSONResponse([], Http::STATUS_OK); } From b216ea89be582e69f0469e45602d2feb803a7682 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 22 Feb 2026 09:11:12 -0500 Subject: [PATCH 2/8] chore: replace deprecated QB execute() calsl in PersonalController Signed-off-by: Josh --- lib/Controller/PersonalController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Controller/PersonalController.php b/lib/Controller/PersonalController.php index d54b1d0e..861d75da 100644 --- a/lib/Controller/PersonalController.php +++ b/lib/Controller/PersonalController.php @@ -79,7 +79,7 @@ public function getAdmins():JSONResponse { $query = $this->dbConnection->getQueryBuilder(); $query->select(['id', 'displayname']) ->from('privacy_admins'); - $stmt = $query->execute(); + $stmt = $query->executeQuery(); foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) { $uids[] = [ From 5387e676faa214683f854e905b6348e2827e99b1 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 22 Feb 2026 09:23:52 -0500 Subject: [PATCH 3/8] refactor: modernize PersonalController - property types&promotion Signed-off-by: Josh --- lib/Controller/PersonalController.php | 41 +++++++++++---------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/lib/Controller/PersonalController.php b/lib/Controller/PersonalController.php index 861d75da..b842f6c6 100644 --- a/lib/Controller/PersonalController.php +++ b/lib/Controller/PersonalController.php @@ -1,9 +1,11 @@ config = $config; - $this->groupManager = $groupManager; - $this->dbConnection = $dbConnection; } /** - * @NoAdminRequired + * Returns all admin users (internal group admins and external privacy admins). * - * @return JSONResponse + * @NoAdminRequired */ - public function getAdmins():JSONResponse { + public function getAdmins(): JSONResponse { $adminGroup = $this->groupManager->get('admin'); // Admin Group should always exist, just catch for safety's sake From 3b5508a785a0b6d932b28dc1a6953db021759fce Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 22 Feb 2026 09:33:31 -0500 Subject: [PATCH 4/8] refactor: modernize AdminController - property types&promotion Signed-off-by: Josh --- lib/Controller/AdminController.php | 43 +++++++++++------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index 4f17d2a4..5ef4e155 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -1,9 +1,11 @@ config = $config; - $this->dbConnection = $dbConnection; } /** * @param string $code * @return JSONResponse */ - public function setReadableLocation(string $code):JSONResponse { + public function setReadableLocation(string $code): JSONResponse { $this->config->setAppValue($this->appName, 'readableLocation', $code); return new JSONResponse([], Http::STATUS_OK); } @@ -55,7 +42,7 @@ public function setReadableLocation(string $code):JSONResponse { * @param string $name * @return JSONResponse */ - public function addAdditionalAdmin(string $name):JSONResponse { + public function addAdditionalAdmin(string $name): JSONResponse { $query = $this->dbConnection->getQueryBuilder(); $query->insert('privacy_admins') ->setValue('displayname', $query->createNamedParameter($name)) @@ -74,7 +61,7 @@ public function addAdditionalAdmin(string $name):JSONResponse { * @param int $id * @return JSONResponse */ - public function deleteAdditionalAdmin(int $id):JSONResponse { + public function deleteAdditionalAdmin(int $id): JSONResponse { $query = $this->dbConnection->getQueryBuilder(); $query->delete('privacy_admins') ->where($query->expr()->eq('id', $query->createNamedParameter($id))) @@ -87,7 +74,7 @@ public function deleteAdditionalAdmin(int $id):JSONResponse { * @param string $enabled * @return JSONResponse */ - public function setFullDiskEncryption(string $enabled):JSONResponse { + public function setFullDiskEncryption(string $enabled): JSONResponse { $allowedValues = ['0', '1']; if (!\in_array($enabled, $allowedValues, true)) { return new JSONResponse([], HTTP::STATUS_NOT_ACCEPTABLE); From 62ff53e8f52dde23dd4c6762ef705ae669944327 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 22 Feb 2026 10:11:20 -0500 Subject: [PATCH 5/8] chore: fixup PersonalController.php Signed-off-by: Josh --- lib/Controller/PersonalController.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/lib/Controller/PersonalController.php b/lib/Controller/PersonalController.php index b842f6c6..4607ab9b 100644 --- a/lib/Controller/PersonalController.php +++ b/lib/Controller/PersonalController.php @@ -17,19 +17,6 @@ use OCP\IRequest; class PersonalController extends Controller { - private IConfig $config; - private IGroupManager $groupManager; - private IDBConnection $dbConnection; - - /** - * PersonalController constructor. - * - * @param string $appName - * @param IRequest $request - * @param IConfig $config - * @param IGroupManager $groupManager - * @param IDBConnection $dbConnection - */ public function __construct( string $appName, IRequest $request, From c18d8a60a997829a9f127189806cd3e21704a642 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 22 Feb 2026 10:11:41 -0500 Subject: [PATCH 6/8] chore: fixup AdminController.php Signed-off-by: Josh --- lib/Controller/AdminController.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index 5ef4e155..76640ae8 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -17,9 +17,6 @@ class AdminController extends Controller { - private IConfig $config; - private IDBConnection $dbConnection; - public function __construct( string $appName, IRequest $request, From 89d59cc46cff35967c8203ee22c33cc424e31176 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 22 Feb 2026 10:15:33 -0500 Subject: [PATCH 7/8] chore: fixup AdminController for lint Signed-off-by: Josh --- lib/Controller/AdminController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index 76640ae8..f3071d79 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -21,7 +21,7 @@ public function __construct( string $appName, IRequest $request, private IConfig $config, - private IDBConnection $dbConnection + private IDBConnection $dbConnection, ) { parent::__construct($appName, $request); } From 1ff40b7d61a6870800262979f48139175b866e38 Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 22 Feb 2026 10:15:52 -0500 Subject: [PATCH 8/8] chore: fixup PersonalController.php for lint Signed-off-by: Josh --- lib/Controller/PersonalController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Controller/PersonalController.php b/lib/Controller/PersonalController.php index 4607ab9b..e34d98fd 100644 --- a/lib/Controller/PersonalController.php +++ b/lib/Controller/PersonalController.php @@ -22,7 +22,7 @@ public function __construct( IRequest $request, private IConfig $config, private IGroupManager $groupManager, - private IDBConnection $dbConnection + private IDBConnection $dbConnection, ) { parent::__construct($appName, $request); }