From e35cc9f3c69b6f69e0d7a105ce39fd4d3c5a87db Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 22 Oct 2015 13:36:23 +0200 Subject: [PATCH 1/4] fix setting of Content-Type in header (Closes: #233) --- op/op.Ajax.php | 82 +++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/op/op.Ajax.php b/op/op.Ajax.php index 3871d9c43..c3b415afd 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -208,7 +208,7 @@ switch($command) { case 'movefolder': /* {{{ */ if($user) { if(!checkFormKey('movefolder', 'GET')) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>'')); } else { $mfolder = $dms->getFolder($_REQUEST['folderid']); @@ -217,26 +217,26 @@ switch($command) { if($folder = $dms->getFolder($_REQUEST['targetfolderid'])) { if($folder->getAccessMode($user) >= M_READWRITE) { if($mfolder->setParent($folder)) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>true, 'message'=>'Folder moved', 'data'=>'')); } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'Error moving folder', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No access on destination folder', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No destination folder', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No folder', 'data'=>'')); } } @@ -246,7 +246,7 @@ switch($command) { case 'movedocument': /* {{{ */ if($user) { if(!checkFormKey('movedocument', 'GET')) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>'')); } else { $mdocument = $dms->getDocument($_REQUEST['docid']); @@ -255,26 +255,26 @@ switch($command) { if($folder = $dms->getFolder($_REQUEST['targetfolderid'])) { if($folder->getAccessMode($user) >= M_READWRITE) { if($mdocument->setFolder($folder)) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>true, 'message'=>'Document moved', 'data'=>'')); } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'Error moving folder', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No access on destination folder', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No destination folder', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No folder', 'data'=>'')); } } @@ -284,25 +284,25 @@ switch($command) { case 'deletefolder': /* {{{ */ if($user) { if(!checkFormKey('removefolder', 'GET')) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>'')); } else { $folder = $dms->getFolder($_REQUEST['id']); if($folder) { if ($folder->getAccessMode($user) >= M_READWRITE) { if($folder->remove()) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>true, 'message'=>'', 'data'=>'')); } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'Error removing folder', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No folder', 'data'=>'')); } } @@ -312,7 +312,7 @@ switch($command) { case 'deletedocument': /* {{{ */ if($user) { if(!checkFormKey('removedocument', 'GET')) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>'')); } else { $document = $dms->getDocument($_REQUEST['id']); @@ -330,18 +330,18 @@ switch($command) { } } } - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>true, 'message'=>'', 'data'=>'')); } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'Error removing document', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No document', 'data'=>'')); } } @@ -357,31 +357,31 @@ switch($command) { $lockingUser = $document->getLockingUser(); if (($lockingUser->getID() == $user->getID()) || ($document->getAccessMode($user) == M_ALL)) { if (!$document->setLocked(false)) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'Error unlocking document', 'data'=>'')); } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>true, 'message'=>'', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>'')); } } else { if (!$document->setLocked($user)) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'Error locking document', 'data'=>'')); } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>true, 'message'=>'', 'data'=>'')); } } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No access', 'data'=>'')); } } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'No document', 'data'=>'')); } } @@ -394,10 +394,10 @@ switch($command) { fputcsv($fp, array(date('Y-m-d H:i:s'), $user->getLogin(), $_POST['key'], $_POST['lang'], $_POST['phrase'])); fclose($fp); } - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>true, 'message'=>'Thank you for your contribution', 'data'=>'')); } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>'Missing translation', 'data'=>'')); } } @@ -441,7 +441,7 @@ switch($command) { if($user) { if(checkFormKey('adddocument')) { if (!isset($_POST["folderid"]) || !is_numeric($_POST["folderid"]) || intval($_POST["folderid"])<1) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>getMLText("invalid_folder_id"))); exit; } @@ -450,7 +450,7 @@ switch($command) { $folder = $dms->getFolder($folderid); if (!is_object($folder)) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>getMLText("invalid_folder_id"))); exit; } @@ -469,12 +469,12 @@ switch($command) { } if (!is_uploaded_file($_FILES["userfile"]["tmp_name"]) || $_FILES['userfile']['error']!=0){ - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>getMLText("uploading_failed"))); exit; } if ($_FILES["userfile"]["size"]==0) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>getMLText("uploading_zerosize"))); exit; } @@ -498,7 +498,7 @@ switch($command) { /* Check if name already exists in the folder */ if(!$settings->_enableDuplicateDocNames) { if($folder->hasDocumentByName($name)) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>getMLText("document_duplicate_name"))); exit; } @@ -567,7 +567,7 @@ switch($command) { '', array(), array(), $workflow); if (is_bool($res) && !$res) { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>getMLText("error_occured"))); exit; } else { @@ -634,10 +634,10 @@ switch($command) { } } - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>true, 'message'=>getMLText('splash_document_added'), 'data'=>$document->getID())); } else { - header('Content-Type', 'application/json'); + header('Content-Type: application/json'); echo json_encode(array('success'=>false, 'message'=>getMLText('invalid_request_token'), 'data'=>'')); } } From 6a4402a1d692ab1b4dbe5089d9cda72739dfb755 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 27 Oct 2015 08:57:26 +0100 Subject: [PATCH 2/4] add mp4 to view filetypes --- conf/settings.xml.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/settings.xml.template b/conf/settings.xml.template index b6275904d..11e30dcd4 100644 --- a/conf/settings.xml.template +++ b/conf/settings.xml.template @@ -32,7 +32,7 @@ --> Date: Tue, 27 Oct 2015 09:01:17 +0100 Subject: [PATCH 3/4] add changes for 4.3.22 --- CHANGELOG | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index ed74b39a2..0f748af7f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +-------------------------------------------------------------------------------- + Changes in version 4.3.22 +-------------------------------------------------------------------------------- +- fix lots of HTTP-Headers in op.Ajax.php (Closes: #233) +- Timeline will be updated by ajax call + -------------------------------------------------------------------------------- Changes in version 4.3.21 -------------------------------------------------------------------------------- From 13dc35192851326d4a24153e95fbf36326430dec Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 27 Oct 2015 09:02:30 +0100 Subject: [PATCH 4/4] more changes for 4.3.22 --- CHANGELOG | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 0f748af7f..07728552c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,7 +2,8 @@ Changes in version 4.3.22 -------------------------------------------------------------------------------- - fix lots of HTTP-Headers in op.Ajax.php (Closes: #233) -- Timeline will be updated by ajax call +- Timeline will be updated by ajax call, clicking on an item in the timeline + will output some document information -------------------------------------------------------------------------------- Changes in version 4.3.21