From c7c5c1d784c79f0ccdc0195d0c71c7929b0ffc21 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sat, 26 Dec 2009 12:36:26 +1300 Subject: [PATCH] Ensure privileges are in decimal form. --- inc/DAVResource.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/DAVResource.php b/inc/DAVResource.php index d77a0abe..dbebeb77 100644 --- a/inc/DAVResource.php +++ b/inc/DAVResource.php @@ -483,9 +483,11 @@ EOQRY; $this->collection->path_privs = $parent->Privileges(); $this->collection->user_no = $parent->GetProperty('user_no'); + $this->collection->principal_id = $parent->GetProperty('principal_id'); } $this->privileges = $this->collection->path_privs; + if ( is_string($this->privileges) ) $this->privileges = bindec( $this->privileges ); } @@ -504,7 +506,7 @@ EOQRY; function HavePrivilegeTo( $do_what ) { if ( !isset($this->privileges) ) $this->FetchPrivileges(); $test_bits = privilege_to_bits( $do_what ); -// dbg_error_log( 'DAVResource', 'Testing privileges of "%s"(%d) against allowed "%s" => "%s"', $do_what, $test_bits, $this->privileges, ($this->privileges & $test_bits) ); +// dbg_error_log( 'DAVResource', 'Testing privileges of "%s" (%s) against allowed "%s" => "%s" (%s)', $do_what, decbin($test_bits), decbin($this->privileges), ($this->privileges & $test_bits), decbin($this->privileges & $test_bits) ); return ($this->privileges & $test_bits) > 0; }