Roundcube Community Forum

 

Calendar plugin

Started by rosali, December 29, 2008, 10:43:58 AM

Previous topic - Next topic

rosali

I never used sync tools. I guess the problem is, that I had to modify webcalender to encode the user by the following function:

substr(base_convert( md5($email), 16, 36 ),0,25);

The reason is, that the webcalendar allows only usernames with a maxium length of 25 digitis. It is not possible just to modify the database for that purpose.

So, please look for the part in WebCalendar Core which is responsibly for adding events remotely and convert "bryan" by using the function above. Let me know your solution to avoid double work.
Regards,
Rosali

rosali

UPDATE:

I assume the stuff is in icalclient.php ...


if ( empty ( $_SERVER['PHP_AUTH_USER'] ) && ! empty ( $_ENV['REMOTE_USER'] ) ) {
  list ( 
$_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ) =
  
explode ':'base64_decode substr $_ENV['REMOTE_USER'], ) ) );

  
$_SERVER['PHP_AUTH_USER'] = trim $_SERVER['PHP_AUTH_USER'] );
  
$_SERVER['PHP_AUTH_PW'] = trim $_SERVER['PHP_AUTH_PW'] );
}

unset ( 
$_ENV['REMOTE_USER'] );
if ( empty ( 
$login ) ) {
  if ( isset ( 
$_SERVER['PHP_AUTH_USER'] ) &&
      
user_valid_login $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'], true ) )
    
$login $_SERVER['PHP_AUTH_USER'];

  if ( empty ( 
$login ) || $login != $_SERVER['PHP_AUTH_USER'] ) {
    
$_SERVER['PHP_AUTH_PW'] = $_SERVER['PHP_AUTH_USER'] = '';
    unset ( 
$_SERVER['PHP_AUTH_USER'] );
    unset ( 
$_SERVER['PHP_AUTH_PW'] );
    
header 'WWW-Authenticate: Basic realm="' $appStr '"' );
    
header 'HTTP/1.0 401 Unauthorized' );
    exit;
  }
}



... insert here ...


$login 
substr(base_convertmd5($login), 1636 ),0,25);


Unfortunately I can't test myself, because I don't have Sunbird or similar.
Regards,
Rosali

techdude

Well I finally got Sunbird syncing with WebCalendar with your help (THANKS!!!)..but there are a few problems...maybe you have an idea how to fix it...

I inserted an event in Thunderbird for 7pm.  The event appears in the WebCalendar at 7pm (C in picture), the event in Thunderbird displays as 11pm (A in picture) yet if you try to edit the event it shows that is starts at 7pm (B in picture): PICTURE 1 (Attached)

And there is a difference in the database as seen below.  The bottom two lines are events created in WebCalendar and the those events above the two bottom lines are created in Thunderbird...could this be part of the problem?
PICTURE 2 (Attached)
The lines are as follows: cal_mod_time   cal_duration   cal_due_date   cal_due_time   cal_priority   cal_type   cal_access

rosali

#1- Sync was solved exactly as advised?

#2- Do you have same timezone on desktop and webcalendar?
Regards,
Rosali

techdude

Well its been a hassle trying to get it to sync.  When I first put in the code that you recommended, everything worked PERFECTLY!  Then I noticed that the timezones were off, so I set all of the timezones on everything I could think (Linux Server, PHP, WebCalendar and Roundcube) everything lined up, but then I when I created an event in Sunbird it woulnd't show in WebCalendar.  Well then I turned off my computer for the night (server remained on) and the next day its working fine sometimes and others not working at all?  Its like it has a mind of its own...but as a SysAdmin, I know that its not possible....:confused:

vwmoose

This plugin is ace! Thanks for all your hard work on it.

One question, can I get my iPhone to sync with the calendar plugin?  And if so how do I manage this?

Cheers

Phil

rosali

I don't own a iPhone (yet). Basically it should be possible, if iPhone is able to connect to CalDAV backends. If so, configure the calendar plugin to use CalDAV instead of local database and sync the iPhone accordingly.

CalDAV is under heavy developement at the moment. It is roughly implemented in current calendar release (alpha). I'll upload a calendar beta later today.
Regards,
Rosali

vwmoose

Rosali, I know your pretty busy but has anyone put together a manual for your plugin yet?  Instructions on how to change the calendar plugin over to CalDav would be great!

rosali

Just create events_caldav database table and choose in calendar settings 'CalDAV'.

When saved insert access credentials and save again. That's all.
Regards,
Rosali

vwmoose

Me again! I can't seem to find a CalDav setting in Calendar Settings through the GUI so I am assuming its somewhere in the config file?

Also is there a definition for the events_caldav table?

Sorry to be such a pain!

rosali

Check @ Mail4us.net Webmail :: Welcome to Mail4us.net Webmail

->Settings->Calendar ... First selector on top of page.
Regards,
Rosali

rosali

Check @ Mail4us.net Webmail :: Welcome to Mail4us.net Webmail

->Settings->Calendar ... First selector on top of page.
Regards,
Rosali

vwmoose

I do not have this option listed.  The top item is "Default View"

I've downloaded the latest version of the plugins that I could find only a week ago so don't know exactly whats going on or whether I am running an old version of the calendar plugin?

Thanks for your help.

rosali

You are using an old version.
Regards,
Rosali

vwmoose

OK, so where do I find the latest version?  
Sorry to be such a pain!