Commit f82e5332 authored by Leigh Stoller's avatar Leigh Stoller

Minor changes for downloading ssl certificate.

parent 45d35b69
......@@ -29,20 +29,16 @@ if (!isset($target_user)) {
# Need these below
$target_uid = $target_user->uid();
#
# Standard Testbed Header, now that we know what we want to say.
#
PAGEHEADER("Generate SSL Certificate for user: $target_uid");
#
# The conclusion.
#
if (isset($finished)) {
PAGEHEADER("Download SSL Certificate for user: $target_uid");
$url = CreateURL("getsslcert", $target_user);
echo "<blockquote>
Your new SSL certificate has been created. You can
<a href='$url'>download</a> your
<a href='$url'>Download</a> your
certificate and private key in PEM format, and then save
it to a file in your .ssl directory.
<br>
......@@ -57,6 +53,11 @@ if (isset($finished)) {
return;
}
#
# Standard Testbed Header, now that we know what we want to say.
#
PAGEHEADER("Generate SSL Certificate for user: $target_uid");
#
# Only admin people can create SSL certs for another user.
#
......
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2009 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -105,6 +105,12 @@ if (!$target_user->wikionly() &&
WRITESUBMENUBUTTON("Generate SSL Cert",
CreateURL("gensslcert", $target_user));
if ($target_user->HasEncryptedCert()) {
WRITESUBMENUBUTTON("Download your SSL Cert",
CreateURL("gensslcert", $target_user,
"finished", 1));
}
if ($MAILMANSUPPORT) {
#
# See if any mailman lists owned by the user. If so we add a menu item.
......
......@@ -1075,6 +1075,12 @@ class User
return $this->Refresh();
}
function HasEncryptedCert() {
$query_result = $this->TableLookUp("user_sslcerts",
"cert,privkey",
"encrypted=1 and revoked is null");
return mysql_num_rows($query_result);
}
#
# Return project access list for a user. This returns just pid,eid for
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment