steffen: server/kolab-resource-handlers/kolab-resource-handlers/freebusy freebusy.php, 1.6, 1.7
cvs at intevation.de
cvs at intevation.de
Tue Jul 13 03:15:16 CEST 2004
Author: steffen
Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy
In directory doto:/tmp/cvs-serv15901/kolab-resource-handlers/freebusy
Modified Files:
freebusy.php
Log Message:
freebusy fixes, resource password stuff
Index: freebusy.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/freebusy.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- freebusy.php 11 Jul 2004 19:46:54 -0000 1.6
+++ freebusy.php 13 Jul 2004 01:15:14 -0000 1.7
@@ -47,6 +47,7 @@
function unauthorized($errortext = '')
{
+ global $params;
shutdown();
header('WWW-Authenticate: Basic realm="freebusy-'.$params['email_domain'].'"');
@@ -339,14 +340,16 @@
$vfb = false;
if( $_SERVER['REQUEST_METHOD'] != 'PUT' && ($imapuser || $extended) ) {
// Open an IMAP connection to the requested users' calendar
- $imap = @imap_open($fullmbox, $imapuser, $imappw, OP_READONLY|OP_HALFOPEN );
+ $imap = @imap_open($fullmbox, $imapuser, $imappw, OP_HALFOPEN );
if ( !$imap ) {
// Login error, check the cache
} else {
testIMAPError();
- $imap = @imap_reopen( $imap, $mailbox, OP_READONLY );
- if ( $imap === false || imap_last_error() ) {
+ trigger_error( "Trying to reopen mailbox $fullmbox", E_USER_NOTICE);
+ @imap_reopen( $imap, $fullmbox );
+ if ( imap_last_error() ) {
// Login error, check the cache
+ trigger_error( "IMAP Error trying to open $mailbox: ".imap_last_error(), E_USER_WARNING );
} else {
// Enumerate our calendar events
$messages = @imap_sort($imap, SORTDATE, 0, SE_UID);
@@ -360,7 +363,7 @@
// Don't cache
} else {
store_freebusy( $fbdir, $fbfilename, $vfb );
- }
+ }
}
}
}
@@ -368,8 +371,7 @@
if( !$vfb ) {
if( !file_exists( $fbfilename ) || $imapuser == $user ) {
- header('WWW-Authenticate: Basic realm="My Realm"');
- header('HTTP/1.0 401 Unauthorized');
+ unauthorized("Failed to create freebusy list");
exit;
}
$vfb = file_get_contents( $fbfilename );
More information about the commits
mailing list