Browse Source

Fix Javascript and LPR shell command

advanced-features
Alfred Egger 1 year ago
parent
commit
470d7c09ef
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      js/printer.tabview.js
  2. +2
    -2
      lib/Controller/PrinterController.php

+ 1
- 1
js/printer.tabview.js View File

@ -76,7 +76,7 @@
}
var url = OC.generateUrl('/apps/printer/printfile'),
data = {source: fileInfo.getFullPath(), orientation: orientation},
data = {sourcefile: fileInfo.getFullPath(), orientation: orientation},
_self = this;
$.ajax({
type: 'GET',


+ 2
- 2
lib/Controller/PrinterController.php View File

@ -29,7 +29,7 @@ class PrinterController extends Controller {
public function printfile($sourcefile, $orientation) {
if($orientation === "landscape") {
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
exec('lpr ' . $filefullpath);
exec('sudo lpr "' . $filefullpath . '"');
return new JSONResponse(
array(
'response' => 'success',
@ -40,7 +40,7 @@ class PrinterController extends Controller {
if($orientation === "portrait"){
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
exec('lpr -o orientation-requested=4 ' . $filefullpath);
exec('sudo lpr -o orientation-requested=4 "' . $filefullpath . '"');
return new JSONResponse(
array(
'response' => 'success',


Loading…
Cancel
Save