Merge pull request #67 from nextcloud-gmbh/autoconfigure_cloudaddress

Autoconfigure cloudaddress
pull/81/head
Julius Härtl 2018-11-29 10:33:03 +01:00 zatwierdzone przez GitHub
commit 2d06e10d80
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 25 dodań i 13 usunięć

Wyświetl plik

@ -145,20 +145,32 @@ class NavigationController extends Controller {
try {
$data['serverData']['cloudAddress'] = $this->configService->getCloudAddress();
} catch (SocialAppConfigException $e) {
$data['serverData']['setup'] = true;
$data['serverData']['isAdmin'] = \OC::$server->getGroupManager()
->isAdmin($this->userId);
if ($data['serverData']['isAdmin']) {
$cloudAddress = $this->request->getParam('cloudAddress');
if ($cloudAddress !== null) {
$this->configService->setCloudAddress($cloudAddress);
} else {
$data['serverData']['cliUrl'] = $this->config->getSystemValue(
'overwrite.cli.url', \OC::$server->getURLGenerator()
->getBaseUrl()
);
$cloudAddress = rtrim(
$this->config->getSystemValue('overwrite.cli.url', ''), '/'
);
$frontControllerActive = ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true');
if ($cloudAddress !== ''){
if (!$frontControllerActive){
$cloudAddress .= '/index.php';
}
$this->configService->setCloudAddress($cloudAddress);
$data['serverData']['cloudAddress'] = $cloudAddress;
} else {
$data['serverData']['setup'] = true;
$data['serverData']['isAdmin'] = \OC::$server->getGroupManager()
->isAdmin($this->userId);
if ($data['serverData']['isAdmin']) {
$cloudAddress = $this->request->getParam('cloudAddress');
if ($cloudAddress !== null) {
$this->configService->setCloudAddress($cloudAddress);
} else {
$data['serverData']['cliUrl'] = $this->config->getSystemValue(
'overwrite.cli.url', \OC::$server->getURLGenerator()
->getBaseUrl()
);
return new TemplateResponse(Application::APP_NAME, 'main', $data);
return new TemplateResponse(Application::APP_NAME, 'main', $data);
}
}
}
}