account_edit_form.php 4.03 KB
Newer Older
1
<?php if ($A == "UpdateAccount"): ?>
2
<form id="edit-profile-form" action="<?= get_user_uri($U) . 'update/'; ?>" method="post">
3
<?php else: ?>
4
<form id="edit-profile-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
		<?php endif; ?>
	</fieldset>
13
14
15
16
17
	<fieldset>
		<p>
			<label for="id_username"><?= __("Username") ?>:</label>
			<input type="text" size="30" maxlength="64" name="U" id="id_username" value="<?= htmlspecialchars($U,ENT_QUOTES) ?>" /> (<?= __("required") ?>)
		</p>
18
19
		<?php
		# Only TUs or Devs can promote/demote/suspend a user
Lukas Fleischer's avatar
Lukas Fleischer committed
20
		if (has_credential(CRED_ACCOUNT_CHANGE_TYPE)):
21
		?>
22
23
24
		<p>
			<label for="id_type"><?= __("Account Type") ?>:</label>
			<select name="T" id="id_type">
25
				<?php if ($T == 1): ?>
26
				<option value="1" selected="selected"><?= __("Normal user") ?></option>
27
				<?php else: ?>
28
				<option value="1"><?= __("Normal user") ?></option>
29
				<?php endif; ?>
30
				<?php if ($T == 2): ?>
31
				<option value="2" selected="selected"><?= __("Trusted user") ?></option>
32
				<?php else: ?>
33
				<option value="2"><?= __("Trusted user") ?></option>
34
				<?php endif; ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
35
				<?php if (has_credential(CRED_ACCOUNT_EDIT_DEV)): ?>
36
				<option value="3"
37
				<?php $T == 3 ? print " selected=\"selected\">" : print ">";
38
				print __("Developer")."\n"; ?>
39
				</option>
40
41
42
43
				<option value="4"
				<?php $T == 4 ? print " selected=\"selected\">" : print ">";
				print __("Trusted User & Developer")."\n"; ?>
				</option>
44
				<?php endif; ?>
45

46
47
			</select>
		</p>
48

49
50
		<p>
			<label for="id_suspended"><?= __("Account Suspended") ?>:</label>
51
			<?php if ($S): ?>
52
			<input type="checkbox" name="S" id="id_suspended" checked="checked" />
53
			<?php else: ?>
54
			<input type="checkbox" name="S" id="id_suspended" />
55
			<?php endif; ?>
56
		</p>
57
58
		<?php endif; ?>

59
60
61
62
63
		<p>
			<label for="id_inactive"><?= __("Inactive") ?>:</label>
			<input type="checkbox" name="J" id="id_inactive" <?= $J ? 'checked="checked"' : '' ?> />
		</p>

64
65
66
67
		<p>
			<label for="id_email"><?= __("Email Address") ?>:</label>
			<input type="text" size="30" maxlength="64" name="E" id="id_email" value="<?= htmlspecialchars($E,ENT_QUOTES) ?>" /> (<?= __("required") ?>)
		</p>
68

69
		<?php if ($A == "UpdateAccount"): ?>
70
71
		<p>
			<label for="id_passwd1"><?= __("Password") ?>:</label>
72
			<input type="password" size="30" name="P" id="id_passwd1" value="<?= $P ?>" />
73
		</p>
74

75
76
		<p>
			<label for="id_passwd2"><?= __("Re-type password") ?>:</label>
77
			<input type="password" size="30" name="C" id="id_passwd2" value="<?= $C ?>" />
78
		</p>
79
		<?php endif; ?>
80

81
82
83
84
		<p>
			<label for="id_realname"><?= __("Real Name") ?>:</label>
			<input type="text" size="30" maxlength="32" name="R" id="id_realname" value="<?= htmlspecialchars($R,ENT_QUOTES) ?>" />
		</p>
85

86
87
88
89
		<p>
			<label for="id_irc"><?= __("IRC Nick") ?>:</label>
			<input type="text" size="30" maxlength="32" name="I" id="id_irc" value="<?= htmlspecialchars($I,ENT_QUOTES) ?>" />
		</p>
90

91
92
93
94
		<p>
			<label for="id_pgp"><?= __("PGP Key Fingerprint") ?>:</label>
			<input type="text" size="30" maxlength="50" name="K" id="id_pgp" value="<?= html_format_pgp_fingerprint($K) ?>" />
		</p>
95

96
97
98
		<p>
			<label for="id_language"><?= __("Language") ?>:</label>
			<select name="L" id="id_language">
99
100
101
102
<?php
	reset($SUPPORTED_LANGS);
	while (list($code, $lang) = each($SUPPORTED_LANGS)) {
		if ($L == $code) {
103
			print "<option value=\"".$code."\" selected=\"selected\"> ".$lang."</option>"."\n";
104
		} else {
105
			print "<option value=\"".$code."\"> ".$lang."</option>"."\n";
106
107
108
		}
	}
?>
109
110
			</select>
		</p>
111

112
113
114
115
116
117
118
119
120
121
		<p>
			<label></label>
			<?php if ($A == "UpdateAccount"): ?>
			<input type="submit" class="button" value="<?= __("Update") ?>" /> &nbsp;
			<?php else: ?>
			<input type="submit" class="button" value="<?= __("Create") ?>" /> &nbsp;
			<?php endif; ?>
			<input type="reset" class="button" value="<?= __("Reset") ?>" />
		</p>
	</fieldset>
122
</form>