Author Topic: Calendar PlugIn  (Read 88238 times)

Offline gjrweb

  • Jr. Member
  • **
  • Posts: 13
Calendar PlugIn
« Reply #45 on: November 15, 2009, 09:03:33 AM »
Does this calendar work for 0.3.1?

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Calendar PlugIn
« Reply #46 on: November 15, 2009, 10:02:31 AM »
Yes, it is designed for v0.3.1.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline flattery

  • Jr. Member
  • **
  • Posts: 17
Calendar PlugIn
« Reply #47 on: November 18, 2009, 11:41:10 AM »
Edit: oops think I forgot something
« Last Edit: November 18, 2009, 11:55:09 AM by flattery »

Offline flattery

  • Jr. Member
  • **
  • Posts: 17
Calendar PlugIn
« Reply #48 on: November 18, 2009, 12:09:15 PM »
Ok here is my hack.  It works, but I do want to figure out a better way to make this work so that there is no hacking of the code needed.
After installing webcalendar make the following changes:


1. First to get the current RoundCube user ID I opened the RoundCube file program/include/rcube_user.php and went to line 47 just inside the _construct function.  After this line: $this->db = rcmail::get_instance()->get_dbh();
I set a cookie by adding this line: setcookie("webcal_user_id",$id);

so it now looks like:
Code: [Select]
 $this->db = rcmail::get_instance()->get_dbh();
  setcookie("webcal_user_id",$id);



2. Then in the webcalendar file at plugins/webcalendar/app/includes/config.php I grab the current roundcube user id.
Around line 207 you will find a line that like:
Code: [Select]
$single_user_login = $settings['single_user_login'];
Change that line to:
Code: [Select]
$single_user_login = $_COOKIE['webcal_user_id'];

3. Open the webcalendar file plugins/webcalendar/app/includes/settings.php
and set the following lines to look like this:
Code: [Select]
user_inc: user.php
use_http_auth: false
single_user: true


Now it should work seamlessly, but there is one small problem left to fix.  Right now every new user will have full admin privileges. Until I figure out the fix for this all new users will need to be manually changed in the db to not be admins.


I have not tested this from scratch so hopefully I didn't miss something that I did.  So let me know if this doesn't work for you and I will try to see what I missed.
« Last Edit: November 18, 2009, 12:12:25 PM by flattery »

Offline flattery

  • Jr. Member
  • **
  • Posts: 17
Calendar PlugIn
« Reply #49 on: November 18, 2009, 05:56:15 PM »
A modification to step one would be to set the user_id in the webcalendar.php file.

in the function init() find the line:
 
Code: [Select]
$rcmail = rcmail::get_instance();and change it to:
 
Code: [Select]
$rcmail = rcmail::get_instance();
  $user = $rcmail->user;
  setcookie("webcal_user_id",$user->ID);


Still working on making it all work nicely from install to end.

Offline flattery

  • Jr. Member
  • **
  • Posts: 17
Calendar PlugIn
« Reply #50 on: November 18, 2009, 06:22:50 PM »
Here is the final hack to make users not have admin privileges:

Open the file plugins/webcalendar/app/includes/classes/WebCalendar.class
and at line 631 you should find the line:
Code: [Select]
array ( $single_user_login, md5 ( $single_user_login ), 'Y' ) ) )

change the Y to a N so it should look like this:

Code: [Select]
array ( $single_user_login, md5 ( $single_user_login ), 'N' ) ) )

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Calendar PlugIn
« Reply #51 on: November 19, 2009, 07:40:54 AM »
The following simple fix stopped all my trouble with the integrated login:

webcalendar.php

    $rcmail
->output->set_env('webcal_user'$rcmail->user->data['username']);
    
$rcmail->output->set_env('webcal_enc_user'substr(base_convertmd5(trim($rcmail->user->data['username'])), 1636 ),0,25));
//Begin fix
    
if($rcmail->user->data['password'])
      
$rcmail->output->set_env('webcal_pass'$rcmail->user->data['password']);
    else
      
$rcmail->output->set_env('webcal_pass'$_SESSION['password']);
//End fix
    
$langs $rcmail->config->get('cal_language');
    
$lang $langs[$_SESSION['language']]; 


Check @ RoundCube Webmail :: Welcome to RoundCube Webmail ... demo user login and first time login of a new registered user should work now.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline flattery

  • Jr. Member
  • **
  • Posts: 17
Calendar PlugIn
« Reply #52 on: November 19, 2009, 10:42:26 AM »
Great, I will have to try your fix out.  I was just packaging mine up along with some changes I made to the installation.

I was taking out all the unnecessary installation stuff such as the authorization type, since people are downloading it as a RoundCube plugin there really isn't the need for a choice there... it just confuses people.  I also want to get rid of the sql settings and just use RoundCube sql settings, or give an option or have RoundCube sql be already filled in my default.

Also I made some modification to get rid of all those dumb scroll bars that appear on every day of the month when there is nothing to scroll.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Calendar PlugIn
« Reply #53 on: November 19, 2009, 11:05:01 AM »
Please feel free to post the result of your adjustments when finished. Improvements are welcome every time.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline flattery

  • Jr. Member
  • **
  • Posts: 17
Calendar PlugIn
« Reply #54 on: November 19, 2009, 12:02:20 PM »
First to get rid of the scroll bars the way I found to fix it was to get rid of the box around the day of the month or set it to float.

Since I could not find where this class was set I worked around it by going into the functions.php file and around line 4411 (just search for "dayofmonth") and I changed "dayofmonth" to "dayofmonths" and then I added a new class in a class file I could find which was theme.css, but then you have to add this to all your themes.

I set mine to float like this:
Code: [Select]
 .dayofmonths {
float:left;
    border:1px solid;
    border-width:0 1px 1px 0;
    padding:0 2px 0 3px;
    font-weight:bold;
    text-decoration:none;
    vertical-align:top;
  }
  .dayofmonths:hover {
    border-right:1px solid #0000ff;
    border-bottom:1px solid #0000ff;
    color:#0000ff;
background-color:yellow;

  }


The other way is to take is to take out the border then just remove the float and border lines.


Also as for the installation I just took the lines that didn't need options and set them to

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Calendar PlugIn
« Reply #55 on: November 19, 2009, 03:16:19 PM »
hmmm ... I don't see unnecessary scrollbars. Which browser? Which resolution? Could you please attach some screenies?
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline flattery

  • Jr. Member
  • **
  • Posts: 17
Calendar PlugIn
« Reply #56 on: November 19, 2009, 03:25:56 PM »
I use Google Chrome and I notice this doesn't seem to affect Firefox, but here is a screen shot:


Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Calendar PlugIn
« Reply #57 on: November 20, 2009, 01:17:18 AM »
Did you use a demo account of mail4us.net? I can't even reproduce it with recent Chrome on XP. If I can't reproduce it it's hard to fix it. Please register an account at mail4us.net. Configure the Calendar with your preferences and PM'me the login data.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline flattery

  • Jr. Member
  • **
  • Posts: 17
Calendar PlugIn
« Reply #58 on: November 20, 2009, 09:26:19 AM »
If you look at the screenshot you should be able to see that it is a demo account on your installation.

I get the scrollbars on the latest version of Chrome, the development version of Chrome and ChromePlus (a Chrome Mod). I get this on Windows 7 and on Windows XP.

Every installation of Chrome that I have on all my computers have the scroll bars and the only way I could get rid of them was to modify the style.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Calendar PlugIn
« Reply #59 on: November 20, 2009, 09:46:28 AM »
Yes, but the demo account calendar preferences may have been modified by others. So please create your own account and send me the login data by PM. Also please let me know your screen resolution.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)