diff --git a/ajax/otpoll.php b/ajax/otpoll.php index 5de6e0ab..180ead6f 100644 --- a/ajax/otpoll.php +++ b/ajax/otpoll.php @@ -49,10 +49,10 @@ function bogusSession($i){ return $bs; } +$response = array(); try{ $request = new OCA\Office\Request(); $command = $request->getParam('command'); - $response = array(); switch ($command){ case 'session-list': $response["session_list"] = array(bogusSession(0), bogusSession(1)); diff --git a/ajax/session.php b/ajax/session.php index 22b13388..c10f29f4 100644 --- a/ajax/session.php +++ b/ajax/session.php @@ -3,7 +3,7 @@ namespace OCA\Office; // Check if we are a user -\OCP\User::checkLoggedIn(); +\OCP\JSON::checkLoggedIn(); $genesis = @$_POST['genesis']; @@ -18,7 +18,8 @@ if (!$officeView->file_exists($genesis)){ if ($genesisPath){ $session = Session::getSessionByPath($genesisPath); if (!$session){ - $session = Session::addSession($genesisPath); + $hash = View::getHashByGenesis($uid, $genesisPath); + $session = Session::addSession($genesisPath, $hash); } \OCP\JSON::success($session); exit(); diff --git a/ajax/sessions.php b/ajax/sessions.php index 1ade18d0..59b8078d 100644 --- a/ajax/sessions.php +++ b/ajax/sessions.php @@ -2,7 +2,7 @@ namespace OCA\Office; -\OCP\User::checkLoggedIn(); +\OCP\JSON::checkLoggedIn(); \OCP\JSON::success(array( 'sessions' => Session::getAllSessions() diff --git a/lib/genesis.php b/lib/genesis.php index 721acd88..5bc8ca56 100644 --- a/lib/genesis.php +++ b/lib/genesis.php @@ -5,7 +5,7 @@ namespace OCA\Office; class Genesis { public static function serve($args){ - \OCP\User::checkLoggedIn(); + \OCP\JSON::checkLoggedIn(); $session = Session::getSession(@$args['es_id']);