autoconfigure CloudAddress

automatically do setCloudAddress() if overwrite.cli.url is set

Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
pull/67/head
Jonas Sulzer 2018-11-28 12:25:36 +01:00 zatwierdzone przez Julius Härtl
rodzic 80dfd0d794
commit 59a9a66914
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4C614C6ED2CDE6DF
1 zmienionych plików z 24 dodań i 13 usunięć

Wyświetl plik

@ -145,20 +145,31 @@ 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()
);
$data['serverData']['cliUrl'] = rtrim(
$this->config->getSystemValue('overwrite.cli.url', ''), "/"
);
$frontControllerActive = ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true');
if ($data['serverData']['cliUrl']){
if (!$frontControllerActive){
$data['serverData']['cliUrl'] .= '/index.php';
}
$this->configService->setCloudAddress($data['serverData']['cliUrl']);
} 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);
}
}
}
}