Use OCP/JSON to check user
This commit is contained in:
parent
7b86f75955
commit
9586253c38
@ -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));
|
||||
|
@ -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();
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace OCA\Office;
|
||||
|
||||
\OCP\User::checkLoggedIn();
|
||||
\OCP\JSON::checkLoggedIn();
|
||||
|
||||
\OCP\JSON::success(array(
|
||||
'sessions' => Session::getAllSessions()
|
||||
|
@ -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']);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user