e9643d02d0dfa71e826bf733ac85a277229bbd97
[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 $colspandefault=2;
22 $userid = intval($_REQUEST['userid']);
23 $res =get_user_data($userid);
24
25
26
27 if(mysql_num_rows($res) <= 0)
28 {
29 echo _("I'm sorry, the user you were looking for seems to have disappeared! Bad things are afoot!");
30 exit;
31 }
32
33 $row = mysql_fetch_assoc($res);
34
35 $fname = $row['fname'];
36 $mname = $row['mname'];
37 $lname = $row['lname'];
38 $suffix = $row['suffix'];
39 $dob = $row['dob'];
40 $username = $fname." ".$mname." ".$lname." ".$suffix;
41 $email = $row['email'];
42 $alerts =get_alerts($userid);
43 $support=0;
44 if(intval($_REQUEST['oldid'])==43){
45 $support=$_SESSION['profile']['admin'];
46 }
47 $ticketno = ""; if(array_key_exists('ticketno', $_SESSION)) $ticketno = $_SESSION['ticketno'];
48 if (!valid_ticket_number($ticketno) && $support == 1) {
49 printf(_("I'm sorry, you did not enter a ticket number!%sSupport is not allowed to view the account history without a ticket number."), '<br/>');
50 echo '<br/><a href="account.php?id=43&amp;userid=' . intval($_REQUEST['userid']) .'">'. _('Back to previous page.').'</a>';
51 showfooter();
52 exit;
53 }
54 if ( $support == 1) {
55 if (!write_se_log($userid, $_SESSION['profile']['id'], 'SE View account history', $_REQUEST['ticketno'])) {
56 echo _("Writing to the admin log failed. Can't continue.");
57 printf('<br/><a href="account.php?id=43&amp;userid=' . intval($_REQUEST['userid']) . '">' . _('Back to previous page.') .'</a>');
58 showfooter();
59 exit;
60 }
61 }
62 ?>
63 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
64 <tr>
65 <td colspan="<?=$colspandefault ?>" class="title"><?=sprintf(_('Account history of %s'),$username)?></td>
66 </tr>
67 <tr>
68 <td colspan="<?=$colspandefault ?>" class="title"><?=_('User actions')?></td>
69 </tr>
70 <tr>
71 <td class="DataTD"><?=_('User name')?></td>
72 <td class="DataTD"><?=$username?></td>
73 </tr>
74 <tr>
75 <td class="DataTD"><?=_('Date of Birth')?></td>
76 <td class="DataTD"><?=$dob?></td>
77 </tr>
78 <tr>
79 <td class="DataTD"><?=_("Is Assurer")?>:</td>
80 <td class="DataTD"><?= ($row['assurer']==0)? _('No'):_('Yes')?></td>
81 </tr>
82 <tr>
83 <td class="DataTD"><?=_("Blocked Assurer")?>:</td>
84 <td class="DataTD"><?= ($row['assurer_blocked']==0)? _('No'):_('Yes')?></td>
85 </tr>
86 <tr>
87 <td class="DataTD"><?=_("Account Locking")?>:</td>
88 <td class="DataTD"><?= ($row['locked']==0)? _('No'):_('Yes')?></td>
89 </tr>
90 <tr>
91 <td class="DataTD"><?=_("Code Signing")?>:</td>
92 <td class="DataTD"><?= ($row['codesign']==0)? _('No'):_('Yes')?></td>
93 </tr>
94 <tr>
95 <td class="DataTD"><?=_("Org Assurer")?>:</td>
96 <td class="DataTD"><?= ($row['orgadmin']==0)? _('No'):_('Yes')?></td>
97 </tr>
98 <tr>
99 <td class="DataTD"><?=_("TTP Admin")?>:</td>
100 <td class="DataTD"><?= $row['ttpadmin']._(' - 0 = none, 1 = TTP Admin, 2 = TTP TOPUP admin')?></td>
101 </tr>
102 <tr>
103 <td class="DataTD"><?=_("Location Admin")?>:</td>
104 <td class="DataTD"><?= ($row['locadmin']==0)? _('No'):_('Yes')?></td>
105 </tr>
106 <tr>
107 <td class="DataTD"><?=_("Admin")?>:</td>
108 <td class="DataTD"><?= ($row['admin']==0)? _('No'):_('Yes')?></td>
109 </tr>
110 <tr>
111 <td class="DataTD"><?=_("Ad Admin")?>:</td>
112 <td class="DataTD"><?= $row['adadmin']._(' - 0 = none, 1 = submit, 2 = approve')?></td>
113 </tr>
114 <tr>
115 <td class="DataTD"><?=_("General Announcements")?>:</td>
116 <td class="DataTD"><?= ($alerts['general']==0)? _('No'):_('Yes')?></td>
117 </tr>
118 <tr>
119 <td class="DataTD"><?=_("Country Announcements")?>:</td>
120 <td class="DataTD"><?= ($row['id']==0)? _('No'):_('Yes')?></td>
121 </tr>
122 <tr>
123 <td class="DataTD"><?=_("Regional Announcements")?>:</td>
124 <td class="DataTD"><?= ($row['id']==0)? _('No'):_('Yes')?></td>
125 </tr>
126 <tr>
127 <td class="DataTD"><?=_("Within 200km Announcements")?>:</td>
128 <td class="DataTD"><?= ($row['id']==0)? _('No'):_('Yes')?></td>
129 </tr>
130 </table>
131 <br/>
132 <?
133 $dres = get_email_address($userid,'',1);
134 if(mysql_num_rows($dres) > 0) {
135 ?>
136 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
137 <tr>
138 <td colspan="3" class="title"><?=_('Email addresses')?></td>
139 </tr>
140 <?
141 output_log_email_header();
142 while($drow = mysql_fetch_assoc($dres))
143 {
144 output_log_email($drow,$email);
145 } ?>
146 </table>
147 <br/>
148 <?}
149 $dres = get_domains($userid,'',1);
150 ?>
151 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
152 <tr>
153 <td colspan="3" class="title"><?=_('Domains')?></td>
154 </tr>
155 <?
156 if(mysql_num_rows($dres) > 0) {
157 output_log_domains_header();
158 while($drow = mysql_fetch_assoc($dres))
159 {
160 output_log_domains($drow,$email);
161 }
162 }ELSE{?>
163 <td colspan="3" ><?=_('no entry avialable')?></td>
164 <?}?>
165 </table>
166 <br/>
167
168 <?
169 $dres = get_training_result($userid);
170 ?>
171 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
172 <tr>
173 <td colspan="3" class="title"><?=_('Trainings')?></td>
174 </tr>
175 <?
176 if(mysql_num_rows($dres) > 0) {
177 output_log_training_header();
178 while($drow = mysql_fetch_assoc($dres))
179 {
180 output_log_training($drow);
181 }
182 }ELSE{
183 ?><td colspan="3" ><?=_('no entry avialable')?></td><?
184 }?>
185 </table>
186 <br/>
187
188 <?
189 $dres = get_user_agreements($userid);
190 ?>
191 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
192 <tr>
193 <td colspan="4" class="title"><?=_('User agreements')?></td>
194 </tr>
195 <?
196 if(mysql_num_rows($dres) > 0) {
197 output_log_agreement_header();
198 while($drow = mysql_fetch_assoc($dres))
199 {
200 output_log_agreement($drow);
201 }
202 }ELSE{
203 ?><td colspan="4" ><?=_('no entry avialable')?></td><?
204 }?>
205 </table>
206 <br/>
207
208 <?
209 $dres = get_client_certs($userid,1);
210 $colspan=10;
211 if (1==$support) {
212 $colspan=7;
213 }
214 ?>
215 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
216 <tr>
217 <td colspan="<?=$colspan?>" class="title"><?=_('Client certificates')?></td>
218 </tr>
219 <?
220 if(mysql_num_rows($dres) > 0) {
221 output_client_cert_header($support);
222 while($drow = mysql_fetch_assoc($dres))
223 {
224 output_client_cert($drow,$support);
225 }
226 }ELSE{
227 ?><td colspan="<?=$colspan?>" ><?=_('no entry avialable')?></td><?
228 }?>
229 </table>
230 <br/>
231
232 <?
233 $dres = get_server_certs($userid,1);
234 $colspan = 8;
235 if (1 == $support) {
236 $colspan = 5;
237 }
238 ?>
239 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
240 <tr>
241 <td colspan="<?=$colspan?>" class="title"><?=_('Server certificates')?></td>
242 </tr>
243 <?
244 if(mysql_num_rows($dres) > 0) {
245 output_log_server_certs_header($support);
246 while($drow = mysql_fetch_assoc($dres))
247 {
248 output_log_server_certs($drow,$support);
249 }
250 }ELSE{
251 ?><td colspan="<?=$colspan?>" ><?=_('no entry avialable')?></td><?
252 }?>
253 </table>
254 <br/>
255
256 <?
257 $dres = get_gpg_certs($userid,1);
258 $colspan = 6;
259 if (1 == $support) {
260 $colspan = 4;
261 }
262 ?>
263 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
264 <tr>
265 <td colspan="<?=$colspan?>" class="title"><?=_('GPG/PGP certificates')?></td>
266 </tr>
267 <?
268 if(mysql_num_rows($dres) > 0) {
269 output_gpg_certs_header($support);
270 while($drow = mysql_fetch_assoc($dres))
271 {
272 output_gpg_certs($drow,$support);
273 }
274 }ELSE{
275 ?><td colspan="<?=$colspan?>" ><?=_('no entry avialable')?></td><?
276 }?>
277 </table>
278 <br/>
279
280 <?
281
282 output_log_given_assurances($userid, $support);
283 ?><br/><?
284
285 output_log_received_assurances($userid, $support);
286 ?><br/><?
287
288 $dres = get_se_log($userid);
289 $colspan = 2;
290 if (1 == $support) {
291 $colspan = 4;
292 }
293 ?>
294 <table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
295 <tr>
296 <td colspan="<?=$colspan?>" class="title"><?=_('Admin log')?></td>
297 </tr>
298 <?
299 if(mysql_num_rows($dres) > 0) {
300 output_log_se_header($support);
301 while($drow = mysql_fetch_assoc($dres))
302 {
303 output_log_se($drow,$support);
304 }
305 }ELSE{
306 ?><td colspan="<?=$colspan?>" ><?=_('no entry avialable')?></td><?
307 }
308 if ($support==1) {
309 ?><td colspan="<?=$colspan?>" ><a href="account.php?id=43&amp;userid=<?= $userid ?>"><?= _('Back to previous page.')?></a></td><?
310 }
311
312 ?>
313
314 </table>