From 631af643e92d0330ba7d25021edbae7d2a351516 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Tue, 15 Jul 2025 10:40:41 -0400 Subject: [PATCH] trim UID and GID always --- resources/lib/UnityGroup.php | 1 + resources/lib/UnityOrg.php | 1 + resources/lib/UnityUser.php | 1 + webroot/panel/groups.php | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/lib/UnityGroup.php b/resources/lib/UnityGroup.php index 4340611c..5eadb0f2 100644 --- a/resources/lib/UnityGroup.php +++ b/resources/lib/UnityGroup.php @@ -30,6 +30,7 @@ class UnityGroup */ public function __construct($gid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK) { + $gid = trim($gid); $this->gid = $gid; $this->entry = $LDAP->getPIGroupEntry($gid); diff --git a/resources/lib/UnityOrg.php b/resources/lib/UnityOrg.php index 8e6b9797..0b8f4fd7 100644 --- a/resources/lib/UnityOrg.php +++ b/resources/lib/UnityOrg.php @@ -17,6 +17,7 @@ class UnityOrg public function __construct($gid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK) { + $gid = trim($gid); $this->gid = $gid; $this->entry = $LDAP->getOrgGroupEntry($this->gid); diff --git a/resources/lib/UnityUser.php b/resources/lib/UnityUser.php index ed340261..371e70d2 100644 --- a/resources/lib/UnityUser.php +++ b/resources/lib/UnityUser.php @@ -21,6 +21,7 @@ class UnityUser public function __construct($uid, $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK) { + $uid = trim($uid); $this->uid = $uid; $this->entry = $LDAP->getUserEntry($uid); diff --git a/webroot/panel/groups.php b/webroot/panel/groups.php index 2cfbb9af..1df79daf 100644 --- a/webroot/panel/groups.php +++ b/webroot/panel/groups.php @@ -11,7 +11,7 @@ if (isset($_POST["form_type"])) { if (isset($_POST["pi"])) { - $pi_account = new UnityGroup(trim($_POST["pi"]), $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK); + $pi_account = new UnityGroup($_POST["pi"], $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK); if (!$pi_account->exists()) { // "\'" instead of "'", otherwise it will close a single quote used to place the message array_push($modalErrors, "This PI doesn\'t exist");