kopia lustrzana https://github.com/nextcloud/social
Merge pull request #67 from nextcloud-gmbh/autoconfigure_cloudaddress
Autoconfigure cloudaddresspull/81/head
commit
2d06e10d80
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue