$selectedFile) { $selectedFile = phpRealEscapeString($selectedFile); if(substr($selectedFile, -1) == "/") $entry = substr($selectedFile, 0, -1); else $entry = $selectedFile; $entry = trim($entry,"\n"); $imgType[$index] = trim($imgType[$index],"\n"); # Make sure it doesn't cause any duplicate entries if(isset($_SESSION['fullEntry']) && in_array($entry, $_SESSION['fullEntry'])) continue; $_SESSION['fullEntry'][] = $entry; $_SESSION['fullEntry'][] = $imgType[$index]; $_SESSION['fullEntry'][] = "undefined"; $_SESSION['fullEntry'][] = "undefined"; file_put_contents($excludeFullFile, ($entry ."\n" . $imgType[$index] . "\nundefined\nundefined\n"), FILE_APPEND); } @chmod($excludeFullFile, $permissionVal); } /* Update backup location to mpc.txt */ update_mpc($_POST["backupLocation"]); /* Proxy Settings - Start */ $accountSettingsFilePath = Scheduler::$user_dir."ACCOUNT_SETTINGS_FILE"; $accountSettingsData = readAccountSettingsFile(); $accountSettingsData['engineCount'] = 2; if($_POST['hiddenEngineStatus']!=2) $accountSettingsData['engineCount'] = 4; if($_POST["proxy_option"]!='No-Proxy' && $_POST["ipAddress"] != "") { if(($file = fopen($accountSettingsFilePath, "a+")) != FALSE) { $accountSettingsData['PROXY'] = urlencode($_POST["userName"]).":".urlencode(base64_decode($_POST["password"]))."@".$_POST["ipAddress"].":".$_POST["port"]; ftruncate($file, 0); fwrite($file, json_encode($accountSettingsData,TRUE)); fclose($file); @chmod($accountSettingsFilePath, $permissionVal); $_SESSION['proxy_option'] = $_POST["proxy_option"]=='autodetect'?'autodetect':'Manual'; $_SESSION['ipAddress'] = $_POST["ipAddress"]; $_SESSION['port'] = $_POST["port"]; $_SESSION['proxyUserName']= $_POST["userName"]; $_SESSION['proxyPassword']= $_POST["password"]; } else { print "File ".ACCOUNT_SETTINGS_FILE." could not be opened successfully"; exit; } } else { if(($file = fopen($accountSettingsFilePath, "a+")) != FALSE) { $accountSettingsData['PROXY'] = ''; ftruncate($file, 0); fwrite($file, json_encode($accountSettingsData,TRUE)); fclose($file); @chmod($accountSettingsFilePath, $permissionVal); } } unsetProxySessions(); //} /* For Bandwidth throttle - Start*/ $bandwidthFilePath = Scheduler::$user_dir.BW_FILE; $bandWidth = $_POST["bandWidth"]; if($bandWidth == 100 || $bandWidth == "") { if(file_exists($bandwidthFilePath)){ unlink($bandwidthFilePath); } } else { file_put_contents($bandwidthFilePath, $bandWidth); @chmod($bandwidthFilePath, $permissionVal); } /* For Bandwidth throttle - End*/ /* Proxy Settings - End */ /* Relative/Mirror Path Settings - Start */ $relativeFile = Scheduler::$user_dir.RELATIVE_FILE; if($_POST["pathType"]) { $pathtypeToset = "--".$_POST["pathType"]; file_put_contents($relativeFile, $pathtypeToset); @chmod($relativeFile, $permissionVal); } else if(file_exists($relativeFile)) unlink($relativeFile); /* Relative/Mirror Path Settings - End */ print PREFERENCES_SUCC; exit(); } else { $_SESSION['proxy_option']=$_POST["proxy_option"]; if($_POST["proxy_option"]=='Manual' || $_POST["proxy_option"]=='autodetect'){ $_SESSION['ipAddress']=$_POST["ipAddress"]; $_SESSION['port']=$_POST["port"]; $_SESSION['proxyUserName']=$_POST["userName"]; $_SESSION['proxyPassword']=$_POST["password"]; } else unsetProxySessions(); } } } ?>