Merge pull request #24201 from owncloud/no-web-updater-for-ldap-and-shibboleth
Disable web updater if ldap or shibboleth are installed
This commit is contained in:
commit
1e400cc113
|
@ -341,11 +341,15 @@ class OC {
|
||||||
$disableWebUpdater = $systemConfig->getValue('upgrade.disable-web', false);
|
$disableWebUpdater = $systemConfig->getValue('upgrade.disable-web', false);
|
||||||
$tooBig = false;
|
$tooBig = false;
|
||||||
if (!$disableWebUpdater) {
|
if (!$disableWebUpdater) {
|
||||||
|
$apps = \OC::$server->getAppManager();
|
||||||
|
$tooBig = $apps->isInstalled('user_ldap') || $apps->isInstalled('user_shibboleth');
|
||||||
|
if (!$tooBig) {
|
||||||
// count users
|
// count users
|
||||||
$stats = \OC::$server->getUserManager()->countUsers();
|
$stats = \OC::$server->getUserManager()->countUsers();
|
||||||
$totalUsers = array_sum($stats);
|
$totalUsers = array_sum($stats);
|
||||||
$tooBig = ($totalUsers > 50);
|
$tooBig = ($totalUsers > 50);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($disableWebUpdater || $tooBig) {
|
if ($disableWebUpdater || $tooBig) {
|
||||||
// send http status 503
|
// send http status 503
|
||||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||||
|
|
Loading…
Reference in New Issue