forked from devryan/GamePanelX-V3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
142 lines (123 loc) · 4.38 KB
/
settings.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
<?php
require('checkallowed.php'); // Check logged-in
if(!$_SESSION['gpx_perms']['perm_updetails']) die('Sorry, you do not have permission to access this page. Please login and try again.');
// Get user info
$result_usr = @mysql_query("SELECT
theme,
language,
first_name,
last_name,
username,
email_address
FROM users
WHERE
id = '$gpx_userid'
LIMIT 1") or die('Unable to get your settings, please try again later.');
while($row_usr = mysql_fetch_array($result_usr))
{
$usr_theme = $row_usr['theme'];
$usr_lang = $row_usr['language'];
$usr_fname = $row_usr['first_name'];
$usr_lname = $row_usr['last_name'];
$usr_usrname = $row_usr['username'];
$usr_email = $row_usr['email_address'];
}
?>
<div class="infobox" style="display:none;"></div>
<div class="box" style="width:750px;">
<div class="box_title" id="box_servers_title"><?php echo $lang['settings']; ?></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><b><?php echo $lang['username']; ?>:</b></td>
<td><?php echo strip_tags($_SESSION['gpx_username']); ?></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>
<?php
// Check perm
if($_SESSION['gpx_perms']['perm_chpass'])
{
?>
<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>
<?php } ?>
<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>