Comments

Tuesday, March 5, 2013

LEAK TNT Auto Trader V2.0 SOURCE CODE

Posted by at Tuesday, March 05, 2013 Read our previous post

LEAK TNT Auto Trader V2.0 SOURCE CODE

 

 

Today i clean out my harddrive,and i found the Most used Fxp Scene AutoTrader Source.

I got it from a Vuln Guy Java wtf Zwinkerndes Smiley

 

Fir3  Security is just an Illusion

 

 

Fuck you all fusa,Ic3,Fir3,Gizeh,GroundZero PaySite …..

G0t w00t ?

 

Source Code :

 

my $show_raced_only;
#use Digest::MD5::Reverse;
use Tie::File;
use Time::Duration;
#use Net::FTPSSL;
#$reverse = Digest::MD5::Reverse->new;
#$reverse->add('6df23dc03f9b54cc38a0fc1483df6e21');
#$data = $reverse->hexreverse;
use Imager::DTP::Textbox::Horizontal; # or Vertical
use DBIx::HTMLTable;
my $optini = new Config::IniFiles( -file => "options.ini" );
my %imdb_fail;
if (!( -e "chain6.ini") ) {
my $file="chain6.ini";
open(APPFH, ">$file");
print APPFH "[TNT2_CHAINS_SYSTEM]\n";
print APPFH "created=auto\n";
close APPFH;
}
if ( -e "DISSABLED_SITES.TNT" ) { unlink "DISABLED_SITES.TNT"; }

my $version;
$version="Ic3_TNT V0.71 Build(01242012) TCP";
my %users;
my %allow_hash;

sub find_section {
my $rlsname=shift;
@_=();
my $history_file="history.db";
my $history =DBI->connect("dbi:SQLite:dbname=$history_file","","",{AutoCommit => 1});
my $get_history = $history->prepare("select section from history where rlsname like \"$rlsname\"");
$get_history->execute;
my @row = $get_history->fetchrow_array;
return "$row[0]";
$history->disconnect;
}
{
package MyWebServer;
use strict;

use Config::IniFiles;
my $web_optini = new Config::IniFiles( -file => "options.ini" );
use HTTP::Server::Simple::CGI;
use HTTP::Server::Simple::Static;
use CGI::Ajax;
#use Authen::Simple::Passwd;
use DateTime;
use Time::Duration;
use DateTime::Locale::en_US;
use XML::RSS::Feed;
use LWP::Simple qw(get);
use Data::Dumper;
my $baseurl;
my $rssfeed;
my $history_limit;
my $mainini;
$mainini = new Config::IniFiles( -file => "options.ini" );
$baseurl=$mainini->val("WEB","baseurl");
$rssfeed=$mainini->val("WEB","RSS");
$history_limit=$mainini->val("WEB","history_limit");
#use Authen::Simple::Passwd;
use base qw(HTTP::Server::Simple::CGI);
my %dispatch;
%dispatch = (
'/hello' => \&resp_hello,
'/show_site' => \&resp_show_site,
'/update_site' => \&resp_update_site,
#'/show_history' => \&resp_show_history,
'/show_history' => \&test_ajax,
'/check_release' => \&resp_check_release,
'/show_all_sites' => \&resp_show_all_sites,
'/frames' => \&resp_frames,
'/add_new_info' => \&resp_add_new_info,
'/show_sections' => \&show_sections,
'/delete_site' => \&delete_site,
'/section_checker' => \&section_checker,
'/sitelist' => \&get_sitelist,
'/chan_info' => \&get_chan_info,
'/prebot_info' => \&get_prebot_info,
'/test_ajax' => \&test_ajax,
'/tnt2.pl' => \&test_ajax2,
'/test_dnd' => \&test_dnd,
'/frames2' => \&frames2,
'/saveit' => \&apage,
'/dnd_main' => \&dnd_main,
#'/trade_paths' => \&trade_paths,

);



sub dnd_main {
my $cgi=shift;
print $cgi->header;
print $cgi->start_html("info...");
my $dbfile="sites.db";
my $site_sql = DBI->connect("dbi:SQLite:dbname=$dbfile","","");
my $find_sections = $site_sql->prepare("select distinct (sitename) FROM sections WHERE sitename like ? order by sitename");
$find_sections->execute("%");
my $sitename;
my @site_sections;
my $oldname;

print '

<div id="mainContainer">
<div id="leftMenu">
<!-- START OF MENU -->
<div id="dhtmlgoodies_slidedown_menu">
';
print "SELECT A SOURCE SITE HERE<br>";
print "<ul>";
while (my @row = $find_sections->fetchrow_array ) {
# if ( !($sitename)) { $oldname=$sitename; }
$sitename=$row[0];
print "<li><a href=\"$baseurl/test_dnd?site=$sitename\" target=MAINWIN2 rel=\"history\"><span>$sitename</span></a></li>";
}
print '
</ul>
</div>
<!-- END OF MENU -->
</div>
<div class="clear"></div>
</div>
</BODY></html>';
}

sub frames2 {
my $cgi = shift; # CGI.pm object
my $self=shift;
@_=();
return if !ref $cgi;
print $cgi->header;
print '<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<META http-equiv="Expires" content="0" >
<META http-equiv="pragma" content="no-cache" >
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>TNT WEBUI V1.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<META http-equiv="Expires" content="0" >
<META http-equiv="pragma" content="no-cache" >
</head>

<FRAMESET COLS="10%,*">
<FRAME SRC="dnd_main" NAME=SIDEBAR>
<FRAME SRC="'. $baseurl .'/test_dnd" NAME=MAINWIN2>
</FRAMESET>
</HTML>

<body>

';

#$cgi->start_html("Hello"),
$cgi->end_html;

}

sub apage {
my @normal;
my @affils;
warn "GOT INFO FROM apage\n";
my $cgi=shift;
print $cgi->header;



my $items=$cgi->param("listOfItems");

my $source_site; my $blah;

my @list=split(";",$items);
foreach my $sp (@list) {
my ($area,$site)=split("~",$sp);
($blah,$source_site)=split(":",$area);
if ( $area=~m,source_site,i ) { push (@normal,$site); }
if ( $area=~m,affils_site,i ) { push (@affils,$site); }

}

my $url="$baseurl/test_dnd?site=$source_site";
print '<meta http-equiv="REFRESH" content="0;url='. $url .'">';
print $cgi->h1("UPDATEING");
print $cgi->start_html("SECTION CHECKING SECTION!");
print "<body>";
warn "USING $source_site as section\n";
if ( !($source_site)) { return undef; }
use Tie::Cfg;
tie my %ini, 'Tie::Cfg', READ => "chain6.ini", WRITE => "chain6.ini";

$ini{$source_site}{"targets"}="";
$ini{$source_site}{"affils"}="";
if ( $normal[0] ) {
warn "WROTE ini{$source_site}{targets}=@normal\n";
$ini{$source_site}{"targets"}="@normal";
}

if ( $affils[0] ) {
$ini{$source_site}{"affils"}="@affils";
}
warn "GOT NORMAL @normal\n";
warn "GOT AFFILS @affils\n";
untie %ini;



print "</body></html>";
}


sub test_dnd {

open(DDHEAD, "htdocs\\dnd.js");my @ddhead=<DDHEAD>;close(DDHEAD);

my $dbfile="sites.db";
my @sitelist;
my $site_sql =DBI->connect("dbi:SQLite:dbname=$dbfile","","",{AutoCommit => 0});
my $hunt = $site_sql->prepare("select distinct (sitename) from sections where section like ? order by sitename asc");
$hunt->execute("%");
while (my @row = $hunt->fetchrow_array ) {
push (@sitelist,$row[0]);
}
my $cgi=shift;
my $source_site = $cgi->param("site");
#warn "GOT SITENAME $source_site\n";
print $cgi->header;
print @ddhead;
print $cgi->start_html("SECTION CHECKING SECTION!");
my $chain6ini = new Config::IniFiles( -file => "chain6.ini" );
my $norm_targets=$chain6ini->val($source_site,"targets");
my $affil_targets=$chain6ini->val($source_site,"affils");
my @stargets=split(" ",$norm_targets);
my @saffils=split(" ",$affil_targets);

if ( !($source_site)) {
print "<body>PLEASE SELECT A SITE FROM THE LEFT</body></html>"; return undef;
}
print "<body>";
print "<h2>Souce site is -------> $source_site</h2>";

print '<div id="dhtmlgoodies_dragDropContainer">
<div id="dhtmlgoodies_listOfItems">
<div>
<p>Available Targets</p>
<ul id="notused:'. $source_site .'">';
foreach my $site (@sitelist) {
print "<li id=\"$site\">$site</li>";
}
print '
</ul>
</div>
</div>
<div id="dhtmlgoodies_mainContainer">
<!-- ONE <UL> for each "room" -->
<div>
<p>NORMAL RACE</p>
<ul id="SOURCE_SITE:'. $source_site .'">
';
foreach my $target (@stargets) {
print "<li id=\"$target\">$target</li>";
}
#}
print '


</ul>
</div>
<div>
<p>AFFILS RACE</p>
<ul id="AFFILS_SITE:'. $source_site .'">
';
foreach my $target (@saffils) {
print "<li id=\"$target\">$target</li>";
}
print '
</ul>
</div>
</div>
</div>
<div id="footer">

<form name="myForm" method="post" action="saveit?ss='. $source_site .'" onsubmit="saveDragDropNodes()">
<input type="hidden" name="listOfItems" value="">
<input type="submit" value="Save" name="saveButton">
</form>
</div>
<ul id="dragContent"></ul>
<div id="dragDropIndicator"><img src="images/insert.gif"></div>
<div id="saveContent"><!-- THIS ID IS ONLY NEEDED FOR THE DEMO --></div>';
print "</head>";
print "</html";




}




sub trade_paths_table {
my $section=shift;
@_=();
my @html;
my @sitelist;
my %configs;
my $dbfile="sites.db";
my $site_sql =DBI->connect("dbi:SQLite:dbname=$dbfile","","",{AutoCommit => 0});
my $hunt = $site_sql->prepare("select distinct * from sections where section like ? order by sitename asc");
$hunt->execute("$section");
$hunt->bind_columns(\my $sitename, \my $section2, \my $skiplist, \my $skipgroup, \my $allowlist, \my $allowgroup, \my $sectionaprove, \my $yearfrom,\my $yearto, \my $section_trade, \my $tvrage, \my $manual_only, \my $ttg, \my $tv_startyear, \my $skip_gen, \my $allow_gen, \my $allowed_country, \my $Allow_INT, \my $USAscr, \my $UKscr, \my $FRscr, \my $racestv, \my $imdb, \my $imdb_spec, \my $imdb_spec_rv, \my $imdb_ltd_rv, \my $imdb_rv, \my $sectslotsdn,\my $sectrateing, \my $sectslotsup, \my $SECT_NOMATCH, \my $affils, \my $siteskip, \my $siteskipgroup, \my $sitetrade,\my $tradefrom,\my $tradeto,\my $rateing,\my $slotsup,\my $slotsdn,\my $preslotsdn);
while (my @row = $hunt->fetchrow_array ) {
$configs{$sitename,"nomatch"}=$SECT_NOMATCH;
$configs{$sitename,"rateing"}=$rateing;
$configs{$sitename,"tradefrom"}=$tradefrom;
$configs{$sitename,"tradeto"}=$tradeto;
$configs{$sitename,"SECT_NOMATCH"}=$SECT_NOMATCH;


push (@sitelist,$row[0]);
}
unshift (@sitelist,"");
push (@html,"
<table border=\"1px\" width=\"100%\">
<tr>
");
my $rc=0;
foreach my $row (@sitelist) {

foreach my $col (@sitelist) {
if (( $row ) && ( $col)) {

## main grid area

my @tradeto=split(" ",$configs{$row,"tradeto"});
my $tradefrom=join(" ",$configs{$col,"tradefrom"});


my $tmatch="";
my @matches;
foreach my $tmpmatch (@tradeto) {

if ( $tradefrom=~m,$tmpmatch,i ) { $tmatch=1; push (@matches,$tmpmatch); }
if ( $tradefrom=~m,ANY,ig ) { $tmatch=1; push (@matches,"ANY"); }
if ( $tradefrom=~m,SITE:$row,ig ) { $tmatch=1; push (@matches,"SPECIFIC"); }
if ( $tradefrom=~m,AFFIL:$row,ig ) { $tmatch=1; push (@matches,"AFFIL"); }
}
if ( $configs{$row,"SECT_NOMATCH"}=~m,$col,i ) { $tmatch=2; }
if ( $configs{$col,"SECT_NOMATCH"}=~m,$row,i ) { $tmatch=2; }

my $sty;
my $cell="@matches";
if ( $tmatch == 1 ) { $sty="\"style=\"color: #000000; background-color: #00ff00;\""; } else { $sty="\"style=\"background-color: #440000; color: #00ffff; \""; }
if ( $tmatch == 2 ) { $sty="\"style=\"color: #333333; background-color: #FF0000;\""; $cell="SECTION NO MATCH"; }
if ( $row eq $col ) { $sty="\"style=\"color: #000000; background-color: #000000;\""; $cell=""; }

push (@html,"
<TD $sty TITLE=\"SOURCE: $row ($configs{$row,'rateing'}) TARGET: $col ($configs{$col,'rateing'})\">$cell</TD
");


## end of main grid
}
elsif ( !($row) ) {
push (@html,"<TD>$col</TD>");
}
elsif (!($col) ) {
push (@html,"<TD>$row</TD>");
}
}
push (@html,"</TR></TR>");
}

push (@html,"</TR></TABLE>");

return @html;
}

my $webhistory;
sub test_ajax2 {
my $cgi=shift;
@_=();
my @params=$cgi->param("val1");
my @params2=$cgi->param("fname");
my $info=$params[0];
if ( !($info)) { return undef; }

print $cgi->header;
print $cgi->start_html("SECTION CHECKING SECTION!");
print '<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="refresh" content="1">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<style type="text/css">
.colour {
font-size: small;
text-align: center;
font-family: "Arial", Gadget, sans-serif;
color: #FFF;
}
.header {background-color; #000033; }
.other {background-color: #000033;}
.odd {background-color: #111155; color: #DDDDDD; }
.even {background-color: #000033; color: #DDDDDD; }
th {background-color: #000000; background-color: #000000;}
h2 {color: #ff0000; font-size: small; background-color: #000000;}
hr {color: #0000DD; background-color: #000000;}
</style>

<style type="text/css">
td { font-size: 70%; }
body {color: "#EEEEEE"; }
</style>
</HEAD>
<BODY>

<HEAD>
<table border="1px" width="100%">
';



## printed the header here. time to find results.

my $history_file="history.db";
$webhistory =DBI->connect("dbi:SQLite:dbname=$history_file","","",{AutoCommit => 0});
$mainini = new Config::IniFiles( -file => "options.ini" );
my $limit=$mainini->val("WEB","history_limit");
my $get_history;
if (!($limit)) { $limit="20"; }
my $show_raced; my $show_section; my $show_allowed;
if ( $info=~m,R:,i ) { $show_raced=1; $info=~s,R:,,i; $info=~s,\W,%,ig;}
if ( $info=~m,S:,i ) { $show_section=1; $info=~s,S:,,i; }
if ( $info=~m,A:,i ) { $show_allowed=1; $info=~s,A:,,i; $info=~s,\W,%,ig;}

$get_history = $webhistory->prepare("select * from history where rlsname like \"%$info%\" order by racetime DESC limit $limit");

if ( $show_raced == 1 ) {
$get_history = $webhistory->prepare("select * from history where (( rlsname like \"%$info%\" ) and ( tradepaths like \"%;%\" )) order by racetime DESC limit $limit");
}

if ( $show_section == 1 ) {
$get_history = $webhistory->prepare("select * from history where ( section is \"$info\" ) order by racetime DESC limit $limit");
}

if ( $show_allowed == 1 ) {
$get_history = $webhistory->prepare("select * from history where ( allowed like \"%$info%\" ) order by racetime DESC limit $limit");
}
$get_history->execute;
print "<tr style=\"background-color: #777777;\"><td>TIME</td><td>RLSNAME</TD><TD>SECTION</TD><TD>ALLOWED</TD><TD>CHAINS</TD></TR>";


while (my @row = $get_history->fetchrow_array ) {
my $class;
#my $color="#8888FF";
## options.ini is $web_optini
my $class="DEFAULT";
my $pb_section=$row[0];
if ( $pb_section=~m,(MP3|MVID|DAY|PAYSITE),i ) { $class="SPAM"; }
if ( $pb_section=~m,(XBOX|WII|PS2|PS3|NDS),i ) { $class="CONSOLE"; }
if ( $pb_section=~m,(GAMES|APPS),i ) { $class="PC"; }
if ( $pb_section=~m,(XVID|X264|BLURAY),i ) { $class="MOVIES"; }
if ( $pb_section=~m,TV,i ) { $class="TV"; }
if (!($row[2])) { $class="NOT_RACED"; }


my $flag;
my $section=$row[1];
if ( !($section=~m,-\w\w$,i )) { $flag="<img src=\"flags\\flag_US_UK_25px.gif\" alt=\"ENGLISH\" HEIGHT=\"20\", WIDTH=\"32\" />"; }
if ( $section=~m,-(\w\w)$,i ) {
if ( -e "htdocs\\flags\\$1.gif" ) { $flag="<img src=\"flags\\$1.gif\" HEIGHT=\"20\", WIDTH=\"32\"/>"; }
}
my $racetime=localtime($row[10]);
if ( $racetime=~m,(\d\d:\d\d:\d\d), ) { $racetime=$1; }
print "<tr class=\"$class\">";
$row[0]="<a class=\"$class\" href=\"$baseurl/check_release?rlsname=$row[0]&section=$row[1]\">$row[0]</a>";
print "<td class=\"$class\">$racetime</td><td class=\"$class\">$flag $row[0]</td><td class=\"$class\">$row[1]</td><td class=\"$class\">$row[2]</td><td class=\"$class\">$row[4]</td></tr>";
}

#print @parmas;


## time to finish the html and return to server
print '</TABLE><br>
</BODY>
</HTML>
';
$webhistory->disconnect;

}

sub test_ajax {
my $cgi = shift;
@_=();
my $pjx = new CGI::Ajax(
'exported_func' => &perl_func,
'ajax_send' => &perl_func2,
);
print $pjx->build_html( $cgi, \&Show_HTML);
}

sub perl_func {
my $input = shift;
@_=();
# do something with $input
my $output = $input . " was the input!";
return "tnt2.pl";
}

sub perl_func2 {
my $input = shift;
# do something with $input
my $output = $input . " was the input!";
return "tnt2.pl";
}

sub Show_HTML {

my $DEFAULT=$web_optini->val("WEB_COL","DEFAULT");
my $SPAM=$web_optini->val("WEB_COL","SPAM");
my $PC=$web_optini->val("WEB_COL","PC");
my $CONSOLE=$web_optini->val("WEB_COL","CONSOLE");
my $MOVIE=$web_optini->val("WEB_COL","MOVIES");
my $TV=$web_optini->val("WEB_COL","TV");
my $NOT_RACED=$web_optini->val("WEB_COL","NOT_RACED");
my $html = '
<HTML>
<LINK REL=STYLESHEET HREF="bodystyles.css">
<link href="samples.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.DEFAULT {color: '. $DEFAULT .'; background-color: #000000; text-decoration: none; }
.SPAM {color: '. $SPAM .'; background-color: #000000; text-decoration: none; }
.CONSOLE {color: '. $CONSOLE .'; background-color: #000000; text-decoration: none; }
.PC {color: '. $PC .'; background-color: #000000; text-decoration: none; }
.MOVIES {color: '. $MOVIE .'; background-color: #000000; text-decoration: none; }
.TV {color: '. $TV .'; background-color: #000000; text-decoration: none;}
.NOT_RACED {color: '. $NOT_RACED .'; background-color: #000000; text-decoration: none;}
</style>

<BODY>
<div style="color: #ffffff;">SEARCH STRING
<input type="text" name="val1" id="val1" value="%"
onkeyup="exported_func( [\'val1\'], [\'resultdiv\'], );">
S:SECTION R:RACED ONLY and A: for allowed sites. ie R:% show all raced. S:XVID show all xvids
<br>
</div>
<div id="resultdiv" width="80%"></div>
<script language="JavaScript" type="text/javascript">
<!--
function timer() {
exported_func( [\'val1\',\'NO_CACHE\'], [\'resultdiv\'],"POST");
t=setTimeout("timer()",5000);
}

exported_func( [\'val1\',\'NO_CACHE\'], [\'resultdiv\']);
t=setTimeout("timer()",3000);


-->
</script>


</BODY>
</HTML>
';
return $html;
}
my $site_list_timer;
my $history_show;



sub get_prebot_info {
my $cgi=shift;

}



sub get_chan_info {
my $cgi=shift;
@_=();
my @prebot_lines;
my $cnt;
$cnt=0;
my $complete;
my $chan_info_db="chaninfo.db";
$history_show =DBI->connect("dbi:SQLite:dbname=$chan_info_db","","",{AutoCommit => 1});
my $hunt = $history_show->prepare("select distinct * from chan_info where (sitename like 'PRECHAN') order by pretime DESC limit 10");
$hunt->execute();
while (my @row = $hunt->fetchrow_array ) {
my $col="#eeeeee";
my $section=$row[1];
my $rlsname=$row[2];
$prebot_lines[$cnt]="$section:$rlsname";
$cnt++;
}


print $cgi->header;
print $cgi->start_html("SECTION CHECKING SECTION!");
print '<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="refresh" content="1">
';
print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<HEAD>
</HEAD>
<BODY>';
$cnt=0;
my $chan_info_db="chaninfo.db";
$history_show =DBI->connect("dbi:SQLite:dbname=$chan_info_db","","",{AutoCommit => 1});
my $hunt = $history_show->prepare("select * from chan_info where (rlsname like '%' and sitename not like 'PRECHAN') order by pretime DESC limit 10");
$hunt->execute();
print "<table style=\"font-size: small;\">";
print "<tr>
<td>SITE</td>
<td>SECTION</td>
<td>RLSNAME</td>
<td>COMPLETE</td>
<td>NUKED</TD>
<TD class=\"td.pbot\">SECTION</TD>
<TD class=\"td.pbot\">RLSNAME</TD>
</tr>";
my $txtline;
while (my @row = $hunt->fetchrow_array ) {
my $col="#eeeeee";
my $sitename=$row[0];
my $section=$row[1];
my $rlsname=$row[2];
my $pretime=$row[4];
my $comptime=$row[5];
if ( $comptime ) { $complete="YES"; $col="#00ff00"; } else { $complete="NO"; }
my $nuked=$row[7];
if ( $nuked=~m,YES,ig ) { $nuked="YES"; $col="#ff0000"; } else { $nuked="NO"; }
my ($pb_section,$pb_rlsname)=split(":",$prebot_lines[$cnt]);
$cnt++;
my $color="#aaaaaa";
if ( $pb_section=~m,(MP3|MVID|DAY|PAYSITE),i ) { $color="#DDDDDD"; }
if ( $pb_section=~m,(XBOX|WII|PS2|PS3|NDS),i ) { $color="#00FF00"; }
if ( $pb_section=~m,(GAMES|APPS),i ) { $color="#DD0000"; }
if ( $pb_section=~m,(XVID|X264|BLURAY),i ) { $color="#0000DD"; }
if ( $pb_section=~m,TV,i ) { $color="#5555aa"; }



print "<tr style=\"background-color: $col;\">
<td>$sitename</td>
<td>$section</td>
<td>$rlsname</td>
<td>$complete</td>
<td>$nuked</td>
<TD style=\"background-color: $color;\">$pb_section</TD>
<TD style=\"background-color: $color;\">$pb_rlsname</TD>
</tr>";
$txtline="$txtline $sitename -- $section -- $rlsname -- $complete -- $nuked\n";
}
print '</table>
</body>
</HTML>';
$history_show->disconnect;
}
sub get_sitelist {

my $cgi=shift;
@_=();
my @sitelist;
my $dbfile="sites.db";
my $site_sql =DBI->connect("dbi:SQLite:dbname=$dbfile","","",{AutoCommit => 0});
my $hunt = $site_sql->prepare("select distinct (sitename) from sections where section like ? order by sitename asc");
$hunt->execute("%");
while (my @row = $hunt->fetchrow_array ) {
push (@sitelist,$row[0]);
}
my $sitelist2="@sitelist";

print $cgi->header;
#print $cgi->start_html("SECTION CHECKING SECTION!");
#print '<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">';
#print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
print "$sitelist2";
$site_sql->disconnect;
}


sub delete_site {
my $cgi=shift;
@_=();
my $site = $cgi->param("site");
my ($sitename,$section)=split("~",$site);
my $dbfile="sites.db";
warn "DELETEING $sitename IN SECTION $section\n";
my $site_sql =DBI->connect("dbi:SQLite:dbname=$dbfile","","",{AutoCommit => 1});
if ( $section ne "%" ) {
my $delete_row = $site_sql->prepare("DELETE from sections where sitename=? and section=?;");
$delete_row->execute($sitename,$section);
} else {
my $delete_row = $site_sql->prepare("DELETE from sections where sitename=?;");
$delete_row->execute($sitename);

}

print $cgi->header;
print $cgi->start_html("DELETE $site $section!");
print '<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">';
my $url="$baseurl/show_sections";
print '<meta http-equiv="REFRESH" content="0;url='. $url .'">';

}

sub section_checker {
my $cgi=shift;
my $dbfile="sites.db";
@_=();
my $site_sql =DBI->connect("dbi:SQLite:dbname=$dbfile","","",{AutoCommit => 0});
print $cgi->header;
print $cgi->start_html("SECTION CHECKING SECTION!");
print '<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">';
print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<HEAD>
<TITLE>TNT Auto Trader V2.0 WEBUI</TITLE>
<LINK REL=STYLESHEET HREF="../stdstyles.css" TYPE="text/css">
<LINK REL=STYLESHEET HREF="../bodystyles.css" TYPE="text/css">
<LINK REL=STYLESHEET HREF="../sidebar.css" TYPE="text/css">
<script type="text/javascript">
function makesure() {
if (confirm(\'ARE YOU SURE YOU WANT TO DELETE THIS INFOMATION?\')) {
return true;
}
else {
return false;
}
}
</script>
<STYLE TYPE="text/css">
<!--
BODY
{
background-color:FFFFFF;
font-size: small;
text-align: center;
}
.colour {
color: #FFF;
}
.colour {
font-family: "Arial", Gadget, sans-serif;
}
.colour {
font-size: small;
}
.colour {
text-align: left;
}



-->
</STYLE>
<style type="text/css">
<!--
a:link {color: #DDDDDD; text-decoration: underline; }
a:active {color: #CCCCCC; text-decoration: underline; }
a:visited {color: #AAAAAA; text-decoration: underline; }
a:hover {color: #ff0000; text-decoration: none; }
-->
</style>
</HEAD>
<BODY class="colour">
';
my $file = "releases.txt";
open(CODES, $file);my @sections=<CODES>;close(CODES);
print '<TABLE BORDER="0" style="table-layout:fixed;">
<TR><TD>OLD SECTION</TD><TD>NEW SECTION</TD><TD>RELEASE NAME</TD><TD>ALLOWED SITES (Section Only)</TD>';
foreach my $tmp (@sections) {
chomp($tmp);
my ($section,$rlsname)=split(" ",$tmp);
if ( !($rlsname )) { next; }
my $nwsection=main::sort_race_section($section,$rlsname);
print '<TR><TD style="border: none; color: #CCFF00;">'. $section .'</TD><TD style="border: none; color: #11FF00;">'. $nwsection .'</TD><TD style="border: none; color: #66FF00;">'. $rlsname .'</TD><TD style="border: none; color: #FFFF00;">';
my $hunt = $site_sql->prepare("select sitename from sections where sitename like ? and section like ?");
$hunt->execute("%",$nwsection);
my $skip=0;
while (my @row = $hunt->fetchrow_array ) {
print "$row[0] "
}
print "<\TD>";

# print "GOT $section --> $rlsname --> NEW: $nwsection<br>";

}
print '</TABLE>';
$site_sql->commit;
$site_sql->disconnect;

}
sub resp_add_new_info {
my $cgi=shift;
@_=();
my $site = $cgi->param("site");
my $section = $cgi->param("section");
print $cgi->header;
print $cgi->start_html("CLICK A SITE FROM THE LEFT. AND THEN PICK A SECTION");
print '<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">';

my $dbfile="sites.db";
my $site_sql =DBI->connect("dbi:SQLite:dbname=$dbfile","","",{AutoCommit => 1});
my $insert = $site_sql->prepare("INSERT INTO sections(sitename,section,skiplist,skipgroup,allowlist,allowgroup,sectionaprove,yearfrom,yearto,section_trade,tvrage,manual_only,ttg,tv_startyear,skip_gen,allow_gen,allowed_country,Allow_INT,USAscr,UKscr,FRscr,racestv,imdb,imdb_spec,imdb_spec_rv,imdb_ltd_rv,imdb_rv,sectslotsdn,sectrateing,sectslotsup,SECT_NOMATCH,affils,siteskip,siteskipgroup,sitetrade,tradefrom,tradeto,rateing, slotsup, slotsdn, preslotsdn) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
my $hunt = $site_sql->prepare("select * from sections where sitename like ? and section like ?");
$hunt->execute($site,$section);
my $skip=0;
while (my @row = $hunt->fetchrow_array ) {
$skip=1;
}
if (!($skip)) {
$insert->execute($site,$section,"","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","");
}

my $url="$baseurl/show_site?site=". $cgi->param('site') ."#". $cgi->param('section');
print '<meta http-equiv="REFRESH" content="0;url='. $url .'">';
print '$cgi->h1("UPDATEING")';
$cgi->end_html;
$site_sql->commit;
$site_sql->disconnect;
}



sub show_sections {
my $cgi=shift;
@_=();
print $cgi->header;
print $cgi->start_html("SHOWING SITE SECTIONS!");
print '<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">';
print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<HEAD>
<TITLE>TNT Auto Trader V2.0 WEBUI</TITLE>
<LINK REL=STYLESHEET HREF="../stdstyles.css" TYPE="text/css">
<LINK REL=STYLESHEET HREF="../bodystyles.css" TYPE="text/css">
<LINK REL=STYLESHEET HREF="../sidebar.css" TYPE="text/css">
<script type="text/javascript">
function makesure() {
if (confirm(\'ARE YOU SURE YOU WANT TO DELETE THIS INFOMATION?\')) {
return true;
}
else {
return false;
}
}
</script>
<STYLE TYPE="text/css">
<!--
BODY
{
background-color:FFFFFF;
font-size: small;
}
.colour {
color: #FFF;
}
.colour {
font-family: "Arial", Gadget, sans-serif;
}
.colour {
font-size: small;
}
.colour {
text-align: center;
}


-->
</STYLE>
<style type="text/css">
<!--
a:link {color: #DDDDDD; text-decoration: underline; }
a:active {color: #CCCCCC; text-decoration: underline; }
a:visited {color: #AAAAAA; text-decoration: underline; }
a:hover {color: #ff0000; text-decoration: none; }
-->
</style>
</HEAD>
<BODY class="colour">
';


my $dbfile="sites.db";
my @sitelist;
my $site_sql =DBI->connect("dbi:SQLite:dbname=$dbfile","","",{AutoCommit => 1});
my $hunt = $site_sql->prepare("select distinct (section) from sections where section like ? order by section asc");
$hunt->execute("%");
while (my @row = $hunt->fetchrow_array ) {
push (@sitelist,$row[0])
}

my $find_sect = $site_sql->prepare("select * from sections where section like ? order by section asc");
my $count=0;
print "<div>TO ENTER A NEW SITE. TYPE THE SITE NAME INTO THE RED BOX AT THE END OF THE SECTION AND HIT ENTER</DIV>";
print "<div>CLICK THE X AT THE END OF THE SITE TO DELETE IT</DIV>";
print "<div>CLICK A SITENAME TO EDIT THAT SITE/SECTION</DIV>";
print "<BR><div>OR ENTER A SITENAME AND SECTION BELOW TO ADD A NEW SECTION TO THE LIST<BR>";
print '<FORM METHOD="GET" ACTION="'. $baseurl .'/add_new_info">';
print 'SECTION: <INPUT TYPE="TEXT" NAME="section" VALUE="" SIZE="10" style="border: none; color: #CCFF00 ; background-color: #221111;">';
print 'SITE: <INPUT TYPE="TEXT" NAME="site" SIZE="10" style="border: none; color: #CCFF00 ; background-color: #221111;">';
print '<INPUT TYPE="SUBMIT" VALUE="ADD INFO" NAME="B1" style="color: #CCFF00 ; background-color: #666666;">';
print '</FORM>';
print "<BR><BR>";

print '<table style="text-align: right;">';
foreach my $site (@sitelist) {
print '
<tr><td nowrap style="text-align: left; color: #dddddd; background-color: #222222;">'. $site .'</Td>';
$find_sect->execute("$site");
while (my @row = $find_sect->fetchrow_array ) {
my $link="<a href=\"$baseurl/delete_site?site=$row[0]~$site\" onclick=\"return makesure();\">X";
my $link2="<a href=\"$baseurl/show_site?site=". $row[0] ."#". $site ."\">$row[0]";
my $col="background-color:#222222";
if ( $row[34] == 1 ) { $col="background-color: #996699"; }# ="sitetrade";
if ( $row[9] == 1 ) { $col="background-color: #663399"; }# ="section_trade";
if (( $row[9] == 1 ) && ( $row[34] == 1 )) { $col="background-color: #ff3399"; }# ="section_trade";
print '<td nowrap style="color:#44FF00; '. $col .'; border: 1px;"> '. $link2 .'</TD><TD style="color: #000000 ; background-color: #aa0000">'. $link .'</TD>';
}
print '<FORM METHOD="GET" ACTION="'. $baseurl .'/add_new_info">';

print '<TD><INPUT TYPE="TEXT" NAME="site" SIZE="10" style="border: none; color: #CCFF00 ; background-color: #221111;"></TD>';
print '<INPUT TYPE="HIDDEN" NAME="section" VALUE="'. $site .'">';
print '</FORM>';
print "</TR>";
}
print "</table>";
print "<HR>";
print "WARNING..... CLICKING A SITENAME BELOW WILL REMOVE THE SITE FROM THE LIST TOTALLY.<br>ENSURE... THAT YOU HAVE EXPORTED TEH SITE FIRST FROM MIRC<BR>ONCE ITS GONE. IT CANNOT BE RECOVERD EXCEPT FOR AN IMPORT<br><BR>";
@sitelist=();
my $sitelist_sql = $site_sql->prepare("select distinct (sitename) from sections where section like ? order by sitename asc");
$sitelist_sql->execute("%");
while (my @row = $sitelist_sql->fetchrow_array ) {
push (@sitelist,$row[0])
}

print "<table style=\"text-align: center;\"><tr>";
my $lnum=0;
foreach my $tmpsite (@sitelist) {
$lnum++;
if ($lnum==15 ) { $lnum=0; print "</TR><TR>"; }
my $link="<a href=\"$baseurl/delete_site?site=$tmpsite~%\" onclick=\"return makesure();\"";
print "<td $link style=\"color:#0FF0EE; background-color:#aa0000\">$tmpsite<td>";
}
print "</TR></TAble>";


}
#sub authen_handler {
# @_=();
# Authen::Simple::Passwd->new(passwd => './etc/passwd');
#}

sub handle_request {
my $self = shift;
my $cgi = shift;
@_=();
#my $user = $self->authenticate or return;
my $path = $cgi->path_info();
if ( $path=~m,\.(GIF|JPG|JPEG|BMP|html|css|png|js|xml|swf),i ) {
my $webroot="./htdocs";
return $self->serve_static( $cgi, $webroot );
}
my $handler = $dispatch{$path};
if (ref($handler) eq "CODE") {
print "HTTP/1.0 200 OK\r\n";
$handler->($cgi);
} else {
print "HTTP/1.0 404 Not found\r\n";
print $cgi->header,
$cgi->start_html('Not found'),
$cgi->h1('Not found'),
$cgi->end_html;
}
}


sub resp_show_all_sites {
my $cgi=shift;
my $self=shift;
@_=();
print $cgi->header;
print '
<LINK REL=STYLESHEET HREF="../stdstyles.css" TYPE="text/css">
<LINK REL=STYLESHEET HREF="../bodystyles.css">
<LINK REL=STYLESHEET HREF="../sidebar.css">
<script type="text/javascript">
/************************************************************************************************************
(C) www.dhtmlgoodies.com, October 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Update log:

March, 15th: Fixed problem with sliding in MSIE

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/
var expandFirstItemAutomatically = false; // Expand first menu item automatically ?
var initMenuIdToExpand = false; // Id of menu item that should be initially expanded. the id is defined in the <li> tag.
var expandMenuItemByUrl = true; // Menu will automatically expand by url - i.e. if the href of the menu item is in the current location, it will expand


var initialMenuItemAlwaysExpanded = true; // NOT IMPLEMENTED YET

var dhtmlgoodies_slme

1 comment:

  1. Hello Ya'll,

    For those of you who are interested in earnings profits by FOREX autotrading,
    I would like to recommend a unique forex autotrading instrument.

    It is called EA Builder and it allows you to create custom Forex Indicators and Trading Strategies.

    The tool includes many features such as:
    * Custom Arrows and Alerts
    * Automated Trading System
    * Trade Just About Anything
    * Alerts
    * Money Management


    LEARN MORE: EA Builder

    ReplyDelete

[#] iNFO [#]

All the information provided on this site is for educational purposes only.
 
The site and it's author is in no way responsible for any misuse of the information.
©2012 Security is just an Illusion is powered by Blogger - Template designed by Stramaxon - Best SEO Template