Пример #1
0
 /**
  * Marks a a device of the Request::GetGETUser() for resynchronization
  *
  * @param string    $deviceId       the device id
  *
  * @access public
  * @return boolean
  * @throws SoapFault
  */
 public function ResyncDevice($deviceId)
 {
     $deviceId = preg_replace("/[^A-Za-z0-9]/", "", $deviceId);
     ZLog::Write(LOGLEVEL_INFO, sprintf("WebserviceDevice::ResyncDevice('%s'): mark device of user '%s' for resynchronization", $deviceId, Request::GetGETUser()));
     if (!ZPushAdmin::ResyncDevice(Request::GetGETUser(), $deviceId)) {
         ZPush::GetTopCollector()->AnnounceInformation(ZLog::GetLastMessage(LOGLEVEL_ERROR), true);
         throw new SoapFault("ERROR", ZLog::GetLastMessage(LOGLEVEL_ERROR));
     }
     ZPush::GetTopCollector()->AnnounceInformation(sprintf("Resync requested - device id '%s'", $deviceId), true);
     return true;
 }
Пример #2
0
 /**
  * Command "Resync device(s)"
  * Resyncs one or all devices of that user
  *
  * @return
  * @access public
  */
 public static function CommandResyncDevices()
 {
     $stat = ZPushAdmin::ResyncDevice(self::$user, self::$device);
     echo sprintf("Resync of device '%s' of user '%s': %s", self::$device, self::$user, $stat ? 'Requested' : ZLog::GetLastMessage(LOGLEVEL_ERROR)) . "\n";
 }