dataset/seed/piwigo/templates/config.inc.php

51 lines
1.6 KiB
PHP
Raw Permalink Normal View History

2022-04-28 21:48:16 +02:00
<?php
if(!isset($_SERVER) && isset($_ENV) && isset($_ENV['REQUEST_URI']))
{
$_SERVER = Array('REQUEST_URI' => $_ENV['REQUEST_URI']);
}
2023-06-23 08:12:05 +02:00
{% for user in piwigo_users %}
{%if loop.index != 1 %}
2022-04-28 21:48:16 +02:00
}
2023-06-23 08:12:05 +02:00
else {% if True -%}{% endif -%}
{%- endif -%}
if(str_starts_with($_SERVER['REQUEST_URI'], '/{{ user }}/')) {
$prefixe = '{{ user }}';
{% endfor %}
2022-04-28 21:48:16 +02:00
}
else
{
2023-06-23 08:12:05 +02:00
$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 }}',
2022-04-28 21:48:16 +02:00
'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;
?>