Commit a3ab3e95 authored by Leigh Stoller's avatar Leigh Stoller

When a class/active user logs into the Portal interface, and that user

has no encrypted certificate, generate one for them using a randomized
pass phrase.
parent ea2870b2
......@@ -330,6 +330,15 @@ if ($login_status == $STATUS_LOGINFAIL) {
SPITFORM($uid, $referrer, "failed");
return;
}
#
# Watch for a classic user logging in but without an encrypted certificate.
# We really want to generate one so stuff does not break.
#
if ($CHECKLOGIN_USER->IsActive() && $CHECKLOGIN_USER->isClassic() &&
!$CHECKLOGIN_USER->HasEncryptedCert(1)) {
$CHECKLOGIN_USER->GenEncryptedCert();
}
if ($ajax_request) {
SPITAJAX_RESPONSE("login sucessful");
exit();
......
......@@ -1213,6 +1213,20 @@ class User
return mysql_num_rows($query_result);
}
#
# Generate an encrypted certificate using existing passphrase or
# randomized one.
#
function GenEncryptedCert() {
$project = $this->FirstApprovedProject();
$pid = (isset($project) ? $project->pid() : "nobody");
$uid = $this->uid();
SUEXEC($uid, $pid,
"webmkusercert -r -P -G $uid",
SUEXEC_ACTION_CONTINUE);
}
function SetGaUserid($id) {
$idx = $this->uid_idx();
......
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