diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c3b80b86..0f703c9f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -82,7 +82,7 @@ cd ./tools/docker-dev tab 2: ``` $ container="$(docker container ls | grep web | awk '{print $1}')" -$ docker exec "$container" -it bash +$ docker exec -it "$container" bash > cd /var/www/unity-web > ./vendor/bin/phpunit /path/to/tests ``` diff --git a/composer.json b/composer.json index 2232137c..6da54163 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,8 @@ }, "require-dev": { "phpunit/phpunit": "<12.1", - "robiningelbrecht/phpunit-coverage-tools": "<2" + "robiningelbrecht/phpunit-coverage-tools": "<2", + "phpstan/phpstan": "^2.1", + "vimeo/psalm": "^6.13" } } diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 00000000..a8001d7e --- /dev/null +++ b/psalm.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + diff --git a/resources/lib/UnityLDAP.php b/resources/lib/UnityLDAP.php index dadfb9db..106bc993 100644 --- a/resources/lib/UnityLDAP.php +++ b/resources/lib/UnityLDAP.php @@ -419,24 +419,24 @@ public function getAllOrgGroupsAttributes($attributes) public function getUserEntry($uid) { $uid = ldap_escape($uid, "", LDAP_ESCAPE_DN); - return $this->getEntry(unityLDAP::RDN . "=$uid," . CONFIG["ldap"]["user_ou"]); + return $this->getEntry(UnityLDAP::RDN . "=$uid," . CONFIG["ldap"]["user_ou"]); } public function getGroupEntry($gid) { $gid = ldap_escape($gid, "", LDAP_ESCAPE_DN); - return $this->getEntry(unityLDAP::RDN . "=$gid," . CONFIG["ldap"]["group_ou"]); + return $this->getEntry(UnityLDAP::RDN . "=$gid," . CONFIG["ldap"]["group_ou"]); } public function getPIGroupEntry($gid) { $gid = ldap_escape($gid, "", LDAP_ESCAPE_DN); - return $this->getEntry(unityLDAP::RDN . "=$gid," . CONFIG["ldap"]["pigroup_ou"]); + return $this->getEntry(UnityLDAP::RDN . "=$gid," . CONFIG["ldap"]["pigroup_ou"]); } public function getOrgGroupEntry($gid) { $gid = ldap_escape($gid, "", LDAP_ESCAPE_DN); - return $this->getEntry(unityLDAP::RDN . "=$gid," . CONFIG["ldap"]["orggroup_ou"]); + return $this->getEntry(UnityLDAP::RDN . "=$gid," . CONFIG["ldap"]["orggroup_ou"]); } } diff --git a/resources/lib/UnityOrg.php b/resources/lib/UnityOrg.php index eef5f76c..a12a7fa4 100644 --- a/resources/lib/UnityOrg.php +++ b/resources/lib/UnityOrg.php @@ -50,7 +50,7 @@ public function inOrg($user, $ignorecache = false) public function getOrgMembers($ignorecache = false) { - $members = $this->getGroupMemberUIDs($ignorecache); + $members = $this->getOrgMemberUIDs($ignorecache); $out = array(); foreach ($members as $member) { $user_obj = new UnityUser( diff --git a/resources/lib/phpopenldaper b/resources/lib/phpopenldaper index eed8c05d..78d79e5d 160000 --- a/resources/lib/phpopenldaper +++ b/resources/lib/phpopenldaper @@ -1 +1 @@ -Subproject commit eed8c05d71b711d83f2ee3b5567c570a37212ed9 +Subproject commit 78d79e5db34baa0dc964178a86857e8b1dc38752