bhuisgen / rc-vacation

Vacation plugin for RoundCube Webmail
http://blog.hbis.fr/softwares/rc-vacation/
GNU General Public License v2.0
33 stars 37 forks source link

update #28

Closed MoonshineSG closed 8 years ago

MoonshineSG commented 9 years ago

Is this still under development ? seams like hasn't ben updated in a while, and roundcube is now @ version 1.1.0 and the plugin is broken..

wpoely86 commented 9 years ago

Well, @bhuisgen seems to have abandoned it? Would you mean if we take over?

I've been using this plugin with 1.1.0 without troubles. What doesn't work for you?

MoonshineSG commented 9 years ago

there's an error saying the "cache" is not optional, which i "solved" by adding a default value in the db schema and the from-to dates dont get saved/read from the DB

if you use posfixadmin, you see how it should behave (which is my workaround)

wpoely86 commented 9 years ago

Which driver are you using? sql? Can you post your config?

MoonshineSG commented 9 years ago

yes, mysql backend for my postfix.

the only change to the config i made was the DB config (user/password) and set "vacation_gui_vacationdate" to TRUE

the dates seams that are not save in the DB

mysql> select activefrom, activeuntil from vacation; +---------------------+---------------------+ | activefrom | activeuntil | +---------------------+---------------------+ | 2000-01-01 13:00:00 | 2000-01-01 13:00:00 | +---------------------+---------------------+ 1 row in set (0.01 sec)

jurim76 commented 9 years ago

Seems that $rcmail_config['vacation_gui_vacationmessage_html'] = TRUE option does not work anymore.

nightah commented 8 years ago

As per my post in #26:

The values are generated in php as Unix time, however Postfix requires them in 'YYYY-MM-DD HH:MM:SS' format.

Below the write query is converted to the required format for Postfix to store and action. The read query needs to be converted back to Unix time so when you are interacting with the jquery calendar you get the stored time (if it exists) as opposed to a time of '01-01-1970' in the widget.

Change the following sections in your config.inc.php:

// read data queries $rcmail_config['vacation_sql_read'] = // MySQL array( "SELECT subject AS vacation_subject, body AS vacation_message, active AS vacation_enable, UNIX_TIMESTAMP(activefrom) AS vacation_start, UNIX_TIMESTAMP(activeuntil) AS vacation_end FROM vacation WHERE email=%username AND domain=%email_domain;" );

// write data queries $rcmail_config['vacation_sql_write'] = // MySQL array( "DELETE FROM vacation WHERE email=%email AND domain=%email_domain;", "INSERT INTO vacation (email,domain,subject,body,created,active,activefrom,activeuntil) VALUES (%email,%email_domain,%vacation_subject,%vacation_message,NOW(),%vacation_enable,FROM_UNIXTIME(%vacation_start, '%Y-%m-%d 00:00:00'),FROM_UNIXTIME(%vacation_end, '%Y-%m-%d 23:59:59'));",

MoonshineSG commented 8 years ago

Although I am no longer using this, it's good to know there's a solution to it.

jurim76 commented 8 years ago

Hi,

This solution does not work for LDAP driver.

On Tue, Mar 15, 2016 at 12:43 PM, ovidiu notifications@github.com wrote:

Although I am no longer using this, it's good to know there's a solution to it.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/bhuisgen/rc-vacation/issues/28#issuecomment-196761632

nightah commented 8 years ago

This solution is specifically for the SQL Postfix integration as per the comments in the issue.

I believe for your LDAP issue you would have to actually assign attributes to the following:

// Attribute name to map vacation start
$rcmail_config['vacation_ldap_attr_vacationstart'] = null;

// Attribute name to map vacation end
$rcmail_config['vacation_ldap_attr_vacationend'] = null;

and ensure that the following areas are also changed to include the attributes you define above instead of 'null':

// Search attributes to read data
$rcmail_config['vacation_ldap_search_attrs'] = array (
                                                'vacationActive',
                                                'vacationInfo');

// array of DN to use for modify operations required to write data.
$rcmail_config['vacation_ldap_modify_dns'] = array (
 'cn=%email_local,ou=Mailboxes,dc=%email_domain,ou=MailServer,dc=ldap,dc=my,dc=domain'
);

// array of operations required to write data.
$rcmail_config['vacation_ldap_modify_ops'] = array(
    array ('replace' => array(
            $rcmail_config['vacation_ldap_attr_vacationenable'] => '%vacation_enable',
            $rcmail_config['vacation_ldap_attr_vacationmessage'] => '%vacation_message',
            $rcmail_config['vacation_ldap_attr_vacationforwarder'] => '%vacation_forwarder'
          )

Looking at the LDAP driver it looks like if you define those values you should be okay. Good luck!

Hi,

This solution does not work for LDAP driver. …

jurim76 commented 8 years ago

The problem is LDAP keeps a date as is, in unix time and jquery calendar does not work as expected.

On Wed, Mar 16, 2016 at 1:55 AM, Amir Zarrinkafsh notifications@github.com wrote:

This solution is specifically for the SQL Postfix integration as per the comments in the issue.

I believe for your LDAP issue you would have to actually assign attributes to the following:

// Attribute name to map vacation start $rcmail_config['vacation_ldap_attr_vacationstart'] = null;

// Attribute name to map vacation end $rcmail_config['vacation_ldap_attr_vacationend'] = null;

and ensure that the following areas are also changed to include the attributes you define above instead of 'null':

// Search attributes to read data $rcmail_config['vacation_ldap_search_attrs'] = array ( 'vacationActive', 'vacationInfo');

// array of DN to use for modify operations required to write data. $rcmail_config['vacation_ldap_modify_dns'] = array ( 'cn=%email_local,ou=Mailboxes,dc=%email_domain,ou=MailServer,dc=ldap,dc=my,dc=domain' );

// array of operations required to write data. $rcmail_config['vacation_ldap_modify_ops'] = array( array ('replace' => array( $rcmail_config['vacation_ldap_attr_vacationenable'] => '%vacation_enable', $rcmail_config['vacation_ldap_attr_vacationmessage'] => '%vacation_message', $rcmail_config['vacation_ldap_attr_vacationforwarder'] => '%vacation_forwarder' )

Looking at the LDAP driver it looks like if you define those values you should be okay. Good luck!

Hi,

This solution does not work for LDAP driver. …

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/bhuisgen/rc-vacation/issues/28#issuecomment-197072371

nightah commented 8 years ago

Based on my testing I noticed that the jquery calendar is expecting the date in unix time though, so I believe the issue might actually be something else.

The problem is LDAP keeps a date as is, in unix time and jquery calendar does not work as expected.