You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					19 lines
				
				485 B
			
		
		
			
		
	
	
					19 lines
				
				485 B
			| 
								 
											2 years ago
										 
									 | 
							
								<?php
							 | 
						||
| 
								 | 
							
								use function Hestiacp\quoteshellarg\quoteshellarg;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								ob_start();
							 | 
						||
| 
								 | 
							
								include $_SERVER["DOCUMENT_ROOT"] . "/inc/main.php";
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								// Check token
							 | 
						||
| 
								 | 
							
								verify_csrf($_GET);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								$database = quoteshellarg($_GET["database"]);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								exec(HESTIA_CMD . "v-dump-database " . $user . " " . $database . " file", $output, $return_var);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								if ($return_var == 0) {
							 | 
						||
| 
								 | 
							
									header("Content-type: application/sql");
							 | 
						||
| 
								 | 
							
									header("Content-Disposition: attachment; filename=" . $output[0]);
							 | 
						||
| 
								 | 
							
									header("X-Accel-Redirect: " . $output[1]);
							 | 
						||
| 
								 | 
							
								}
							 |