eurysco

eurysco is a free and open source project based on PHP language, in order to enhance and simplify the remote administration of Microsoft operating systems with an intuitive, fast and responsive web interface

view my linkedin profileview my linkedin profile :)

Privacy Policy
     

Total sweet donations $23
Help me to support eurysco (^_^) !

Source download





0001 <?php
0002 
0003 include(str_replace('\\server', '', $_SERVER['DOCUMENT_ROOT']) . '\\include\\init_server.php');
0004 
0005 set_time_limit(60);
0006 
0007 if (isset($_POST['type']) && isset($_POST['download'])) {
0008 	$filelocation = '';
0009 	if ($_POST['type'] == 'groups') { $filelocation = $euryscoinstallpath . '\\groups\\' . $_POST['download']; }
0010 	if ($_POST['type'] == 'users') { $filelocation = $euryscoinstallpath . '\\users\\' . $_POST['download']; }
0011 	if ($_POST['type'] == 'settings' && isset($_POST['computername'])) { $filelocation = $euryscoinstallpath . '\\nodes\\' . $_POST['computername'] . '\\' . $_POST['download']; }
0012 	if ($filelocation == '') { exit; }
0013 	if (file_exists($filelocation)) {
0014 		if (false != ($handler = fopen($filelocation, 'r'))) {
0015 			ob_end_clean();
0016 			ob_start();
0017 			header('Content-Description: File Transfer');
0018 			header('Content-Type: application/octet-stream');
0019 			header('Content-Disposition: attachment; filename=' . $_POST['download']);
0020 			header('Content-Transfer-Encoding: chunked');
0021 			header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
0022 			header('Cache-Control: no-cache');
0023 			header('Pragma: no-cache');
0024 			$filesize = filesize($filelocation);
0025 			header('Content-Length: ' . $filesize);
0026 			while (false != ($chunk = fread($handler, 1048576))) {
0027 				if ($chunk != '') {
0028 					echo $chunk;
0029 					ob_flush();
0030 					flush();
0031 				} else {
0032 					ob_flush();
0033 					flush();
0034 					break;
0035 				}
0036 			}
0037 			fclose($handler);
0038 		}
0039 		if ($_POST['type'] == 'settings') { @unlink($filelocation); }
0040 		exit;
0041 	}
0042 }
0043 
0044 
0045 
0046 foreach (get_defined_vars() as $key=>$val) {
0047 	if ($key != '_GET' && $key != '_POST' && $key != '_COOKIE' && $key != '_FILES' && $key != '_SERVER' && $key != '_SESSION' && $key != '_ENV') {
0048 		$$key = null;
0049 		unset($$key);
0050 	}
0051 }
0052 
0053 if (extension_loaded('zlib')) { ob_end_flush(); }
0054 
0055 ?>