Skip to content

Commit

Permalink
Fix Javascript and LPR shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred Egger committed Jun 24, 2019
1 parent cdc94d2 commit 470d7c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/printer.tabview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/PrinterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct($appName, IRequest $request) {
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',
Expand All @@ -40,7 +40,7 @@ public function printfile($sourcefile, $orientation) {

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',
Expand Down

0 comments on commit 470d7c0

Please sign in to comment.