mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-26 02:44:29 +00:00
Cope with noisy file access denial such as open_basedir.
This commit is contained in:
parent
b17c163d9b
commit
89df8d8881
@ -9,6 +9,9 @@
|
|||||||
// Ensure the configuration starts out as an empty object.
|
// Ensure the configuration starts out as an empty object.
|
||||||
unset($c);
|
unset($c);
|
||||||
|
|
||||||
|
// Ditto for a few other global things
|
||||||
|
unset($session); unset($request); unset($dbconn);
|
||||||
|
|
||||||
// Default some of the configurable values
|
// Default some of the configurable values
|
||||||
$c->sysabbr = 'davical';
|
$c->sysabbr = 'davical';
|
||||||
$c->admin_email = 'admin@davical.example.com';
|
$c->admin_email = 'admin@davical.example.com';
|
||||||
@ -53,6 +56,11 @@ $c->protocol_server_port_script = sprintf( "%s://%s%s%s", (isset($_SERVER['HTTPS
|
|||||||
|
|
||||||
init_gettext( 'rscds', '../locale' );
|
init_gettext( 'rscds', '../locale' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We use @file_exists because things like open_basedir might noisily deny
|
||||||
|
* access which could break DAViCal completely by causing output to start
|
||||||
|
* too early.
|
||||||
|
*/
|
||||||
if ( @file_exists("/etc/davical/".$_SERVER['SERVER_NAME']."-conf.php") ) {
|
if ( @file_exists("/etc/davical/".$_SERVER['SERVER_NAME']."-conf.php") ) {
|
||||||
include_once("/etc/davical/".$_SERVER['SERVER_NAME']."-conf.php");
|
include_once("/etc/davical/".$_SERVER['SERVER_NAME']."-conf.php");
|
||||||
}
|
}
|
||||||
@ -85,7 +93,7 @@ awl_set_locale($c->default_locale);
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$c->code_version = 0;
|
$c->code_version = 0;
|
||||||
$c->version_string = '0.9.3'; // The actual version # is replaced into that during the build /release process
|
$c->version_string = '0.9.4'; // The actual version # is replaced into that during the build /release process
|
||||||
if ( isset($c->version_string) && preg_match( '/(\d+)\.(\d+)\.(\d+)(.*)/', $c->version_string, $matches) ) {
|
if ( isset($c->version_string) && preg_match( '/(\d+)\.(\d+)\.(\d+)(.*)/', $c->version_string, $matches) ) {
|
||||||
$c->code_major = $matches[1];
|
$c->code_major = $matches[1];
|
||||||
$c->code_minor = $matches[2];
|
$c->code_minor = $matches[2];
|
||||||
|
|||||||
@ -56,13 +56,18 @@ $c->protocol_server_port_script = sprintf( "%s://%s%s%s", (isset($_SERVER['HTTPS
|
|||||||
|
|
||||||
init_gettext( 'rscds', '../locale' );
|
init_gettext( 'rscds', '../locale' );
|
||||||
|
|
||||||
if ( file_exists("/etc/davical/".$_SERVER['SERVER_NAME']."-conf.php") ) {
|
/**
|
||||||
|
* We use @file_exists because things like open_basedir might noisily deny
|
||||||
|
* access which could break DAViCal completely by causing output to start
|
||||||
|
* too early.
|
||||||
|
*/
|
||||||
|
if ( @file_exists("/etc/davical/".$_SERVER['SERVER_NAME']."-conf.php") ) {
|
||||||
include_once("/etc/davical/".$_SERVER['SERVER_NAME']."-conf.php");
|
include_once("/etc/davical/".$_SERVER['SERVER_NAME']."-conf.php");
|
||||||
}
|
}
|
||||||
else if ( file_exists("/etc/rscds/".$_SERVER['SERVER_NAME']."-conf.php") ) {
|
else if ( @file_exists("/etc/rscds/".$_SERVER['SERVER_NAME']."-conf.php") ) {
|
||||||
include_once("/etc/rscds/".$_SERVER['SERVER_NAME']."-conf.php");
|
include_once("/etc/rscds/".$_SERVER['SERVER_NAME']."-conf.php");
|
||||||
}
|
}
|
||||||
else if ( file_exists("../config/config.php") ) {
|
else if ( @file_exists("../config/config.php") ) {
|
||||||
include_once("../config/config.php");
|
include_once("../config/config.php");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user