-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmemberlist.php
More file actions
187 lines (159 loc) · 7.36 KB
/
memberlist.php
File metadata and controls
187 lines (159 loc) · 7.36 KB
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
<?php
error_reporting(E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_ERROR | E_CORE_ERROR | E_PARSE | E_USER_WARNING | E_USER_ERROR);
$notification_back_link = '<br> <a href="#" onclick="history.go(-1);">Go back</a> OR <a href="./">Go to board index</a>';
if (file_exists("settings.php")) {
include_once "settings.php";
} else {
die(file_get_contents("./install/InstallerReq.html"));
}
include_once "./lib/funcs.php";
include_once "./lib/groups.php";
include_once "./lib/users.php";
include_once "./globals.php";
include_once "./lib/login.php";
include_once "./lib/view_forum.php";
include_once "./lib/view_topic.php";
include_once "./lib/tobase.php";
include_once "./lib/bbcode.php";
include_once "./lib/permissions.php";
include_once "./lib/forms.php";
include_once "./lib/render.php";
include_once "./lib/lng/english.php";
include_once './lib/security.php';
sanitarize_input();
pre_checks();
define_user();
$forum_links = get_allowed_forums("0");
check_empty_site();
post_checks();
define_forum_permissions();
render_search();
render_acp_links();
generate_og_tags();
render_mobile_css();
render_back_link();
render_forum_path();
render_last_update();
define_bbcodes();
$login_form = get_login_form();
$load = array('File');
if (!has_permission($current_user['permissions']['global'], 'u_view_members')) {
render_acp_links();
generate_og_tags();
render_mobile_css();
$login_form = get_login_form();
$load = array('File');
$acp_action = "./theme/" . $site_settings['template'] . "/ucp/failure_module.html";
$notification = "You do not have permission to view member list";
$content = file_get_contents("./theme/" . $site_settings['template'] . "/main.html");
$content = str_replace("{title}", $site_settings['site_name'], $content);
$content = str_replace("{INJECT_FILE}", $acp_action, $content);
$content = template_replace($content, $load);
print($content);
exit();
}
$acp_action = "./theme/" . $site_settings['template'] . "/ucp/memberlist.html";
$notification = $language['notifications']['unknown_action'] . $notification_back_link;
if (isset($_GET['g'])) {
$user_list = get_table_contents("", "", "", False, "SELECT username, users.user_id, user_join_date, user_facebook, user_email, last_active, ranks.image, description, groups.name AS gname, ranks.name AS rname, user_show_mail, user_show_facebook, user_avatar, user_color, r2.image AS r2img, r2.name AS r2name, user_post_count, groups.rank AS grank FROM users
LEFT JOIN ranks
ON ranks.id = users.user_rank
LEFT JOIN groups
ON groups.id = users.user_default_group
LEFT JOIN ranks AS r2
ON groups.rank = r2.id
LEFT JOIN user_groups
ON user_groups.user_id = users.user_id
WHERE user_password != '' AND user_group_id = '" . $_GET['g'] . "'", array("user_join_date", "last_active"));
$group_data = group_get_info_by_id($_GET['g']);
} else {
$user_list = get_table_contents("", "", "", False, "SELECT username, user_id, user_join_date, user_facebook, user_email, last_active, ranks.image, description, groups.name AS gname, ranks.name AS rname, user_show_mail, user_show_facebook, user_avatar, user_color, r2.image AS r2img, r2.name AS r2name, user_post_count, groups.rank AS grank FROM users
LEFT JOIN ranks
ON ranks.id = users.user_rank
LEFT JOIN groups
ON groups.id = users.user_default_group
LEFT JOIN ranks AS r2
ON groups.rank = r2.id
WHERE user_password != ''", array("user_join_date", "last_active"));
}
$member_rows = "";
$root = ".";
if ($_GET["ajax"] == "1") {
$root = "..";
}
for ($i = 0; $i < count($user_list); $i++) {
$user_list[$i]['user_email'] = str_replace("@", " [at] ", $user_list[$i]['user_email']);
$user_list[$i]['user_facebook'] = '<a href="https://www.facebook.com/' . $user_list[$i]['user_facebook'] . '">' . $user_list[$i]['user_facebook'] . '</a>';
if ($user_list[$i]['user_show_facebook'] != "1") {
$user_list[$i]['user_facebook'] = "hidden";
}
if ($user_list[$i]['user_show_mail'] != "1") {
$user_list[$i]['user_email'] = "hidden";
}
if ($user_list[$i]['image'] != "") {
$user_list[$i]['user_rankimage'] = '<img src="./ranks/' . $user_list[$i]['image'] . '">';
} else {
$user_list[$i]['user_rankimage'] = "";
}
if ($user_list[$i]['user_avatar'] == "") {
$user_list[$i]['user_avatar'] = $root . '/theme/' . $site_settings['template'] . "/icons/default_profile.png";
}
$user_list[$i]['user_avatar'] = '<img style="max-width: 32px; max-height: 32px;" src="' . $user_list[$i]['user_avatar'] . '">';
$user_list[$i]['rank'] = "";
if ($user_list[$i]['rname'] != "") {
$user_list[$i]['rank'] = $user_list[$i]['rname'];
} else {
if ($user_list[$i]['grank'] > 0) {
$user_list[$i]['rank'] = $user_list[$i]['r2name'];
if ($user_list[$i]['r2img'] != "") {
$user_list[$i]['user_rankimage'] = '<img src="' . $root . '/ranks/' . $user_list[$i]['r2img'] . '">';
}
} else {
if ($user_list[$i]['description'] != "") {
$user_list[$i]['rank'] = $user_list[$i]['description'];
}
}
}
if ($user_list[$i]['user_rankimage'] != "") {
$user_list[$i]['rank'] = $user_list[$i]['user_rankimage'] . "<br>" . $user_list[$i]['rank'];
}
if ($user_list[$i]['user_color'] == "") {
$user_list[$i]['user_color'] = "inherit";
}
$select = "";
$select_head = "";
if (isset($_GET['mode'])) {
if ($_GET['mode'] == "one") {
$select = '<td><input type="button" value="Select" onclick="selectUser(\'' . str_replace("'", "\'", $user_list[$i]['username']) . '\')"></td>';
} elseif ($_GET['mode'] == "many") {
$select = '<td><input type="checkbox" name="' . str_replace('"', '\"', $user_list[$i]['username']) . '"></td>';
}
}
$member_rows .= '<tr>' . $select . '<td>' . $user_list[$i]['user_avatar'] . '</td><td><a style="color: ' . $user_list[$i]['user_color'] . '" href="' . $root . '/profile.php?uid=' . $user_list[$i]['user_id'] . '">' . $user_list[$i]['username'] . '</a></td><td>' . $user_list[$i]['rank'] . '</td><td>' . $user_list[$i]['user_post_count'] . '</td><td>' . $user_list[$i]['user_join_date'] . '</td><td>' . $user_list[$i]['last_active'] . '</td><td>' . $user_list[$i]['user_email'] . '</td><td>' . $user_list[$i]['user_facebook'] . '</td></tr>';
}
$select_head = isset($_GET['mode']) ? "<td><b>Select</b></td>" : "";
$sel_btn = isset($_GET['mode']) && $_GET['mode'] == "many" ? '<button onclick="selectUsers();" >Select users</button>' : "";
$list_color = "inherit";
$list_name = "All members";
if (isset($_GET['g'])) {
$list_name = $group_data[0]['name'];
if ($group_data[0]['color'] != "") {
$list_color = $group_data[0]['color'];
}
}
if ($_GET["ajax"] == "1") {
$content = file_get_contents("./theme/" . $site_settings['template'] . "/ucp/memberlist.html");
$content = template_replace($content, $load);
print($content);
//line 790
} else {
$OG_TAGS .= generate_og_tags();
//end
$content = file_get_contents("./theme/" . $site_settings['template'] . "/main.html");
$content = str_replace("{title}", $site_settings['site_name'], $content);
$content = str_replace("{INJECT_FILE}", $acp_action, $content);
$milliseconds2 = round(microtime(true) * 1000);
$generation_time = ($milliseconds2 - $milliseconds) / 1000;
$content = template_replace($content, $load);
print($content);
}