Best Calendar for Suite CRM -- (Plugin & Share)

I can confirm this works out of the box now with 7.7.5.

Timo

This same bug is now back in 7.8.7.

any one else seeing this?

I was able to get it working without authentication on .ics output in 7.9.11 – warning your mileage may vary.

Just comment a few lines of code in the HTTP_WebDAV_Server_iCal.php file to get rid of the AUTHENTICATION:

--- modules/iCals/HTTP_WebDAV_Server_iCal.php~	2018-02-02 14:00:13.881000000 -0800
+++ modules/iCals/HTTP_WebDAV_Server_iCal.php	2018-02-13 15:25:54.693000000 -0800
@@ -201,15 +201,15 @@
         } else {
             if ($this->vcal_type == 'ics') {
                 // DO HTTP AUTHORIZATION for iCal:
-                if (empty($this->publish_key) ||
-                    $this->publish_key != $this->user_focus->getPreference('calendar_publish_key')
-                ) {
-                    $this->http_status("401 not authorized");
-                    header('WWW-Authenticate: Basic realm="SugarCRM iCal"');
-                    echo 'Authorization required';
+                // if (empty($this->publish_key) ||
+                //     $this->publish_key != $this->user_focus->getPreference('calendar_publish_key')
+                // ) {
+                //     $this->http_status("401 not authorized");
+                //     header('WWW-Authenticate: Basic realm="SugarCRM iCal"');
+                //     echo 'Authorization required';

-                    return;
-                }
+                //     return;
+                // }

                 $this->http_status("200 OK");
                 header('Content-Type: text/calendar; charset="' . $this->cal_charset . '"');

@smmilton, I am out of context with this big thread after so much time… can you please explain the implications of this fix you propose? Is there any reason why that authentication is there?

Is this fix good enough to go into the code or should this broken authentication be replaced by another?

Sorry, I should have posted afterwards that I had found an alternate way to get things working.

I re-enabled that code, and found that sometimes a calendar_publish_key is set for a user, but is not properly read in this code segment. If you delete the publish key using the web GUI, and re-add a new key it cleared the issue, and started working. I did not go through and try to find out why webdav code was failing to read the key that showed up properly in the web GUI.

However, I was able to fix my issue by clearing the publish_key for the user, and re-adding a new publish key.

Cheers,
-Steve

Ok Steve, thanks for the explanation.

I’m trying not to “let go” of this issue because it has caused so much grief, for such a long time, I really really want to see it fixed for good.

Even if you didn’t pinpoint exactly why things go wrong, do you think you can at least open an Issue on Github with all this information you uncovered?

https://github.com/salesagility/SuiteCRM/issues

If you can find a list of “steps to reproduce” where you can make a calendar_publish_key be produced that fails with this segment of code, that should be enough to get the developers on the right track… do you think you can do it?

Thanks in advance.

I have tried to look through the rest of my users, and can’t they all either have a publish key set that works, or don’t have one set at all. So at the moment I can’t reproduce it myself. If I run across another user that displays the same behavior I will check the database and the code and see if I can figure out what is unique about them.

Thanks for keeping on it though.

1 Like

I think I spotted it!!! I don’t know where to edit the code, but I think I found where the error is.

Hover over your user (top right), go to profile, click advanced.

Scroll down and carefully look at the three URL’s.

Two of them have “server.php/type”, but the ical one has “server.php?type”. I think that should be former.

I tried to change that URL into my browser and it didn’t work, but I feel if it were corrected in the code, it would work.

Does anyone know where it is in the code and can change it to test? We can then send this fix to SuiteCRM.

Actually the “?” is necessary, that is the one that looks more correct to me.

So you can try fixing the parts saying “php/type” and correct them to “php?type” and then trying those. You don’t have to change the code to test. Once you get a working URL it should be easy to fix SuiteCRM to produce that URL.

wow. it works… as read only… which is ‘kind of good enough’ for our purposes for business.

for anyone wondering how to view your suitecrm calendar ‘elsewhere’ note the following steps:

  1. Follow this guy’s youtube tutorial to get you ‘nearly there’ and familiarized

  2. in thunderbird (or any other client where this happens) when prompted for your user / pass, use the crm user / pass

  3. If it doesn’t work right away, you might have to edit the calendar and change to read-only

Other than not being able to both read and write, this is now actually working for me following these steps so… nice.

Hope this helps someone else too