mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-21 01:54:23 +00:00
Merge branch 'master' of git://repo.or.cz/davical into sched
This commit is contained in:
commit
887aa8259c
@ -187,7 +187,7 @@ class CalDAVRequest
|
||||
$this->content_type = $matches[1];
|
||||
}
|
||||
if ( isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > 7 ) {
|
||||
if ( $this->method == 'PROPFIND' || $this->method == 'REPORT' ) {
|
||||
if ( $this->method == 'PROPFIND' || $this->method == 'REPORT' || $this->method == 'PROPPATCH' || $this->method == 'BIND' || $this->method == 'MKTICKET' || $this->method == 'ACL' ) {
|
||||
if ( !preg_match( '{^(text|application)/xml$}', $this->content_type ) ) {
|
||||
@dbg_error_log( "LOG request", 'Request is "%s" but client set content-type to "%s". Assuming they meant XML!',
|
||||
$request->method, $this->content_type );
|
||||
@ -198,6 +198,13 @@ class CalDAVRequest
|
||||
$this->CoerceContentType();
|
||||
}
|
||||
}
|
||||
else if ( !preg_match( '{^(text|application)/xml$}', $this->content_type ) ) {
|
||||
if ( $this->method == 'GET' || $this->method == 'HEAD' || $this->method == 'OPTIONS' || $this->method == 'MKCALENDAR' || $this->method == 'MKCOL' ) {
|
||||
@dbg_error_log( "LOG request", '%s Request specified %s content type but none is present. Assuming null content-type.',
|
||||
$request->method, $this->content_type );
|
||||
$this->content_type = 'text/plain';
|
||||
}
|
||||
}
|
||||
$this->user_agent = ((isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "Probably Mulberry"));
|
||||
|
||||
/**
|
||||
|
||||
@ -101,6 +101,8 @@ class HTTPAuthSession {
|
||||
/**
|
||||
* Get HTTP Auth to work with PHP+FastCGI
|
||||
*/
|
||||
if ( !isset($_SERVER["AUTHORIZATION"]) && isset($_SERVER["HTTP_AUTHORIZATION"]) && !empty($_SERVER["HTTP_AUTHORIZATION"]))
|
||||
$_SERVER["AUTHORIZATION"] = $_SERVER["HTTP_AUTHORIZATION"];
|
||||
if (isset($_SERVER["AUTHORIZATION"]) && !empty($_SERVER["AUTHORIZATION"])) {
|
||||
list ($type, $cred) = split (" ", $_SERVER['AUTHORIZATION']);
|
||||
if ($type == 'Basic') {
|
||||
|
||||
@ -532,20 +532,19 @@ class Principal {
|
||||
$sql_params = array();
|
||||
foreach( self::updateableFields() AS $k ) {
|
||||
if ( !isset($field_values->{$k}) && !isset($this->{$k}) ) continue;
|
||||
$param_name = ':'.$k;
|
||||
$sql_params[$param_name] = (isset($field_values->{$k}) ? $field_values->{$k} : $this->{$k});
|
||||
if ( $k == 'default_privileges' ) {
|
||||
$sql_params[$param_name] = sprintf('%024s',decbin($sql_params[$param_name]));
|
||||
$param_name = 'cast('.$param_name.' as text)::BIT(24)';
|
||||
}
|
||||
if ( $inserting ) {
|
||||
$param_names[] = ':'.$k;
|
||||
$param_names[] = $param_name;
|
||||
$insert_fields[] = $k;
|
||||
}
|
||||
else {
|
||||
if ($k == 'default_privileges') {
|
||||
$update_list[] = $k.'=cast(:'.$k.' as text)::BIT(24)';
|
||||
}
|
||||
else {
|
||||
$update_list[] = $k.'=:'.$k;
|
||||
}
|
||||
$update_list[] = $k.'='.$param_name;
|
||||
}
|
||||
|
||||
$sql_params[':'.$k] = (isset($field_values->{$k}) ? $field_values->{$k} : $this->{$k});
|
||||
}
|
||||
|
||||
if ( $inserting && isset(self::$db_mandatory_fields) ) {
|
||||
|
||||
@ -39,7 +39,7 @@ function create_external ( $path,$is_calendar,$is_addressbook )
|
||||
}
|
||||
}
|
||||
|
||||
function fetch_external ( $bind_id, $min_age )
|
||||
function fetch_external ( $bind_id, $min_age = '1 hour' )
|
||||
{
|
||||
if ( ! function_exists ( "curl_init" ) ) {
|
||||
dbg_error_log("external", "external resource cannot be fetched without curl, please install curl");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user