fmbiete / Z-Push-contrib

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

CALDAV username & password #233

Open hungpr0 opened 9 years ago

hungpr0 commented 9 years ago

Hi,

Thanks for nice Z-Push, I would like to request a feature. I have problem with shared calendar from caldav server. It uses different username+password from the current user. Can I have a config section of caldav to have a username, password config that I can login to caldav server.

How can I modify the caldav.php to have it? public function Logon($username, $domain, $password) { $this->_caldav_path = str_replace('%u', $username, CALDAV_PATH); $url = sprintf("%s://%s:%d%s", CALDAV_PROTOCOL, CALDAV_SERVER, CALDAV_PORT, $this->_caldav_path); $this->_caldav = new CalDAVClient($url, $username, $password); if ($connected = $this->_caldav->CheckConnection()) { ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendCalDAV->Logon(): User '%s' is authenticated on CalDAV '%s'", $username, $url)); } else { ZLog::Write(LOGLEVEL_WARN, sprintf("BackendCalDAV->Logon(): User '%s' is not authenticated on CalDAV '%s'", $username, $url)); }

    return $connected;
}

Thank you, Hung

fmbiete commented 9 years ago

If I understand correctly you want to transform your credentials into anothers. So if your user is usernameA you want it to be usernameB for CalDAV. Take a look at the mapping option in z-push-admin.php I think it does what you need.