<?php
/*
## Релиз выпущен Nulled.WS - Nulled Warez Scripts
## Команда: GriZone, Nosferatu, Zeratul
## Наш сайт: http://Nulled.WS/
## Наш форум: http://Nulled.WS/Forum/
## Пожалуйста не стирайте данный текст!
*/
include 'config.php';
set_time_limit(0);
$version='';
if(substr(PHP_OS,0,3)!='WIN')
{
// проверка на совместимость хостинга
if(!function_exists('curl_multi_init'))
mdie('Не установлен curl или версия php < 5');
if(!is_writeable('tmp'))
mdie('Не установлены права на запись на папку tmp');
}
else
//msg('Под windows спамилка не будет работать');
;
$mods=glob('mod/*.php');
foreach($mods as $mod)
include $mod;
$proxy_total_count=countrec('proxy');
if(!isset($_GET['s']) || $_GET['s']=='profiles')
{
$page_title='Профили';
if(isset($_POST['save']))
{
if(strlen($_POST['add']['name'])>0)
ins('profiles',$_POST['add']);
foreach($_POST['name'] as $id=>$name)
{
upd('profiles',array(
'name'=>$_POST['name'][$id],
'base'=>$_POST['base'][$id],
),'id='.i($id));
if(strlen($name)<=0)
q("DELETE FROM `profiles` WHERE `id`=".i($id));
}
refresh();
}
$profiles=rows("SELECT * FROM `profiles`");
$tpl='profiles';
}
elseif($_GET['s']=='fields')
{
$pid=i($_GET['profile_id']);
$profile=row("SELECT * FROM `profiles` WHERE id=$pid");
$page_title='Поля профиля '.$profile['name'];
if(isset($_GET['clearflds']))
{
q('DELETE FROM `fields` WHERE `profile_id`='.$pid);
refresh('?s=fields&profile_id='.$pid);
}
if(isset($_POST['save']))
{
if(strlen($_POST['add']['name'])>0)
{
$_POST['add']['profile_id']=$pid;
ins('fields',$_POST['add']);
}
foreach($_POST['name'] as $id=>$name)
{
upd('fields',array(
'name'=>$_POST['name'][$id],
'value'=>$_POST['value'][$id],
),'id='.i($id));
if(strlen($name)<=0)
q("DELETE FROM `fields` WHERE `id`=".i($id));
}
refresh();
}
if(isset($_POST['makeflds']))
{
$form=file_get_contents($_POST['formurl']);
preg_match("#<form.*>(.*)</form>#isU",$form,$ret);
$form=$ret[1];
preg_match_all("#<input.*>#isU",$form,$inputs);
foreach ($inputs[0] as $n=>$input)
{
preg_match("#type=[\"']{0,1}([a-z]{4,10})[\"']{0,1}#i",$input,$ret);
if(isset($ret[1]))
$flds[$n]['type']=$ret[1];
else
$flds[$n]['type']='text';
if(preg_match("#name=[\"']{0,1}([a-z_]{1,20})[\"']{0,1}#i",$input,$ret))
$flds[$n]['name']=$ret[1];
if(preg_match("#value=[\"']{0,1}([a-z_ 0-9]{1,25})[\"']{0,1}#i",$input,$ret))
$flds[$n]['value']=$ret[1];
}
if(preg_match("#<textarea.*name=[\"']{0,1}([a-z_]{4,20})[\"']{0,1}.*>.*</textarea>#is",$form,$txtar))
{
$flds[$n+1]['type']='text';
$flds[$n+1]['name']=$txtar[1];
}
$names=array();
foreach ($flds as $fld)
{
if($fld['type']=='reset' || $fld['name']=='' || in_array($fld['name'],$names) )
continue;
elseif($fld['type']=='hidden' ||
$fld['type']=='submit' ||
$fld['type']=='radio')
ins('fields',array(
'profile_id'=>$pid,
'name'=>$fld['name'],
'value'=>$fld['value'],
));
elseif($fld['type']=='checkbox')
continue;
elseif($fld['type']=='text')
{
$newval='';
if(strpos($fld['name'],'name')!==false)
$newval='do:rand(names.txt)';
if(strpos($fld['name'],'mail')!==false)
$newval='do:rand(emails.txt)';
if(strpos($fld['name'],'town')!==false || strpos($fld['name'],'city')!==false )
$newval='do:rand(citys.txt)';
if(strpos($fld['name'],'state')!==false)
$newval='do:rand(states.txt)';
if(strpos($fld['name'],'country')!==false || strpos($fld['name'],'locati')!==false)
$newval='do:rand(countrys.txt)';
if($newval=='')
$newval='$';
ins('fields',array(
'profile_id'=>$pid,
'name'=>$fld['name'],
'value'=>$newval,
));
}
$names[]=$fld['name'];
}
refresh();
}
$fields=rows("SELECT * FROM `fields` WHERE `profile_id`=".$pid);
$tpl='fields';
}
elseif($_GET['s']=='messages')
{
$page_title='Добавление сообщения для рассылки ';
$profiles=rows("SELECT * FROM `profiles`");
if(!isset($_GET['pid']))
refresh('?s=messages&pid='.$profiles[0]['id']);
else
{
$pid=i($_GET['pid']);
$profile=row("SELECT * FROM `profiles` WHERE id=$pid");
$fields_rec=rows("SELECT * FROM `fields` WHERE `profile_id`='$pid' AND `value`='$'");
if(isset($_POST['save']))
{
$fields=rows("SELECT * FROM `fields` WHERE `profile_id`='$pid'");
$post_data='';
foreach($fields as $n=>$fld)
{
if($fld['value']=='$')
{
$value=$_POST['values'][$fld['name']];
}
elseif(preg_match("#do\:([a-z0-9_]{2,20})\((.*)\)#",$fld['value'],$ret))
{
$action=$ret[1];
$action_args=$ret[2];
$call='mod_'.$action;
if(function_exists($call))
$value=$call($action_args);
else
$value='Error at call '.$call;
}
else
$value=$fld['value'];
$post_data.=$fld['name'].'='.urlencode($value).'&';
}
$base_urls=rows("SELECT * FROM `base` WHERE `profile_id`=$pid");
foreach( $base_urls as $url)
{
if($url['url']=='')continue;
ins('send',array(
'url'=>$url['url'],
'post'=>$post_data,
'proxy'=>(int)isset($_POST['proxy']),
));
}
refresh();
}
}
$tpl='messages';
}
elseif($_GET['s']=='stat')
{
$count_send=countrec('send');
$page_title='Состояние ';
$tpl='stat';
}
elseif($_GET['s']=='base')
{
unset($base_urls);
$base_urls = array();
unset($good_urls);
$good_urls = array();
unset($die_urls);
$die_urls = array();
$profile_id=i($_GET['profile_id']);
$profile=row("SELECT * FROM `profiles` WHERE `id`=$profile_id");
$count_u=mysql_num_rows(q("SELECT * FROM `base` WHERE `profile_id`=$profile_id"));
$count_du=mysql_num_rows(q("SELECT * FROM `base` WHERE `profile_id`=$profile_id AND `status`='bad'"));
$page_title='База профиля '.$profile['name'];
if(isset($_POST['showall']))
{
# if(is_array($base_urls))
$base_urls=rows("SELECT * FROM `base` WHERE `profile_id`=$profile_id");
foreach($base_urls as $url)
echo $url['url'].'<br>';
exit;
}
elseif(isset($_POST['showgood']))
{
# if(is_array($good_urls))
$good_urls=rows("SELECT * FROM `base` WHERE `profile_id`=$profile_id AND `status`='good'");
foreach($good_urls as $url)
echo $url['url'].'<br>';
exit;
}
elseif(isset($_POST['showbad']))
{
# if(is_array($die_urls))
$die_url=rows("SELECT * FROM `base` WHERE `profile_id`=$profile_id AND `status`='bad'");
foreach($die_urls as $url)
echo $url['url'].'<br>';
exit;
}
elseif(isset($_POST['delbad']))
{
q("DELETE FROM `base` WHERE `profile_id`=$profile_id AND `status`='bad'");
refresh();
}
elseif(isset($_POST['delall']))
{
q("DELETE FROM `base` WHERE `profile_id`=$profile_id");
refresh();
}
elseif(isset($_POST['updb']))
{
unset($lines);
$lines = array();
$lines=file($_FILES['db']['tmp_name']);
if(isset($_POST['clear']))
q("DELETE FROM `base` WHERE `profile_id`=$profile_id");
# if(isset($lines[0]) && strlen($lines[0])>0)
# $q='INSERT INTO `base` (`url`,`profile_id`) VALUES (\''.addslashes(esc(trim($lines[0]))).'\','.$profile_id.')';
# q(addslashes($q));
# unset($lines[0]);
foreach($lines as $line)
{
$line=addslashes(trim($line));
if(strlen($line)>0) {
$q="INSERT INTO `base` (`url`,`profile_id`) VALUES ('$line','$profile_id')";
q($q);
}
}
refresh();
}
elseif(isset($_POST['indb']))
{
unset($lines);
$lines = array();
$lines=explode("\n",$_POST['db']);
if(isset($_POST['clear']))
q("DELETE FROM `base` WHERE `profile_id`=$profile_id");
# if(isset($lines[0]) && strlen($lines[0])>0)
# $q='INSERT INTO `base` (`url`,`profile_id`) VALUES (\''.addslashes(esc(trim($lines[0]))).'\','.$profile_id.')';
# q(addslashes($q));
# unset($lines[0]);
foreach($lines as $line)
{
$line=addslashes(trim($line));
if(strlen($line)>0) {
$q="INSERT INTO `base` (`url`,`profile_id`) VALUES ('$line','$profile_id')";
q($q);
}
}
refresh();
}
$tpl='base';
}
elseif($_GET['s']=='proxy')
{
$page_title='Прокси ';
$tpl='proxy';
if(isset($_GET['do']) && $_GET['do']=='clear')
{
q("TRUNCATE `proxy`");
$out='Список прокси успешно очищен';
}
elseif(isset($_GET['do']) && $_GET['do']=='search')
{
$furls=file('data/-find_proxy.txt');
$content='';
foreach ($furls as $url)
$content.=file_get_contents(trim($url));
preg_match_all("#[0-9\.]{7,15}\:[0-9]{2,5}#is",$content,$ret);
foreach($ret[0] as $prox)
{
$e=explode(':',$prox);
ins('proxy',array(
'ip'=>$e[0],
'port'=>$e[1],
));
}
refresh('?s=proxy');
}
}
error_reporting(E_ERROR);
chdir('tpl');
include $tpl.'.htm';
/* 5
## Nulled.WS
## Nulled Warez Scripts
## Team: Zeratul, Grizone, Nosferatu
*/
?>