Lines Matching refs:conn

77       $conn = $this->getConnection($connectionId);
78 if($conn === false)
80 $conn = array_merge($conn, $this->getCredentials($connectionId));
81 $this->setupClient($conn, strlen($data), null, 'text/calendar; charset=utf-8');
82 $path = $conn['uri'].'/'.uniqid('dokuwiki-').'.ics';
86 $this->syncConnection($conn['id'], true);
104 $conn = $this->getConnection($connectionId);
105 if($conn === false)
107 $conn = array_merge($conn, $this->getCredentials($connectionId));
110 …$this->setupClient($conn, strlen($data), null, 'text/calendar; charset=utf-8', array('If-Match' =>…
111 $path = $conn['uri'].'/'.$entry['uri'];
115 $this->syncConnection($conn['id'], true);
133 $conn = $this->getConnection($connectionId);
134 if($conn === false)
136 $conn = array_merge($conn, $this->getCredentials($connectionId));
139 …$this->setupClient($conn, strlen($data), null, 'text/calendar; charset=utf-8', array('If-Match' =>…
140 $path = $conn['uri'].'/'.$entry['uri'];
144 $this->syncConnection($conn['id'], true);
216 $conn = $this->getConnection($connectionId);
217 if($conn === false)
219 if($conn['type'] === 'calendar')
224 elseif($conn['type'] === 'contacts')
282 $conn = $this->getConnection($connectionId);
283 if($conn === false)
285 $conn = array_merge($conn, $this->getCredentials($connectionId));
286 $this->setupClient($conn, strlen($data), null, 'text/vcard; charset=utf-8');
287 $path = $conn['uri'].'/'.uniqid('dokuwiki-').'.vcf';
291 $this->syncConnection($conn['id'], true);
310 $conn = $this->getConnection($connectionId);
311 if($conn === false)
313 $conn = array_merge($conn, $this->getCredentials($connectionId));
316 …$this->setupClient($conn, strlen($data), null, 'text/vcard; charset=utf-8', array('If-Match' => $e…
317 $path = $conn['uri'].'/'.$entry['uri'];
321 $this->syncConnection($conn['id'], true);
339 $conn = $this->getConnection($connectionId);
340 if($conn === false)
342 $conn = array_merge($conn, $this->getCredentials($connectionId));
345 …$this->setupClient($conn, strlen($data), null, 'text/vcard; charset=utf-8', array('If-Match' => $e…
346 $path = $conn['uri'].'/'.$entry['uri'];
350 $this->syncConnection($conn['id'], true);
381 $conn = $this->getConnection($connectionId);
382 switch($conn['type'])
561 $conn = array();
562 $conn['uri'] = $urilist[0];
563 $conn['username'] = $username;
564 $conn['password'] = $password;
565 $this->setupClient($conn, strlen($data), ' 0',
621 $this->setupClient($conn, strlen($data), ' 0');
640 $this->setupClient($conn, strlen($data), ' 0');
677 $this->setupClient($conn, strlen($data), '1');
785 $conn = $this->getConnection($connectionId);
786 if($conn === false)
791 $conn = array_merge($conn, $this->getCredentials($connectionId));
796 if((time() < ($conn['lastsynced'] + $conn['syncinterval'])) && !$force)
804 if(($conn['active'] !== '1') && !$overrideActive)
813 if(($conn['type'] !== 'contacts') && ($conn['type'] !== 'calendar')
814 && ($conn['type'] !== 'icsfeed'))
816 $this->lastErr = "Unsupported connection type found: ".$conn['type'];
822 if($conn['type'] === 'icsfeed')
824 return $this->syncConnectionFeed($conn, $force);
829 return $this->syncConnectionDAV($conn, $force, $deleteBeforeSync);
839 private function syncConnectionFeed($conn, $force = false) argument
842 $this->setupClient($conn, null, null, null);
843 $resp = $this->client->sendRequest($conn['uri']);
863 $sqlite->query($query, $conn['id']);
874 $calendarData['href'] = $conn['uri'];
876 $this->object2calendar($conn['id'], $calendarData);
881 $this->updateConnection($conn['id'], time());
892 private function syncConnectionDAV($conn, $force = false, argument
895 $syncResponse = $this->getCollectionStatusForConnection($conn);
901 if(($conn['ctag'] === $syncResponse['getctag']) && !$force)
904 $this->updateConnection($conn['id'], time(), $conn['ctag']);
913 $remoteEtags = $this->getRemoteETagsForConnection($conn);
928 if($conn['type'] === 'calendar')
931 $sqlite->query($query, $conn['id']);
933 elseif($conn['type'] === 'contacts')
936 $sqlite->query($query, $conn['id']);
940 $localEtags = $this->getLocalETagsForConnection($conn);
956 $objects = $this->getRemoteObjectsByEtag($conn, $worklist['fetch']);
964 $this->insertObjects($conn, $objects);
970 $this->deleteEntriesByETag($conn, $worklist['del']);
975 $this->updateConnection($conn['id'], time(), $syncResponse['getctag']);
983 * @param array $conn The connection to work with
988 private function insertObjects($conn, $objects) argument
993 if($conn['type'] === 'calendar')
995 $this->object2calendar($conn['id'], $data);
997 elseif($conn['type'] === 'contacts')
999 $this->object2addressbook($conn['id'], $data);
1013 * @param array $conn The connection to work with
1018 private function deleteEntriesByETag($conn, $worklist) argument
1020 if($conn['type'] === 'calendar')
1025 elseif($conn['type'] === 'contacts')
1041 $sqlite->query($query, $etag, $conn['id']);
1049 * @param array $conn The connection to work with
1054 private function getRemoteObjectsByEtag($conn, $etags) argument
1056 if($conn['type'] === 'contacts')
1063 elseif($conn['type'] === 'calendar')
1071 $this->setupClient($conn, strlen($data), '1');
1072 $resp = $this->client->sendRequest($conn['uri'], $data, 'REPORT');
1110 * @param array $conn The connection information
1117 private function setupClient($conn, $cl = null, $depth = null, argument
1121 $this->client->user = $conn['username'];
1122 $this->client->pass = $conn['password'];
1144 * @param array $conn The local connection
1148 private function getLocalETagsForConnection($conn) argument
1150 if($conn['type'] === 'calendar')
1155 elseif($conn['type'] === 'contacts')
1169 $res = $sqlite->query($query, $conn['id']);
1177 * @param array $conn The connection to work with
1181 private function getRemoteETagsForConnection($conn) argument
1184 if($conn['type'] === 'contacts')
1189 elseif($conn['type'] === 'calendar')
1200 $this->setupClient($conn, strlen($data), '1');
1201 $resp = $this->client->sendRequest($conn['uri'], $data, 'REPORT');
1316 * @param array $conn An array containing connection information
1319 private function getCollectionStatusForConnection($conn) argument