aboutsummaryrefslogtreecommitdiff
path: root/data/templates/default/editprofile-sslclientcerts.tpl.php
blob: 900c19351b416391387e6562eb9c311c11d60e7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
 * User's own profile page: SSL client certificate settings
 *
 * @param array  $sslClientCerts Array of SSL client certificate objects
 * @param string $formaction     URL where to send the forms to
 * @param SemanticScuttle_Model_User_SslClientCert
 *               $currentCert    Current SSL client certificate (may be null)
 */
?>
<h3><?php echo T_('SSL client certificates'); ?></h3>
<?php if (count($sslClientCerts)) { ?>
<table>
 <thead>
  <tr>
   <th>Options</th>
   <th><?php echo T_('Serial'); ?></th>
   <th><?php echo T_('Name'); ?></th>
   <th><?php echo T_('Email'); ?></th>
   <th><?php echo T_('Issuer'); ?></th>
  </tr>
 </thead>
 <tbody>
 <?php foreach($sslClientCerts as $cert) { ?>
  <tr <?php if ($cert->isCurrent()) { echo 'class="ssl-current"'; } ?>>
   <td>
    <form method="post" action="<?php echo $formaction; ?>">
     <input type="hidden" name="certId" value="<?php echo $cert->id; ?>"/>
     <button type="submit" name="action" value="deleteClientCert">
      <?php echo T_('delete'); ?>
     </button>
    </form>
   </td>
   <td><?php echo htmlspecialchars($cert->sslSerial); ?></td>
   <td><?php echo htmlspecialchars($cert->sslName); ?></td>
   <td><?php echo htmlspecialchars($cert->sslEmail); ?></td>
   <td><?php echo htmlspecialchars($cert->sslClientIssuerDn); ?></td>
  </tr>
 <?php } ?>
 </tbody>
</table>
<?php } else { ?>
 <p><?php echo T_('No certificates registered'); ?></p>
<?php } ?>

<?php if ($currentCert) { ?>
 <?php if ($currentCert->isRegistered($sslClientCerts)) { ?>
  <p><?php echo T_('Your current certificate is already registered with your account.'); ?></p>
 <?php } else { ?>
  <p>
   <form method="post" action="<?php echo $formaction; ?>">
    <button type="submit" name="action" value="registerCurrentCert">
     <?php echo T_('Register current certificate to automatically login.'); ?>
    </button>
   </form>
  </p>
 <?php } ?>
<?php } else { ?>
 <p><?php echo T_('Your browser does not provide a certificate.'); ?></p>
<?php } ?>