Remove sudo from shell command
This commit is contained in:
parent
9a929d0c20
commit
b2bda9ef60
|
@ -29,7 +29,7 @@ class PrinterController extends Controller {
|
||||||
public function printfile($sourcefile, $orientation) {
|
public function printfile($sourcefile, $orientation) {
|
||||||
if($orientation === "landscape") {
|
if($orientation === "landscape") {
|
||||||
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
|
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
|
||||||
exec('sudo lpr "' . $filefullpath . '"');
|
exec('lpr "' . $filefullpath . '"');
|
||||||
return new JSONResponse(
|
return new JSONResponse(
|
||||||
array(
|
array(
|
||||||
'response' => 'success',
|
'response' => 'success',
|
||||||
|
@ -40,7 +40,7 @@ class PrinterController extends Controller {
|
||||||
|
|
||||||
if($orientation === "portrait"){
|
if($orientation === "portrait"){
|
||||||
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
|
$filefullpath = \OC\Files\Filesystem::getLocalFile($sourcefile);
|
||||||
exec('sudo lpr -o orientation-requested=4 "' . $filefullpath . '"');
|
exec('lpr -o orientation-requested=4 "' . $filefullpath . '"');
|
||||||
return new JSONResponse(
|
return new JSONResponse(
|
||||||
array(
|
array(
|
||||||
'response' => 'success',
|
'response' => 'success',
|
||||||
|
|
Loading…
Reference in a new issue