Commit 9e4f0a3e authored by Sebastian Kummer's avatar Sebastian Kummer

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

Merge pull request #515 in ZP/z-push from feature/ZP-1195-expose-webservicedevice--getdevicedetails to develop

* commit 'cbdcc5f1':
  ZP-1195 Call Request::GetUser() only once.
  ZP-1195 Expose GetDeviceDetails() via WebserviceDevice.
parents a5a3d28b cbdcc5f1
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
class WebserviceDevice { class WebserviceDevice {
/** /**
* Returns a list of all known devices of the Request::GetGETUser() * Returns a list of all known devices of the Request::GetGETUser().
* *
* @access public * @access public
* @return array * @return array
...@@ -48,7 +48,22 @@ class WebserviceDevice { ...@@ -48,7 +48,22 @@ class WebserviceDevice {
} }
/** /**
* Remove all state data for a device of the Request::GetGETUser() * Returns the details of a given deviceid of the Request::GetGETUser().
*
* @access public
* @return ASDevice object
*/
public function GetDeviceDetails($deviceId) {
$user = Request::GetGETUser();
$deviceId = preg_replace("/[^A-Za-z0-9]/", "", $deviceId);
ZLog::Write(LOGLEVEL_INFO, sprintf("WebserviceDevice::GetDeviceDetails('%s'): getting device details from state of user '%s'", $deviceId, $user));
ZPush::GetTopCollector()->AnnounceInformation(sprintf("Retrieved details of device '%s'", $deviceId), true);
return ZPushAdmin::GetDeviceDetails($deviceId, $user);
}
/**
* Remove all state data for a device of the Request::GetGETUser().
* *
* @param string $deviceId the device id * @param string $deviceId the device id
* *
...@@ -70,7 +85,7 @@ class WebserviceDevice { ...@@ -70,7 +85,7 @@ class WebserviceDevice {
} }
/** /**
* Marks a device of the Request::GetGETUser() to be remotely wiped * Marks a device of the Request::GetGETUser() to be remotely wiped.
* *
* @param string $deviceId the device id * @param string $deviceId the device id
* *
......
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