Allow freebusy query to be public for freebusy URLs at least.

This commit is contained in:
Andrew McMillan 2009-10-07 09:07:50 -07:00
parent 9e9d232b88
commit cf5e93c9f5
2 changed files with 10 additions and 3 deletions

View File

@ -2,8 +2,14 @@
require_once("../inc/always.php");
dbg_error_log( "freebusy", " User agent: %s", ((isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "Unfortunately Mulberry and Chandler don't send a 'User-agent' header with their requests :-(")) );
dbg_log_array( "headers", '_SERVER', $_SERVER, true );
require_once("HTTPAuthSession.php");
$session = new HTTPAuthSession();
if ( isset($c->public_freebusy_url) && $c->public_freebusy_url ) {
require_once("PublicSession.php");
$session = new PublicSession();
}
else {
require_once("HTTPAuthSession.php");
$session = new HTTPAuthSession();
}
/**
* Submission parameters recommended by calconnect, plus some generous alternatives

View File

@ -69,7 +69,8 @@ class PublicSession {
* @return boolean Whether or not the user has the specified role.
*/
function AllowedTo ( $whatever ) {
return ( $this->logged_in && isset($this->roles[$whatever]) && $this->roles[$whatever] );
dbg_error_log('session', 'Checking whether "Public" is allowed to "%s"', $whatever);
return ( isset($this->roles[$whatever]) && $this->roles[$whatever] );
}
}