Проверки с перенаправлениями переехали в functions.php. Глобальный выход если нет сессии в config.php.

This commit is contained in:
lopar
2020-10-30 01:30:05 +02:00
parent 2024a6fac7
commit 32c72e3413
143 changed files with 6986 additions and 7329 deletions
+42 -42
View File
@@ -1,6 +1,6 @@
<?php
// magic идентификацыя
//if (rand(1,2)==1) {
//if (rand(1,2)==1) {
$coma[] = "А вот раньше просто кляпом рот затыкали.";
$coma[] = "А еще раз можешь? ;)";
@@ -44,49 +44,49 @@ $coma[] = "Я конечно не садист, но мне все это нра
$coma[] = "Помолчи, за умного сойдешь. ";
if (empty($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
$target = mysql_real_escape_string($_POST['target']);
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$target}' LIMIT 1;"));
if ($tar['id']) { {
if($tar['align'] == 0 && $user['align'] == 2.99) {
$ok=1;
} else {
$ok=0;
}
if ($ok == 1) {
if (mysql_query("UPDATE `users` SET `align` = 6 WHERE `id` ='{$tar['id']}' LIMIT 1")) {
$ldtarget=$target;
if ($user['sex'] == 1) {$action="присвоил";}
else {$action="присвоила";}
if ($user['align'] > '2' && $user['align'] < '3') {
$angel="Ангел";
}
elseif ($user['align'] > '1' && $user['align'] < '2') {
$angel="Паладин";
}
$mess="$angel &quot;{$user['login']}&quot; $action Светлую склонность &quot;$target&quot;";
$messch="$angel &quot;{$user['login']}&quot; $action Светлую склонность &quot;$target&quot;";
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
echo "<font color=red><b>Успешно изменена склонность персонажа \"$target\"</b></font>";
}
else {
echo "<font color=red><b>Произошла ошибка!<b></font>";
}
}
else {
echo "<font color=red><b>Вы не можете менять склонность этого персонажа!<b></font>";
}
}
}
else {
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
}
$target = mysql_real_escape_string($_POST['target']);
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$target}' LIMIT 1;"));
if ($tar['id']) {
{
if ($tar['align'] == 0 && $user['align'] == 2.99) {
$ok = 1;
} else {
$ok = 0;
}
if ($ok == 1) {
if (mysql_query("UPDATE `users` SET `align` = 6 WHERE `id` ='{$tar['id']}' LIMIT 1")) {
$ldtarget = $target;
if ($user['sex'] == 1) {
$action = "присвоил";
} else {
$action = "присвоила";
}
if ($user['align'] > '2' && $user['align'] < '3') {
$angel = "Ангел";
} elseif ($user['align'] > '1' && $user['align'] < '2') {
$angel = "Паладин";
}
$mess = "$angel &quot;{$user['login']}&quot; $action Светлую склонность &quot;$target&quot;";
$messch = "$angel &quot;{$user['login']}&quot; $action Светлую склонность &quot;$target&quot;";
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
echo "<font color=red><b>Успешно изменена склонность персонажа \"$target\"</b></font>";
} else {
echo "<font color=red><b>Произошла ошибка!<b></font>";
}
} else {
echo "<font color=red><b>Вы не можете менять склонность этого персонажа!<b></font>";
}
}
} else {
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
}