correstion CAS nextcloud

This commit is contained in:
afornerot 2024-09-22 10:35:25 +02:00
parent 55e4226456
commit 2ca0cef4f6
8 changed files with 29 additions and 19 deletions

View File

@ -2,8 +2,6 @@
if [ -f "$dir/dicos/.env.dicos" ]; then
echo $dir
dicos="$dir/dicos/.env.dicos"
# Exporter la variable

View File

@ -30,7 +30,7 @@
<dependencies>
<owncloud min-version="10.0" max-version="10.10"/>
<nextcloud min-version="14" max-version="27.1"/>
<nextcloud min-version="14" max-version="27.2"/>
</dependencies>
<commands>

View File

@ -123,7 +123,7 @@ class AuthenticationController extends Controller
$this->loggingService->write(\OCA\UserCas\Service\LoggingService::FATAL, 'Fatal error with code: ' . $e->getCode() . ' and message: ' . $e->getMessage());
header("Location: " . $this->appService->getAbsoluteURL('/'));
header("Location: " . this->getServiceBasedUrl());
die();
}
}
@ -217,7 +217,7 @@ class AuthenticationController extends Controller
$this->loggingService->write(\OCA\UserCas\Service\LoggingService::FATAL, 'Fatal error with code: ' . $e->getCode() . ' and message: ' . $e->getMessage());
header("Location: " . $this->appService->getAbsoluteURL('/'));
header("Location: " . this->getServiceBasedUrl());
die();
}
}
@ -278,19 +278,26 @@ class AuthenticationController extends Controller
$newProtocol = 'http://';
if (intval($this->config->getAppValue($this->appName, 'cas_server_port')) === 443) {
$newProtocol = 'https://';
}
$params['backUrl'] = $newProtocol . $this->config->getAppValue($this->appName, 'cas_server_hostname') . $this->config->getAppValue($this->appName, 'cas_server_path');
} else {*/
$params['backUrl'] = $this->appService->getAbsoluteURL('/');
$params['backUrl'] = this->getServiceBasedUrl();
//}
$response = new TemplateResponse($this->appName, 'cas-error', $params, 'guest');
return $response;
}
private function getServiceBasedUrl(): string {
$overwrite = \OC::$server->getConfig()->getSystemValue('overwrite.cli.url');
if($overwrite) return $overwrite;
$httpProtocol = \OC::$server->getConfig()->getSystemValue('protocol');
$currentUrl = $_SERVER['SERVER_NAME'];
return $httpProtocol . $currentUrl;
}
}

View File

@ -406,7 +406,7 @@ class UserHooks
# Reset cookie
setcookie("user_cas_redirect_url", '/', 0, '/');
\phpCAS::logout(array("service" => $this->appService->getAbsoluteURL('/')));
\phpCAS::logout(array("service" => $this->getServiceBasedUrl()));
} else {
@ -445,4 +445,14 @@ class UserHooks
return $attributes;
}
private function getServiceBasedUrl(): string {
$overwrite = \OC::$server->getConfig()->getSystemValue('overwrite.cli.url');
if($overwrite) return $overwrite;
$httpProtocol = \OC::$server->getConfig()->getSystemValue('protocol');
$currentUrl = $_SERVER['SERVER_NAME'];
return $httpProtocol . $currentUrl;
}
}

View File

@ -54,7 +54,7 @@ run_as 'php occ app:update files_external'
run_as 'php occ app:enable files_external'
if [[ "${NEXTCLOUD_SAMBA}" == "1" ]]
then
run_as 'php occ files_external:import /envole/mount.json -q'
run_as 'php occ files_external:import /nine/mount.json -q'
fi
echo
@ -67,7 +67,7 @@ echo
echo "== USER CAS"
if [[ "${MODE_AUTH}" == "CAS" && "${CAS_ACTIVATE}" == "1" ]]
then
cp -rf /envole/app/user_cas /var/www/html/custom_apps
cp -rf /nine/app/user_cas /var/www/html/custom_apps
chown www-data:www-data /var/www/html/custom_apps -R
run_as 'php occ config:app:set user_cas cas_server_hostname --value='${CAS_HOST}' -q'
run_as 'php occ config:app:set user_cas cas_server_path --value='${CAS_PATH}' -q'

View File

@ -1,5 +0,0 @@
# nineskeletor
ProxyPass /nineskeletor http://nineskeletor/nineskeletor retry=0 keepalive=On
ProxyPassReverse /nineskeletor http://nineskeletor/nineskeletor retry=0

View File

@ -8,7 +8,7 @@ WORDPRESS_DB_PASSWORD=${MARIADB_PASSWORD}
WORDPRESS_TITLE=wordpress
WORDPRESS_USER=${ADMIN_USER}
WORDPRESS_PASSWORD=${ADMIN_PASSWORD}
WORDPRESS_EMAIL=${ADMIN_USER}@noreply.fr
WORDPRESS_EMAIL=${ADMIN_EMAIL}
WORDPRESS_PROTOCOL=${PROTOCOLE}
WORDPRESS_DOMAINE=${WEB_URL}
WORDPRESS_ALIAS=/wordpress/