forked from cunaedy/Kemana-Directory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
76 lines (61 loc) · 2.25 KB
/
profile.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
<?php
// part of qEngine
require "./includes/user_init.php";
$mode = get_param('mode');
switch ($mode) {
case 'logout':
kick_user();
break;
case 'lost':
qvc_init(3);
$tpl_mode = 'lost';
$txt['main_body'] = quick_tpl(load_tpl('lost.tpl'), $txt);
generate_html_header("$config[site_name] $config[cat_separator] Lost Password");
break;
case 'reset':
qvc_init(3);
$tpl_mode = 'reset';
$row['user_id'] = get_param('user_id');
$row['reset'] = get_param('reset');
$txt['main_body'] = quick_tpl(load_tpl('lost.tpl'), $row);
generate_html_header("$config[site_name] $config[cat_separator] Reset Password");
break;
case 'register':
qvc_init(3);
if ($isLogin) {
redir($config['site_url'].'/profile.php');
}
if (!$row = load_form('register')) {
$row = create_blank_tbl($db_prefix.'user');
}
$txt = array_merge($txt, $row);
$txt['main_body'] = quick_tpl(load_tpl('register.tpl'), $txt);
generate_html_header("$config[site_name] $config[cat_separator] Registration");
break;
case 'act':
$row['user_id'] = get_param('user_id');
$row['act'] = get_param('act');
$txt['main_body'] = quick_tpl(load_tpl('act.tpl'), $row);
generate_html_header("$config[site_name] $config[cat_separator] Account Activation");
break;
default:
if (!$isLogin) {
// login form
qvc_init(3);
$profile_mode = 'login';
$redir = get_param('redir');
if (!empty($redir)) {
ip_config_update('redir', html_unentities($redir));
}
$txt['main_body'] = quick_tpl(load_tpl('login.tpl'), $txt);
generate_html_header("$config[site_name] $config[cat_separator] Login");
} else {
// get ID
$res = sql_query("SELECT * FROM ".$db_prefix."user WHERE user_id = '$current_user_id' LIMIT 1");
$row = sql_fetch_array($res);
$txt['main_body'] = quick_tpl(load_tpl('profile.tpl'), $row);
generate_html_header("$config[site_name] $config[cat_separator] My Profile");
}
break;
}
flush_tpl();