-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathviewuser.php
More file actions
150 lines (126 loc) · 4.56 KB
/
viewuser.php
File metadata and controls
150 lines (126 loc) · 4.56 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
<?php
require('checkallowed.php'); // Check logged-in
$url_id = $GPXIN['id'];
// Get user info
$result_usr = $GLOBALS['mysqli']->query("SELECT
first_name,
last_name,
username,
theme,
language,
email_address
FROM users
WHERE
id = '$url_id'
LIMIT 1") or die('Failed to query for user details: '.$GLOBALS['mysqli']->error);
while($row_usr = $result_usr->fetch_array())
{
$usr_fname = $row_usr['first_name'];
$usr_lname = $row_usr['last_name'];
$usr_usrname = $row_usr['username'];
$usr_theme = $row_usr['theme'];
$usr_lang = $row_usr['language'];
$usr_email = $row_usr['email_address'];
}
$tab = 'info';
include(DOCROOT.'/ajax/user_tabs.php');
?>
<div class="infobox" style="display:none;"></div>
<div class="box" style="width:750px;">
<div class="box_title" id="box_servers_title"><?php echo $lang['info']; ?></div>
<div class="box_content" id="box_servers_content">
<table border="0" cellpadding="2" cellspacing="0" width="700" class="cfg_table" style="margin-top:20px;">
<tr>
<td width="180"><b><?php echo $lang['delete']; ?>:</b></td>
<td><span class="links" onClick="javascript:user_confirm_delete(<?php echo $url_id; ?>);"><?php echo $lang['click_here']; ?></span></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td><b><?php echo $lang['username']; ?>:</b></td>
<td><input type="text" value="<?php echo $usr_usrname; ?>" id="usr_username" class="inputs" /></td>
</tr>
<tr>
<td><b><?php echo $lang['language']; ?>:</b></td>
<td>
<select id="usr_language" class="dropdown">
<?php
// No lang yet
if(empty($usr_lang)) echo '<option value="" selected>'.$lang['none'].'</option>';
// List everything in the 'languages/' dir
if ($handle = opendir(DOCROOT.'/languages'))
{
while(false !== ($entry = readdir($handle)))
{
// Loop over PHP language files
if(preg_match('/\.php$/i', $entry) && $entry != 'index.php')
{
$opt_val = str_replace('.php', '', $entry);
if($usr_lang == $opt_val) echo '<option value="'.$opt_val.'" selected>'.ucwords($opt_val).'</option>';
else echo '<option value="'.$opt_val.'">'.ucwords($opt_val).'</option>';
}
}
closedir($handle);
}
?>
</select>
</td>
</tr>
<tr>
<td><b><?php echo $lang['theme']; ?>:</b></td>
<td>
<select id="usr_theme" class="dropdown">
<?php
// List everything in the '/themes' dir
if ($handle = opendir(DOCROOT.'/themes'))
{
while(false !== ($entry = readdir($handle)))
{
// Loop over themes
if($entry != 'index.php' && !preg_match('/^\./', $entry) && !preg_match('/\.css$/i', $entry))
{
if($usr_theme == $entry) echo '<option value="'.$entry.'" selected>'.ucwords($entry).'</option>';
else echo '<option value="'.$entry.'">'.ucwords($entry).'</option>';
}
}
closedir($handle);
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td><b><?php echo $lang['newpassword']; ?>:</b></td>
<td><input type="password" id="usr_pass1" class="inputs" /></td>
</tr>
<tr>
<td><?php echo $lang['newpassword_conf']; ?>:</td>
<td><input type="password" id="usr_pass2" class="inputs" /></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td><b><?php echo $lang['email_address']; ?>:</b></td>
<td><input type="text" value="<?php echo $usr_email; ?>" id="usr_email" class="inputs" /></td>
</tr>
<tr>
<td><b><?php echo $lang['first_name']; ?>:</b></td>
<td><input type="text" value="<?php echo $usr_fname; ?>" id="usr_fname" class="inputs" /></td>
</tr>
<tr>
<td><b><?php echo $lang['last_name']; ?>:</b></td>
<td><input type="text" value="<?php echo $usr_lname; ?>" id="usr_lname" class="inputs" /></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
</div>
<div align="center">
<div class="button" onClick="javascript:user_save(<?php echo $url_id; ?>);"><?php echo $lang['save']; ?></div>
</div>