Commit 63f86fdc authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #38 in ZP/z-push from...

Merge pull request #38 in ZP/z-push from feature/ZP-677-expose-resync-folder-funcitonality to develop

* commit 'd72a5be9':
  ZP-677 Expose ResyncFolder to webservice. Released under the Affero GNU General Public License (AGPL) version 3.
parents 9dced9e2 d72a5be9
......@@ -111,7 +111,7 @@ class WebserviceDevice {
}
/**
* Marks a a device of the Request::GetGETUser() for resynchronization
* Marks a device of the Request::GetGETUser() for resynchronization.
*
* @param string $deviceId the device id
*
......@@ -131,4 +131,28 @@ class WebserviceDevice {
ZPush::GetTopCollector()->AnnounceInformation(sprintf("Resync requested - device id '%s'", $deviceId), true);
return true;
}
/**
* Marks a folder of a device of the Request::GetGETUser() for resynchronization.
*
* @param string $deviceId the device id
* @param string $folderId the folder id
*
* @access public
* @return boolean
* @throws SoapFault
*/
public function ResyncFolder($deviceId, $folderId) {
$deviceId = preg_replace("/[^A-Za-z0-9]/", "", $deviceId);
$folderId = preg_replace("/[^A-Za-z0-9]/", "", $folderId);
ZLog::Write(LOGLEVEL_INFO, sprintf("WebserviceDevice::ResyncFolder('%s','%s'): mark folder of a device of user '%s' for resynchronization", $deviceId, $folderId, Request::GetGETUser()));
if (! ZPushAdmin::ResyncFolder(Request::GetGETUser(), $deviceId, $folderId)) {
ZPush::GetTopCollector()->AnnounceInformation(ZLog::GetLastMessage(LOGLEVEL_ERROR), true);
throw new SoapFault("ERROR", ZLog::GetLastMessage(LOGLEVEL_ERROR));
}
ZPush::GetTopCollector()->AnnounceInformation(sprintf("Folder resync requested - device id '%s', folder id '%s", $deviceId, $folderId), true);
return true;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment