Exemplo n.º 1
0
 /**
  * Sets the the next synckey.
  * This is done by parsing it and saving uuid and next counter.
  * if the folder has no synckey until now (new sync), the next counter becomes current asl well.
  *
  * @param string    $synckey
  *
  * @access public
  * @throws FatalException       if the uuids of current and next do not match
  * @return boolean
  */
 public function SetNewSyncKey($synckey)
 {
     list($uuid, $uuidNewCounter) = StateManager::ParseStateKey($synckey);
     if (!$this->HasSyncKey()) {
         $this->uuid = $uuid;
         $this->uuidCounter = $uuidNewCounter;
     } else {
         if ($uuid !== $this->uuid) {
             throw new FatalException("SyncParameters->SetNewSyncKey(): new SyncKey must have the same UUID as current SyncKey");
         }
     }
     $this->uuidNewCounter = $uuidNewCounter;
     $this->counterconfirmed = false;
     $this->confirmationChanged = true;
     $this->synckeyChanged = true;
 }