diff --git a/inc/caldav-MKCALENDAR.php b/inc/caldav-MKCALENDAR.php index e8520f1d..4367a10e 100644 --- a/inc/caldav-MKCALENDAR.php +++ b/inc/caldav-MKCALENDAR.php @@ -25,7 +25,7 @@ if ( preg_match( '#^(.*/)([^/]+)(/)?$#', $request_path, $matches ) ) { $displayname = $matches[2]; } $sql = "SELECT * FROM collection WHERE user_no = ? AND dav_name = ?;"; -$qry = new PgQuery( $sql, $session->user_no, $request_path ); +$qry = new PgQuery( $sql, $path_user_no, $request_path ); if ( ! $qry->Exec("MKCALENDAR") ) { header("HTTP/1.1 500 Infernal Server Error"); dbg_error_log( "ERROR", " MKCALENDAR Failed (database error) for '%s' named '%s', user '%d' in parent '%s'", $request_path, $displayname, $session->user_no, $parent_container); @@ -38,7 +38,7 @@ if ( $qry->rows != 0 ) { } $sql = "INSERT INTO collection ( user_no, parent_container, dav_name, dav_etag, dav_displayname, is_calendar, created, modified ) VALUES( ?, ?, ?, ?, ?, TRUE, current_timestamp, current_timestamp );"; -$qry = new PgQuery( $sql, $session->user_no, $parent_container, $request_path, md5($session->user_no. $request_path), $displayname ); +$qry = new PgQuery( $sql, $path_user_no, $parent_container, $request_path, md5($path_user_no. $request_path), $displayname ); if ( $qry->Exec("MKCALENDAR",__LINE__,__FILE__) ) { header("HTTP/1.1 200 Created"); diff --git a/inc/caldav-MKCOL.php b/inc/caldav-MKCOL.php index 27b7a41d..35683707 100644 --- a/inc/caldav-MKCOL.php +++ b/inc/caldav-MKCOL.php @@ -26,7 +26,7 @@ if ( preg_match( '#^(.*/)([^/]+)(/)?$#', $request_path, $matches ) ) { } $sql = "SELECT * FROM collection WHERE user_no = ? AND dav_name = ?;"; -$qry = new PgQuery( $sql, $session->user_no, $request_path ); +$qry = new PgQuery( $sql, $path_user_no, $request_path ); if ( ! $qry->Exec("MKCOL") ) { header("HTTP/1.1 500 Infernal Server Error"); dbg_error_log( "ERROR", " MKCOL Failed (database error) for '%s' named '%s', user '%d' in parent '%s'", $request_path, $displayname, $session->user_no, $parent_container); @@ -39,7 +39,7 @@ if ( $qry->rows != 0 ) { } $sql = "INSERT INTO collection ( user_no, parent_container, dav_name, dav_etag, dav_displayname, is_calendar, created, modified ) VALUES( ?, ?, ?, ?, ?, FALSE, current_timestamp, current_timestamp );"; -$qry = new PgQuery( $sql, $session->user_no, $parent_container, $request_path, md5($session->user_no. $request_path), $displayname ); +$qry = new PgQuery( $sql, $path_user_no, $parent_container, $request_path, md5($path_user_no. $request_path), $displayname ); if ( $qry->Exec("MKCOL",__LINE__,__FILE__) ) { header("HTTP/1.1 200 Created"); diff --git a/inc/caldav-PUT.php b/inc/caldav-PUT.php index dc833609..a38a23bd 100644 --- a/inc/caldav-PUT.php +++ b/inc/caldav-PUT.php @@ -54,7 +54,7 @@ if ( $request_container == "/$path_username" ) { } else { $sql = "SELECT * FROM collection WHERE user_no = ? AND dav_name = ?;"; - $qry = new PgQuery( $sql, $session->user_no, $request_container ); + $qry = new PgQuery( $sql, $path_user_no, $request_container ); if ( ! $qry->Exec("PUT") ) { header("HTTP/1.1 500 Internal Server Error"); dbg_error_log( "ERROR", " PUT Failed (database error) for '%s' named '%s', user '%d' in parent '%s'", $request_path, $session->user_no, $parent_container); @@ -66,7 +66,7 @@ else { $displayname = $matches[2]; } $sql = "INSERT INTO collection ( user_no, parent_container, dav_name, dav_etag, dav_displayname, is_calendar, created, modified ) VALUES( ?, ?, ?, ?, ?, TRUE, current_timestamp, current_timestamp );"; - $qry = new PgQuery( $sql, $session->user_no, $parent_container, $request_container, md5($session->user_no. $request_container), $displayname ); + $qry = new PgQuery( $sql, $path_user_no, $parent_container, $request_container, md5($path_user_no. $request_container), $displayname ); $qry->Exec("PUT"); } }