5a54dcf5f6a77c432d9e0bcc1f4a8c36d9c23806
[cacert-devel.git] / pages / account / 59.php
1 <?/*
2 LibreSSL - CAcert web application
3 Copyright (C) 2004-2008 CAcert Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; version 2 of the License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php");
19
20
21 $userid = intval($_REQUEST['userid']);
22
23 $res = get_user_data($userid);
24 if (mysql_num_rows($res) <= 0)
25 {
26 echo _("I'm sorry, the user you were looking for seems to have disappeared! Bad things are afoot!");
27 exit;
28 }
29
30 $user = mysql_fetch_assoc($res);
31
32 $fname = $user['fname'];
33 $mname = $user['mname'];
34 $lname = $user['lname'];
35 $suffix = $user['suffix'];
36 $dob = $user['dob'];
37 $username = $fname." ".$mname." ".$lname." ".$suffix;
38 $email = $user['email'];
39 $alerts =get_alerts($userid);
40
41 $support=0;
42 if (array_key_exists('admin', $_SESSION['profile'])){
43 $support=$_SESSION['profile']['admin'];
44 }
45
46 $ticketno = "";
47 if (array_key_exists('ticketno', $_SESSION)) {
48 $ticketno = $_SESSION['ticketno'];
49 }
50
51 // Support Engineer access restrictions
52 if ($userid != $_SESSION['profile']['id']) {
53 if ($support == 0) {
54 echo _("You do not have access to this page.");
55 showfooter();
56 exit;
57 }
58
59 if (!valid_ticket_number($ticketno)) {
60 printf(_("I'm sorry, you did not enter a ticket number! %s Support is not allowed to view the account history without a ticket number."), '<br/>');
61 echo '<br/><a href="account.php?id=43&amp;userid='.$userid.'">'. _('Back to previous page.') .'</a>';
62 showfooter();
63 exit;
64 }
65
66 if (!write_se_log($userid, $_SESSION['profile']['id'], 'SE View account history', $ticketno)) {
67 echo _("Writing to the admin log failed. Can't continue.");
68 echo '<br/><a href="account.php?id=43&amp;userid='.$userid.'">'. _('Back to previous page.') .'</a>';
69 showfooter();
70 exit;
71 }
72 }
73
74 // Account details
75 ?>
76 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
77 <tr>
78 <td colspan="2" class="title"><?printf(_('Account history of %s'),$username)?></td>
79 </tr>
80 <tr>
81 <td colspan="2" class="title"><?=_('User actions')?></td>
82 </tr>
83 <tr>
84 <td class="DataTD"><?=_('User name')?></td>
85 <td class="DataTD"><?=$username?></td>
86 </tr>
87 <tr>
88 <td class="DataTD"><?=_('Date of Birth')?></td>
89 <td class="DataTD"><?=$dob?></td>
90 </tr>
91 <tr>
92 <td class="DataTD"><?=_("Is Assurer")?>:</td>
93 <td class="DataTD"><?= ($user['assurer']==0)? _('No'):_('Yes')?></td>
94 </tr>
95 <tr>
96 <td class="DataTD"><?=_("Blocked Assurer")?>:</td>
97 <td class="DataTD"><?= ($user['assurer_blocked']==0)? _('No'):_('Yes')?></td>
98 </tr>
99 <tr>
100 <td class="DataTD"><?=_("Account Locking")?>:</td>
101 <td class="DataTD"><?= ($user['locked']==0)? _('No'):_('Yes')?></td>
102 </tr>
103 <tr>
104 <td class="DataTD"><?=_("Code Signing")?>:</td>
105 <td class="DataTD"><?= ($user['codesign']==0)? _('No'):_('Yes')?></td>
106 </tr>
107 <tr>
108 <td class="DataTD"><?=_("Org Assurer")?>:</td>
109 <td class="DataTD"><?= ($user['orgadmin']==0)? _('No'):_('Yes')?></td>
110 </tr>
111 <tr>
112 <td class="DataTD"><?=_("TTP Admin")?>:</td>
113 <td class="DataTD"><?= $user['ttpadmin']._(' - 0 = none, 1 = TTP Admin, 2 = TTP TOPUP admin')?></td>
114 </tr>
115 <tr>
116 <td class="DataTD"><?=_("Location Admin")?>:</td>
117 <td class="DataTD"><?= ($user['locadmin']==0)? _('No'):_('Yes')?></td>
118 </tr>
119 <tr>
120 <td class="DataTD"><?=_("Admin")?>:</td>
121 <td class="DataTD"><?= ($user['admin']==0)? _('No'):_('Yes')?></td>
122 </tr>
123 <tr>
124 <td class="DataTD"><?=_("Ad Admin")?>:</td>
125 <td class="DataTD"><?= $user['adadmin']._(' - 0 = none, 1 = submit, 2 = approve')?></td>
126 </tr>
127 <tr>
128 <td class="DataTD"><?=_("General Announcements")?>:</td>
129 <td class="DataTD"><?= ($alerts['general']==0)? _('No'):_('Yes')?></td>
130 </tr>
131 <tr>
132 <td class="DataTD"><?=_("Country Announcements")?>:</td>
133 <td class="DataTD"><?= ($alerts['country']==0)? _('No'):_('Yes')?></td>
134 </tr>
135 <tr>
136 <td class="DataTD"><?=_("Regional Announcements")?>:</td>
137 <td class="DataTD"><?= ($alerts['regional']==0)? _('No'):_('Yes')?></td>
138 </tr>
139 <tr>
140 <td class="DataTD"><?=_("Within 200km Announcements")?>:</td>
141 <td class="DataTD"><?= ($alerts['radius']==0)? _('No'):_('Yes')?></td>
142 </tr>
143 </table>
144 <br/>
145 <?
146
147 // Email addresses
148 $dres = get_email_addresses($userid,'',1);
149 ?>
150 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
151 <tr>
152 <td colspan="3" class="title"><?=_('Email addresses')?></td>
153 </tr>
154 <?
155 if (mysql_num_rows($dres) > 0) {
156 output_log_email_header();
157 while ($drow = mysql_fetch_assoc($dres))
158 {
159 output_log_email($drow,$email);
160 }
161 } else {
162 ?>
163 <tr>
164 <td colspan="3" ><?=_('no entry available')?></td>
165 </tr>
166 <?
167 }
168 ?>
169 </table>
170 <br/>
171 <?
172
173 // Domains
174 $dres = get_domains($userid, 1);
175 ?>
176 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
177 <tr>
178 <td colspan="3" class="title"><?=_('Domains')?></td>
179 </tr>
180 <?
181 if (mysql_num_rows($dres) > 0) {
182 output_log_domains_header();
183 while ($drow = mysql_fetch_assoc($dres))
184 {
185 output_log_domains($drow);
186 }
187 } else {
188 ?>
189 <tr>
190 <td colspan="3" ><?=_('no entry available')?></td>
191 </tr>
192 <?
193 }
194 ?>
195 </table>
196 <br/>
197
198 <?
199 // Trainings
200 $dres = get_training_results($userid);
201 ?>
202 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
203 <tr>
204 <td colspan="3" class="title"><?=_('Trainings')?></td>
205 </tr>
206 <?
207 if (mysql_num_rows($dres) > 0) {
208 output_log_training_header();
209 while ($drow = mysql_fetch_assoc($dres))
210 {
211 output_log_training($drow);
212 }
213 } else {
214 ?>
215 <tr>
216 <td colspan="3" ><?=_('no entry available')?></td>
217 </tr>
218 <?
219 }
220 ?>
221 </table>
222 <br/>
223
224 <?
225 // User Agreements
226 $dres = get_user_agreements($userid);
227 ?>
228 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
229 <tr>
230 <td colspan="4" class="title"><?=_('User agreements')?></td>
231 </tr>
232 <?
233 if (mysql_num_rows($dres) > 0) {
234 output_log_agreement_header();
235 while ($drow = mysql_fetch_assoc($dres))
236 {
237 output_log_agreement($drow);
238 }
239 } else {
240 ?>
241 <tr>
242 <td colspan="4" ><?=_('no entry available')?></td>
243 </tr>
244 <?
245 }
246 ?>
247 </table>
248 <br/>
249
250 <?
251 $dres = get_client_certs($userid,1);
252 $colspan=10;
253 if (1 == $support) {
254 $colspan=7;
255 }
256 ?>
257 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
258 <tr>
259 <td colspan="<?=$colspan?>" class="title"><?=_('Client certificates')?></td>
260 </tr>
261 <?
262 if (mysql_num_rows($dres) > 0) {
263 output_client_cert_header($support);
264 while ($drow = mysql_fetch_assoc($dres))
265 {
266 output_client_cert($drow,$support);
267 }
268 } else {
269 ?>
270 <tr>
271 <td colspan="<?=$colspan?>" ><?=_('no entry available')?></td>
272 </tr>
273 <?
274 }
275 ?>
276 </table>
277 <br/>
278
279 <?
280 $dres = get_server_certs($userid,1);
281 $colspan = 8;
282 if (1 == $support) {
283 $colspan = 5;
284 }
285 ?>
286 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
287 <tr>
288 <td colspan="<?=$colspan?>" class="title"><?=_('Server certificates')?></td>
289 </tr>
290 <?
291 if (mysql_num_rows($dres) > 0) {
292 output_server_certs_header($support);
293 while ($drow = mysql_fetch_assoc($dres))
294 {
295 output_server_certs($drow,$support);
296 }
297 } else {
298 ?>
299 <tr>
300 <td colspan="<?=$colspan?>" ><?=_('no entry available')?></td>
301 </tr>
302 <?
303 }
304 ?>
305 </table>
306 <br/>
307
308 <?
309 $dres = get_gpg_certs($userid,1);
310 $colspan = 6;
311 if (1 == $support) {
312 $colspan = 4;
313 }
314 ?>
315 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
316 <tr>
317 <td colspan="<?=$colspan?>" class="title"><?=_('GPG/PGP certificates')?></td>
318 </tr>
319 <?
320 if (mysql_num_rows($dres) > 0) {
321 output_gpg_certs_header($support);
322 while ($drow = mysql_fetch_assoc($dres))
323 {
324 output_gpg_certs($drow, $support);
325 }
326 } else {
327 ?>
328 <tr>
329 <td colspan="<?=$colspan?>" ><?=_('no entry available')?></td>
330 </tr>
331 <?
332 }?>
333 </table>
334 <br/>
335
336 <?
337
338 output_log_given_assurances($userid, $support);
339 ?><br/><?
340
341 output_log_received_assurances($userid, $support);
342 ?><br/><?
343
344 $dres = get_se_log($userid);
345 $colspan = 2;
346 if (1 == $support) {
347 $colspan = 4;
348 }
349 ?>
350 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
351 <tr>
352 <td colspan="<?=$colspan?>" class="title"><?=_('Admin log')?></td>
353 </tr>
354 <?
355 if (mysql_num_rows($dres) > 0) {
356 output_log_se_header($support);
357 while ($drow = mysql_fetch_assoc($dres))
358 {
359 output_log_se($drow,$support);
360 }
361 } else {
362 ?>
363 <tr>
364 <td colspan="<?=$colspan?>" ><?=_('no entry available')?></td>
365 </tr>
366 <?
367 }
368 if ($support==1) {
369 ?>
370 <tr>
371 <td colspan="<?=$colspan?>" >
372 <a href="account.php?id=43&amp;userid=<?= $userid ?>"><?= _('Back to previous page.')?></a>
373 </td>
374 </tr>
375 <?
376 }
377
378 ?>
379 </table>