Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: pinemail11 on April 20, 2010, 01:23:03 PM

Title: Roundcube calendar plugin not working
Post by: pinemail11 on April 20, 2010, 01:23:03 PM
Hello Team,

I am new to linux and roundcube. I have implemented iRedMail with Roundcube as webmail solution.
Roundcube version is 0.3.1
I have installed Calendar plugin.
I am able to see calendar option. when I click on Calendar or try to post a new event, I get following error and no event is getting added.

Server Error! (OK)

Could someone please help me resolve this?
Title: Roundcube calendar plugin not working
Post by: rosali on April 21, 2010, 12:47:19 AM
Looks like you did not not create 'events' database table correctly. What is in Roundcube's error log?
Title: Roundcube calendar plugin not working
Post by: pinemail11 on April 21, 2010, 04:33:06 AM
I dont see any errors logged. I have enabled debug logging level to 8, I see only 3 files under /roundcubemail/logs folder. console, userlogin, and sendmail. These logs are not showing any errors related to the issue. Is there any other logging I need to increase ? (sorry this is very basic question)
Title: Roundcube calendar plugin not working
Post by: pinemail11 on April 21, 2010, 04:48:58 AM
Also, I did create events table under roundcubemail database using mysql.sql script. I can see events table listed under roundcubemail database. Does it require any permission to be added to this database or table after this?
Title: Roundcube calendar plugin not working
Post by: rosali on April 22, 2010, 01:26:40 AM
Are you able/willing to give me a test account, phpmyadmin access and read/write/delete FTP access to roundcube folder? PM'me! This problem was reported by another user as well, but has been never solved. I need to reproduce the issue to track it down.
Title: Roundcube calendar plugin not working
Post by: pinemail11 on April 24, 2010, 07:27:48 AM
Hello Rosali,

We were able to resolve the issue by adding following code to roundcybemail-0.3.1/program/include/rcube_shared.inc


if (!function_exists('json_encode'))
{
  function json_encode($a=false)
  {
    if (is_null($a)) return 'null';
    if ($a === false) return 'false';
    if ($a === true) return 'true';
    if (is_scalar($a))
    {
      if (is_float($a))
      {
        // Always use "." for floats.
        return floatval(str_replace(",", ".", strval($a)));
      }

      if (is_string($a))
      {
        static $jsonReplaces = array(array("\\", "/", "\n", "\t", "\r", "\b", "\f", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'));
        return '"' . str_replace($jsonReplaces[0], $jsonReplaces[1], $a) . '"';
      }
      else
        return $a;
    }
    $isList = true;
    for ($i = 0, reset($a); $i < count($a); $i++, next($a))
    {
      if (key($a) !== $i)
      {
        $isList = false;
        break;
      }
    }
    $result = array();
    if ($isList)
    {
      foreach ($a as $v) $result[] = json_encode($v);
      return '[' . join(',', $result) . ']';
    }
    else
    {
      foreach ($a as $k => $v) $result[] = json_encode($k).':'.json_encode($v);
      return '{' . join(',', $result) . '}';
    }
  }
}

I am able to repro this issue and it resolves with this code change. Hope this will be helpful for someone :)
Title: RoundCube Calendar 0.2 BETA 2
Post by: cogancorp on June 06, 2010, 11:43:41 PM
Hi,

Just installed Roundcube and working fine.  Attempted to install the Roundcube Calendar plugin:

RoundCube Calendar (http://rc-calendar.lazlo.me/)

I imported the .sql file and see the "events" table but do not see any Calenaer Button under the menu nor can I pull up  
/plugins/calenadar/calendar.php.

Any help would be greatly appreciated.

Thanks,
-Todd
Title: Roundcube calendar plugin not working
Post by: SKaero on June 07, 2010, 02:08:27 AM
Did you add the calendar to the $rcmail_config['plugins'] in the /config/main.inc.php
Title: Roundcube calendar plugin not working
Post by: dziobak on June 07, 2010, 02:51:26 AM
the calendar may not work with RC 0.2, because of jquery. Am I correct?
Title: Roundcube calendar plugin not working
Post by: suicidepills on June 09, 2010, 08:21:41 PM
Hey guys, I'm also getting the "server error (OK)" message when I try to add events.  It also displays when I browse to the calendar.

I've made sure that the 'events' table exists (I used PHPMyAdmin and copy-pasted the contents of the SQL file in there) and tried the mode that pinemail11 posted.  Still no dice :(

My log shows this at the bottom:

Code: [Select]
[09-Jun-2010 15:54:11 -0700]: DB Error: _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_3055a37261af92c267005b94743a05546006f9f31 FROM 'DELETE FROM events\r\n         WHERE user_id=?\r\n         AND del=?']
[Native code: 1054]
[Native message: Unknown column 'del' in 'where clause']
 in /nfs/c06/h04/mnt/95491/domains/zandadev.com/html/roundcube/program/include/rcube_mdb2.php on line 272 (POST /roundcube/?_task=dummy&_action=plugin.calendar_purge?_task=&_action=)
[09-Jun-2010 15:54:12] MDB2 Error: no such field (-19): _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_38e7b9010444d91ca7db9000380ab8fa6b14c230b FROM 'SELECT * FROM events \r\n         WHERE user_id=? AND recurrence_id<>0']
[Native code: 1054]
[Native message: Unknown column 'recurrence_id' in 'where clause']

[09-Jun-2010 15:54:12 -0700]: DB Error: _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_38e7b9010444d91ca7db9000380ab8fa6b14c230b FROM 'SELECT * FROM events \r\n         WHERE user_id=? AND recurrence_id<>0']
[Native code: 1054]
[Native message: Unknown column 'recurrence_id' in 'where clause']
 in /nfs/c06/h04/mnt/95491/domains/zandadev.com/html/roundcube/program/include/rcube_mdb2.php on line 272 (GET /roundcube/?_task=dummy&_action=plugin.getEvents&_=1276210340633&start=1275796800&end=1276401600)

Any ideas?  Please let me know what other information I should provide.

Thanks in advance!
Title: Roundcube calendar plugin not working
Post by: rosali on June 10, 2010, 12:27:17 AM
Which calendar plugin do you use? It looks like you use mine (jquery fullcalendar forked by rosali) on the default database of the original plugin.
Title: Delete an event
Post by: LMSSML on September 01, 2010, 12:14:11 PM
Hi people ,

I'm trying to delete an event from calendar but it's not possible.

Error Service currently not available


Should I change something to this ?
Title: Roundcube calendar plugin not working
Post by: dziobak on September 01, 2010, 12:57:01 PM
what version of calendar, RC??

look in /error and post here eventually errors
Title: Roundcube calendar plugin not working
Post by: toootooo on September 09, 2010, 07:49:30 AM
I've just installed Calendar plugin, installed postgresql DB 'events' and
'events_user_id' index. And while adding a new event the following error occur:

Quote

MDB2 Error: syntax error (-2): prepare: [Error message: Unable to create prepared statement handle]\n[Last executed query: DEALLOCATE PREPARE mdb2_statement_pgsql_26eaed0e7398ad4cf1b5555ad8dedce946448dd31]\n[Native message: ERROR:  syntax error at or near "end"\nLINE 2:          (user_id, start, end, summary, description, locatio...\n                                  ^]\n, referer: https://mailg.kipt.kharkov.ua/?_task=dummy&_action=plugin.calendar


From PGSQL:
Quote

STATEMENT:  INSERT INTO events
                 (user_id, start, end, summary, description, location, categories, all_day, recurring, rr, expires, occurrences, byday, bymonth, bymonthday, recurrence_id, uid, timestamp)
                 VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18)
WARNING:  nonstandard use of \\ in a string literal at character 30
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
WARNING:  nonstandard use of \\ in a string literal at character 165
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.


What should i do?

Thanx in advance!
Title: Roundcube calendar plugin not working
Post by: alec on September 09, 2010, 09:19:53 AM
'end' column name must be quoted using rcube_mdb2::quote_identifier()
Title: Roundcube calendar plugin not working
Post by: toootooo on September 09, 2010, 10:00:24 AM
And what should I do?
Title: Roundcube calendar plugin not working
Post by: rosali on September 09, 2010, 11:43:25 AM
@ alec:

Could you please explain how the queries have to be modified?

Currently f.e.:

      $query = $this->rcmail->db->query(
        "UPDATE " . get_table_name('events') . "
         SET start=?, end=?, all_day=?, timestamp=?, notified=?
         WHERE event_id=?
         AND user_id=?",
        $start,
        $end,
        $allDay,
        date('Y-m-d H:i:s', time()),
        0,        
        $id,
        $this->rcmail->user->ID
      );


Or would it be better to rename the 'end' table column?
Title: Roundcube calendar plugin not working
Post by: alec on September 10, 2010, 02:35:08 AM
Code: [Select]

SET start=?, &quot;.$this->rcmail->db->quote_delimiter('end').&quot;=?, all_day=?, timestamp=?, notified=?

also, to be sure that other columns in different databases are working ok, you should probably use quote_identifier on all columns. I think this will be simpler and prefered than column name change.
Title: Roundcube calendar plugin not working
Post by: toootooo on September 10, 2010, 07:14:42 AM
After adding this code rcube_mdb2::quote_identifier('end') to plugins/calendar/program/backend/database.php:

Quote
$query = $this->rcmail->db->query(
        "INSERT INTO " . get_table_name('events') . "
         (user_id, start,". rcube_mdb2::quote_identifier('end').", summary, description, location, categories, all
_day, recurring, rr, expires, occurrences, byday, bymonth, bymonthday, recurrence_id, uid, timestamp)
         VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",...
I got this error:

Quote
PHP Fatal error:  Call to undefined method Database::db_connect() in /usr/local/etc/httpd/webmail/program/include/rcube_mdb2.php on line 456,
Title: Roundcube calendar plugin not working
Post by: rosali on September 13, 2010, 12:22:18 AM
Check new release.
Title: Roundcube calendar plugin not working
Post by: toootooo on September 13, 2010, 03:01:14 AM
Quote from: rosali;29992
Check new release.

Thanx! The calendar plugin is working just fine now!

P.S: Russian translation attached!

Good luck!
Title: Roundcube calendar plugin not working
Post by: K9Marc on September 22, 2010, 03:31:48 PM
Hello Rosali,

I have hMailserver running with Roundcube as the webmail portal.

I installed the latest calendar plugin from you and I must have not done something I need to. It has a bunch of items already posted and I cant seem to save any new items, delete or open the existing ones.

Is there a step by step instruction area I can refer to for these plugins?

It looked like I got the "Event" table creatated in MySql ok.

Thanks for any assistance!!

Marc
Title: Roundcube calendar plugin not working
Post by: rosali on September 23, 2010, 01:32:55 AM
Do you have installed jqueryui plugin? Could you give me remote access to your server. PM'me details.
Title: Roundcube calendar plugin not working
Post by: K9Marc on September 24, 2010, 04:33:31 PM
Yes sir, plugin installed and PM sent with access to my site.

Thanks again

Marc
Title: Roundcube calendar plugin not working
Post by: rosali on September 26, 2010, 07:51:04 AM
You missed to configure the plugin to use database backend instead of using the demo mode. Check your mails.
Title: Roundcube calendar plugin not working
Post by: nerbrume on October 01, 2010, 09:17:29 AM
Hi Rosali, and thanks for this plugin.

I have to small (non-blocking) problem, don't know if they are related.

First, my roundcube log warns me with :
Code: [Select]
roundcube: PHP Warning:  in_array() expects parameter 2 to be array, null given in /var/wwws/mail/plugins/calendar/calendar.php on line 1094

the corresponding line is : $enabled = in_array($num, $workdays);
I'v check my config, and workdays seems well defined to me :
Code: [Select]
$rcmail_config['workdays'] = array(1,2,3,4,5);


Next problem is the use of the "first_hour" parameter. Is this supposed to fix the hour at wich the view of the calendar starts ?
Because my calendar view always start at 00h, and ends at 24h, causing very small cells. I'don't see any effect when changing "first_hour"

I hope I was clear enough, I can provide precisions if needed.
Title: Roundcube calendar plugin not working
Post by: rosali on October 17, 2010, 02:55:30 AM
Sorry for delayed reply due to vacations.

So you use recent version from myroundcube - Project Hosting on Google Code (http://myroundcube.googlecode.com) ?

I do not see the warning here. Also first hour setting works for me.
Title: Roundcube calendar & jqueryui-1.8.2.1
Post by: Theet on November 30, 2010, 09:34:03 AM
I have installed the calendar & jqueryui-1.8.2.1 plugin, it seems to be working perfectly, but it is read only.

How can I fully use the calendar without dummy appointments?

Have I change a setting?

I use the calendar in roundcube v0.4 for Synology NAS (PostgreSQL, files calendar includes a PostgreSQL update)
Title: Roundcube calendar plugin not working
Post by: rosali on November 30, 2010, 09:50:03 AM
Configure it to use database backend. Do not miss to create database table. If you use beta version from Downloads - myroundcube - Project Hosting on Google Code (http://code.google.com/p/myroundcube/downloads/list) don't miss to upgrade Roundcube to 0.5 beta.
Title: Which database backend?
Post by: Theet on November 30, 2010, 10:28:47 AM
Quote from: rosali;31582
Configure it to use database backend. Do not miss to create database table. If you use beta version from Downloads - myroundcube - Project Hosting on Google Code (http://code.google.com/p/myroundcube/downloads/list) don't miss to upgrade Roundcube to 0.5 beta.


I have just installed roundcube 0.5 beta and also put the plugin calendar and jqueryui in de map plugins.
What I have to do with the database backend? I don't understand it...
Title: Roundcube calendar plugin not working
Post by: rosali on November 30, 2010, 10:48:29 AM
./plugins/calendar/config/config.inc.php[.dist]

// backend type (dummy, database), see README
// Note: "dummy" is only for demonstrating basic functionality.
$rcmail_config['backend'] = "dummy"; <--- replace this with database and create the database table (use suitable script in SQL folder).
Title: suitable script in SQL folder
Post by: Theet on November 30, 2010, 11:42:47 AM
Quote from: rosali;31584
./plugins/calendar/config/config.inc.php[.dist]

// backend type (dummy, database), see README
// Note: "dummy" is only for demonstrating basic functionality.
$rcmail_config['backend'] = "dummy"; <--- replace this with database and create the database table (use suitable script in SQL folder).

I have done this, but what name I have to give the backend?

"events"  does'nt work for example What is the name of the database?
If I give the database the name "database" then I get a server error...

I have also used the suitable PostgreSQL script in the SQL folder of the calendar.

I have read the README but I don't know what to do...
Title: Roundcube calendar plugin not working
Post by: dshepherd on November 30, 2010, 12:09:37 PM
You will need to use the name of your main RC database for the 'backend' variable. Then create the events table in this database using the relevant file in the SQL folder for your database type.
Title: Name of the database
Post by: Theet on November 30, 2010, 12:19:53 PM
Quote from: dshepherd;31587
You will need to use the name of your main RC database for the 'backend' variable. Then create the events table in this database using the relevant file in the SQL folder for your database type.


The name of the database is "roundcubemail"
In this database I have import the "events"

If I do this and rename "dummy" into "roundcubemail" then I see nothing when I try to login IMAP...
Title: Roundcube calendar plugin not working
Post by: rosali on November 30, 2010, 02:20:53 PM
Create in database roundcubemail the table events and set backend to database. Maybe you have problems because you are on postgresql. It is coded for mysql. postgresql script is a contribution of users. I don't use postgresql.

Which RC version do you use? Notice, it requires 0.5 beta.
Title: Backend en RC version
Post by: Theet on December 01, 2010, 04:04:33 AM
Quote from: rosali;31590
Create in database roundcubemail the table events and set backend to database. Maybe you have problems because you are on postgresql. It is coded for mysql. postgresql script is a contribution of users. I don't use postgresql.

Which RC version do you use? Notice, it requires 0.5 beta.


I use now RC 0.5 beta. I have to look for possibilities how to make the database as backend. I'll be back for details...
Title: Backend PostgreSQL
Post by: Theet on December 02, 2010, 08:28:54 AM
Quote from: Theet;31596
I use now RC 0.5 beta. I have to look for possibilities how to make the database as backend. I'll be back for details...


The database "roundcubemail" seems to be the backend, with table "events",
but if I setup this in the config.inc.php file, then I will nothing see and I
could not login to roundcube v0.5 anymore....
Title: Roundcube calendar plugin not working
Post by: rosali on December 02, 2010, 08:57:31 AM
What did you exactly put into the config file?

Anything in error log?
Title: Roundcube calendar plugin not working
Post by: Theet on December 02, 2010, 10:04:01 AM
Quote from: rosali;31621
What did you exactly put into the config file?

Anything in error log?

Please see the attachements (jpg = view database and php = config file)

If I change dummy into roundcubemail then I see nothing after login roundcubemail.
If I change roundcubemail back to dummy then it will be back to original "read only calendar"
Title: Roundcube calendar plugin not working
Post by: rosali on December 02, 2010, 10:21:28 AM
wrong:

// backend type (dummy, database), see README
// Note: "dummy" is only for demonstrating basic functionality.
$rcmail_config['backend'] = 'database'; //not roundcubemail here!!!
Title: Server Fout
Post by: Theet on December 02, 2010, 11:37:57 AM
Quote from: rosali;31625
wrong:

// backend type (dummy, database), see README
// Note: "dummy" is only for demonstrating basic functionality.
$rcmail_config['backend'] = 'database'; //not roundcubemail here!!!

I have changed "roundcubemail" in "database" and I can login to roundcube!
But for the calendar roundcube gives the sign "Server Fout" (server error).
I think this is about the calendar, because mail is working now!

I also connot insert new appointments, so it looks like the events table is not yet reachable for
the plugin? what to do?
Title: Roundcube calendar plugin not working
Post by: rosali on December 02, 2010, 01:59:40 PM
There is something wrong with your setup. I'm not a visionary. Check your logs ...
Title: Roundcube calendar plugin not working
Post by: Dronch on December 03, 2010, 04:48:20 AM
Why, when i add event expires till 10th date in calendar view event show till 11th date?
Title: Roundcube calendar plugin not working
Post by: rosali on December 03, 2010, 05:09:27 AM
Maybe this bug is fixed: Check Downloads - myroundcube - Project Hosting on Google Code (http://code.google.com/p/myroundcube/downloads/list) (beta version).
Title: Roundcube calendar plugin not working
Post by: Dronch on December 03, 2010, 05:35:20 AM
Quote from: rosali;31653
Maybe this bug is fixed: Check Downloads - myroundcube - Project Hosting on Google Code (http://code.google.com/p/myroundcube/downloads/list) (beta version).
I cant use new version of calendar. Because after install this new version i see only white screen instead of login page. How to fix problem with Expires in old version? Thanks!
Title: Roundcube calendar plugin not working
Post by: rosali on December 03, 2010, 06:11:42 AM
I'm not a visionary. I have asked more than once to check logs. If you are not even able to check your logs, please don't bug me!
Title: Roundcube calendar plugin not working
Post by: Dronch on December 03, 2010, 06:19:25 AM
Quote from: rosali;31655
I'm not a visionary. I have asked more than once to check logs. If you are not even able to check your logs, please don't bug me!

[03-Dec-2010 14:17:01 +0300]: PHP Error: Deprecated hook name. save_preferences -> preferences_save in /www/soundcas/users/soundcas-syntpac/www/htdocs/mail/program/include/rcube_plugin_api.php on line 207 (GET /mail/?_task=dummy&_action=plugin.getEvents&_=1291375019823&start=1290978000&end=1294606800)
Title: Error Log
Post by: Theet on December 03, 2010, 07:02:03 AM
Quote from: rosali;31633
There is something wrong with your setup. I'm not a visionary. Check your logs ...

I have checked the error log, please see enclosure.

check:

1) user for roundcubemail = roundcube (in PostgreSQL)
2) login roundcubemail = a user from synology NAS = is not
    defined in the list of the database (every user has automatich a mail adress for MailStation)
3) looked to the file rcube_mdb2.php and don't know what to do
    he checked before proceeding and gives an error...

mail works fine, calendar does'nt work. I think there must be a redirection to the users of the synology NAS and
not to the users of the roundcubemail, am I right? And how should I make this change?
Title: Roundcube calendar plugin not working
Post by: rosali on December 04, 2010, 12:55:21 AM
@Dronch:

I don't fix things in old versions. Your error log states that you have installed an outdated plugin which uses deprectated hook 'save_preferences'. This is not a recent plugin of mine. I have updated my hooks completely.

@Theet:

There is something wrong with your database (events table). I don't use PostgreSQL.
Title: Plugin Sticky Note
Post by: Theet on December 07, 2010, 02:37:30 AM
Quote from: rosali;31673
@Dronch:

I don't fix things in old versions. Your error log states that you have installed an outdated plugin which uses deprectated hook 'save_preferences'. This is not a recent plugin of mine. I have updated my hooks completely.

@Theet:

There is something wrong with your database (events table). I don't use PostgreSQL.


In the enclosure I have made a PostgreSQL for Sticky Note, it works!
This can be enclosed to the trunk plugins Sticky Note.
I have to begin with small PostgreSQL scripts to understand the script for
the calendar.

What is wrong with the events table in the database, I have no idea...
Title: Roundcube calendar plugin not working
Post by: rosali on December 07, 2010, 03:55:10 AM
Well the screenshot of your logs states that there are problems with the user_id and recurrence_id fields. I can't help you with this issue. My PostgresSQL knowledge is zero.

Thanks for the notes script!
Title: Recurrence_id?
Post by: Theet on December 07, 2010, 04:06:33 AM
Quote from: rosali;31703
Well the screenshot of your logs states that there are problems with the user_id and recurrence_id fields. I can't help you with this issue. My PostgresSQL knowledge is zero.

Thanks for the notes script!

I know that user_id is the same unique field of the users Synology NAS.
What I have to do with recurrence_id I don't know, but I will try to
solve the problem.

Thanks also for your advice at this moment.
Title: Roundcube calendar plugin not working
Post by: Theet on December 07, 2010, 09:18:30 AM
Quote from: Theet;31704
I know that user_id is the same unique field of the users Synology NAS.
What I have to do with recurrence_id I don't know, but I will try to
solve the problem.

Thanks also for your advice at this moment.

I have change into database.php "getEvents"
AND ".$this->q('recurrence_id')."<>0", into
AND ".$this->q('recurrence_id')."=?",

Then there will happens nothing, also not an error...
It looks like with user is nothing wrong but recurrence table.

What does the recurrence table doing exactly?

I have also no "fetch_assoc" table.... in my PostgreSQL database.... what is this?

 $recurrences = array();
      while ($result && ($event = $this->rcmail->db->fetch_assoc($result))) {
        $recurrences[] = $event;
Title: Roundcube calendar plugin not working
Post by: rosali on December 07, 2010, 09:33:32 AM
Try:

      $rcmail = $this->rcmail;
      $result = $this->rcmail->db->query(
        "SELECT * FROM " . $this->table('events') . "
         WHERE ".$this->q('user_id')."=? AND ".$this->q('recurrence_id')."<>?",
         $this->rcmail->user->ID,
         0
      );


fetch_assoc is ok (Postgres compatibility is garantueed by roundcbuce mdb2 driver).

The query collects all table rows for current user where recurrence_id is not equal 0.
Title: Try this... "<>?"
Post by: Theet on December 08, 2010, 12:48:32 AM
Quote from: rosali;31707
Try:

      $rcmail = $this->rcmail;
      $result = $this->rcmail->db->query(
        "SELECT * FROM " . $this->table('events') . "
         WHERE ".$this->q('user_id')."=? AND ".$this->q('recurrence_id')."<>?",
         $this->rcmail->user->ID,
         0
      );


fetch_assoc is ok (Postgres compatibility is garantueed by roundcbuce mdb2 driver).

The query collects all table rows for current user where recurrence_id is not equal 0.


It wil nothing do, the same action with "=?" (no reaction of the server)
Title: Roundcube calendar plugin not working
Post by: rosali on December 08, 2010, 03:51:16 AM
Could you give me remote access?

FTP (read-write) to Roundcube root folder
IMAP test account
Postgres Webaccess
Title: remote
Post by: Theet on December 08, 2010, 06:41:21 AM
Quote from: rosali;31712
Could you give me remote access?

FTP (read-write) to Roundcube root folder
IMAP test account
Postgres Webaccess

I'am very sorry, but that is not so simple for me, because then you will have all rights in my NAS.
For ftp to roundcubemail you have now login into the linux program of the NAS. Also the phppgadmin
is now an open database, if I change rights, then programs as roundcube will not work.

I will try to make a user so that you can login, but this will costs more time for me.
Title: Calendar works!
Post by: Theet on December 10, 2010, 06:34:53 AM
Yesterday I have change several settings in my NAS. After that I could'nt login to roundcube mail.

I have build a new database for roundcubemail, setup for roundcube with the plugins: sticky-note, calendar and jqueryui. Changed the backend database.php into "database". (with trunk plugins) After that I restarted the NAS.

Now it works realy fine, also the calendar, a great plugin!!!

I think there was something wrong with the complete setup of the roundcubemail database.

@ Rosali: Thank you very much for the help in the last days!
I hope that I was helpfull for the PostgreSQL script sticky_note...
Title: How to delete posts?
Post by: Theet on December 10, 2010, 07:50:49 AM
I can insert events, but not modify/delete? Is there something about
a time in it for modify a message?

(I have tried to modify with a time between login)
Title: Roundcube calendar plugin not working
Post by: rosali on December 10, 2010, 08:25:16 AM
Click on event and hit delete button on the upcoming dialog.
Title: no upcoming dialog
Post by: Theet on December 10, 2010, 12:30:10 PM
Quote from: rosali;31742
Click on event and hit delete button on the upcoming dialog.

When I login to roundcube, make an appointment then I can remove, edit this one.

When I login again to roundcube, and I want to remove the appointment, then the dialog will not coming up...

If I make a new appointment, then I can edit or remove it directly...
The already maked event can be edited AFTER that I have made the new appointment, before it is been frozen....

Scheduled (time changes) is not working? for example: when I have made an appointment, standard time is 1 hour,
is it not possible to change it to two hours? (when I do this then it gives a database error: connection failed)
Title: Roundcube calendar plugin not working
Post by: rosali on December 12, 2010, 07:14:59 AM
Give me remote access to help this plugin working better.

At the moment it looks like just you having problems.
Title: Error
Post by: Theet on December 13, 2010, 08:12:40 AM
Quote from: rosali;31749
Give me remote access to help this plugin working better.

At the moment it looks like just you having problems.

Sorry, I cannot give you remote access because then you have all rights on my system.

Yesterday I have setup the dutch version of calendar, before (with english version) it worked!
Now I have again the same error, see attachements.
He saves the appointments in de database, but he will give 3times an error with loading the calendar and the appointments will not
come into the calendar. Als now a new log.txt attachment
Title: Roundcube calendar plugin not working
Post by: rosali on December 13, 2010, 10:58:49 AM
Obiously you are not able to track the issue back to the root.

So, either give me remote access (setup a test environment) or give up.
Title: .htaccess file
Post by: Theet on December 14, 2010, 05:56:02 AM
Is there something in the .htaccess file that is important for the roundcube calendar?

in my file .htaccess:

Order allow,deny
Deny from all


in the file of roundcube 0.5 beta:

# AddDefaultCharset   UTF-8
AddType text/x-component .htc


php_flag   display_errors   Off
php_flag   log_errors   On
# php_value   error_log   logs/errors

php_value   upload_max_filesize   5M
php_value   post_max_size      6M
php_value   memory_limit      64M

php_flag   zlib.output_compression      Off
php_flag   magic_quotes_gpc      Off
php_flag   magic_quotes_runtime      Off
php_flag   zend.ze1_compatibility_mode   Off
php_flag    suhosin.session.encrypt    Off

#php_value   session.cookie_path      /
php_value   session.auto_start   0
php_value   session.gc_maxlifetime   21600
php_value   session.gc_divisor   500
php_value   session.gc_probability   1

# PHP :: Bug #30766 :: mail() adds headers and encodes the body (http://bugs.php.net/bug.php?id=30766)
php_value   mbstring.func_overload   0



RewriteEngine On
RewriteRule ^favicon.ico$ skins/default/images/favicon.ico



SetOutputFilter DEFLATE



# replace 'append' with 'merge' for Apache version 2.2.9 and later
#Header append Cache-Control public env=!NO_CACHE



ExpiresActive On
ExpiresDefault "access plus 1 month"


FileETag MTime Size
Title: Roundcube calendar plugin not working
Post by: rosali on December 14, 2010, 05:59:19 AM
No, there is nothing.
Title: index.php (roundcube)
Post by: Theet on December 14, 2010, 07:24:30 AM
I have compare de index of roundcube and there are several differences/changes (red) in the file.

@Rosali:  can you see which changes are important for the calendar?

/*
 +-------------------------------------------------------------------------+
 | RoundCube Webmail IMAP Client                                           |
 | Version 0.3.1-20091031                                                  |
 |                                                                         |
 +-------------------------------------------------------------------------+
 | Author: Thomas Bruederli                          |
 +-------------------------------------------------------------------------+

 $Id: index.php 3081 2009-10-31 13:20:02Z thomasb $

*/

// include environment
require_once 'program/include/iniset.php';

// init application and start session with requested task
$RCMAIL = rcmail::get_instance();

// init output class
$OUTPUT = !empty($_REQUEST['_remote']) ? $RCMAIL->init_json() : $RCMAIL->load_gui(!empty($_REQUEST['_framed']));

// init plugin API
$RCMAIL->plugins->init();

// turn on output buffering
ob_start();

// check if config files had errors
if ($err_str = $RCMAIL->config->get_error()) {
  raise_error(array(
    'code' => 601,
    'type' => 'php',
    'message' => $err_str), false, true);
}

// check DB connections and exit on failure
if ($err_str = $DB->is_error()) {
  raise_error(array(
    'code' => 603,
    'type' => 'db',
    'message' => $err_str), FALSE, TRUE);
}

// error steps
if ($RCMAIL->action=='error' && !empty($_GET['_code'])) {
  raise_error(array('code' => hexdec($_GET['_code'])), FALSE, TRUE);
}

// check if https is required (for login) and redirect if necessary
if (empty($_SESSION['user_id']) && ($force_https = $RCMAIL->config->get('force_https', false))) {
  $https_port = is_bool($force_https) ? 443 : $force_https;
  if (!rcube_https_check($https_port)) {
    header('Location: https://' . $_SERVER['HTTP_HOST'] . ($https_port != 443 ? ':' . $https_port : '') . $_SERVER['REQUEST_URI']);
    exit;
  }
}

// trigger startup plugin hook
$startup = $RCMAIL->plugins->exec_hook('startup', array('task' => $RCMAIL->task, 'action' => $RCMAIL->action));
$RCMAIL->set_task($startup['task']);
$RCMAIL->action = $startup['action'];

// try to log in
if ($RCMAIL->action=='login' && $RCMAIL->task=='mail') {
  // purge the session in case of new login when a session already exists
  $RCMAIL->kill_session();
 
  $auth = $RCMAIL->plugins->exec_hook('authenticate', array(
    'host' => $RCMAIL->autoselect_host(),
    'user' => trim(get_input_value('_user', RCUBE_INPUT_POST)),
    'cookiecheck' => true,
  )) + array('pass' => get_input_value('_pass', RCUBE_INPUT_POST, true, 'ISO-8859-1'));

  // check if client supports cookies
  if ($auth['cookiecheck'] && empty($_COOKIE)) {
    $OUTPUT->show_message("cookiesdisabled", 'warning');
  }
  else if ($_SESSION['temp'] && !$auth['abort'] && !empty($auth['host']) &&
            !empty($auth['user']) && isset($auth['pass']) &&
            $RCMAIL->login($auth['user'], $auth['pass'], $auth['host'])) {
    // create new session ID
    rcube_sess_unset('temp');
    rcube_sess_regenerate_id();

    // send auth cookie if necessary
    $RCMAIL->authenticate_session();

    // log successful login
    if ($RCMAIL->config->get('log_logins')) {
      write_log('userlogins', sprintf('Successful login for %s (id %d) from %s',
        $RCMAIL->user->get_username(),
        $RCMAIL->user->ID,
        $_SERVER['REMOTE_ADDR']));
    }
   
    // restore original request parameters
    $query = array();
    if ($url = get_input_value('_url', RCUBE_INPUT_POST))
      parse_str($url, $query);

    // allow plugins to control the redirect url after login success
    $redir = $RCMAIL->plugins->exec_hook('login_after', $query + array('task' => $RCMAIL->task));
    unset($redir['abort']);

    // send redirect
    $OUTPUT->redirect($redir);
  }
  else {
    $OUTPUT->show_message($IMAP->error_code < -1 ? 'imaperror' : 'loginfailed', 'warning');
    $RCMAIL->plugins->exec_hook('login_failed', array('code' => $IMAP->error_code, 'host' => $auth['host'], 'user' => $auth['user']));
    $RCMAIL->kill_session();
  }
}

// end session
else if ($RCMAIL->task=='logout' && isset($_SESSION['user_id'])) {
  $userdata = array('user' => $_SESSION['username'], 'host' => $_SESSION['imap_host'], 'lang' => $RCMAIL->user->language);
  $OUTPUT->show_message('loggedout');
  $RCMAIL->logout_actions();
  $RCMAIL->kill_session();
  $RCMAIL->plugins->exec_hook('logout_after', $userdata);
}

// check session and auth cookie
else if ($RCMAIL->action != 'login' && $_SESSION['user_id'] && $RCMAIL->action != 'send') {
  if (!$RCMAIL->authenticate_session()) {
    $OUTPUT->show_message('sessionerror', 'error');
    $RCMAIL->kill_session();
  }
}

// don't check for valid request tokens in these actions
$request_check_whitelist = array('login'=>1, 'spell'=>1);

// check client X-header to verify request origin
if ($OUTPUT->ajax_call) {
  if (!$RCMAIL->config->get('devel_mode') && rc_request_header('X-RoundCube-Request') != $RCMAIL->get_request_token() && !empty($RCMAIL->user->ID)) {
    header('HTTP/1.1 404 Not Found');
    die("Invalid Request");
  }
}
// check request token in POST form submissions
else if (!empty($_POST) && !$request_check_whitelist[$RCMAIL->action] && !$RCMAIL->check_request()) {
  $OUTPUT->show_message('invalidrequest', 'error');
  $OUTPUT->send($RCMAIL->task);
}

// not logged in -> show login page
if (empty($RCMAIL->user->ID)) {
  if ($OUTPUT->ajax_call)
    $OUTPUT->redirect(array(), 2000);
 
  if (!empty($_REQUEST['_framed']))
    $OUTPUT->command('redirect', '?');

  // check if installer is still active
  if ($RCMAIL->config->get('enable_installer') && is_readable('./installer/index.php')) {
    $OUTPUT->add_footer(html::div(array('style' => "background:#ef9398; border:2px solid #dc5757; padding:0.5em; margin:2em auto; width:50em"),
      html::tag('h2', array('style' => "margin-top:0.2em"), "Installer script is still accessible") .
      html::p(null, "The install script of your RoundCube installation is still stored in its default location!") .
      html::p(null, "Please remove the whole installer folder from the RoundCube directory because .
        these files may expose sensitive configuration data like server passwords and encryption keys
        to the public. Make sure you cannot access the installer script from your browser.")
      )
    );
  }
 
  $OUTPUT->set_env('task', 'login');
  $OUTPUT->send('login');
}

// CSRF prevention (missing)

// handle keep-alive signal
if ($RCMAIL->action == 'keep-alive') {
  $OUTPUT->reset();
  $OUTPUT->send();
}
// save preference value
else if ($RCMAIL->action == 'save-pref') {
  $RCMAIL->user->save_prefs(array(get_input_value('_name', RCUBE_INPUT_POST) => get_input_value('_value', RCUBE_INPUT_POST)));
  $OUTPUT->reset();
  $OUTPUT->send();
}


// map task/action to a certain include file
$action_map = array(
  'mail' => array(
    'preview' => 'show.inc',
    'print'   => 'show.inc',
    'moveto'  => 'move_del.inc',
    'delete'  => 'move_del.inc',
    'send'    => 'sendmail.inc',
    'expunge' => 'folders.inc',
    'purge'   => 'folders.inc',
    'remove-attachment'  => 'attachments.inc',
    'display-attachment' => 'attachments.inc',
    'upload' => 'attachments.inc',
  ),
 
  'addressbook' => array(
    'add' => 'edit.inc',
  ),
 
  'settings' => array(
    'folders'       => 'manage_folders.inc',
    'create-folder' => 'manage_folders.inc',
    'rename-folder' => 'manage_folders.inc',
    'delete-folder' => 'manage_folders.inc',
    'subscribe'     => 'manage_folders.inc',
    'unsubscribe'   => 'manage_folders.inc',
    'add-identity'  => 'edit_identity.inc',
  )
);

// include task specific functions
if (is_file($incfile = 'program/steps/'.$RCMAIL->task.'/func.inc'))
  include_once($incfile);

// allow 5 "redirects" to another action
$redirects = 0; $incstep = null;
while ($redirects < 5) {
  $stepfile = !empty($action_map[$RCMAIL->task][$RCMAIL->action]) ?
    $action_map[$RCMAIL->task][$RCMAIL->action] : strtr($RCMAIL->action, '-', '_') . '.inc';

  // execute a plugin action
  if (preg_match('/^plugin\./', $RCMAIL->action)) {
    $RCMAIL->plugins->exec_action($RCMAIL->action);
    break;
  }
  // try to include the step file
  else if (is_file($incfile = 'program/steps/'.$RCMAIL->task.'/'.$stepfile)) {
    include($incfile);
    $redirects++;
  }
  else {
    break;
  }
}


// parse main template (default)
$OUTPUT->send($RCMAIL->task);


// if we arrive here, something went wrong
raise_error(array(
  'code' => 404,
  'type' => 'php',
  'line' => __LINE__,
  'file' => __FILE__,
  'message' => "Invalid request"), true, true);
                     
?>
Title: Roundcube calendar plugin not working
Post by: rosali on December 14, 2010, 08:25:44 AM
You need Roundcube v0.5 beta. This file is version 0.3.x.
Title: pg_hba.conf
Post by: Theet on December 15, 2010, 08:24:40 AM
Quote from: rosali;31772
You need Roundcube v0.5 beta. This file is version 0.3.x.

Okay, I have already Roundcube v0.5 beta.

Is it possible something I have to change /usr/syno/pgsql/etc/.. in the file pg_hba.conf and postgresql.conf to let work calendar correctly?
Title: Roundcube calendar plugin not working
Post by: rosali on December 15, 2010, 10:55:28 AM
I don't think so. Roundcube itself works also without any config changes. There is nothing I could think about what should it make necessary for the calendar plugin.
Title: Roundcube calendar plugin not working
Post by: martinenders on December 15, 2010, 01:07:30 PM
Hi,

In my Roundcube installation the calendar plugin also works not properly.
The Userinterface works fine, but events aren't displayed.

It seems that the events can't be loaded from the server.

If I create a new event the message box on the top of the page appears and says "Server Error! (OK)"
But the request for the Event Creation is send properly - the event appears in the Database.

The First Request where I create a new Event with title "test" (I assume that this request creats the entry in the database):
http://........./h-roundcube/?_task=dummy&_action=plugin.newEvent
--> Response: {"action":"plugin.newEvent","exec":"","callbacks":[["plugin.reloadCalendar",[]]]}

Second Request:
http://......../h-roundcube/?_task=dummy&_action=plugin.getEvents&_=1292436238739&start=1290985200&end=1294614000
--> Response: ... SERVICE CURRENTLY NOT AVAILABLE! .... Error No. [500] ....

The third Request is the same as the Second.


Roundcube Version: 0.5 - beta
Calendar Plugin: 2.1 - 14.11.2010
JQuery Plugin: 1.8.2
Database: PostgreSQL

Greetings,
Martin
Title: Roundcube calendar plugin not working
Post by: rosali on December 15, 2010, 03:52:35 PM
I do not have PostGreSQL here. So, I can't track your problems back to the root!

Give me remote access on a test environment. I'm sure I'm able to solve these issues!

My plugin runs on MySQL ... no remote access, please no complaints anymore!
Title: Same problem...
Post by: Theet on December 16, 2010, 02:52:33 AM
Quote from: martinenders;31794
Hi,

In my Roundcube installation the calendar plugin also works not properly.
The Userinterface works fine, but events aren't displayed.

It seems that the events can't be loaded from the server.

If I create a new event the message box on the top of the page appears and says "Server Error! (OK)"
But the request for the Event Creation is send properly - the event appears in the Database.

The First.... Second Request... The third Request....


Roundcube Version: 0.5 - beta
Calendar Plugin: 2.1 - 14.11.2010
JQuery Plugin: 1.8.2
Database: PostgreSQL

Greetings,
Martin

@Martin: I think I have exactly the same problem and same 3 error messages, I hope you can help Rosali with a remote access to solve the problem.
Title: Roundcube calendar plugin not working
Post by: rosali on December 17, 2010, 08:34:06 AM
Try this package.

Notice:
#1-Re-build database from scratch! It is working for me on PostgreSQL.
#2-Re-configure it

EDIT: Removed attachment
Title: Jqueryui?
Post by: Theet on December 17, 2010, 09:12:34 AM
Quote from: rosali;31835
Try this package.

Notice:
#1-Re-build database from scratch! It is working for me on PostgreSQL.
#2-Re-configure it


Now I have installed the new plugin and updated the postgreSQL. Now I have login to Roundcube and calendar asks for the jqueryui plugin. I have already marked jqueryui as plugin. Do I have the wrong version?

jqueryui plugin must be registered before calendar plugin.
Title: Jqueryui?
Post by: Theet on December 17, 2010, 09:13:04 AM
Quote from: rosali;31835
Try this package.

Notice:
#1-Re-build database from scratch! It is working for me on PostgreSQL.
#2-Re-configure it


Sorry, I have registered the "jqueryui" plugin first in plugin, after that "calendar", now it shows a loading screen.
It takes a long time, I will not see the events now
Title: Roundcube calendar plugin not working
Post by: rosali on December 18, 2010, 01:01:02 AM
Check attached version and update jqueryui (it is included in the zip).
Title: new Calendar and Jqeuryui
Post by: Theet on December 18, 2010, 05:49:58 AM
Quote from: rosali;31851
Check attached version and update jqueryui (it is included in the zip).

Wow, Perfect! I can connect with the database to set some appointments with different times in it. But when I want to change the duration of the appointment it comes with an error... see attachment. The most of it will work now!
Title: Roundcube calendar plugin not working
Post by: rosali on December 18, 2010, 05:53:46 AM
Well, give me remote access. Don't worry, just trust me.
Title: Roundcube calendar plugin not working
Post by: rosali on December 18, 2010, 05:56:34 AM
... or try to update to postgres 9.x
Title: Roundcube calendar plugin not working
Post by: admins on December 19, 2010, 07:14:49 AM
Thanks. It works very well.
Has someone integreated an alert feautre?
Or has someone a plugin for syncing the calendar to / from outlook?

Thx
Title: PostgreSQL 9
Post by: Theet on December 19, 2010, 08:21:46 AM
Quote from: rosali;31858
... or try to update to postgres 9.x


Is there something special with PostgreSQL 9.0, now i'm uses the ajax
NAS v8.3.11

Can I setup a new version of PostgreSQL without problems over the older version? (copy the files into the map?) I have looked to the site of
PostgreSQL: The world's most advanced open source database (http://www.postgresql.org/), there are different versions... which version
I need to update?
Title: Roundcube calendar plugin not working
Post by: rosali on December 19, 2010, 11:29:18 AM
I have 9.0.2-1 running.
Title: Roundcube calendar plugin not working
Post by: Andreas72 on August 24, 2011, 08:42:44 AM
sorry, how can I install Calendar, there is this tutorial?
Title: Roundcube calendar plugin not working
Post by: thomas_g on October 19, 2011, 02:36:59 PM
Hey!
I just installed the RC Calender Plugin (version 5.4) and now I have also the problem that appointments I want to create are not shown.
In the error log is the following statement:

[19-Oct-2011 20:15:19 +0200]: DB Error: _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_49e9d474b45d4ff562d28042d68fbba9a257486b3 FROM 'SELECT * FROM `eventsroundcubemail` \r\n         WHERE `user_id`=? AND `start`>? AND `start`?']
[Native code: 1146]
[Native message: Table 'roundcubemail.eventsroundcubemail' doesn't exist]
 in /*...*/webmail/program/include/rcube_mdb2.php on line 285 (GET /?_task=dummy&_action=plugin.getEvents&_gmtoffset=-2&_realgmtoffset=-1&_dststart=1301187600&_dstend=1319936400&_start=1318802400&_end=1319666400&_category=&_tzname=Europe%2FBerlin&_echo=1&_=1319048133556)

I checked the database and there is really no table "eventsroundcubemail", but there are no instructions to create such a table in the mysql.sql file.
The database backend test indicates the same problem ("eventsroundcubemail_caldav" doesn't exist, too), but there is also the statement "Currently we need tables 'events', 'events_caldav' and 'events_cache' for this plugin."

What went wrong? What's to do?

Greetings
thomas
Title: Roundcube calendar plugin not working
Post by: rosali on October 19, 2011, 11:36:13 PM
Did you change the following settings?


/* Database table mapping */
// notice: leading underscore
$rcmail_config['backend_db_table_map'] = array(
  'dummy' => '', // no db table
  'database' => '', // default db table
  'caldav' => '_caldav', // caldav db table (= default db table) extended by _caldav
);

/* database table name (main table) */
$rcmail_config['db_table_events'] = 'events';
$rcmail_config['db_sequence_events'] = 'events_ids';

/* database table name (cache) */
$rcmail_config['db_table_events_cache'] = 'events_cache';
$rcmail_config['db_sequence_events_cache'] = 'events_cache_ids';

/* database table name reminders */
$rcmail_config['db_table_events_reminders'] = 'reminders';