Modification : nginx root configurable.
[lhc/ateliers.git] / etc / agendav / config.php
index ca587a4..262dcb4 100755 (executable)
@@ -1,7 +1,12 @@
 <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
-require_once('/home/www/pub/agendav/web/public/../application/config/production/advanced.php');
-require_once('/home/www/pub/agendav/web/public/../application/config/production/defaults.php');
+require_once('/home/www/data/agendav/web/public/../application/config/production/advanced.php');
+require_once('/home/www/data/agendav/web/public/../application/config/production/defaults.php');
+
+$http_host = $_SERVER['HTTP_HOST'];
+if (substr($http_host, 0, strlen("agendav.")) == "agendav.") {
+       $http_host = substr($http_host, strlen("agendav."));
+ }
 
 $scheme = 'http';
 if (strtolower($_SERVER['HTTPS']) == 'on') {
@@ -9,7 +14,7 @@ if (strtolower($_SERVER['HTTPS']) == 'on') {
  }
 
 $config['additional_js'] = array();
-$config['base_url'] = "$scheme://agendav.heureux-cyclage.org/";
+$config['base_url'] = "$scheme://agendav.$http_host/";
 $config['calendar_colors'] = array
  ( 'D4EAEF'
  , '3A89C9'
@@ -34,7 +39,7 @@ $config['default_language'] = 'fr_FR';
 $config['default_time_format'] = '24';
 $config['default_timezone'] = 'Europe/Paris';
 #$config['encryption_key'] = '';
-$config['footer'] = 'davical.heureux-cyclage.org';
+$config['footer'] = "davical.$http_host";
 $config['format_column_day'] = 'ddd d MMMM';
 $config['format_column_month'] = 'ddd';
 $config['format_column_table'] = 'MMM d, yyyy';
@@ -45,9 +50,20 @@ $config['format_title_month'] = 'MMMM yyyy';
 $config['format_title_table'] = 'dddd, MMM d yyyy';
 $config['format_title_week'] = "MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}";
 $config['log_path'] = '/home/www/log/php5/fpm/agendav/';
-$config['logo'] = 'agendav_100transp.png';
+if (file_exists("/home/www/data/agendav/web/public/img/logo-$http_host.png")) {
+       $config['logo'] = "logo-$http_host.png";
+ }
+else {
+       $config['logo'] = 'agendav_100transp.png';
+ }
+if (file_exists("/home/www/data/agendav/web/public/img/logo-login-$http_host.png")) {
+       $config['login_page_logo'] = "logo-login-$http_host.png";
+ }
+else {
+       $config['login_page_logo'] = "agendav_300transp.png";
+ }
 $config['logout_redirect_to'] = '';
 $config['proxy_ips'] = '';
 $config['show_in_log']= array('ERROR', 'INFO', 'AUTHERR', 'AUTHOK'); # , 'INTERNALS', 'DEBUG'
 $config['show_public_caldav_url'] = TRUE;
-$config['site_title'] = 'agendav.heureux-cyclage.org';
+$config['site_title'] = "agendav.$http_host";