account_edit_form.php 5.36 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
5
</p>

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

50
51
			</select>
		</p>
52

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

63
		<?php if ($A == "UpdateAccount"): ?>
64
65
66
67
		<p>
			<label for="id_inactive"><?= __("Inactive") ?>:</label>
			<input type="checkbox" name="J" id="id_inactive" <?= $J ? 'checked="checked"' : '' ?> />
		</p>
68
		<?php endif; ?>
69

70
71
		<p>
			<label for="id_email"><?= __("Email Address") ?>:</label>
72
			<input type="text" size="30" maxlength="254" name="E" id="id_email" value="<?= htmlspecialchars($E,ENT_QUOTES) ?>" /> (<?= __("required") ?>)
73
		</p>
74

75
76
77
78
		<p>
			<em><?= __("Please ensure you correctly entered your email address, otherwise you will be locked out.") ?></em>
		</p>

79
80
81
82
83
		<p>
			<label for="id_hide"><?= __("Hide Email Address") ?>:</label>
			<input type="checkbox" name="H" id="id_hide" <?= $H ? 'checked="checked"' : '' ?> />
		</p>

84
		<?php if ($A == "UpdateAccount"): ?>
85
86
		<p>
			<label for="id_passwd1"><?= __("Password") ?>:</label>
87
			<input type="password" size="30" name="P" id="id_passwd1" value="<?= $P ?>" />
88
		</p>
89

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

96
97
98
99
		<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>
100

101
102
103
104
		<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>
105

106
107
108
109
		<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>
110

111
112
113
		<p>
			<label for="id_language"><?= __("Language") ?>:</label>
			<select name="L" id="id_language">
114
115
116
117
<?php
	reset($SUPPORTED_LANGS);
	while (list($code, $lang) = each($SUPPORTED_LANGS)) {
		if ($L == $code) {
118
			print "<option value=\"".$code."\" selected=\"selected\"> ".$lang."</option>"."\n";
119
		} else {
120
			print "<option value=\"".$code."\"> ".$lang."</option>"."\n";
121
122
123
		}
	}
?>
124
125
			</select>
		</p>
126
127
128
129
130
131
132
133
134
	</fieldset>

	<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>
135

136
137
138
139
140
141
	<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>
142
143
144
145
		<p>
			<label for="id_updatenotify"><?= __("Notify of package updates") ?>:</label>
			<input type="checkbox" name="UN" id="id_updatenotify" <?= $UN ? 'checked="checked"' : '' ?> />
		</p>
146
147
	</fieldset>

148
	<fieldset>
149
150
151
152
153
154
155
156
157
158
		<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>
159
</form>