-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin.php
executable file
·703 lines (588 loc) · 23.7 KB
/
admin.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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
<?php
/**************************************************************************
* 0xBB ~ Bullettin Board *
**************************************************************************
* 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 3 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
* =========================================================================*
* Software: 0xBB
* Software version: 2.0
* Author: KinG-InFeT
* Copyleft: GNU General Public License
* =========================================================================*
* admin.php
***************************************************************************/
include "kernel.php";
show_header();
show_menu ();
list ($username, $password) = get_data ();
if (!login ($username, $password))
die (header('Location: index.php'));
if (!(level($username) == 'admin'))
die (header('Location: index.php'));
csrf_attemp($_SERVER['HTTP_REFERER']);
$usr = $username;
?>
<div class = 'path' id = 'path'>
<table>
<?php if(empty($_GET['mode'])) {?>
<tr><td><b><a href = 'index.php'>Home Forum</a></b></td></tr>
<?php }else{ ?>
<tr><td><b><a href = 'admin.php'>Home ACP</a></b></td></tr>
<?php }?>
</table>
</div>
<div class = 'main_admin'>
<?php
switch (@$_GET ['mode']) {
case 1:
switch (@$_GET ['action']) {
case 1:
?>
<br /><p align="center"><b>Gestione Forum:</b><p><hr /><br />
<h4><a href = 'admin.php?mode=1&action=4'>[-Aggiungi Nuovo Forum-]</a></h4>
<br /><br />
<?php
$query = "SELECT * FROM ". __PREFIX__ ."forum";
$res = mysql_query ($query) or _err(mysql_error());
while ($row = mysql_fetch_row ($res)) {
?>
<p><b>Titolo: </b><?php print $row [1]; ?><br />
<i><?php print $row [2]; ?></i><br />
<i>Access: <?php if(!empty($row[3])) print check_graphic_access_forum($row[0]); else print 'FULL ACCESS'; ?></i><br />
<a href = 'admin.php?mode=1&action=2&id=<?php print $row [0]; ?>'>Elimina</a>
<a href = 'admin.php?mode=1&action=3&id=<?php print $row [0]; ?>'>Edita</a><p>
<hr />
<?php
}
break;
case 2:
$id = (int) $_GET ['id'];
if (!(check_forum_id($id)))
_err("Errore! L'ID specificato non è Valido!");
$query = "DELETE FROM ". __PREFIX__ ."forum WHERE id = '". $id ."'";
mysql_query ($query);
$query = "DELETE FROM ". __PREFIX__ ."topic WHERE f_id = '". $id ."'";
mysql_query ($query) or _err(mysql_error());
header ("Location: admin.php?mode=1");
print "Forum deleted successfully.";
break;
case 3:
$id = (int) $_GET ['id'];
if (!(check_forum_id($id)))
_err("Errore! L'ID Specificato non è valido!");
@$title = clear ($_POST ['title']);
@$descr = clear ($_POST ['descr']);
@$access = clear ($_POST ['access']);
if (($title) && ($descr)) {
$query = "UPDATE ". __PREFIX__ ."forum SET title = '{$title}', description = '{$descr}', user_access = '{$access}' WHERE id = '". $id ."'";
mysql_query ($query) or _err(mysql_error());
header ("Location: admin.php?mode=1");
}else {
$query = "SELECT * FROM ". __PREFIX__ ."forum WHERE id = '". $id ."'";
$row = mysql_fetch_row (mysql_query ($query));
?>
<br /><b>Modifica Forum:</b><p>
<form method = 'POST' action = 'admin.php?mode=1&action=3&id=<?php print $id; ?>'>
<br />
<table>
<tr><td>Titolo:</td><td><input name = 'title' value = '<?php print $row [1]; ?>'></td></tr>
</table>
<br />
Descrizione:<br />
<textarea class = 'forum_text' name = 'descr'><?php print $row [2]; ?></textarea><br />
Accesso: <select name="access">
<?php print "<option value=\"".$row[3]."\">".$row[3]."</option>"; ?>
<option value="">Tutti</option>
<option value="admin">Admin</option>
<option value="mod">Mod</option>
<option value="vip">VIP</option>
</select>
<br />
<input type = 'submit' value = 'Modifica'>
</form>
<?php
}
break;
case 4:
@$title = clear ($_POST ['title']);
@$descr = clear ($_POST ['descr']);
@$access = clear ($_POST ['access']);
if (($title) && ($descr)) {
$query = mysql_query ("SELECT MAX(position) FROM ".__PREFIX__."forum") or _err(mysql_error());
$result = mysql_fetch_row($query);
$position = $result[0] + 1;
$query = "INSERT INTO ". __PREFIX__ ."forum (title, description, user_access, position) VALUES ('{$title}', '{$descr}', '{$access}', ".$position.")";
mysql_query ($query) or _err(mysql_error());
header ("Location: admin.php?mode=1");
}else{
?>
<br /><b>Aggiungi un nuovo Forum:</b><p>
<form action = 'admin.php?mode=1&action=4' method = 'POST'>
<table>
<tr><td>Titolo: </td>
<td><input name = 'title'></td></tr>
</table>
Descrizione:<br />
<textarea class = 'forum_text' name = 'descr'></textarea><br />
Accesso: <select name="access">
<option value="">Tutti</option>
<option value="admin">Admin</option>
<option value="mod">Mod</option>
<option value="vip">VIP</option>
</select>
<br />
<input type = 'submit' value = 'Crea forum'>
</form>
<?php
}
break;
default:
header ("Location: admin.php?mode=1&action=1");
break;
}
break;
case 2:
@$username = clear ($_POST ['username']);
if ($username) {
$query = "SELECT id,level FROM ". __PREFIX__ ."users WHERE username = '". $username ."'";
$row = mysql_fetch_row (mysql_query ($query));
if (!$row [0])
_err("Errore! L'Username Specificato non esiste!");
if($row[0] == nick2uid($usr))
_err("Errore! L'utente selezionato è già amministratore!");
if ($row [1] == 'admin')
$query = "UPDATE ". __PREFIX__ ."users SET level = 'user' WHERE id = '". $row[0] ."'";
else
$query = "UPDATE ". __PREFIX__ ."users SET level = 'admin' WHERE id = '". $row[0] ."'";
mysql_query ($query) or _err(mysql_error());
header ("Location: admin.php?mode=2");
}else {
?>
<form action = 'admin.php?mode=2' method = 'POST'>
<br /><b>Gestione dei permessi per Admin:</b>
<p>Aggiungi/Rimuovi un admin(Basta scrivere l'username): <input name = 'username'><br />
<input type = 'submit' value = 'Edit'>
</form>
<br /><br />
<?php
}
print "<b>Amministratori:</b><p>\n";
$query = "SELECT id, username FROM ". __PREFIX__ ."users WHERE level = 'admin'";
$res = mysql_query ($query) or _err(mysql_error());
while ($row = mysql_fetch_row ($res))
print "<a href = 'profile.php?id=".$row [0]."'>".$row [1]."</a><br />";
break;
case 3;
@$username = clear ($_POST ['username']);
if ($username) {
$query = "SELECT id FROM ". __PREFIX__ ."users WHERE username = '". $username ."'";
$row = mysql_fetch_row (mysql_query ($query));
if (!$row [0])
_err("Errore! L'Username Specificato non esiste!");
if($row[0] == nick2uid($usr))
_err("Errore! L'accaunt selezionato è in utilizzo!");
mysql_query("DELETE FROM ". __PREFIX__ ."users WHERE username = '". $username ."'") or _err(mysql_error());
mysql_query("DELETE FROM ". __PREFIX__ ."karma WHERE vote_user_id = '". nick2uid($username) ."'") or _err(mysql_error());
mysql_query("DELETE FROM ". __PREFIX__ ."ban_ip WHERE user_id = '". nick2uid($username) ."'") or _err(mysql_error());
print '<script>alert("Utente cancellato con successo!"); window.location="admin.php?mode=3";</script>';
}else{
?>
<form action = 'admin.php?mode=3' method = 'POST'>
<br /><b>Cancella Utente:</b>
<p>Inserire l'username: <input name = 'username' maxleght='20'><br />
<input type = 'submit' value = 'Cancella'>
</form>
<?php
}
break;
case 4;
@$username = clear ($_POST ['username']);
if ($username) {
$query = "SELECT id,level FROM ". __PREFIX__ ."users WHERE username = '". $username ."'";
$row = mysql_fetch_row (mysql_query ($query));
if (!$row [0])
_err("Errore! L'Username Specificato non esiste!");
if($row[0] == nick2uid($usr))
_err("Errore! Banni il tuo stesso account?!");
if($row[1] == 'banned')
mysql_query("UPDATE ". __PREFIX__ ."users SET level= 'user' WHERE username = '". $username ."'") or _err(mysql_error());
else
mysql_query("UPDATE ". __PREFIX__ ."users SET level= 'banned' WHERE username = '". $username ."'") or _err(mysql_error());
print '<script>window.location="admin.php?mode=4";</script>';
}else{
?>
<form action = 'admin.php?mode=4' method = 'POST'>
<br /><b>Banna\Sbanna Utente:</b><br /><br />
Inserire l'username: <input name = 'username' value='' maxleght=20><br />
<input type = 'submit' value = 'Banna'>
</form>
<?php
}
print "<br /><b>Utenti Bannati:</b><p>\n";
$query = "SELECT id, username FROM ". __PREFIX__ ."users WHERE level = 'banned'";
$res = mysql_query ($query);
while ($row = mysql_fetch_row ($res))
if($row[0] != nick2uid($username))
print "<a href = 'profile.php?id=". $row[0] ."'>". $row[1] ."</a><br />\n";
break;
case 5:
@$username = clear ($_POST ['username']);
if ($username) {
$query = "SELECT id,level FROM ". __PREFIX__ ."users WHERE username = '". $username ."'";
$row = mysql_fetch_row (mysql_query ($query));
if (!$row [0])
_err("Errore! L'Username Specificato non esiste!</div>");
if($row[0] == nick2uid($usr))
_err("Errore! Non puoi diventare Mod se ora sei ADMIN!");
if ($row [1] == 'mod')
$query = "UPDATE ". __PREFIX__ ."users SET level = 'user' WHERE id = '". $row[0] ."'";
else
$query = "UPDATE ". __PREFIX__ ."users SET level = 'mod' WHERE id = '". $row[0] ."'";
mysql_query ($query) or _err(mysql_error());
header ("Location: admin.php?mode=5");
}else {
?>
<form action = 'admin.php?mode=5' method = 'POST'>
<br /><b>Gestione dei permessi per Mod:</b>
<p>Aggiungi/Rimuovi un Mod (Basta scrivere l'username): <input name = 'username'><br />
<input type = 'submit' value = 'Edit'>
</form>
<br /><br />
<?php
}
?>
<b>Moderatori:</b><p>
<?php
$query = "SELECT id, username FROM ". __PREFIX__ ."users WHERE level = 'mod'";
$res = mysql_query ($query);
while ($row = mysql_fetch_row ($res))
print "<a href = 'profile.php?id=".$row [0]."'>".$row [1]."</a><br />";
break;
case 6:
@$ip = clear ($_REQUEST['ip']);
if (($ip) && (@$_GET['ban'] == 2)) {
$query = "SELECT * FROM ". __PREFIX__ ."ban_ip WHERE ip = '". $ip ."'";
$row = mysql_fetch_row (mysql_query ($query));
if($ip == $_SERVER['REMOTE_ADD'])
_err("Errore! IP da bannare è identico al tuo, ti banni?");
if (!$row [2]) {
//ip inesistente quindi lo aggiungo
$ban_ip = "INSERT INTO ". __PREFIX__ ."ban_ip ( user_id, ip, banned ) VALUES ('', '". $ip ."', '1')";
mysql_query($ban_ip) or _err(mysql_error());
}else{
_err("Errore! Questo IP esiste nel Database!");
}
header ("Location: admin.php?mode=6");
}
else {
?>
<form action = 'admin.php?mode=6&ban=2' method = 'POST'>
<br /><b>Gestione Ban per IP:</b>
<p>Banna IP Esterno: <input name = 'ip'><br />
<input type = 'submit' value = 'Banna'></p>
</form>
<br /><br />
<?php
}
if(@$_GET['ban'] == 1) {
$query = "SELECT * FROM ". __PREFIX__ ."ban_ip WHERE ip = '{$ip}'";
$row = mysql_fetch_row (mysql_query ($query));
if($row[1] == nick2uid($usr))
_err("Errore! IP da bannare è identico al tuo, ti banni?");
if ($row [3] == 0)
$query = "UPDATE ". __PREFIX__ ."ban_ip SET banned = '1' WHERE id = '". $row[0] ."'";
else
$query = "UPDATE ". __PREFIX__ ."ban_ip SET banned = '0' WHERE id = '". $row[0] ."'";
mysql_query ($query) or _err(mysql_error());
header ("Location: admin.php?mode=6");
}
if((@$_GET['elimina'] == 1) && (!empty($_GET['id']))) {
$id = (int) $_GET['id'];
mysql_query("DELETE FROM ". __PREFIX__ ."ban_ip WHERE id = '". $id ."'") or _err(mysql_error());
print '<script>alert("IP Cancellato!); window.location="admin.php?mode=6";</script>';
}
?>
<table border="1">
<tr><td>Username</td><td>IP</td><td>Bannato?</td><td></td></tr>
<?php
$query = "SELECT * FROM ". __PREFIX__ ."ban_ip";
$res = mysql_query ($query);
while ($row = mysql_fetch_row ($res)) {
if(($row[3] == 0) || ($row[3] == NULL))
$banned = "NO";
else
$banned = "SI";
if($banned == 'NO')
$banna = "<a href=\"admin.php?mode=6&ip=".$row[2]."&ban=1\"><i>Banna</i></a> ~ <a href=\"admin.php?mode=6&id=".$row[0]."&elimina=1\"><i>Elimina</i></a>";
else
$banna = "<a href=\"admin.php?mode=6&ip=".$row[2]."&ban=1\"><i>Leva Ban</i></a> ~ <a href=\"admin.php?mode=6&id=".$row[0]."&elimina=1\"><i>Elimina</i></a>";
if(!($row[1] == NULL))
$usr = "<a href = 'profile.php?id=".$row [1]."'>".user_id($row [1])."</a>";
else
$usr = "<i>IP Esterno</i>";
if($row[1] != nick2uid($username)) {
?>
<tr>
<td><?php print $usr; ?></td>
<td><?php print $row[2]; ?></td><td><?php print $banned; ?></td>
<td><?php print $banna; ?></td>
</tr>
<?php
}
}
?>
</table>
<?php
break;
case 7:
?>
<form action = 'admin.php?mode=7' method = 'POST'>
<br /><b>Modifica Modalità "Manutenzione"</b><br /><br />
<select name="operazione">
<option value ="disattiva">Disattiva</option>
<option value ="attiva">Attiva</option>
</select>
<input type = 'submit' value = 'Modifica'></p>
</form>
<?php
if(!empty($_POST['operazione'])) {
if($_POST['operazione'] == 'attiva') {
mysql_query("UPDATE `". __PREFIX__ ."settings` SET maintenance = '1'")or _err(mysql_error());
print '<script>alert("Modalità Manutenzione ATTIVATA!"); window.location="admin.php";</script>';
}elseif($_POST['operazione'] == 'disattiva') {
mysql_query("UPDATE `". __PREFIX__ ."settings` SET maintenance = '0'")or _err(mysql_error());
print '<script>alert("Modalità Manutenzione DISATTIVATA!"); window.location="admin.php";</script>';
}
}
break;
case 8:
?>
<form action = 'admin.php?mode=8' method = 'POST'>
<br /><b>Attiva/Disattiva Registrazioni</b><br /><br />
<select name="operazione">
<option value ="disattiva">Disattiva</option>
<option value ="attiva">Attiva</option>
</select>
<input type = 'submit' value = 'Modifica'></p>
</form>
<?php
if(!empty($_POST['operazione'])) {
if($_POST['operazione'] == 'attiva') {
mysql_query("UPDATE `". __PREFIX__ ."settings` SET block_register = '0'")or _err(mysql_error());
print '<script>alert("Iscrizioni/Registrazioni ATTIVATE!"); window.location="admin.php";</script>';
}elseif($_POST['operazione'] == 'disattiva') {
mysql_query("UPDATE `". __PREFIX__ ."settings` SET block_register = '1'")or _err(mysql_error());
print '<script>alert("Iscrizioni/Registrazioni DISATTIVATE!"); window.location="admin.php";</script>';
}
}
break;
case 9: ?>
<form action="dump.php" method="POST">
<br />Opzioni per il Dump:
<table border="0">
<tr>
<td>Drop table statement: </td>
<td><input type="checkbox" name="sql_drop_table" <?php if(isset($_REQUEST['action']) && ! isset($_REQUEST['sql_drop_table'])) ; else print 'checked' ?> /></td>
</tr>
<tr>
<td>Create table statement: </td>
<td><input type="checkbox" name="sql_create_table" <?php if(isset($_REQUEST['action']) && ! isset($_REQUEST['sql_create_table'])) ; else print 'checked' ?> /></td>
</tr>
<tr>
<td>Table data: </td>
<td><input type="checkbox" name="sql_table_data" <?php if(isset($_REQUEST['action']) && ! isset($_REQUEST['sql_table_data'])) ; else print 'checked' ?>/></td>
</tr>
</table>
<input type="submit" name="esegui_backup" value="Backup"><br />
</form>
<?php
break;
case 10:
@$oggetto = clear ($_POST['oggetto']);
@$messaggio = clear ($_POST['messaggio']);
$config = mysql_fetch_array(mysql_query("SELECT site_name, description FROM ". __PREFIX__ ."settings"));
if(($oggetto) && ($messaggio)) {
$query = "SELECT email ". __PREFIX__ ."users";
$res = mysql_query($query) or _err(mysql_error());
$emails = 0;
while($email = mysql_fetch_row($res)) {
$headers = "From: ".$config['site_name'];
mail($email[0], $oggetto, $messaggio, $headers);
$emails++;
}
print "<script>alert(\"Inviate ".$emails."\"); window.location=\"admin.php\";</script>";
}else{
print "<form method='POST' action='admin.php?mode=10'>\n
<table>\n
<tr>\n
<td>Oggetto</td>\n
</tr>\n
<tr>\n
<td><input name='oggetto' type='text' size='50'/></td>\n
</tr>\n
<tr>\n
<td>Messaggio</td>\n
</tr>\n
<tr>\n
<td>\n
<textarea rows='20' cols='100' name='text'/>\n\n\n\n
--------------------------------------------
News-Letter dal sito ".$config['site_name']."\n
http://www.".$_SERVER['SERVER_NAME']."</textarea>\n
</td>\n
</tr>\n
<tr>\n
<td><input type='submit' value='Invia'/></td>\n
</tr>\n
</table>\n
</form>\n";
}
break;
case '11':
check_version();
break;
case '12':
@$site_name = clear ($_POST ['site_name']);
@$description = clear ($_POST ['description']);
if (($site_name) && ($description)) {
$query = "UPDATE ". __PREFIX__ ."settings SET site_name = '".$site_name."', description = '".$description."'";
mysql_query ($query) or _err(mysql_error());
header ("Location: admin.php?mode=12");
}else {
$config = mysql_fetch_array(mysql_query("SELECT site_name, description FROM ". __PREFIX__ ."settings"));
?>
<br /><b>Aggiorna Settaggi:</b><p>
<form method = 'POST' action = 'admin.php?mode=12'>
<br />
<table>
<tr><td>Titolo Board:</td><td><input name = 'site_name' value = '<?php print $config['site_name']; ?>' size="50"></td></tr>
<tr><td>Descrizione:</td><td><input name = 'description' value = '<?php print $config['description']; ?>' size="50"></td></tr>
</table>
<input type = 'submit' value = 'Aggiorna'>
</form>
<?php
}
break;
case '13':
if(@$_GET['reset'] == 1) {
mysql_query("UPDATE ". __PREFIX__ ."users SET theme = 'default.css'") or _err(mysql_error());
print "\n<script>alert(\"Reset Completato\"); window.location=\"admin.php\";</script>";
}
print "<script>"
. "\n\tif(confirm('Sei sicuro di voler procedere al reset del tema per tutti gli utenti?.') == true) {"
. "\n\t\tlocation.href = 'admin.php?mode=13&reset=1'"
. "\n\t}else{"
. "\n\t\tlocation.href = 'admin.php'"
. "\n\t}"
. "\n</script>";
break;
case '14':
@$username = clear ($_POST ['username']);
if ($username) {
$query = "SELECT id, level FROM ". __PREFIX__ ."users WHERE username = '". $username ."'";
$row = mysql_fetch_row (mysql_query ($query));
if (!$row [0])
_err("Errore! L'Username Specificato non esiste!");
if($row[0] == nick2uid($usr))
_err("Errore! L'utente selezionato è già VIP!");
if ($row [1] == 'vip')
$query = "UPDATE ". __PREFIX__ ."users SET level = 'user' WHERE id = '". $row[0] ."'";
else
$query = "UPDATE ". __PREFIX__ ."users SET level = 'vip' WHERE id = '". $row[0] ."'";
mysql_query ($query) or _err(mysql_error());
header ("Location: admin.php?mode=14");
}else {
?>
<form action = 'admin.php?mode=14' method = 'POST'>
<br /><b>Gestione dei permessi per Utenti VIP:</b>
<p>Aggiungi/Rimuovi un' utente VIP(Basta scrivere l'username): <input name = 'username'><br />
<input type = 'submit' value = 'Invia'>
</form>
<br /><br />
<?php
}
print "<b>Utenti VIP:</b><p>\n";
$query = "SELECT id, username FROM ". __PREFIX__ ."users WHERE level = 'vip'";
$res = mysql_query ($query) or _err(mysql_error());
while ($row = mysql_fetch_row ($res))
print "<a href = 'profile.php?id=".$row [0]."'>".$row [1]."</a><br />";
break;
case '15':
@$position = (int) $_GET ['position'];
@$real_position = (int) $_GET ['real_position'];
@$f_id = (int) $_GET ['f_id'];
if(($position) && ($f_id) && ($real_position)) {
// nuova posizione
$new_position = $real_position + $position;
$query = "UPDATE ". __PREFIX__ ."forum SET position = ".$real_position." WHERE position = ".$new_position;
$res = mysql_query ($query) or _err(mysql_error());
$query = "UPDATE ".__PREFIX__."forum SET position = ".$new_position." WHERE id = ".$f_id;
$res = mysql_query ($query) or _err(mysql_error());
header ("Location: admin.php?mode=15");
}else {
print "\n<h2 align=\"center\">Posizionamento dei Forum</h2><br /><br />"
. "\n<table align=\"center\">"
. "\n<tr>"
. "\n\t<td class=\"users\"> Titolo</td>"
. "\n\t<td class=\"users\">Descrizione</td>"
. "\n\t<td class=\"users\">Sposta</td>"
. "\n</tr>";
$query = "SELECT * FROM ". __PREFIX__ ."forum ORDER BY position";
$res = mysql_query ($query) or _err(mysql_error());
while ($row = mysql_fetch_array ($res)) {
print "\n<tr>"
. "\n\t<td class=\"users\">".$row['title']."</td>"
. "\n\t<td class=\"users\">".$row['description']."</td>"
. "\n\t<td class=\"users\"><a href=\"admin.php?mode=15&position=-1&f_id=".$row['id']."&real_position=".$row['position']."\">[SU]</a> -"
. "\n\t<a href=\"admin.php?mode=15&position=1&f_id=".$row['id']."&real_position=".$row['position']."\">[GIU]</a></td>"
. "\n</tr>";
}
print "\n</table>";
}
break;
default;
?>
<p><b>Pannello di Controllo Amministratore:</b></p>
-> <a href = 'admin.php?mode=1'>Gestione Forums</a><br />
-> <a href = 'admin.php?mode=15'>Gestione Posizione Forums</a><br />
-> <a href = 'admin.php?mode=2'>Aggiungi/Rimuovi Amministratori</a><br />
-> <a href = 'admin.php?mode=5'>Aggiungi/Rimuovi Moderatori</a><br />
-> <a href = 'admin.php?mode=14'>Aggiungi/Rimuovi Utenti VIP</a><br />
-> <a href = 'admin.php?mode=3'>Cancella Utente</a><br />
-> <a href = 'admin.php?mode=4'>Banna Utente</a><br />
-> <a href = 'admin.php?mode=6'>Banna IP</a><br />
<br /><br />
<p><b>Strumenti di Sistema</b></p>
-> <a href = 'admin.php?mode=7'>Modalità "Manutenzione"</a><br />
-> <a href = 'admin.php?mode=8'>Attiva/Disattiva Registrazioni</a><br />
-> <a href = 'admin.php?mode=9'>Effettua un backup del Database</a><br />
-> <a href = 'admin.php?mode=10'>Manda una NewsLetter a tutti gli utenti registrati</a><br />
<br />
<p><b>Settaggi</b></p>
-> <a href = 'admin.php?mode=12'>Gestione Settaggi Board</a><br />
<br />
<p><b>TOOLS</b></p>
-> <a href = 'admin.php?mode=11'>Controlla Versione 0xBB</a><br />
-> <a href = 'admin.php?mode=13'>Resetta Tema per tutti gli utenti</a><br />
<?php
break;
}
?>
</div>
</div>
<?php
footer();
?>
</body>
</html>