-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move config option to ini files + printer touchups
- Loading branch information
1 parent
c009dba
commit 1ef89b5
Showing
8 changed files
with
119 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
; This file contains the configuration option that are loaded by config.php | ||
FreeSpaceWarn = 2048 ; In Megabytes, Warning is displayed if there is less then the amount specified | ||
Fortune = true ; Enable/disable fortunes in the debug console | ||
ExtraScanners = false ; Adds sample scanners from ./inc/scanhelp/ | ||
CheckForUpdates = true ; Enables auto update checking | ||
RequireLogin = false ; Require user to login (A 'geek' could bypass this without too much trouble using JavaScript); Create the user 'root' 1st, also Authorization is root's password | ||
SessionDuration = 86400 ; Max time (in seconds) signed in is 24hrs (irrelevant with the above off) | ||
Theme = '383838.B84E40.407EB4.202020.408080.FF0.FFF.3B133B.FFF.F00.FFF' ; Default Color Scheme | ||
DarkPicker = true ; Use the dark color picker by default (It is part of the theme manager) | ||
RulerIncrement = 25.4 ; Controls the rulers number increments relative to millimeters [25.4=inches (25.4 mm = 1 in), 10=centimeters (10 mm = 1 cm)] | ||
TimeZone = '' ; Time zone override (used with scan file names) List of settings is on this page: http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone | ||
Printer = 0 ; 0 mean printing is disabled, 1 means integrated printer, 2 means upload printer, 3 means upload/integrated printing | ||
; No need to mess with these | ||
NAME = "PHP Scanner Server" ; Application Name | ||
VER = "1.4-11_dev" ; Scanner Version | ||
SAE_VER = "1.4" ; Scanner Access Enabler version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,41 @@ | ||
<?php | ||
# This file is used to get a list of printers via AJAX | ||
# The printer.php file in the inc folder does the printer tab | ||
# The download.php in the parent folder does the integrated printing | ||
header('Content-type: plain/txt; charset=UTF-8'); | ||
echo str_replace("\n",",",substr(shell_exec('lpstat -a|awk \'{print $1}\''),0,-1)); | ||
# This file is used to handle all the print commands | ||
# This file runs all the print commands, ../download.php and inc/printer.php call this page via include | ||
$lpstat='lpstat -a | awk \'{print $1}\'';// command used to find printers | ||
if(function_exists('exe')){// internal call via inc/printer.php | ||
if(isset($file)) | ||
|
||
Print_Message( | ||
$_POST['printer'], | ||
'Your document is being processed:<br/><pre>'.html( | ||
exe('lp -d '.shell($_POST['printer'])." $file",true) // Print via Printer page | ||
).'</pre>', | ||
'center' | ||
); | ||
else | ||
$printers=explode("\n",exe($lpstat,true)); | ||
} | ||
else if(isset($Printer)){ // internal call via include from ../download.php | ||
header('Content-type: application/json; charset=UTF-8'); | ||
echo json_encode((object)array( | ||
'printer'=>$_GET['printer'], | ||
'message'=>shell_exec('lp -d '.escapeshellarg($_GET['printer'])." $file")// This line makes it print using the integrated printer | ||
)); | ||
} | ||
else{ | ||
$Printer=parse_ini_file(file_exists('res')?'config.ini':'../config.ini'); | ||
$Printer=(integer)$Printer['Printer']; | ||
if(!function_exists('ext2mime')){// external call via browser | ||
if($Printer==0){// Check if printer service is enabled | ||
header('Content-type: application/json; charset=UTF-8'); | ||
echo '{"error":"Printer service is disabled"}'; | ||
} | ||
else if(isset($_GET['list'])){// Return list of printers | ||
header('Content-type: plain/txt; charset=UTF-8'); | ||
echo str_replace("\n",",",substr(shell_exec($lpstat),0,-1)); | ||
} | ||
else | ||
echo "Todo: Don't reload printer page, use AJAX"; | ||
} | ||
} | ||
?> |