diff options
Diffstat (limited to 'data/templates')
-rw-r--r-- | data/templates/editprofile-sslclientcerts.tpl.php | 60 | ||||
-rw-r--r-- | data/templates/editprofile.tpl.php | 4 | ||||
-rw-r--r-- | data/templates/register.tpl.php | 2 | ||||
-rw-r--r-- | data/templates/toolbar.inc.php | 2 |
4 files changed, 65 insertions, 3 deletions
diff --git a/data/templates/editprofile-sslclientcerts.tpl.php b/data/templates/editprofile-sslclientcerts.tpl.php new file mode 100644 index 0000000..900c193 --- /dev/null +++ b/data/templates/editprofile-sslclientcerts.tpl.php @@ -0,0 +1,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 } ?> diff --git a/data/templates/editprofile.tpl.php b/data/templates/editprofile.tpl.php index 2a3c3b8..cc74f04 100644 --- a/data/templates/editprofile.tpl.php +++ b/data/templates/editprofile.tpl.php @@ -50,13 +50,15 @@ $this->includeTemplate($GLOBALS['top_include']); <td><input type="submit" name="submitted" value="<?php echo T_('Save Changes'); ?>" /></td> </tr> </table> + +<?php include 'editprofile-sslclientcerts.tpl.php'; ?> <h3><?php echo T_('Actions'); ?></h3> <table class="profile"> <tr> <th align="left"><?php echo T_('Export bookmarks'); ?></th> <td> <a href="../api/export_html.php"><?php echo T_('HTML file (for browsers)')?></a> / - <a href="../api/posts_all.php"><?php echo T_('XML file (like del.icio.us)')?></a> / + <a href="../api/posts_all.php"><?php echo T_('XML file (like del.icio.us)')?></a> / <a href="../api/export_csv.php"><?php echo T_('CSV file (for spreadsheet tools)')?></a> </td> </tr> diff --git a/data/templates/register.tpl.php b/data/templates/register.tpl.php index da3deec..62cebad 100644 --- a/data/templates/register.tpl.php +++ b/data/templates/register.tpl.php @@ -24,7 +24,7 @@ window.onload = function() { </tr> <tr> <th align="left"><label for="email"><?php echo T_('E-mail'); ?></label></th> - <td><input type="text" id="email" name="email" size="40" class="required" /></td> + <td><input type="text" id="email" name="email" size="40" class="required" value="<?php echo htmlspecialchars(POST_MAIL); ?>" /></td> <td><?php echo '←'.T_(' to send you your password if you forget it')?></td> </tr> diff --git a/data/templates/toolbar.inc.php b/data/templates/toolbar.inc.php index 0d9bf49..fb6638d 100644 --- a/data/templates/toolbar.inc.php +++ b/data/templates/toolbar.inc.php @@ -1,5 +1,5 @@ <?php -if ($userservice->isLoggedOn()) { +if ($userservice->isLoggedOn() && is_object($currentUser)) { $cUserId = $userservice->getCurrentUserId(); $cUsername = $currentUser->getUsername(); ?> |