/** * add server to the list of trusted ownCloud servers * * @param $url * @return int server id */ public function addServer($url) { $url = $this->updateProtocol($url); $result = $this->dbHandler->addServer($url); if ($result) { $token = $this->secureRandom->generate(16); $this->dbHandler->addToken($url, $token); $this->jobList->add('OCA\\Federation\\BackgroundJob\\RequestSharedSecret', ['url' => $url, 'token' => $token]); } return $result; }