summaryrefslogtreecommitdiff
path: root/web/template/account_edit_form.php
blob: 7da8e337f7166004e0e99ce5af851af1562303fa (plain)
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
<form action="<?php echo get_uri('/account/'); ?>" method="post">
	<fieldset>
		<input type="hidden" name="Action" value="<?php echo $A ?>" />
		<?php if ($UID): ?>
		<input type="hidden" name="ID" value="<?php echo $UID ?>" />
		<input type="hidden" name="token" value="<?php print htmlspecialchars($_COOKIE['AURSID']) ?>" />
		<?php endif; ?>
	</fieldset>
	<table>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>

		<tr>
			<td align="left"><?php echo __("Username") ?>:</td>
			<td align="left"><input type="text" size="30" maxlength="64" name="U" value="<?php echo htmlspecialchars($U,ENT_QUOTES) ?>" /> (<?php echo __("required") ?>)</td>
		</tr>
		<?php
		# Only TUs or Devs can promote/demote/suspend a user
		if ($UTYPE == "Trusted User" || $UTYPE == "Developer"):
		?>
		<tr>
			<td align="left"><?php echo __("Account Type") ?>:</td>
			<td align="left">
				<select name=T>
					<?php if ($T == "User"): ?>
					<option value="1" selected><?php echo __("Normal user") ?>
					<?php else: ?>
					<option value="1"><?php echo __("Normal user") ?>
					<?php endif; ?>
					<?php if ($T == "Trusted User"): ?>
					<option value="2" selected><?php echo __("Trusted user") ?>
					<?php else: ?>
					<option value="2"><?php echo __("Trusted user") ?>
					<?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>
			<td align="left"><?php echo __("Account Suspended") ?>:</td>

			<?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>
			<td align="left"><?php echo __("Email Address") ?>:</td>
			<td align="left"><input type="text" size="30" maxlength="64" name="E" value="<?php echo htmlspecialchars($E,ENT_QUOTES) ?>" /> (<?php echo __("required") ?>)</td>
		</tr>

		<tr>
			<td align="left"><?php echo __("Password") ?>:</td>
			<td align="left">
				<input type="password" size="30" maxlength="32" name="P" value="<?php echo $P ?>" />
				<?php if ($A != "UpdateAccount"):
					print " (".__("required").")";
				endif; ?>
			</td>
		</tr>

		<tr>
			<td align="left"><?php echo __("Re-type password") ?>:</td>
			<td align="left">
				<input type="password" size="30" maxlength="32" name="C" value="<?php echo $C ?>" />
				<?php if ($A != "UpdateAccount"):
					print " (".__("required").")";
				endif; ?>
			</td>
		</tr>

		<tr>
			<td align="left"><?php echo __("Real Name") ?>:</td>
			<td align="left">
				<input type="text" size="30" maxlength="32" name="R" value="<?php echo htmlspecialchars($R,ENT_QUOTES) ?>" />
			</td>
		</tr>

		<tr>
			<td align="left"><?php echo __("IRC Nick") ?>:</td>
			<td align="left">
				<input type="text" size="30" maxlength="32" name="I" value="<?php echo htmlspecialchars($I,ENT_QUOTES) ?>" />
			</td>
		</tr>

		<tr>
			<td align="left"><?php echo __("PGP Key Fingerprint") ?>:</td>
<td align="left">
				<input type="text" size="30" maxlength="50" name="K" value="<?php echo html_format_pgp_fingerprint($K) ?>" />
			</td>
		</tr>

		<tr>
			<td align="left"><?php echo __("Language") ?>:</td>
			<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"): ?>
				<input type="submit" class="button" value="<?php echo __("Update") ?>" /> &nbsp;
				<?php else: ?>
				<input type="submit" class="button" value="<?php echo __("Create") ?>" /> &nbsp;
				<?php endif; ?>
				<input type="reset" class="button" value="<?php echo __("Reset") ?>" />
			</td>
		</tr>

	</table>
</form>