Fix Javascript and LPR shell command
This commit is contained in:
parent
cdc94d2db7
commit
470d7c09ef
|
@ -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',
|
||||
|
|
|
@ -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…
Reference in a new issue