Commit 32d7d504 authored by Leigh Stoller's avatar Leigh Stoller

Minor tweaks for protogeni

parent bf7c10c6
......@@ -191,6 +191,8 @@ sub pid_idx($) { return field($_[0], 'pid_idx'); }
sub gid_idx($) { return field($_[0], 'gid_idx'); }
sub eid($) { return field($_[0], 'eid'); }
sub idx($) { return field($_[0], 'idx'); }
sub uuid($) { return field($_[0], 'eid_uuid'); }
sub eid_uuid($) { return field($_[0], 'eid_uuid'); }
sub description($) { return field($_[0], 'expt_name'); }
sub path($) { return field($_[0], 'path'); }
sub state($) { return field($_[0], 'state'); }
......
......@@ -995,6 +995,31 @@ sub SetStatus($$)
return $self->Update(\%args);
}
#
# Get user ssl certificate (pubkey).
#
sub SSLCert($$$)
{
my ($self, $encrypted, $pref) = @_;
$encrypted = ($encrypted ? 1 : 0);
# Must be a real reference.
return -1
if (! ref($self));
my $uid_idx = $self->uid_idx();
my $query_result =
DBQueryWarn("select cert from user_sslcerts ".
"where uid_idx='$uid_idx' and encrypted=$encrypted");
return -1
if (!defined($query_result) || !$query_result->numrows);
my ($cert) = $query_result->fetchrow_array();
$$pref = $cert;
return 0;
}
#
# Set password for user.
#
......
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