PHP:
<?php
session_start();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="bg" lang="bg">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251" />
<meta name="author" content="CS-HASKOVO.INFO" />
<title>SMS Admin</title>
<style>
html, body {
background: url('http://46.47.80.65//bans/bans/background.gif');
background-repeat: repeat-x;
background-color: #ffffff;
margin: 0;
padding: 0;
font-family: Tahoma, Verdana, sans-serif;
font-size: 13px;
}
div.container {
width: 987px;
height: 100%;
margin: 0 auto;
}
div.header {
width: 983px;
height: 60px;
padding-top: 40px;
padding-left: 30px;
}
div.header a {
font-size: 23px;
color: #216ebb;
text-decoration: none;
}
div.header a:hover {
color: #316ebb;
text-decoration: underline;
text-shadow: #fff 1px 1px 1px;
}
div.header #small_head {
font-size: 12px;
color: #216ebb;
}
div.form_admin {
margin-top: 10px;
margin-left: 10px;
padding: 15px;
border: 1px solid #ddd;
border-radius: 4px;
}
a {
color: #000000;
text-decoration: none;
}
a:hover {
color: red;
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<div class="header"><a href="http://BG-RESOR.COM/">BG-RESOR.COM</a> <div id="small_head">Хасковските Counter-Strike сървъри</div></div>
<div style="text-align: right; margin-bottom: 5px; padding-right: 5px; font-size: 14px;;"> <a href="/bans/admin/index.php">SMS Админ</a> | <a href="http://bill.bg-resor.com/login.php">Билинг</a> | <a href="/bans/bans/index.php">Бан лист</a></div>
<div class="form_admin">
<?php
$connect = mysql_connect("localhost","root","");
if(!$connect) {
die('invalid user/password');
}
mysql_select_db("banss", $connect) or die(mysql_error());
function filter($string) {
return preg_replace('/[^a-zA-Z0-9]/', '', $string);
}
function filter2($string) {
$string = trim($string);
return $string;
}
function makeToken($length=0) {
$length = $length + 0;
if (!$length || $length < 10) {
$length = rand(10, 250);// generate random length
}
$chars = "";// holds generated chars
while ($length--) {
$chars .= chr(rand(33, 126));
}
$chars = md5($chars);
return $chars;
}
function mobio_checkcode($servID, $code, $debug=0) {
$res_lines = file("http://www.mobio.bg/code/checkcode.php?servID=$servID&code=$code");
$ret = 0;
if($res_lines) {
if(strstr("PAYBG=OK", $res_lines[0])) {
$ret = 1;
} else {
if($debug)
echo $line."\n";
}
} else {
if($debug)
echo "Unable to connect to mobio.bg server.\n";
$ret = 0;
}
return $ret;
}
$servIDs = array(17773, 9769);//1 serv: 6,00 | 2 serv: 4,80
if(isSet($_REQUEST['submit'])) {
if(isSet($_SESSION['token']) && filter($_POST['token']) == $_SESSION['token']) {
if(isSet($_POST['usrName'])) {
$usrName = trim($_POST['usrName']);
} else {
$usrName = "";
}
if(isSet($_POST['usrPassword'])) {
$usrPassword = filter(trim($_POST['usrPassword']));
} else {
$usrPassword = "";
}
if(isSet($_POST['usrPassword1'])) {
$usrPassword1 = filter(trim($_POST['usrPassword1']));
} else {
$usrPassword1 = "";
}
if(isSet($_POST['usrServer'])) {
$usrServer = filter($_POST['usrServer']);
} else {
$usrServer = "";
}
if(isSet($_POST['smscode'])) {
$code = filter($_POST['smscode']);
} else {
$code = "";
}
//
if(!$usrName || !$usrPassword || !$usrPassword1 || !$usrServer || $usrServer == '0' || !$code) {
echo "Има празни полета.";
} else {
if(!preg_match('#^[a-z0-9\s\_\-\[\]\{\}\| \<\>\(\)\^\*\@\!\.\:\;\#\/]{3,30}+$#iu', $usrName)) {
echo "<h3 style=\"border-bottom : 1px dotted #bdbdbd; text-shadow : #ddd 1px 2px 0;\">Проблем</h3>Потребителското име трябва да бъде по-дълго от 3 символа и по-късо от 30 символа.";
} else {
if(!preg_match("/^[0-9]{1,3}$/i", $usrServer)) {//проверяваме дали сървър , в който се опитват да станат админ е истински
echo "Въведете истински сървър.";
} else {
if($usrServer > 3) {//проверяваме дали сървър , в който се опитват да станат админ е истински
echo "Въведете истински сървър.";
} else {
if(!preg_match("/^[a-zA-Z0-9]{5,7}$/i", $code)) {
echo "<h3 style=\"border-bottom : 1px dotted #bdbdbd;text-shadow : #ddd 0 1px 0;\">Проблем</h3>Въведете валиден код.";
} else {
if(!preg_match('/^[a-zA-Z0-9]{6,20}$/', $usrPassword)) {
echo "<h3 style=\"border-bottom : 1px dotted #bdbdbd; text-shadow : #ddd 1px 2px 0;\">Проблем</h3>Паролата трябва да бъде по-дълга от 6 символа и по-къса от 20 символа.";
} else {
if(!preg_match('/^[a-zA-Z0-9]{6,20}$/', $usrPassword1)) {
echo "<h3 style=\"border-bottom : 1px dotted #bdbdbd; text-shadow : #ddd 1px 2px 0;\">Проблем</h3>Паролата трябва да бъде по-дълга от 6 символа и по-къса от 20 символа.";
} else {
if($usrPassword != $usrPassword1) {
echo "<h3 style=\"border-bottom : 1px dotted #bdbdbd;text-shadow : #ddd 0 1px 0;\">Проблем</h3>Двете пароли не се съвпадат.";
} else {
$usrPassword1 = md5($usrPassword1);
$time = time();
if(mobio_checkcode($servIDs[0], $code) == 1){
$expired = time() + (45 * 24 * 60 * 60);
$query = mysql_query("INSERT INTO `amx_amxadmins` (`username`, `nickname`, `steamid`, `password`, `created`,`expired`,`days`,`flags`,`access`,`w`) VALUES ('{$usrName}', '{$usrName}', '{$usrName}', '{$usrPassword1}', '{$time}','{$expired}','45','a','bceip','1');")or die(mysql_error());
if(!$query) {
die('Invalid query');
} else {
//insert log for this reg
}
$insert_id = mysql_insert_id();
if($usrServer == 1) {
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '1', '', 'yes');");
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '2', '', 'yes');");
} elseif($usrServer == 2) {
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '3', '', 'yes');");
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '4', '', 'yes');");
} elseif($usrServer == 3) {
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '5', '', 'yes');");
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '6', '', 'yes');");
} else {}
echo "Успшено се регистрирахте";//45 $servIDs[0]
} else {
//1 , 2 - d2 | 3,4 - classic
if(mobio_checkcode($servIDs[1], $code) == 1){
$expired = time() + (30 * 24 * 60 * 60);
$query = mysql_query("INSERT INTO `amx_amxadmins` (`username`,`nickname`, `steamid`, `password`, `created`,`expired`,`days`,`flags`,`access`,`w`) VALUES ('{$usrName}', '{$usrName}', '{$usrName}', '{$usrPassword1}', '{$time}','{$expired}','30','a','bceip','1');")or die(mysql_error());
if(!$query) {
die('Invalid query');
} else {
//insert log for this reg
}
$insert_id = mysql_insert_id();
if($usrServer == 1) {
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '1', '', 'yes');");
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '2', '', 'yes');");
} elseif($usrServer == 2) {
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '3', '', 'yes');");
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '4', '', 'yes');");
} elseif($usrServer == 3) {
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '5', '', 'yes');");
mysql_query("INSERT INTO `amx_admins_servers` (`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) VALUES ('$insert_id', '6', '', 'yes');");
} else {}
echo "Успшено се регистрирахте";//30 $servIDs[1]
} else {
echo "<h3 style=\"border-bottom : 1px dotted #bdbdbd;text-shadow : #ddd 0 1px 0;\">Проблем</h3>Грешен или изтекъл SMS код за достъп.";
}
}
}
}
}
}
}
}
}
}
} else {
echo "Invalid form submission!";
}
} else {
$token = $_SESSION['token'] = md5(uniqid(makeToken(),true));
echo "
<div style=\"float: left;\">
<div style='float: left; width: 270px; margin-right: 20px;'>
<h3 style=\"border-bottom : 1px dotted #bdbdbd; text-shadow : #ddd 1px 2px 0;\">Стани администратор</h3>
<form method=\"POST\" action=\"/bans/admin/index.php\">
<table>
<tbody>
<tr>
<td> <label for=\"usrName\">Прякор: </label> </td>
<td> <input type=\"text\" name=\"usrName\" id=\"usrName\" style=\"width: 195px\" /> </td>
</tr>
<tr>
<td> <label for=\"usrPassword\">Парола: </label> </td>
<td> <input type=\"password\" name=\"usrPassword\" id=\"usrPassword\" AUTOCOMPLETE=\"off\" style=\"width: 195px\" /> </td>
</tr>
<tr>
<td> <label for=\"usrPassword1\">Повтори паролата:</label> </td>
<td> <input type=\"password\" name=\"usrPassword1\" id=\"usrPassword1\" AUTOCOMPLETE=\"off\" style=\"width: 195px\" /> </td>
</tr>
<tr>
<td> <label for=\"usrServer\">Сървър: </label> </td>
<td>
<select name=\"usrServer\" id=\"usrServer\" style=\"width: 200px\">
<option value=\"0\">Избери сървър</option>
<option value=\"1\">CS-HASKOVO.INFO Dust2 Only</option>
<option value=\"2\">CS-HASKOVO.INFO Classic</option>
</select></td>
</tr>
<tr>
<td> <label for=\"smscode\">SMS Code: </label> </td>
<td> <input type=\"text\" name=\"smscode\" id=\"smscode\" style=\"width: 195px\" /> </td>
</tr>
<tr>
<td colspan=\"2\"><input type=\"submit\" name=\"submit\" value=\"стани админ!\" style=\"width: 265px; padding: 5px;\" /><input type=\"hidden\" name=\"token\" value=\"{$token}\" /></td>
</tr>
</tbody>
</table>
</form>
</div>
<div style='float: left; width: 630px;'>
<h3 style=\"border-bottom : 1px dotted #bdbdbd; text-shadow : #ddd 1px 2px 0;\">Как да получа код?</h3>
Ако искаш да си админ за 45 дни в един от нашите сървъри трябва да изпратиш SMS с текст <b>cshaskovo</b><br />
<b>Услугата важи - 45 дни</b><br />
<b>номер 1096</b><br />
Цената на SMS към номер <b>1096</b> е <b>6.00 лв. (с ДДС)</b><br /><br />
Ако искаш да си админ за 30 дни в един от нашите сървъри трябва да изпратиш SMS с текст <b>cshaskovo</b><br />
<b>Услугата важи - 30 дни</b><br />
<b>номер 1094</b><br />
Цената на SMS към номер <b>1094</b> е <b>4.80 лв. (с ДДС)</b><br /><br />
<h3 style=\"border-bottom : 1px dotted #bdbdbd; text-shadow : #ddd 1px 2px 0;\">Какво получавам след регистрация?</h3>
Флаговете, които получавате са: <b>a , b, c, e, i</b><br />
<b>a</b> - имунитет ( защитава те от slay, slap, ban, kick, и т.н.)<br />
<b>b</b> - резервиращ слот (влизаш дори и сървърът да е пълен)<br />
<b>c</b> - кик (можеш да кикваш играчи от сървъра)<br />
<b>e</b> - слай и слап (слай - убива играча, слап - удря играча)<br />
<b>i</b> -съобщения (можеш да пишеш на всички в сървъра)<br /><br />
Команди за ползване в сървъра :<br />
<b>amx_slapmenu</b> - менюто за слай и слап<br />
<b>amx_kickmenu</b> - менютo за кик<br />
<b>amx_say \"съобщение\"</b> - пишете на всички в сървъра<br />
<b>amx_chat \"съобщение\"</b> - пишете само на админите в сървъра<br />
<h3 style=\"border-bottom : 1px dotted #bdbdbd; text-shadow : #ddd 1px 2px 0;\">Специални символи?</h3>
Потребителското име трябва да бъде по-дълго от 3 символа и по-късо от 30 символа.<br />
Разрешени символи: <b>само букви на латница, цифри, символи: _-[]{}/| <>()^*@!.:;'# и празно място.</b><br />
Да не започва/завършва с празно място.
<br /><br />
Паролата трябва да бъде по-дълга от 6 символа и по-къса от 20 символа.<br />
Разрешени символи: <b>само букви на латница, цифри, символи: @ както и празно място.</b><br />
Да не започва/завършва с празно място.
</div>
</div>
<div style=\"clear: both;\"></div>";
}
?>
</div></div>
<br />
<center>SMS Admin System v.1.0.1 © CS-HASKOVO.INFO</center>
<br />
</body>
</html>
Ми дава тази грешка
PHP:
Field 'lastlogin' doesn't have a default value