Server IP : 51.89.169.208 / Your IP : 3.148.107.92 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/yellowleaf/public_html/_git/ |
Upload File : |
<? include_once 'accesscontrol.php'; $backup = addslashes($_GET['backup']); $datebase = addslashes($_GET['datebase']); if($backup) { if (!file_exists($backup)) { echo "ERROR! No such file found."; die; } //make backup 2 $backuppathtwo = str_replace('BACKUP_', 'BACKUP2_',$backup); copy($backup, $backuppathtwo); $originalbackuppath = str_replace('BACKUP_', '',$backup); unlink($originalbackuppath); rename($backuppathtwo, $originalbackuppath); echo "<h1>SUCCESS! Reverted.</h1><hr><br><br>"; die; } //include_once '../connect_db.php'; $p = addslashes($_GET['p']); $f = addslashes($_GET['f']); $originalpath = '/home/postcode/public_html/yellowleaf.co.uk/'.$p.$f; $existingpath = str_replace('NEW_', '',$originalpath); $backuppath = str_replace('NEW_', 'BACKUP_',$originalpath); if (file_exists($originalpath)) { // put current live version in db if(!$datebase){ $cont_existingpath = file_get_contents($existingpath); //$connect->query("INSERT INTO `git` SET `path`='{$existingpath}', `content`='".addslashes($cont_existingpath)."', `date`='".time()."'") or custom_log($connect->error); } //change live one to backup file @rename($existingpath, $backuppath); //change dev version to live rename($originalpath, $existingpath); echo $datebase ? '<h1>Made Previous version from MySQL file live on LIVE server.</h1><hr>' : '<h1>Made Dev Server file live on LIVE server.</h1><hr>'; }else { echo "<h1>ERROR! No such file found.</H1>"; die; } echo '<button onclick="myFunction()"><a href="live.php?backup='.$backuppath.'">Revert back to previous version ></a></button><hr><br><br>'; /* $home_path=$_SERVER['DOCUMENT_ROOT']; include_once "$home_path/connect.4.php"; $newversionno = str_replace("v","",$versionno)+1; $data = file_get_contents("$home_path/connect.4.php"); $data=str_replace($versionno, "v".$newversionno,$data); file_put_contents("$home_path/connect.4.php", $data); echo json_encode(['status'=>'success','vesion'=>"v".$newversionno,'message'=>"vesion update successfully"]); */ ?> <script> function myFunction() { confirm("Are you sure you want to revert back to previous version >"); } </script>