102 lines
		
	
	
		
			4.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			102 lines
		
	
	
		
			4.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| $yn = $_POST['YN'];
 | |
| $yb = $_POST['YB'];
 | |
| $user1 = $_POST['user'];
 | |
| $pass1 = $_POST['pass'];
 | |
| $servicesvisible1 = $_POST['servicesvisible'];
 | |
| $clockvisible1 = $_POST['clockvisible'];
 | |
| $kknowledgefeedvisible1 = $_POST['kknowledgefeedvisible'];
 | |
| $webclipfeedvisible1 = $_POST['webclipfeedvisible'];
 | |
| $konvoschat1 = $_POST['konvoschat'];
 | |
| $konvosvisible1 = $_POST['konvosvisible'];
 | |
| $kodivisible1 = $_POST['kodivisible'];
 | |
| $backgroundcolor1 = $_POST['backgroundcolor'];
 | |
| $showversion1 = $_POST['showversion'];
 | |
| $widgetbackgroud1 = $_POST['widgetvisible'];
 | |
| $customwidgetbackgroud1 = $_POST['customwidget'];
 | |
| $widgetbackgroudcolour1 = $_POST['widgetbackgroudcolour'];
 | |
| $KWorldEnabled1 = $_POST['kworldenabled'];
 | |
| $widgetcolor1 = $_POST['widgetcolor'];
 | |
| 
 | |
| //
 | |
| $fl='../config.php'; 
 | |
|         /*read operation ->*/ $tmp = fopen($fl, "r");   $content=fread($tmp,filesize($fl)); fclose($tmp);
 | |
| 
 | |
| // here goes your update
 | |
| // Server Updates
 | |
| $content =   preg_replace( '/\$yourname = \"(.*?)\";/', '$yourname = "'.$yn.'";', $content);
 | |
| $content =   preg_replace( '/\$base = \"(.*?)\";/', '$base = "'.$yb.'";', $content);
 | |
| // User/Pass Update
 | |
| $content =   preg_replace( '/\$user = \"(.*?)\";/', '$user = "'.$user1.'";', $content);
 | |
| $content =   preg_replace( '/\$pass = \"(.*?)\";/', '$pass = "'.$pass1.'";', $content);
 | |
| $content =   preg_replace( '/\$custombackground = \"(.*?)\";/', '$custombackground = "#'.$backgroundcolor1.'";', $content);
 | |
| $content =   preg_replace( '/\$widgetcolour = \"(.*?)\";/', '$widgetcolour = "#'.$widgetcolor1.'";', $content);
 | |
|  // version Settings
 | |
|  if (empty($showversion1)) {
 | |
|     $content =   preg_replace( '/\$showversion = \"(.*?)\";/', '$showversion = "0";', $content);
 | |
|  } else {
 | |
|  $content =   preg_replace( '/\$showversion = \"(.*?)\";/', '$showversion = "1";', $content);
 | |
|  }
 | |
|  // clockvisible Settings
 | |
|  if (empty($clockvisible1)) {
 | |
|     $content =   preg_replace( '/\$clockvisible = \"(.*?)\";/', '$clockvisible = "0";', $content);
 | |
|  } else {
 | |
|  $content =   preg_replace( '/\$clockvisible = \"(.*?)\";/', '$clockvisible = "1";', $content);
 | |
|  }
 | |
|  // kknowledgefeedvisible Settings
 | |
|  if (empty($kknowledgefeedvisible1)) {
 | |
|     $content =   preg_replace( '/\$kknowledgefeedvisible = \"(.*?)\";/', '$kknowledgefeedvisible = "0";', $content);
 | |
|  } else {
 | |
|  $content =   preg_replace( '/\$kknowledgefeedvisible = \"(.*?)\";/', '$kknowledgefeedvisible = "1";', $content);
 | |
|  }
 | |
|  // webclipfeedvisible Settings
 | |
|  if (empty($webclipfeedvisible1)) {
 | |
|     $content =   preg_replace( '/\$webclipfeedvisible = \"(.*?)\";/', '$webclipfeedvisible = "0";', $content);
 | |
|  } else {
 | |
|  $content =   preg_replace( '/\$webclipfeedvisible = \"(.*?)\";/', '$webclipfeedvisible = "1";', $content);
 | |
|  }
 | |
|  // konvosvisible Settings
 | |
|  if (empty($konvosvisible1)) {
 | |
|     $content =   preg_replace( '/\$konvosvisible = \"(.*?)\";/', '$konvosvisible = "0";', $content);
 | |
|  } else {
 | |
|  $content =   preg_replace( '/\$konvosvisible = \"(.*?)\";/', '$konvosvisible = "1";', $content);
 | |
|  }
 | |
|  // konvoschat Settings
 | |
|  if (empty($konvoschat1)) {
 | |
|     $content =   preg_replace( '/\$konvoschat = \"(.*?)\";/', '$konvoschat = "0";', $content);
 | |
|  } else {
 | |
|  $content =   preg_replace( '/\$konvoschat = \"(.*?)\";/', '$konvoschat = "1";', $content);
 | |
|  }
 | |
|   // kodivisible Settings
 | |
|  if (empty($kodivisible1)) {
 | |
|     $content =   preg_replace( '/\$kodivisible = \"(.*?)\";/', '$kodivisible = "0";', $content);
 | |
|  } else {
 | |
|  $content =   preg_replace( '/\$kodivisible = \"(.*?)\";/', '$kodivisible = "1";', $content);
 | |
|  }
 | |
|  // Widget Config
 | |
| if (empty($widgetbackgroud1)) {
 | |
|     $content =   preg_replace( '/\$widgetbackgroud = \"(.*?)\";/', '$widgetbackgroud = "0";', $content);
 | |
|  } else {
 | |
|  $content =   preg_replace( '/\$widgetbackgroud = \"(.*?)\";/', '$widgetbackgroud = "1";', $content);
 | |
|  }
 | |
|  if (empty($customwidgetbackgroud1)) {
 | |
|     $content =   preg_replace( '/\$customwidgetbackgroud = \"(.*?)\";/', '$customwidgetbackgroud = "0";', $content);
 | |
|  } else {
 | |
|  $content =   preg_replace( '/\$customwidgetbackgroud = \"(.*?)\";/', '$customwidgetbackgroud = "1";', $content);
 | |
|  }
 | |
| $content =   preg_replace( '/\$widgetbackgroudcolour = \"(.*?)\";/', '$widgetbackgroudcolour = "#'.$widgetbackgroudcolour1.'";', $content);
 | |
| // kworld Settings
 | |
|  if (empty($KWorldEnabled1)) {
 | |
|     $content =   preg_replace( '/\$KWorldEnabled = \"(.*?)\";/', '$KWorldEnabled = "0";', $content);
 | |
|  } else {
 | |
|  $content =   preg_replace( '/\$KWorldEnabled = \"(.*?)\";/', '$KWorldEnabled = "1";', $content);
 | |
|  }
 | |
|          /*write operation ->*/ $tmp =fopen($fl, "w");    fwrite($tmp, $content);    fclose($tmp);
 | |
| 
 | |
| 		//sleep for 5 seconds
 | |
| 		
 | |
| 		
 | |
| 		header("Location: re1.php");
 | |
| die();
 | |
| 		
 | |
| 		?>
 |