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