fmbiete / Z-Push-contrib

Z-Push fork with changes that I will try to contrib
GNU Affero General Public License v3.0
135 stars 62 forks source link

Caldav interface does not honor "domain" #293

Open tickerguy opened 7 years ago

tickerguy commented 7 years ago

The domain is not honored (at all) by the caldav processor. This would not be a problem EXCEPT that if you have an event with no organizer in it, "Workaround #127" sticks the login in that field. That causes the phone to think you're not the organizer of the event (when you are) and it will refuse to allow you to edit it.

This particularly hoses people using BlackBerry's Android Hub implementation, and I suspect it may impact others. I have filed a ticket with BlackBerry as well urging them to match the organizeremail against the bare user login name if that is what is presented, but absent them making that change this appears to work.

If you change the existing code around line 732 in backend/caldav/caldav.php to:

    // Workaround #127 - No organizeremail defined
    if (!isset($message->organizeremail)) {
        if ($this->domain == "") {
            $message->organizeremail = $this->originalUsername;
        }
        else {
            $message->organizeremail = $this->originalUsername."@".$this->domain;
        }
        ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendCalDAV->_ParseVEventToSyncObject(): No organizeremail defined, using %s", $message->organizeremail ));
    }

modify the Caldav Logon function to store the passed domain in private $domain, and connect using the "domain\user" syntax originally when setting up the account then it works as expected as the organizer email is pushed down with the domain component associated with it.