Hello list:
I started using RC 0.8.1 yesterday, and wanted to congratulate everybody involved for a great piece of software: Thank you!
LDAP has significantly improved, and I am now able to sync all fields from my iOS devices with an LDAP backend that can also be edited via RC.
An execption are the two fields birthDate and anniversary. The issue is that RC stores them by default in "Y-m-d" (yyyy-mm-dd) format, but iOS expects the field to be in Unix timestamp format:
stored as "1975-09-24" in LDAP, and in turn this is displayed on iOS as "1 January 1970" (the default value), because "1975-09-24" it is obviously not a valid timestamp.
in iOS, the field is stored as 180741600 in LDAP, and then CORRECTLY displayed on RC as "24 September 1975": so all dandy up to here. However, when I try to edit that (correctly displayed) date field in RC, the behaviour outlined in 1) converts the timestamp to "Y-m-d" format in LDAP, breaking the field for iOS.
In summary: round-trip editing of date fields does not work at the moment with RC and iOS.
I have tried to update rcmail_format_date_col() from program/steps/addressbook/func.inc (using date format string "s" for timestamp), and format_date() from program/steps/addressbook/func.inc but RC still writes the date field as "Y-m-d", independent of what I use in rcmail_format_date_col().
Any ideas how to fix this final issue?
Thank you in advance, Achim
On 09/09/2012 02:30 PM, Achim wrote:
I have tried to update rcmail_format_date_col() from program/steps/addressbook/func.inc (using date format string "s" for timestamp), and format_date() from program/steps/addressbook/func.inc but RC still writes the date field as "Y-m-d", independent of what I use in rcmail_format_date_col().
This function is used only to display the date. You need to convert the field value in rcube_ldap::_map_data() method which is called before inserting/updating LDAP entry.
Hello Alec:
On 2012-09-09 15:58, A.L.E.C wrote:
On 09/09/2012 02:30 PM, Achim wrote:
I have tried to update rcmail_format_date_col() from program/steps/addressbook/func.inc (using date format string "s" for timestamp), and format_date() from program/steps/addressbook/func.inc but RC still writes the date field as "Y-m-d", independent of what I use in rcmail_format_date_col().
This function is used only to display the date. You need to convert the field value in rcube_ldap::_map_data() method which is called before inserting/updating LDAP entry.
That was the missing piece!
I added special cases (hardcoded) for the two fields birthday and anniversary (line 1567ff):
if ($fld && $val) { // The field does exist, add it to the entry. $ldap_data[$fld] = $val; // Special case: we should store the dates as Unix timestamp if (($col == "birthday") || ($col == "anniversary")) { $timestamp = strtotime($val); $ldap_data[$fld] = $timestamp; } }
Perhaps this is not very elegant, but it works. Feel free to include/improve this.
On the same issue, does anybody know if only iPhone expects Unix timestamps, or if it is "The Right Thing To Do (TM)" for most clients?
Best regards, Achim
On 09/10/2012 01:55 AM, Achim wrote:
Perhaps this is not very elegant, but it works. Feel free to include/improve this.
On the same issue, does anybody know if only iPhone expects Unix timestamps, or if it is "The Right Thing To Do (TM)" for most clients?
It looks that there's no standard for this. There are also not many LDAP schemas with these fields. They are using different formats of date. It would be good to have an option in Roundcube to define date format used on write, e.g.
'date_format' => array( 'anniversary' => '%Y-%m-%d', 'birthday' => '%s', ),
Achim achim+roundcube@qustodium.net schrieb:
Hello Alec:
On 2012-09-09 15:58, A.L.E.C wrote:
On 09/09/2012 02:30 PM, Achim wrote:
I have tried to update rcmail_format_date_col() from program/steps/addressbook/func.inc (using date format string "s" for timestamp), and format_date() from program/steps/addressbook/func.inc but RC still writes the date field as "Y-m-d", independent of what I
use in rcmail_format_date_col().
This function is used only to display the date. You need to convert the field value in rcube_ldap::_map_data() method which is called before inserting/updating LDAP entry.
That was the missing piece!
I added special cases (hardcoded) for the two fields birthday and anniversary (line 1567ff):
if ($fld && $val) { // The field does exist, add it to the entry. $ldap_data[$fld] = $val; // Special case: we should store the dates as Unix timestamp if (($col == "birthday") || ($col == "anniversary")) { $timestamp = strtotime($val); $ldap_data[$fld] = $timestamp; } }
Perhaps this is not very elegant, but it works. Feel free to include/improve this.
On the same issue, does anybody know if only iPhone expects Unix timestamps, or if it is "The Right Thing To Do (TM)" for most clients?
the standard schemas of LDAP do not support birth... I defined my own schema attr for it. and I do not known any OS addressbook client using it... but what schema is iOS using?
Andreas
Best regards, Achim _______________________________________________ Roundcube Users mailing list users@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/users
Could anyone tell me how to get off this infernal mailing list. I have repeatedly asked to be deleted but no response,
Ron
www.worldinneed.co.uk
On 10 Sep 2012, at 09:05, Andreas Dick andudi@gmx.ch wrote:
Achim achim+roundcube@qustodium.net schrieb:
Hello Alec:
On 2012-09-09 15:58, A.L.E.C wrote:
On 09/09/2012 02:30 PM, Achim wrote:
I have tried to update rcmail_format_date_col() from program/steps/addressbook/func.inc (using date format string "s" for timestamp), and format_date() from program/steps/addressbook/func.inc but RC still writes the date field as "Y-m-d", independent of what I
use in rcmail_format_date_col().
This function is used only to display the date. You need to convert the field value in rcube_ldap::_map_data() method which is called before inserting/updating LDAP entry.
That was the missing piece!
I added special cases (hardcoded) for the two fields birthday and anniversary (line 1567ff):
if ($fld && $val) { // The field does exist, add it to the entry. $ldap_data[$fld] = $val; // Special case: we should store the dates as Unix timestamp if (($col == "birthday") || ($col == "anniversary")) { $timestamp = strtotime($val); $ldap_data[$fld] = $timestamp; } }
Perhaps this is not very elegant, but it works. Feel free to include/improve this.
On the same issue, does anybody know if only iPhone expects Unix timestamps, or if it is "The Right Thing To Do (TM)" for most clients?
the standard schemas of LDAP do not support birth... I defined my own schema attr for it. and I do not known any OS addressbook client using it... but what schema is iOS using?
Andreas
Best regards, Achim _______________________________________________ Roundcube Users mailing list users@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/users
Roundcube Users mailing list users@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/users
DO NOT HIJACK THREADS
Am 10.09.2012 17:36, schrieb Ron George:
Could anyone tell me how to get off this infernal mailing list.
the same way you subscribed
and no this is NOT a INTERNAL list, it is the users list maybe you did not understand the context "user" from the software point of view
I have repeatedly asked to be deleted but no response
because nobody can help you or most people ignore users hijacking threads and ignoring any guidelines
if someone is able to subscribe he should aslo able to unsubscribe
so why do you NOT rklick on the link in the list-footer? http://lists.roundcube.net/mailman/listinfo/users
EACH mailing-list on this planet has a welcome message WHY do people not read and throw away anyting? _____________
additionally EACH mail of ANY mailing-list contains a header:
List-Unsubscribe: http://lists.roundcube.net/mailman/options/users, mailto:users-request@lists.roundcube.net?subject=unsubscribe
Hello Andreas:
On 2012-09-10 11:05, Andreas Dick wrote:
On the same issue, does anybody know if only iPhone expects Unix timestamps, or if it is "The Right Thing To Do (TM)" for most clients?
the standard schemas of LDAP do not support birth... I defined my own schema attr for it. and I do not known any OS addressbook client using it... but what schema is iOS using?
Honestly: I have no idea, since I am not using pure LDAP to connect iOS to OpenLDAP.
I use an updated version of PHP-Push 2 [1] as an intermediary layer to provide Exchange-like ActiveSync services for
which now seems to work 90%: HTML email, for instance, is still missing.
I use the object classes top, person, inetOrgPerson, organizationalPerson, and evolutionPerson in OpenLDAP. With a few scripts in between, this seems to work rather well. You can see my additions in this feature request [2].
Best regards, Achim
[1] https://github.com/dupondje/PHP-Push-2 [2] https://github.com/dupondje/PHP-Push-2/issues/18