Update and rename fileread.php to file_read.php
This commit is contained in:
parent
c577d887e9
commit
452e1e2a8a
|
|
@ -17,33 +17,39 @@
|
||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
Portions created by the Initial Developer are Copyright (C) 2008-2019
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
*/
|
*/
|
||||||
include "root.php";
|
|
||||||
require_once "resources/require.php";
|
|
||||||
require_once "resources/check_auth.php";
|
|
||||||
if (permission_exists('script_editor_view')) {
|
|
||||||
//access granted
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo "access denied";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$filename = $_POST["file"];
|
//includes
|
||||||
$filename = str_replace ("\\", "/", $filename);
|
include "root.php";
|
||||||
|
require_once "resources/require.php";
|
||||||
|
require_once "resources/check_auth.php";
|
||||||
|
|
||||||
$handle = fopen($filename, "r");
|
//check permissions
|
||||||
if ($handle) {
|
if (permission_exists('edit_view')) {
|
||||||
while (!feof($handle)) {
|
//access granted
|
||||||
$buffer = fgets($handle, 4096);
|
}
|
||||||
echo $buffer;
|
else {
|
||||||
|
echo "access denied";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
//get the file name
|
||||||
|
$file_name = $_POST["file"];
|
||||||
|
$file_name = str_replace ("\\", "/", $filename);
|
||||||
|
|
||||||
|
//get the contents of the file
|
||||||
|
$handle = fopen($file_name, "r");
|
||||||
|
if ($handle) {
|
||||||
|
while (!feof($handle)) {
|
||||||
|
$buffer = fgets($handle, 4096);
|
||||||
|
echo $buffer;
|
||||||
|
}
|
||||||
|
fclose($handle);
|
||||||
}
|
}
|
||||||
fclose($handle);
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue