diff --git a/ashop.php b/ashop.php index a166996..062db5c 100644 --- a/ashop.php +++ b/ashop.php @@ -11,7 +11,7 @@ if ($user['battle'] != 0) { header('location: fbattle.php'); die(); } if($_POST['enter'] && $_POST['pass']) { - $data = mysql_query("SELECT * FROM `bank` WHERE `owner`='".$user['id']."' AND `id`='".$_POST['id']."' AND `pass`='".md5($_POST['pass'])."';"); + $data = mysql_query("SELECT * FROM `bank` WHERE `id`='".$user['id']."' AND `pass`='".md5($_POST['pass'])."';"); $data = mysql_fetch_array($data); if($data) { $_SESSION['bankid'] = $_POST['id']; @@ -130,7 +130,7 @@ if(!$_SESSION['bankid']) {
Войти в счет
  № "; while ($rah = mysql_fetch_array($banks)) { echo ""; diff --git a/confpassbank.php b/confpassbank.php deleted file mode 100644 index 406c2f2..0000000 --- a/confpassbank.php +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - Востановление пароля - -
 
-
- - - - -
-
- browser."--"; - /*switch ($browsers->browser){ - case 'Chrome' : - $_GET['login']=iconv('utf-8', 'cp1251', $_GET['login']); - break; - case 'Safari' : - $_GET['login']=iconv('utf-8', 'cp1251', $_GET['login']); - break; - case 'Default Browser' : //Opera10 - $_GET['login']=iconv('utf-8', 'cp1251', $_GET['login']); - break; - case 'Firefox' : - $_GET['login']=$_GET['login']; - break; - }*/ - - $realtime=mktime(date(H), date(i), date(s), date("m") , date("d"), date("Y")); - - $_GET['login']=strtolower($_GET['login']); - if ($_GET['newpass']!='' && $_GET['login']!='' && $_GET['timev']!='' && $realtime<=$_GET['timev']) { - include("config.php"); - $sql=mysql_query("select * from confirmpasswd where login='bbb".$_GET['login']."bbb' and passwd='".$_GET['newpass']."' and date='".$_GET['timev']."' and active=1") or die("Ошибка обработки запроса."); - if (mysql_num_rows($sql)==0 or mysql_num_rows($sql)=='') die("

Ссылка устарела!

"); - $sql=mysql_fetch_array($sql,MYSQL_ASSOC) or die("Ошибка обработки запроса!!"); - mysql_query("update bank set pass='".md5($_GET['newpass'])."' where id='".$_GET['login']."'") or die("Ошибка обработки запроса!"); - echo "
Пароль изменен. Не забывайте пароль.
Для входа в игру перейдите по сылке http://old-dark.ru/
"; - @mysql_query("update confirmpasswd set active=0 where login='bbb".$_GET['login']."bbb' and passwd='".$_GET['newpass']."' and date='".$_GET['timev']."' and active=1"); - } - else echo "

Ссылка устарела.

"; - ?> -
- -
-
-
-

- - - \ No newline at end of file diff --git a/functions.php b/functions.php index f1c133d..8fad4ad 100644 --- a/functions.php +++ b/functions.php @@ -77,39 +77,6 @@ if (!isset($user)) { // regenhp($user); //} -$inder = filter_input(INPUT_COOKIE, 'inder'); - -if (!isset($banks['id'])) { - $banks = db::c()->query('SELECT `id`, `cr`, `ekr` FROM `bank` WHERE `id` = "?s" AND `owner` = "?s" LIMIT 1', $inder, $user['id'])->fetch_assoc(); -} - -function auth_bank($id, $pass, $us) -{ - global $banks; - $bn = db::c()->query('SELECT `id`, `pass` FROM `bank` WHERE `id` = ?i AND `owner` = "?s"', $id, $us)->fetch_assoc(); - if (isset($bn['id'])) { - if ($bn['pass'] == md5($pass)) { - setcookie('inder', $bn['id'], time() + 60 * 60 * 24 * 7, '/', GAMEDOMAIN, 0, true); - $banks['id'] = $bn['id']; - $msg = 'Успешная авторизация ...'; - } else { - $msg = 'Неверный пароль ...'; - } - } else { - $msg = 'Счёт не найден ...'; - } - return $msg; -} - -function exit_bank($link) -{ - global $banks; - $r = 'Работа со счётом завершена ...'; - setcookie('inder', '', time() + 60 * 60 * 24 * 7, '', GAMEDOMAIN); - $banks['id'] = null; - header('Location: ' . $link); - return $r; -} function getNum($v) { @@ -127,24 +94,12 @@ function getNum($v) function banks() { - global $user, $banks; - $bank = db::c()->query('SELECT `id`, `cr`, `ekr` FROM `bank` WHERE `id` = "?s" AND `owner` = "?s" LIMIT 1', $banks['id'], $user['id'])->fetch_assoc(); + $id = $_SESSION['uid']; + $bank = db::c()->query('SELECT `id`, `ekr` FROM `bank` WHERE `id` = ?i ', $id)->fetch_assoc(); if (isset($bank['id'])) { - echo '
СчётБанковский счёт №' . $bank['id'] . '. x
На счету ' . $bank['ekr'] . ' еврокредитов.
'; + echo '
СчётБанковский счёт № {$id}
На счету ' . $bank['ekr'] . ' еврокредитов.
'; } else { - $sp = db::c()->query('SELECT `id` FROM `bank` WHERE `owner` = "?s" ORDER BY `id` ASC', $user['id']); - if ($sp->getNumRows() > 0) { - $nums .= ' '; - } else { - $nums = 'У вас нет счетов'; - } - $auth = $nums; - echo '
Авторизация
' . $auth . '
'; + echo 'У вас нет счета в банке.'; } } @@ -947,7 +902,7 @@ function add_user_abil($ab, $cost) $isset[$ab] += 1; mysql_query('UPDATE `abils_user` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `uid` = "' . $user['id'] . '" LIMIT 1'); $banks['ekr'] -= $cost; - mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `owner` = "' . $user['id'] . '" LIMIT 1'); + mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); return true; } } @@ -964,7 +919,7 @@ function add_klan_abil($ab, $cost) $isset[$ab] += 1; mysql_query('UPDATE `abils_klan` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `klan` = "' . $user['klan'] . '" LIMIT 1'); $banks['ekr'] -= $cost; - mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `owner` = "' . $user['id'] . '" LIMIT 1'); + mysql_query('UPDATE `bank` SET `ekr` = "' . $banks['ekr'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1'); return true; } } @@ -2616,7 +2571,7 @@ function showpersout($pas = 0) Ничьих:
query('SELECT SUM(`ekr`) AS `bank_ekr`,SUM(`cr`) AS `bank_cr` FROM `bank` WHERE `owner`= ?i', $user['id'])->fetch_assoc(); + $ekr_bank = db::c()->query('SELECT SUM(`ekr`) AS `bank_ekr`,SUM(`cr`) AS `bank_cr` FROM `bank` WHERE `id`= ?i', $user['id'])->fetch_assoc(); ?> Деньги: кр.
diff --git a/inf.php b/inf.php index 52ba2e6..baf1398 100644 --- a/inf.php +++ b/inf.php @@ -197,7 +197,7 @@ if ($own['admin'] == 1) { if (!empty($user['reputation'])) echo "Всего Репутации: " . $user['reputation'] . "
"; if (!empty($user['doblest'])) echo "Репутации: " . $user['doblest'] . "
"; - if ($user_bank = db::c()->query('SELECT `id`,`cr`,`ekr` FROM `bank` WHERE `owner` = ?i', $user['id'])) { + if ($user_bank = db::c()->query('SELECT `id`,`cr`,`ekr` FROM `bank` WHERE `id` = ?i', $user['id'])) { echo "

Банк

"; echo " diff --git a/main.php b/main.php index 686fb13..b7b99dd 100644 --- a/main.php +++ b/main.php @@ -19,18 +19,6 @@ if ($user['battle'] != 0) { // $shadow = mysql_fetch_array(mysql_query("SELECT `id`, `mshadow`, `wshadow` FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1")); //} -if ($_POST['bankpsw']) { - echo "" . auth_bank((int)$_POST['bank'], $_POST['bankpsw'], $user['id']) . ""; -} - -if ($_GET['unset_bank'] == 1) { - exit_bank('?error=bank'); -} - -if ($_GET['error'] == 'bank') { - err('Работа со счётом завершена.'); -} - function updstats() { global $user; @@ -1706,40 +1694,30 @@ if ($_GET['edit']) { Ничьих:
- Деньги: кр.
Репутация: реп.
- - Банк - #: ( .кр, - .екр) X -
- - Авторизация в банке - + Войти в счет
  № "; while ($rah = mysql_fetch_array($banks)) { echo "";