forked from GDRCD/GDRCD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
77 lines (50 loc) · 1.92 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
<?php
$dont_check = FALSE;
$check_for_update = TRUE;
require 'header.inc.php';
require 'includes/credits.inc.php';
if ($PARAMETERS['settings']['protection']=='ON')
{
require 'protezione.php';
}
/** * Definizione pagina da visualizzare */
if (!empty($_GET['page']))
$page = gdrcd_filter('include',$_GET['page']);
else
$page = 'index';
/** * Definizione dell'eventuale contenuto interno
* Utile se si vuol mantenere la struttura della homepage quando si aprono i link
*/
if (!empty($_GET['content']))
$content = gdrcd_filter('include',$_GET['content']);
else
$content = 'home';
/** * Algoritmi di base della homepage
*/
/** * Conteggio utenti online
*/
$users = gdrcd_query("SELECT COUNT(nome) AS online FROM personaggio WHERE ora_entrata > ora_uscita AND DATE_ADD(ultimo_refresh, INTERVAL 4 MINUTE) > NOW()");
/** * Procedura di recupero Password
*/
$RP_response = '';
if(!empty($_POST['email']))
{
$newpass = gdrcd_query("SELECT email FROM personaggio WHERE email = '".gdrcd_filter('in',$_POST['email'])."' LIMIT 1", 'result');
if (gdrcd_query($newpass, 'num_rows') > 0)
{
gdrcd_query($newpass, 'free');
$pass = gdrcd_genera_pass();
gdrcd_query("UPDATE personaggio SET pass = '".gdrcd_encript($pass)."' WHERE email = '".gdrcd_filter('in',$_POST['email'])."' LIMIT 1");
$subject = gdrcd_filter('out',$MESSAGE['register']['forms']['mail']['sub'].' '.$PARAMETERS['info']['site_name']);
$text = gdrcd_filter('out',$MESSAGE['register']['forms']['mail']['text'].': '.$pass);
mail($_POST['email'], $subject, $text, 'From: '.$PARAMETERS['info']['webmaster_email']);
$RP_response = gdrcd_filter('out',$MESSAGE['warning']['modified']);
}else
{
$RP_response = gdrcd_filter('out',$MESSAGE['warning']['cant_do']);
}
}
/** * Fine Recupero Password */
include 'themes/'. $PARAMETERS['themes']['current_theme'] .'/home/' . $page . '.php';
require 'footer.inc.php';
?>