cleanup
This commit is contained in:
parent
9c4da055a8
commit
89f2dd905f
@ -127,8 +127,9 @@ var odfViewer = {
|
|||||||
$.ajax({type: 'GET',
|
$.ajax({type: 'GET',
|
||||||
url: OC.filePath('richdocuments', 'ajax', 'generate.php'),
|
url: OC.filePath('richdocuments', 'ajax', 'generate.php'),
|
||||||
data: {id: context.$file.attr('data-id')},
|
data: {id: context.$file.attr('data-id')},
|
||||||
async: false, success: function(result) {
|
async: false,
|
||||||
if(result.status=="success"){
|
success: function(result) {
|
||||||
|
if(result.status==='success'){
|
||||||
var $chatroom = $('<div />');
|
var $chatroom = $('<div />');
|
||||||
$chatroom.attr('id','chatroom');
|
$chatroom.attr('id','chatroom');
|
||||||
$chatroom.data('chatroom-password',result.password);
|
$chatroom.data('chatroom-password',result.password);
|
||||||
|
@ -260,7 +260,8 @@ class DocumentController extends Controller {
|
|||||||
if (empty($id)) {
|
if (empty($id)) {
|
||||||
return array(
|
return array(
|
||||||
'status' => 'error',
|
'status' => 'error',
|
||||||
'message' => 'no id received');
|
'message' => 'no id received'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$view = \OC\Files\Filesystem::getView();
|
$view = \OC\Files\Filesystem::getView();
|
||||||
try {
|
try {
|
||||||
@ -273,16 +274,19 @@ class DocumentController extends Controller {
|
|||||||
return array(
|
return array(
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
'password' => $chatRoomPassword,
|
'password' => $chatRoomPassword,
|
||||||
'name' => $chatRoomName);
|
'name' => $chatRoomName
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return array(
|
return array(
|
||||||
'status' => 'error',
|
'status' => 'error',
|
||||||
'message' => 'user unauthorised to view file');
|
'message' => 'user unauthorised to view file'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return array(
|
return array(
|
||||||
'status' => 'error',
|
'status' => 'error',
|
||||||
'message' => 'user unauthorised to view file');
|
'message' => 'user unauthorised to view file'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user