summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/User
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2021-10-26 16:43:39 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2021-12-16 09:43:30 +0100
commitf3dcbfe146782d2c7dec8760651e79605ddc96e7 (patch)
treea22984b0976ae1b7ac4ba3082217bc5dd8b34f61 /apps/user_ldap/lib/User
parent37f8f7a5a18e57507330036b747d4b12e58efae4 (diff)
downloadnextcloud-server-f3dcbfe146782d2c7dec8760651e79605ddc96e7.tar.gz
nextcloud-server-f3dcbfe146782d2c7dec8760651e79605ddc96e7.zip
Fix PHP 8.1 support for user_ldap application
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/lib/User')
-rw-r--r--apps/user_ldap/lib/User/Manager.php2
-rw-r--r--apps/user_ldap/lib/User/User.php8
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/user_ldap/lib/User/Manager.php b/apps/user_ldap/lib/User/Manager.php
index 63af3cf1770..e752b113e3f 100644
--- a/apps/user_ldap/lib/User/Manager.php
+++ b/apps/user_ldap/lib/User/Manager.php
@@ -177,7 +177,7 @@ class Manager {
$this->access->getConnection()->ldapExtStorageHomeAttribute,
];
- $homeRule = $this->access->getConnection()->homeFolderNamingRule;
+ $homeRule = (string)$this->access->getConnection()->homeFolderNamingRule;
if (strpos($homeRule, 'attr:') === 0) {
$attributes[] = substr($homeRule, strlen('attr:'));
}
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index a0955f94bb4..ab1500ff368 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -464,9 +464,9 @@ class User {
* bytes), '1234 MB' (quota in MB - check the \OC_Helper::computerFileSize method for more info)
*
* fetches the quota from LDAP and stores it as Nextcloud user value
- * @param string $valueFromLDAP the quota attribute's value can be passed,
+ * @param ?string $valueFromLDAP the quota attribute's value can be passed,
* to save the readAttribute request
- * @return null
+ * @return void
*/
public function updateQuota($valueFromLDAP = null) {
if ($this->wasRefreshed('quota')) {
@@ -487,7 +487,7 @@ class User {
} elseif (is_array($aQuota) && isset($aQuota[0])) {
$this->logger->debug('no suitable LDAP quota found for user ' . $this->uid . ': [' . $aQuota[0] . ']', ['app' => 'user_ldap']);
}
- } elseif ($this->verifyQuotaValue($valueFromLDAP)) {
+ } elseif (!is_null($valueFromLDAP) && $this->verifyQuotaValue($valueFromLDAP)) {
$quota = $valueFromLDAP;
} else {
$this->logger->debug('no suitable LDAP quota found for user ' . $this->uid . ': [' . $valueFromLDAP . ']', ['app' => 'user_ldap']);
@@ -509,7 +509,7 @@ class User {
}
}
- private function verifyQuotaValue($quotaValue) {
+ private function verifyQuotaValue(string $quotaValue) {
return $quotaValue === 'none' || $quotaValue === 'default' || \OC_Helper::computerFileSize($quotaValue) !== false;
}