-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c35199
commit e8783fa
Showing
866 changed files
with
288,870 additions
and
288,839 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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
RewriteEngine on | ||
RewriteBase /api/ | ||
#RewriteCond $1 !^(index\.php|assets|application|down|robots|upload|ajax|temp|slic3r|\.txt\.json) | ||
#RewriteRule ^(.*)$ /fabui/index.php/$1 [L] | ||
RewriteRule ^files/([A-Za-z0-9-]+)/?$ file_upload.php?location=$1 [NC] | ||
RewriteRule ^version/?$ connection_test.php [NC] | ||
|
||
|
||
php_value upload_max_filesize 512M | ||
php_value post_max_size 512M | ||
RewriteEngine on | ||
RewriteBase /api/ | ||
#RewriteCond $1 !^(index\.php|assets|application|down|robots|upload|ajax|temp|slic3r|\.txt\.json) | ||
#RewriteRule ^(.*)$ /fabui/index.php/$1 [L] | ||
RewriteRule ^files/([A-Za-z0-9-]+)/?$ file_upload.php?location=$1 [NC] | ||
RewriteRule ^version/?$ connection_test.php [NC] | ||
|
||
|
||
php_value upload_max_filesize 512M | ||
php_value post_max_size 512M | ||
php_value memory_limit 512M |
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,18 +1,18 @@ | ||
<?php | ||
require_once $_SERVER['DOCUMENT_ROOT'] . '/fabui/ajax/config.php'; | ||
$post_key = $_SERVER['HTTP_X_API_KEY']; | ||
$_units = json_decode(file_get_contents(CONFIG_UNITS), TRUE); | ||
$_upload_api_keys = isset($_units['api']['keys']) ? $_units['api']['keys']: ''; | ||
foreach ($_upload_api_keys as $user => $key){ | ||
if ($key == $post_key){ | ||
return http_response_code(200); | ||
} | ||
} | ||
// if($key == $_upload_api_key){ | ||
// ; | ||
// }else{ | ||
|
||
|
||
// } | ||
return http_response_code(401); | ||
<?php | ||
require_once $_SERVER['DOCUMENT_ROOT'] . '/fabui/ajax/config.php'; | ||
$post_key = $_SERVER['HTTP_X_API_KEY']; | ||
$_units = json_decode(file_get_contents(CONFIG_UNITS), TRUE); | ||
$_upload_api_keys = isset($_units['api']['keys']) ? $_units['api']['keys']: ''; | ||
foreach ($_upload_api_keys as $user => $key){ | ||
if ($key == $post_key){ | ||
return http_response_code(200); | ||
} | ||
} | ||
// if($key == $_upload_api_key){ | ||
// ; | ||
// }else{ | ||
|
||
|
||
// } | ||
return http_response_code(401); | ||
?> |
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,42 +1,42 @@ | ||
<?php | ||
/** | ||
* | ||
* @author Krios Mane | ||
* @version 0.1 | ||
* @license https://opensource.org/licenses/GPL-3.0 | ||
* | ||
*/ | ||
|
||
|
||
include '/var/www/lib/config.php'; | ||
include '/var/www/lib/utilities.php'; | ||
include "/var/www/lib/serial.php"; | ||
|
||
|
||
$command = isset($_GET['code']) ? trim($_GET['code']) : ''; | ||
$callback = $_GET['callback']; | ||
|
||
|
||
if($command == ''){ | ||
header('Content-Type: application/json; charset=utf-8'); | ||
echo $callback.'('.json_encode(array('command' => '', 'output' => 'Command not set')).')'; | ||
exit(); | ||
} | ||
|
||
//load serial class | ||
$ini_array = parse_ini_file(SERIAL_INI); | ||
$serial = new Serial(); | ||
$serial->deviceSet($ini_array['port']); | ||
$serial->confBaudRate($ini_array['baud']); | ||
$serial->confParity("none"); | ||
$serial->confCharacterLength(8); | ||
$serial->confStopBits(1); | ||
$serial->deviceOpen(); | ||
//send command | ||
$serial->sendMessage($command.PHP_EOL); | ||
$reply = $serial->readPort(); | ||
$serial->serialflush(); | ||
$serial->deviceClose(); | ||
header('Content-Type: application/json; charset=utf-8'); | ||
echo $callback.'('.json_encode(array('command' => $command, 'output' => $reply)).')'; | ||
<?php | ||
/** | ||
* | ||
* @author Krios Mane | ||
* @version 0.1 | ||
* @license https://opensource.org/licenses/GPL-3.0 | ||
* | ||
*/ | ||
|
||
|
||
include '/var/www/lib/config.php'; | ||
include '/var/www/lib/utilities.php'; | ||
include "/var/www/lib/serial.php"; | ||
|
||
|
||
$command = isset($_GET['code']) ? trim($_GET['code']) : ''; | ||
$callback = $_GET['callback']; | ||
|
||
|
||
if($command == ''){ | ||
header('Content-Type: application/json; charset=utf-8'); | ||
echo $callback.'('.json_encode(array('command' => '', 'output' => 'Command not set')).')'; | ||
exit(); | ||
} | ||
|
||
//load serial class | ||
$ini_array = parse_ini_file(SERIAL_INI); | ||
$serial = new Serial(); | ||
$serial->deviceSet($ini_array['port']); | ||
$serial->confBaudRate($ini_array['baud']); | ||
$serial->confParity("none"); | ||
$serial->confCharacterLength(8); | ||
$serial->confStopBits(1); | ||
$serial->deviceOpen(); | ||
//send command | ||
$serial->sendMessage($command.PHP_EOL); | ||
$reply = $serial->readPort(); | ||
$serial->serialflush(); | ||
$serial->deviceClose(); | ||
header('Content-Type: application/json; charset=utf-8'); | ||
echo $callback.'('.json_encode(array('command' => $command, 'output' => $reply)).')'; | ||
?> |
Oops, something went wrong.