50 lines
1.6 KiB
PHP
50 lines
1.6 KiB
PHP
<?php
|
|
if(!isset($_SERVER) && isset($_ENV) && isset($_ENV['REQUEST_URI']))
|
|
{
|
|
$_SERVER = Array('REQUEST_URI' => $_ENV['REQUEST_URI']);
|
|
}
|
|
|
|
{% for user in piwigo_users %}
|
|
{%if loop.index != 1 %}
|
|
}
|
|
else {% if True -%}{% endif -%}
|
|
{%- endif -%}
|
|
if(str_starts_with($_SERVER['REQUEST_URI'], '/{{ user }}/')) {
|
|
$prefixe = '{{ user }}';
|
|
{% endfor %}
|
|
}
|
|
else
|
|
{
|
|
$conf['OIDC'] = Array('issuer_url' => 'https://{{ general.oauth2_client.oauth2_client_server_domainname }}/',
|
|
'client_id' => '{{ general.oauth2_client.oauth2_client_id }}',
|
|
'client_secret' => '{{ general.oauth2_client.oauth2_client_secret }}',
|
|
'scope' => 'openid profile email',
|
|
);
|
|
require_once(PHPWG_ROOT_PATH . 'plugins/OpenIdConnect/oidc.php');
|
|
require_once(PHPWG_ROOT_PATH . 'include/functions.inc.php');
|
|
$oidc = get_oidc_client();
|
|
try {
|
|
$success = $oidc->authenticate();
|
|
} catch (Exception $e) {
|
|
}
|
|
if (isset($_REQUEST['code'])) {
|
|
$token_json = $oidc->getTokenResponse();
|
|
$oidc->setAccessToken($token_json->access_token);
|
|
$name = $oidc->requestUserInfo('nickname');
|
|
if(isset($name)) {
|
|
redirect('/' . $name . '/plugins/OpenIdConnect/auth.php');
|
|
};
|
|
print('unknown album');
|
|
die();
|
|
}
|
|
}
|
|
$conf['data_location'] = "_data/$prefixe/";
|
|
$conf['log_dir'] = "logs/$prefixe";
|
|
$conf['upload_dir'] = "./upload/$prefixe";
|
|
$conf['graphics_library'] = 'ext_imagick';
|
|
$conf['osm_add_osmmap.php'] = false;
|
|
$conf['show_exif'] = false;
|
|
$conf['derivative_default_size'] = 'large';
|
|
#FOR GPX
|
|
$conf['upload_form_all_types'] = true;
|
|
?>
|