file_exists($genesis)){ $genesisPath = View::storeDocument($uid, $genesis); } else { $genesisPath = $genesis; } if ($genesisPath){ $session = Session::getSessionByPath($genesisPath); if (!$session){ $hash = View::getHashByGenesis($uid, $genesisPath); $session = Session::addSession($genesisPath, $hash); } \OCP\JSON::success($session); exit(); } \OCP\JSON::error();