This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
280 lines (237 loc) · 14.8 KB
/
index.php
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<?php
/*****************************************************************************
* index.php *
*****************************************************************************
* Iw DB: Icewars geoscan and sitter database *
* Open-Source Project started by Robert Riess ([email protected]) *
* ========================================================================= *
* Copyright (c) 2004 Robert Riess - All Rights Reserved *
*****************************************************************************
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
* Public License for more details. *
* *
* The GNU GPL can be found in LICENSE in this directory *
*****************************************************************************
* *
* Entwicklerforum/Repo: *
* *
* https://handels-gilde.org/?www/forum/index.php;board=1099.0 *
* https://github.com/iwdb/iwdb *
* *
*****************************************************************************/
define('APPLICATION_PATH_ABSOLUTE', dirname(__FILE__));
define('APPLICATION_PATH_RELATIVE', dirname($_SERVER['SCRIPT_NAME']));
define('APPLICATION_PATH_URL', dirname($_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']));
require_once("includes/bootstrap.php");
if ($login_ok) {
$sqlIA = "SELECT `text`,`value` FROM `{$db_tb_params}` WHERE `name` = 'gesperrt' ";
$resultIA = $db->db_query($sqlIA)
or error(GENERAL_ERROR, 'Could not query user status information.', '', __FILE__, __LINE__, $sqlIA);
$rowIA = $db->db_fetch_array($resultIA);
$grund = $rowIA['text'];
$isornot = $rowIA['value'];
if ($isornot == 'true') {
if ($user_status <> 'admin') {
echo "<div style='text-align:center;color:red'>Die Datenbank ist zur Zeit gesperrt!</div>";
echo "<div style='text-align:center;color:red'>Grund: $grund</div>";
exit;
} else {
echo "<div style='text-align:center'>Die Datenbank ist zur Zeit gesperrt!</div>";
echo "<div style='text-align:center'>Grund: $grund</div>";
}
}
}
if ($action === 'memberlogout2') {
header("Location: " . APPLICATION_PATH_RELATIVE);
exit;
}
// Regeln akzeptieren //
if (($action === 'rules') AND (getVar('accept_rules')) AND ($login_ok)) {
$user_rules = "1";
$result = $db->db_update($db_tb_user, array('rules' => 1), "WHERE id='$user_id'")
or error(GENERAL_ERROR, 'Could not update rules information.', '', __FILE__, __LINE__);
$action = $config_default_action;
}
// Sitterlogin //
$sitterlogin = getVar('sitterlogin');
if ((($user_adminsitten == SITTEN_BOTH) || ($user_adminsitten == SITTEN_ONLY_LOGINS)) && ($action == "sitterlogins") && (!empty($sitterlogin)) && ($login_ok)) {
$sql = "DELETE FROM " . $db_tb_sitterlog . " WHERE date<" . (CURRENT_UNIX_TIME - $config_sitterlog_timeout);
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "SELECT id FROM " . $db_tb_sitterlog . " WHERE sitterlogin = '" . $sitterlogin . "' AND fromuser = '" . $user_sitterlogin . "' AND action = 'login' AND date > " . (CURRENT_UNIX_TIME - $config_sitterpunkte_timeout);
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$anz = $db->db_num_rows($result);
$sql = "INSERT INTO " . $db_tb_sitterlog . " (sitterlogin, fromuser, date, action) VALUES ('" . $sitterlogin . "', '" . $user_sitterlogin . "', '" . CURRENT_UNIX_TIME . "', 'login')";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
// User
$sql = "UPDATE " . $db_tb_user . " SET lastsitterloggedin=0 WHERE lastsitteruser='" . $user_sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "UPDATE " . $db_tb_user . " SET lastsitterlogin=" . CURRENT_UNIX_TIME . ",lastsitteruser='" . $user_sitterlogin . "',lastsitterloggedin=1 WHERE id='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
if (($sitterlogin != $user_sitterlogin) && ($anz == 0)) {
$sql = "UPDATE " . $db_tb_user . " SET sitterpunkte = sitterpunkte + " . $config_sitterpunkte_login . " WHERE sitterlogin = '" . $user_sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
}
$sql = "SELECT sitterpwd FROM " . $db_tb_user . " WHERE sitterlogin = '" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$row = $db->db_fetch_array($result);
header("Location: http://icewars.de/index.php?action=login&name=" . urlencode($sitterlogin) . "&pswd=" . $row['sitterpwd'] . "&sitter=1&ismd5=1&ip_change=1&serverskin=1&serverskin_typ=" . $user_sitterskin . "&submit=true");
exit;
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title><?php echo $config_allytitle ?></title>
<?php
$SERVERURI = "index.php?action=" . $action;
if (($action == "sitterlogins") || ($action == "sitterliste")) {
if (($user_adminsitten == SITTEN_BOTH) || ($user_adminsitten == SITTEN_ONLY_LOGINS)) {
echo "<meta http-equiv='refresh' content='" . $config_refresh_timeout . "; URL=" . $SERVERURI . "'>";
}
}
?>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link href="css/style.css" rel="stylesheet" type="text/css">
<!--[if lt IE 9]>
<script src="javascript/jquery-1.9.1.min.js"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
<script src="javascript/jquery-2.0.0.min.js"></script>
<!--<![endif]-->
</head>
<?php
if (!getVar("nobody")) {
?>
<body class="body background">
<div align="center">
<table class="seite">
<tr>
<td style="text-align: center;" class="background">
<?php
//hier hin verschoben da der IE iwie imemr sonst Mist baut ^^
include ('includes/sitterfadein.php');
if (!empty($config_banner)) {
echo "<div id='iwdb_logo'><img src={$config_banner} alt='banner' style='vertical-align: middle;'></div>";
}
}
if ( ($login_ok) && ($user_rules == "1") ) {
if (getVar("action") == "profile") {
// Menue-Änderung voraus?
$newmenustyle = getVar("menu_default");
if ((!empty($newmenustyle)) && ($newmenustyle != $user_menu_default)) {
$user_menu_default = $newmenustyle;
}
}
if (empty($user_menu_default)) {
$user_menu_default = "default";
}
$user_doc_style = $user_menu_default;
if (!file_exists("./menustyles/doc_" . $user_doc_style . ".php")) {
$user_doc_style = "default";
}
include "./menustyles/doc_" . $user_doc_style . ".php";
if (!getVar("nobody")) {
include "./menustyles/menu_" . $user_menu_default . ".php";
}
} else {
?>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="windowbg1" style="padding-left: 0; text-align: center;">
<?php
}
if (($user_password == "a338268847bac752d23c30b410570c2c") || ($user_password == "2f5a63d542da883a490dd61ef46fe2a9")) {
echo "<br><div class='system_notification'><b>*moep* Achtung! Ändere bitte dein Passwort im Profil. Danke.</b></div><br><br>";
}
if ((empty($user_sitterpwd)) && ($user_sitten == "1")) {
echo "<br><div class='system_notification'><b>*moep* Achtung! Du hast zwar anderen das Sitten erlaubt, aber kein Sitterpasswort eingetragen.</b></div><br><br>";
}
if (($login_ok) && ($user_rules == "1")) {
if ($action === 'memberlogin2') {
include("modules/" . $config_default_action . ".php");
}
if (file_exists("modules/" . $action . ".php") === true) {
include("modules/" . $action . ".php");
}
if ($action == 'deluser' AND $user_status === "admin") {
$sql = "DELETE FROM " . $db_tb_user . " WHERE sitterlogin='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "DELETE FROM " . $db_tb_punktelog . " WHERE user='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "DELETE FROM " . $db_tb_schiffe . " WHERE user='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "DELETE FROM " . $db_tb_preset . " WHERE fromuser='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "DELETE FROM " . $db_tb_lager . " WHERE user='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "DELETE FROM " . $db_tb_ressuebersicht . " WHERE user='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "DELETE FROM " . $db_tb_research2user . " WHERE userid='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "DELETE FROM " . $db_tb_group_user . " WHERE user_id='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "DELETE FROM " . $db_tb_group_sort . " WHERE user_id='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "DELETE FROM " . $db_tb_gebaeude_spieler . " WHERE user='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "DELETE FROM " . $db_tb_bestellung . " WHERE user='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
$sql = "DELETE FROM " . $db_tb_user_research . " WHERE user='" . $sitterlogin . "'";
$result = $db->db_query($sql)
or error(GENERAL_ERROR, 'Could not query config information.', '', __FILE__, __LINE__, $sql);
doc_title('Account löschen');
doc_message('Account ' . $sitterlogin . ' gelöscht!');
}
} elseif (($login_ok) && ($user_rules != "1")) {
include("modules/rules.php");
exit;
} else {
if ($action == 'password') {
include("modules/password.php");
} else {
include("modules/login.php");
}
}
echo $error;
if (!getVar("nobody")) { ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
</td>
</tr>
</table>
</div>
<script src="javascript/misc.js"></script>
</body>
</html>
<?php } ?>