Commit 1263cc28 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Hmm, a left over protogeni change; method to change ssh keys.

parent a727dac1
......@@ -1707,6 +1707,35 @@ sub Create($$$$$$;$)
return User::NonLocal->Lookup($idx);
}
#
# Modify the keys.
#
sub ModifyKeys($$)
{
my ($self, $sshkeys) = @_;
return 0
if ($self->shadow());
my $idx = $self->uid_idx();
my $uid = $self->uid();
DBQueryWarn("delete from user_pubkeys where uid_idx='$idx'")
or return -1;
if (defined($sshkeys)) {
foreach my $sshkey (@{ $sshkeys }) {
my $safe_sshkey = DBQuoteSpecial($sshkey);
DBQueryWarn("insert into user_pubkeys set ".
" uid='$uid', uid_idx='$idx', ".
" idx=NULL, stamp=now(), pubkey=$safe_sshkey")
or return -1;
}
}
return 0;
}
#
# Delete the user, as for registration errors.
#
......
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