[go: up one dir, main page]

Menu

[r99]: / tags / 1.3 / account.php  Maximize  Restore  History

Download this file

69 lines (63 with data), 2.2 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
<?php
# $Id: account.php 86 2010-10-05 12:19:27Z rediculum $
#
# Includes
####################################################################
include("includes/session.inc.php");
include("includes/layout.inc.php");
include("includes/functions.inc.php");
include("includes/db.inc.php");
include("includes/variables.inc.php");
# Main
#####################################################################?>
<html>
<head>
<?php echo "$headtitle $head";?>
</head>
<body>
<?php echo "<b>$account $settings $from $activeuser:</b>";?>
<p>
<?php if (isset($_REQUEST[submitpw])) {
if ($_REQUEST[password1] != $_REQUEST[password2])
echo "<font color=red>$password $wrong</font>";
elseif ($_REQUEST[password1] == "")
echo "<font color=red>$password $may_not_empty</font>";
else {
echo "<font color=green> $password $set</font>";
$passwort = md5($_REQUEST[password1]);
mysql_query("UPDATE users SET password='$passwort' WHERE username='$activeuser'");
}
} elseif (isset($_REQUEST[submitlang])) {
echo "<font color=green> $language $set</font>";
mysql_query("UPDATE users SET language='$_REQUEST[lang]' WHERE username='$activeuser'");
}?>
<form method="post" action=<?php $PHP_SELF;?>>
<?php echo "2x $new_s $password: ";?><br>
<input type=password name=password1 size=8>&nbsp;
<input type=password name=password2 size=8><p>
<input type=submit class=button_click name=submitpw value=<?php echo $save;?>>
</form>
</td></tr>
<hr>
<tr><td>
<?php $mylangarr = mysql_fetch_row(mysql_query("SELECT language FROM users WHERE username='$activeuser'"));
$availlangs = array_diff(scandir('languages'), Array('.','..')); # Scan directory and exlude . and ..
$mylang = $mylangarr[0];
?>
<form method="post" action=<?php $PHP_SELF;?>>
<?php echo "$language: ";?><br>
<select name="lang">
<?php foreach ($availlangs as $availlang) {
$lang = substr("$availlang",0,2); # Cut the first 2 chars
if ($mylang == $lang)
echo "<option selected value=$mylang>$mylang</option>";
else
echo "<option value=$lang>$lang</option>";
}?>
</select><p>
<input type=submit class=button_click name=submitlang value=<?php echo $save;?>>
</form>
<p>
</td></tr>
</table>
</html>