[ Index ] |
|
Code source de Cr@wltr@ck 2.2.1 |
1 <?php 2 //---------------------------------------------------------------------- 3 // CrawlTrack 2.2.1 4 //---------------------------------------------------------------------- 5 // Crawler Tracker for website 6 //---------------------------------------------------------------------- 7 // Author: Jean-Denis Brun 8 //---------------------------------------------------------------------- 9 // Website: www.crawltrack.fr 10 //---------------------------------------------------------------------- 11 // That script is distributed under GNU GPL license 12 //---------------------------------------------------------------------- 13 // file: adminipsuppress.php 14 //---------------------------------------------------------------------- 15 16 if (!defined('IN_CRAWLT_ADMIN')) 17 { 18 echo"<h1>Hacking attempt !!!!</h1>"; 19 exit(); 20 } 21 22 if(isset($_GET['suppressip'])) 23 { 24 $suppressip = (int)$_GET['suppressip']; 25 } 26 else 27 { 28 if(isset($_POST['suppressip'])) 29 { 30 $suppressip = (int)$_POST['suppressip']; 31 } 32 else 33 { 34 $suppressip = 0; 35 } 36 } 37 38 if(isset($_GET['suppressipok'])) 39 { 40 $suppressipok = (int)$_GET['suppressipok']; 41 } 42 else 43 { 44 if(isset($_POST['suppressipok'])) 45 { 46 $suppressipok = (int)$_POST['suppressipok']; 47 } 48 else 49 { 50 $suppressipok = 0; 51 } 52 } 53 54 if(isset($_POST['originsuprip'])) 55 { 56 $originsuprip = (int)$_POST['originsuprip']; 57 } 58 else 59 { 60 $originsuprip = 0; 61 } 62 63 64 if($suppressip==1) 65 { 66 67 if(isset($_GET['iptosuppress'])) 68 { 69 $iptosuppress = $_GET['iptosuppress']; 70 } 71 else 72 { 73 if(isset($_POST['iptosuppress'])) 74 { 75 $iptosuppress = $_POST['iptosuppress']; 76 } 77 else 78 { 79 header("Location:../index.php"); 80 } 81 } 82 83 84 //test to see if the IP address is correct 85 $modele="^[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}$"; 86 $iptosuppress=strtolower($iptosuppress); 87 if (ereg($modele, $iptosuppress)) 88 { 89 $validaddress=1; 90 } 91 else 92 { 93 $validaddress=0; 94 } 95 96 97 if($suppressipok==1 && $validaddress==1) 98 { 99 //ip suppression 100 101 //database connection 102 $connexion = mysql_connect($crawlthost,$crawltuser,$crawltpassword) or die("MySQL connection to database problem"); 103 $selection = mysql_select_db($crawltdb) or die("MySQL database selection problem"); 104 105 106 //database query to suppress the visits coming from that ip 107 108 $sqldelete="DELETE FROM crawlt_visits WHERE crawlt_ip_used= '".sql_quote($iptosuppress)."'"; 109 $requetedelete = mysql_query($sqldelete, $connexion) or die("MySQL query error"); 110 111 //emptied the cache table 112 $sqlcache = "TRUNCATE TABLE crawlt_cache"; 113 $requetecache = mysql_query($sqlcache, $connexion) or die("MySQL query error"); 114 115 if($requetedelete) 116 { 117 echo"<br><br><h1>".$language['ip_suppress_ok']."</h1>\n"; 118 119 echo"<div class=\"form\">\n"; 120 echo"<form action=\"index.php\" method=\"POST\" >\n"; 121 if ($originsuprip==1) 122 { 123 echo "<input type=\"hidden\" name ='navig' value='6'>\n"; 124 } 125 else 126 { 127 echo "<input type=\"hidden\" name ='navig' value='8'>\n"; 128 } 129 echo "<input type=\"hidden\" name ='originsuprip' value=\"$originsuprip\">\n"; 130 echo "<input type=\"hidden\" name ='period' value=\"$period\">"; 131 echo "<input type=\"hidden\" name ='site' value=\"$site\">\n"; 132 echo"<input name='ok' type='submit' value='OK' size='20'>\n"; 133 echo"</form>\n"; 134 echo"</div>\n"; 135 } 136 else 137 { 138 echo"<br><br><h1>".$language['ip_suppress_no_ok']."</h1>\n"; 139 140 echo"<div class=\"form\">\n"; 141 echo"<form action=\"index.php\" method=\"POST\" >\n"; 142 if ($originsuprip==1) 143 { 144 echo "<input type=\"hidden\" name ='navig' value='6'>\n"; 145 } 146 else 147 { 148 echo "<input type=\"hidden\" name ='navig' value='8'>\n"; 149 } 150 echo "<input type=\"hidden\" name ='originsuprip' value=\"$originsuprip\">\n"; 151 echo "<input type=\"hidden\" name ='period' value=\"$period\">"; 152 echo "<input type=\"hidden\" name ='site' value=\"$site\">\n"; 153 echo"<input name='ok' type='submit' value='OK' size='20'>\n"; 154 echo"</form>\n"; 155 echo"</div>\n"; 156 } 157 158 } 159 elseif ($suppressipok==1 && $validaddress==0) 160 { 161 echo"<p>".$language['ip_no_ok']."</p><br><br>\n"; 162 } 163 else 164 { 165 //validation of suppression 166 167 //display 168 169 $iptosuppress = stripslashes($iptosuppress); 170 $iptosuppressdisplay=htmlentities($iptosuppress); 171 172 echo"<br><br><h1>".$language['crawler_ip']." $iptosuppressdisplay</h1>\n"; 173 174 if($originsuprip==1) 175 { 176 echo"<br><p>".$language['ip_suppress_validation2']."</p>\n"; 177 } 178 else 179 { 180 echo"<br><p>".$language['ip_suppress_validation']."</p>\n"; 181 } 182 183 echo"<div class=\"form\">\n"; 184 echo"<form action=\"index.php\" method=\"POST\" >\n"; 185 echo "<input type=\"hidden\" name ='navig' value='6'>\n"; 186 echo "<input type=\"hidden\" name ='validform' value=\"19\">"; 187 echo "<input type=\"hidden\" name ='suppressip' value=\"1\">\n"; 188 echo "<input type=\"hidden\" name ='suppressipok' value=\"1\">\n"; 189 echo "<input type=\"hidden\" name ='originsuprip' value=\"$originsuprip\">\n"; 190 echo "<input type=\"hidden\" name ='iptosuppress' value=\"$iptosuppress\">\n"; 191 echo"<table class=\"centrer\">\n"; 192 echo"<tr>\n"; 193 echo"<td colspan=\"2\">\n"; 194 echo"<input name='ok' type='submit' value=' ".$language['yes']." ' size='20'>\n"; 195 echo"</td>\n"; 196 echo"</tr>\n"; 197 echo"</table>\n"; 198 echo"</form>\n"; 199 echo"</div>"; 200 201 echo"<div class=\"form\">\n"; 202 echo"<form action=\"index.php\" method=\"POST\" >\n"; 203 if ($originsuprip==1) 204 { 205 echo "<input type=\"hidden\" name ='navig' value='6'>\n"; 206 } 207 else 208 { 209 echo "<input type=\"hidden\" name ='navig' value='8'>\n"; 210 } 211 echo "<input type=\"hidden\" name ='period' value=\"$period\">"; 212 echo "<input type=\"hidden\" name ='site' value=\"$site\">\n"; 213 echo "<input type=\"hidden\" name ='originsuprip' value=\"$originsuprip\">\n"; 214 echo"<table class=\"centrer\">\n"; 215 echo"<tr>\n"; 216 echo"<td colspan=\"2\">\n"; 217 echo"<input name='ok' type='submit' value=' ".$language['no']." ' size='20'>\n"; 218 echo"</td>\n"; 219 echo"</tr>\n"; 220 echo"</table>\n"; 221 echo"</form>\n"; 222 echo"</div>"; 223 224 echo"<br><p>".$language['ip_suppress_validation3']."\n"; 225 echo"<b>Deny from $iptosuppressdisplay</b></p><br>\n"; 226 227 228 } 229 230 } 231 else 232 { 233 234 echo"<br><br><h1>".$language['ip_suppress']."</h1>\n"; 235 //data collect form 236 237 echo"<div class=\"form\">\n"; 238 echo"<form action=\"index.php\" method=\"POST\" >\n"; 239 echo "<input type=\"hidden\" name ='validform' value=\"19\">"; 240 echo "<input type=\"hidden\" name ='navig' value='6'>\n"; 241 echo "<input type=\"hidden\" name ='suppressip' value='1'>\n"; 242 echo "<input type=\"hidden\" name ='originsuprip' value='1'>\n"; 243 echo"<table class=\"centrer\">\n"; 244 echo"<tr>\n"; 245 echo"<td>".$language['crawler_ip']."</td>\n"; 246 echo"<td><input name='iptosuppress' value='' type=\"text\" maxlength=\"16\" size=\"50\"/></td>\n"; 247 echo"</tr>\n"; 248 echo"<tr><td> </td></tr>\n"; 249 echo"<tr><td> </td></tr>\n"; 250 echo"<tr>\n"; 251 echo"<td colspan=\"2\">\n"; 252 echo"<br>\n"; 253 echo"<input name='ok' type='submit' value=' OK ' size='20'>\n"; 254 echo"</td>\n"; 255 echo"</tr>\n"; 256 echo"</table>\n"; 257 echo"</form>\n"; 258 echo"</div><br>\n"; 259 260 261 } 262 263 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Sep 6 14:14:11 2007 | par Balluche grâce à PHPXref 0.7 |