account_edit_form.php 3.97 KB
Newer Older
1
<?php if ($A == "UpdateAccount"): ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
2
<form action="<?= get_user_uri($U) . 'update/'; ?>" method="post">
3
<?php else: ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
4
<form action="<?= get_uri('/register/'); ?>" method="post">
5
<?php endif; ?>
6
	<fieldset>
Lukas Fleischer's avatar
Lukas Fleischer committed
7
		<input type="hidden" name="Action" value="<?= $A ?>" />
8
		<?php if ($UID): ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
9
10
		<input type="hidden" name="ID" value="<?= $UID ?>" />
		<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
11
12
13
14
15
16
17
18
		<?php endif; ?>
	</fieldset>
	<table>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>

		<tr>
Lukas Fleischer's avatar
Lukas Fleischer committed
19
20
			<td align="left"><?= __("Username") ?>:</td>
			<td align="left"><input type="text" size="30" maxlength="64" name="U" value="<?= htmlspecialchars($U,ENT_QUOTES) ?>" /> (<?= __("required") ?>)</td>
21
22
23
24
25
26
		</tr>
		<?php
		# Only TUs or Devs can promote/demote/suspend a user
		if ($UTYPE == "Trusted User" || $UTYPE == "Developer"):
		?>
		<tr>
Lukas Fleischer's avatar
Lukas Fleischer committed
27
			<td align="left"><?= __("Account Type") ?>:</td>
28
29
30
			<td align="left">
				<select name=T>
					<?php if ($T == "User"): ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
31
					<option value="1" selected><?= __("Normal user") ?>
32
					<?php else: ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
33
					<option value="1"><?= __("Normal user") ?>
34
35
					<?php endif; ?>
					<?php if ($T == "Trusted User"): ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
36
					<option value="2" selected><?= __("Trusted user") ?>
37
					<?php else: ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
38
					<option value="2"><?= __("Trusted user") ?>
39
40
41
42
43
44
45
46
47
48
49
50
51
52
					<?php endif; ?>
					<?php
					# Only developers can make another account a developer
					if ($UTYPE == "Developer"):
					?>
					<option value="3"
					<?php $T == "Developer" ? print " selected>" : print ">";
					print __("Developer")."\n"; ?>
					<?php endif; ?>
				</select>
			</td>
		</tr>

		<tr>
Lukas Fleischer's avatar
Lukas Fleischer committed
53
			<td align="left"><?= __("Account Suspended") ?>:</td>
54
55
56
57
58
59
60
61
62
63

			<?php if ($S): ?>
			<td align="left"><input type="checkbox" name="S" checked="checked" />
			<?php else: ?>
			<td align="left"><input type="checkbox" name="S" />
			<?php endif; ?>
		</tr>
		<?php endif; ?>

		<tr>
Lukas Fleischer's avatar
Lukas Fleischer committed
64
65
			<td align="left"><?= __("Email Address") ?>:</td>
			<td align="left"><input type="text" size="30" maxlength="64" name="E" value="<?= htmlspecialchars($E,ENT_QUOTES) ?>" /> (<?= __("required") ?>)</td>
66
67
68
		</tr>

		<tr>
Lukas Fleischer's avatar
Lukas Fleischer committed
69
			<td align="left"><?= __("Password") ?>:</td>
70
			<td align="left">
Lukas Fleischer's avatar
Lukas Fleischer committed
71
				<input type="password" size="30" maxlength="32" name="P" value="<?= $P ?>" />
72
73
74
75
76
77
78
				<?php if ($A != "UpdateAccount"):
					print " (".__("required").")";
				endif; ?>
			</td>
		</tr>

		<tr>
Lukas Fleischer's avatar
Lukas Fleischer committed
79
			<td align="left"><?= __("Re-type password") ?>:</td>
80
			<td align="left">
Lukas Fleischer's avatar
Lukas Fleischer committed
81
				<input type="password" size="30" maxlength="32" name="C" value="<?= $C ?>" />
82
83
84
85
86
87
88
				<?php if ($A != "UpdateAccount"):
					print " (".__("required").")";
				endif; ?>
			</td>
		</tr>

		<tr>
Lukas Fleischer's avatar
Lukas Fleischer committed
89
			<td align="left"><?= __("Real Name") ?>:</td>
90
			<td align="left">
Lukas Fleischer's avatar
Lukas Fleischer committed
91
				<input type="text" size="30" maxlength="32" name="R" value="<?= htmlspecialchars($R,ENT_QUOTES) ?>" />
92
93
94
95
			</td>
		</tr>

		<tr>
Lukas Fleischer's avatar
Lukas Fleischer committed
96
			<td align="left"><?= __("IRC Nick") ?>:</td>
97
			<td align="left">
Lukas Fleischer's avatar
Lukas Fleischer committed
98
				<input type="text" size="30" maxlength="32" name="I" value="<?= htmlspecialchars($I,ENT_QUOTES) ?>" />
99
100
101
102
			</td>
		</tr>

		<tr>
Lukas Fleischer's avatar
Lukas Fleischer committed
103
			<td align="left"><?= __("PGP Key Fingerprint") ?>:</td>
104
<td align="left">
Lukas Fleischer's avatar
Lukas Fleischer committed
105
				<input type="text" size="30" maxlength="50" name="K" value="<?= html_format_pgp_fingerprint($K) ?>" />
106
107
108
109
			</td>
		</tr>

		<tr>
Lukas Fleischer's avatar
Lukas Fleischer committed
110
			<td align="left"><?= __("Language") ?>:</td>
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
			<td align="left">
				<select name=L>
<?php
	reset($SUPPORTED_LANGS);
	while (list($code, $lang) = each($SUPPORTED_LANGS)) {
		if ($L == $code) {
			print "<option value=".$code." selected> ".$lang."\n";
		} else {
			print "<option value=".$code."> ".$lang."\n";
		}
	}
?>
				</select>
			</td>
		</tr>

		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td align="left">
				<?php if ($A == "UpdateAccount"): ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
134
				<input type="submit" class="button" value="<?= __("Update") ?>" /> &nbsp;
135
				<?php else: ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
136
				<input type="submit" class="button" value="<?= __("Create") ?>" /> &nbsp;
137
				<?php endif; ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
138
				<input type="reset" class="button" value="<?= __("Reset") ?>" />
139
140
141
142
143
			</td>
		</tr>

	</table>
</form>