Commit 912b7e0b authored by Leigh Stoller's avatar Leigh Stoller

Minor change to HasEncryptedCert(); allow argument to exclude

expired certs.
parent 23fcaf90
<?php
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -132,7 +132,7 @@ if (!$archived && !$target_user->wikionly() &&
WRITESUBMENUBUTTON("Generate SSL Cert",
CreateURL("gensslcert", $target_user));
if ($target_user->HasEncryptedCert()) {
if ($target_user->HasEncryptedCert(0)) {
WRITESUBMENUBUTTON("Download your SSL Cert",
CreateURL("gensslcert", $target_user,
"finished", 1));
......
<?php
#
# Copyright (c) 2006-2012 University of Utah and the Flux Group.
# Copyright (c) 2006-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -1123,10 +1123,12 @@ class User
return $this->Refresh();
}
function HasEncryptedCert() {
$query_result = $this->TableLookUp("user_sslcerts",
"cert,privkey",
"encrypted=1 and revoked is null");
function HasEncryptedCert($expired_notokay) {
$query_result =
$this->TableLookUp("user_sslcerts", "cert,privkey",
"encrypted=1 and revoked is null ".
($expired_notokay ? "and expires > now()" : ""));
return mysql_num_rows($query_result);
}
......
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