mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-26 02:44:29 +00:00
Fix debugging code so this doesn't break a server with open_basedir
enabled. Not that I in any way endorse the use of open_basedir...
This commit is contained in:
parent
73af273610
commit
c6b312e04a
@ -53,13 +53,13 @@ $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") ) {
|
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 {
|
||||||
|
|||||||
@ -124,10 +124,12 @@ function import_collection( $ics_content, $user_no, $path, $caldav_context ) {
|
|||||||
// According to RFC2445 we should always end with CRLF, but the CalDAV spec says
|
// According to RFC2445 we should always end with CRLF, but the CalDAV spec says
|
||||||
// that normalising XML parses often muck with it and may remove the CR.
|
// that normalising XML parses often muck with it and may remove the CR.
|
||||||
$icalendar = preg_replace('/\r?\n /', '', $ics_content );
|
$icalendar = preg_replace('/\r?\n /', '', $ics_content );
|
||||||
if ( isset($c->dbg['ALL']) || isset($c->dbg['put']) ) {
|
if ( ! ini_get('open_basedir') && (isset($c->dbg['ALL']) || isset($c->dbg['put'])) ) {
|
||||||
$fh = fopen('/tmp/PUT-2.txt','w');
|
$fh = fopen('/tmp/PUT-2.txt','w');
|
||||||
fwrite($fh,$icalendar);
|
if ( $fh ) {
|
||||||
fclose($fh);
|
fwrite($fh,$icalendar);
|
||||||
|
fclose($fh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$lines = preg_split('/\r?\n/', $icalendar );
|
$lines = preg_split('/\r?\n/', $icalendar );
|
||||||
|
|||||||
@ -10,10 +10,12 @@
|
|||||||
*/
|
*/
|
||||||
dbg_error_log("REPORT", "method handler");
|
dbg_error_log("REPORT", "method handler");
|
||||||
|
|
||||||
if ( isset($c->dbg['ALL']) || $c->dbg['report'] ) {
|
if ( ! ini_get('open_basedir') && (isset($c->dbg['ALL']) || $c->dbg['report']) ) {
|
||||||
$fh = fopen('/tmp/REPORT.txt','w');
|
$fh = fopen('/tmp/REPORT.txt','w');
|
||||||
fwrite($fh,$request->raw_post);
|
if ( $fh ) {
|
||||||
fclose($fh);
|
fwrite($fh,$request->raw_post);
|
||||||
|
fclose($fh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! ($request->AllowedTo('read') || $request->AllowedTo('freebusy')) ) {
|
if ( ! ($request->AllowedTo('read') || $request->AllowedTo('freebusy')) ) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user