aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Template/JSConfigHelper.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Template/JSConfigHelper.php')
-rw-r--r--lib/private/Template/JSConfigHelper.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php
index 5743d2965d2..07e557d0706 100644
--- a/lib/private/Template/JSConfigHelper.php
+++ b/lib/private/Template/JSConfigHelper.php
@@ -30,6 +30,7 @@ use OCP\ILogger;
use OCP\ISession;
use OCP\IURLGenerator;
use OCP\IUser;
+use OCP\Server;
use OCP\ServerVersion;
use OCP\Session\Exceptions\SessionNotAvailableException;
use OCP\Share\IManager as IShareManager;
@@ -66,9 +67,11 @@ class JSConfigHelper {
$backend = $this->currentUser->getBackend();
if ($backend instanceof IPasswordConfirmationBackend) {
- $userBackendAllowsPasswordConfirmation = $backend->canConfirmPassword($uid);
+ $userBackendAllowsPasswordConfirmation = $backend->canConfirmPassword($uid) && $this->canUserValidatePassword();
} elseif (isset($this->excludedUserBackEnds[$this->currentUser->getBackendClassName()])) {
$userBackendAllowsPasswordConfirmation = false;
+ } else {
+ $userBackendAllowsPasswordConfirmation = $this->canUserValidatePassword();
}
} else {
$uid = null;
@@ -161,6 +164,8 @@ class JSConfigHelper {
'enable_non-accessible_features' => $this->config->getSystemValueBool('enable_non-accessible_features', true),
];
+ $shareManager = Server::get(IShareManager::class);
+
$array = [
'_oc_debug' => $this->config->getSystemValue('debug', false) ? 'true' : 'false',
'_oc_isadmin' => $uid !== null && $this->groupManager->isAdmin($uid) ? 'true' : 'false',
@@ -235,11 +240,11 @@ class JSConfigHelper {
'defaultExpireDateEnforced' => $enforceDefaultExpireDate,
'enforcePasswordForPublicLink' => Util::isPublicLinkPasswordRequired(),
'enableLinkPasswordByDefault' => $enableLinkPasswordByDefault,
- 'sharingDisabledForUser' => Util::isSharingDisabledForUser(),
+ 'sharingDisabledForUser' => $shareManager->sharingDisabledForUser($uid),
'resharingAllowed' => Share::isResharingAllowed(),
'remoteShareAllowed' => $outgoingServer2serverShareEnabled,
'federatedCloudShareDoc' => $this->urlGenerator->linkToDocs('user-sharing-federated'),
- 'allowGroupSharing' => \OC::$server->get(IShareManager::class)->allowGroupSharing(),
+ 'allowGroupSharing' => $shareManager->allowGroupSharing(),
'defaultInternalExpireDateEnabled' => $defaultInternalExpireDateEnabled,
'defaultInternalExpireDate' => $defaultInternalExpireDate,
'defaultInternalExpireDateEnforced' => $defaultInternalExpireDateEnforced,