Browse Source

Remove sudo from shell command

advanced-features
Alfred Egger 1 year ago
parent
commit
b2bda9ef60
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/Controller/PrinterController.php

+ 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('sudo lpr "' . $filefullpath . '"');
exec('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('sudo lpr -o orientation-requested=4 "' . $filefullpath . '"');
exec('lpr -o orientation-requested=4 "' . $filefullpath . '"');
return new JSONResponse(
array(
'response' => 'success',


Loading…
Cancel
Save