diff options
author | Minteck <nekostarfan@gmail.com> | 2021-08-24 15:38:16 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-08-24 15:38:16 +0200 |
commit | 529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105 (patch) | |
tree | 8a50c30271b9b328cde0d907b1441f2dabdc341b /Neutron-trunk/api/setup/check.php | |
parent | 15e4724761c50b30803df1811a525c85058f70bf (diff) | |
download | electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.gz electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.bz2 electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.zip |
Update
Diffstat (limited to 'Neutron-trunk/api/setup/check.php')
-rw-r--r-- | Neutron-trunk/api/setup/check.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Neutron-trunk/api/setup/check.php b/Neutron-trunk/api/setup/check.php new file mode 100644 index 0000000..d3eb831 --- /dev/null +++ b/Neutron-trunk/api/setup/check.php @@ -0,0 +1,30 @@ +<?php require_once "../../resources/private/relative.php"; getRelativeDetails("api"); ?> +<?php + +// require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("It works!"); + +if (substr($_SERVER['SERVER_PROTOCOL'], 0, 4) != "HTTP") { + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("Unsupported protocol"); +} + +if ($_SERVER['REQUEST_METHOD'] != "GET") { + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("Unsupported request method"); +} + +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/resources/upload")) { + mkdir($_SERVER['DOCUMENT_ROOT'] . "/resources/upload"); +} + +ob_start(); +phpinfo(); +$data = ob_get_contents(); +ob_clean(); +if (strpos($data, '<tr><td class="e">GD Support </td><td class="v">enabled </td></tr>') !== false || strpos($data, 'GD Support => enabled') !== false) {} else { + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("The GD2 library is not installed or enabled"); +} + +if (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {} else { + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("Unsupported browser, please use Chrome, Chrome-based or Firefox"); +} + +require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("ok"); |