account_edit_form.php 8.41 KB
Newer Older
1
<?php if ($A == "UpdateAccount"): ?>
2
<p>
3
	<?= __('Click %shere%s if you want to permanently delete this account.', '<a href="' . get_user_uri($N) . 'delete/' . '">', '</a>') ?>
4
	<?= __('Click %shere%s for user details.', '<a href="' . get_user_uri($N) . '">', '</a>') ?>
5
	<?= __('Click %shere%s to list the comments made by this account.', '<a href="' . get_user_uri($N) . 'comments/' . '">', '</a>') ?>
6
7
</p>

8
<form id="edit-profile-form" action="<?= get_user_uri($N) . 'update/'; ?>" method="post">
9
<?php else: ?>
10
<form id="edit-profile-form" action="<?= get_uri('/register/'); ?>" method="post">
11
<?php endif; ?>
12
	<fieldset>
Lukas Fleischer's avatar
Lukas Fleischer committed
13
		<input type="hidden" name="Action" value="<?= $A ?>" />
14
		<?php if ($UID): ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
15
16
		<input type="hidden" name="ID" value="<?= $UID ?>" />
		<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
17
18
		<?php endif; ?>
	</fieldset>
19
20
21
	<fieldset>
		<p>
			<label for="id_username"><?= __("Username") ?>:</label>
22
			<input type="text" size="30" maxlength="<?= config_get_int('options', 'username_max_len'); ?>" name="U" id="id_username" value="<?= htmlspecialchars($U,ENT_QUOTES) ?>" /> (<?= __("required") ?>)
23
		</p>
24
25
26
		<p>
			<em><?= __("Your user name is the name you will use to login. It is visible to the general public, even if your account is inactive.") ?></em>
		</p>
27
28
		<?php
		# Only TUs or Devs can promote/demote/suspend a user
Lukas Fleischer's avatar
Lukas Fleischer committed
29
		if (has_credential(CRED_ACCOUNT_CHANGE_TYPE)):
30
		?>
31
32
33
		<p>
			<label for="id_type"><?= __("Account Type") ?>:</label>
			<select name="T" id="id_type">
34
				<?php if ($T == 1): ?>
35
				<option value="1" selected="selected"><?= __("Normal user") ?></option>
36
				<?php else: ?>
37
				<option value="1"><?= __("Normal user") ?></option>
38
				<?php endif; ?>
39
				<?php if ($T == 2): ?>
40
				<option value="2" selected="selected"><?= __("Trusted user") ?></option>
41
				<?php else: ?>
42
				<option value="2"><?= __("Trusted user") ?></option>
43
				<?php endif; ?>
Lukas Fleischer's avatar
Lukas Fleischer committed
44
				<?php if (has_credential(CRED_ACCOUNT_EDIT_DEV)): ?>
45
				<option value="3"
46
				<?php $T == 3 ? print " selected=\"selected\">" : print ">";
47
				print __("Developer")."\n"; ?>
48
				</option>
49
50
51
52
				<option value="4"
				<?php $T == 4 ? print " selected=\"selected\">" : print ">";
				print __("Trusted User & Developer")."\n"; ?>
				</option>
53
				<?php endif; ?>
54

55
56
			</select>
		</p>
57

58
59
		<p>
			<label for="id_suspended"><?= __("Account Suspended") ?>:</label>
60
			<?php if ($S): ?>
61
			<input type="checkbox" name="S" id="id_suspended" checked="checked" />
62
			<?php else: ?>
63
			<input type="checkbox" name="S" id="id_suspended" />
64
			<?php endif; ?>
65
		</p>
66
67
		<?php endif; ?>

68
		<?php if ($A == "UpdateAccount"): ?>
69
70
71
72
		<p>
			<label for="id_inactive"><?= __("Inactive") ?>:</label>
			<input type="checkbox" name="J" id="id_inactive" <?= $J ? 'checked="checked"' : '' ?> />
		</p>
73
		<?php endif; ?>
74

75
76
		<p>
			<label for="id_email"><?= __("Email Address") ?>:</label>
77
			<input type="text" size="30" maxlength="254" name="E" id="id_email" value="<?= htmlspecialchars($E,ENT_QUOTES) ?>" /> (<?= __("required") ?>)
78
		</p>
79
80
81
82
		<p>
			<em><?= __("Please ensure you correctly entered your email address, otherwise you will be locked out.") ?></em>
		</p>

83
84
85
86
87
88
89
90
		<p>
			<label for="id_hide"><?= __("Hide Email Address") ?>:</label>
			<input type="checkbox" name="H" id="id_hide" <?= $H ? 'checked="checked"' : '' ?> />
		</p>
		<p>
			<em><?= __("If you do not hide your email address, it is visible to all registered AUR users. If you hide your email address, it is visible to members of the Arch Linux staff only.") ?></em>
		</p>

91
92
93
94
95
96
97
98
		<p>
			<label for="id_backup_email"><?= __("Backup Email Address") ?>:</label>
			<input type="text" size="30" maxlength="254" name="BE" id="id_backup_email" value="<?= htmlspecialchars($BE, ENT_QUOTES) ?>" />
		</p>
		<p>
			<em>
				<?= __("Optionally provide a secondary email address that can be used to restore your account in case you lose access to your primary email address.") ?>
				<?= __("Password reset links are always sent to both your primary and your backup email address.") ?>
99
				<?= __("Your backup email address is always only visible to members of the Arch Linux staff, independent of the %s setting.", "<em>" . __("Hide Email Address") . "</em>") ?>
100
101
102
			</em>
		</p>

103
104
105
106
		<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>
107

108
109
110
111
112
		<p>
			<label for="id_homepage"><?= __("Homepage") ?>:</label>
			<input type="text" size="30" name="HP" id="id_homepage" value="<?= htmlspecialchars($HP,ENT_QUOTES) ?>" />
		</p>

113
114
115
116
		<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>
117

118
119
120
121
		<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>
122

123
124
125
		<p>
			<label for="id_language"><?= __("Language") ?>:</label>
			<select name="L" id="id_language">
126
127
<?php
	reset($SUPPORTED_LANGS);
Lukas Fleischer's avatar
Lukas Fleischer committed
128
	foreach ($SUPPORTED_LANGS as $code => $lang) {
129
		if ($L == $code) {
130
			print "<option value=\"".$code."\" selected=\"selected\"> ".$lang."</option>"."\n";
131
		} else {
132
			print "<option value=\"".$code."\"> ".$lang."</option>"."\n";
133
134
		}
	}
Mark Weiman's avatar
Mark Weiman committed
135
136
137
138
139
140
141
142
?>
			</select>
		</p>
		<p>
			<label for="id_timezone"><?= __("Timezone") ?></label>
			<select name="TZ" id="id_timezone">
<?php
	$timezones = generate_timezone_list();
Lukas Fleischer's avatar
Lukas Fleischer committed
143
	foreach ($timezones as $key => $val) {
Mark Weiman's avatar
Mark Weiman committed
144
145
146
147
148
149
		if ($TZ == $key) {
			print "<option value=\"".$key."\" selected=\"selected\"> ".$val."</option>\n";
		} else {
			print "<option value=\"".$key."\"> ".$val."</option>\n";
		}
	}
150
?>
151
152
			</select>
		</p>
153
154
	</fieldset>

155
156
	<?php if ($A == "UpdateAccount"): ?>
	<fieldset>
157
		<legend><?= __("If you want to change the password, enter a new password and confirm the new password by entering it again.") ?></legend>
158
159
160
161
162
163
164
165
166
167
168
169
		<p>
			<label for="id_passwd1"><?= __("Password") ?>:</label>
			<input type="password" size="30" name="P" id="id_passwd1" value="<?= $P ?>" />
		</p>

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

170
171
172
173
174
175
176
	<fieldset>
		<legend><?= __("The following information is only required if you want to submit packages to the Arch User Repository.") ?></legend>
		<p>
			<label for="id_ssh"><?= __("SSH Public Key") ?>:</label>
			<textarea name="PK" id="id_ssh" rows="5" cols="30"><?= htmlspecialchars($PK) ?></textarea>
		</p>
	</fieldset>
177

178
179
180
181
182
183
	<fieldset>
		<legend><?= __("Notification settings") ?>:</legend>
		<p>
			<label for="id_commentnotify"><?= __("Notify of new comments") ?>:</label>
			<input type="checkbox" name="CN" id="id_commentnotify" <?= $CN ? 'checked="checked"' : '' ?> />
		</p>
184
185
186
187
		<p>
			<label for="id_updatenotify"><?= __("Notify of package updates") ?>:</label>
			<input type="checkbox" name="UN" id="id_updatenotify" <?= $UN ? 'checked="checked"' : '' ?> />
		</p>
188
189
190
191
		<p>
			<label for="id_ownershipnotify"><?= __("Notify of ownership changes") ?>:</label>
			<input type="checkbox" name="ON" id="id_ownershipnotify" <?= $ON ? 'checked="checked"' : '' ?> />
		</p>
192
193
	</fieldset>

194
	<fieldset>
195
196
197
198
199
200
201
	<?php if ($A == "UpdateAccount"): ?>
		<legend><?= __("To confirm the profile changes, please enter your current password:") ?></legend>
		<p>
			<label for="id_passwd_current"><?= __("Your current password") ?>:</label>
			<input type="password" size="30" name="passwd" id="id_passwd_current" value="" />
		</p>
	<?php else: ?>
202
203
204
205
206
207
208
		<legend><?= __("To protect the AUR against automated account creation, we kindly ask you to provide the output of the following command:") ?> <code><?= htmlspecialchars($captcha_challenge) ?></code></legend>
		<p>
			<label for="id_captcha"><?= __("Answer") ?>:</label>
			<input type="text" size="30" maxlength="6" name="captcha" id="id_captcha" value="<?= htmlspecialchars($captcha, ENT_QUOTES) ?>" /> (<?= __("required") ?>)
			<input type="hidden" name="captcha_salt" value="<?= htmlspecialchars($captcha_salt) ?>" />
		</p>
	<?php endif; ?>
209
	</fieldset>
210

211
	<fieldset>
212
213
214
215
216
217
218
219
220
221
		<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>
222
</form>