diff options
author | jim-p <jimp@pfsense.org> | 2010-09-02 13:37:57 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-09-02 16:50:13 -0400 |
commit | c25f73ae8560fcf2f7be641e0510c5275d411a9b (patch) | |
tree | 8c2fa6ce0f2aa122c93876dfa5ff193ad32e58b0 /usr | |
parent | 3554c9f05c1bcb74a14eefb4b97917f0e70ba1c1 (diff) | |
download | pfsense-c25f73ae8560fcf2f7be641e0510c5275d411a9b.zip pfsense-c25f73ae8560fcf2f7be641e0510c5275d411a9b.tar.gz |
Adjust the user manager to use cert references on the user instead of the actual certs.
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/system_usermanager.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php index 9345e12..263d741 100644 --- a/usr/local/www/system_usermanager.php +++ b/usr/local/www/system_usermanager.php @@ -100,7 +100,7 @@ if (isAllowedPage("system_usermanager")) { exit; } - $cert =& $a_user[$id]['cert'][$_GET['certid']]; + $cert =& lookup_cert($a_user[$id]['cert'][$_GET['certid']]); $exp_name = urlencode("{$a_user[$id]['name']}-{$cert['name']}.crt"); $exp_data = base64_decode($cert['crt']); @@ -120,7 +120,7 @@ if (isAllowedPage("system_usermanager")) { exit; } - $cert =& $a_user[$id]['cert'][$_GET['certid']]; + $cert =& lookup_cert($a_user[$id]['cert'][$_GET['certid']]); $exp_name = urlencode("{$a_user[$id]['name']}-{$cert['name']}.key"); $exp_data = base64_decode($cert['prv']); @@ -140,12 +140,13 @@ if (isAllowedPage("system_usermanager")) { exit; } - $certdeleted = $a_user[$id]['cert'][$_GET['certid']]['name']; + $certdeleted = lookup_cert($a_user[$id]['cert'][$_GET['certid']]); + $certdeleted = $certdeleted['name']; unset($a_user[$id]['cert'][$_GET['certid']]); write_config(); $_GET['act'] = "edit"; $savemsg = gettext("Certificate")." {$certdeleted} ". - gettext("successfully deleted")."<br/>"; + gettext("association removed.")."<br/>"; } if ($_GET['act'] == "edit") { @@ -316,7 +317,10 @@ if (isAllowedPage("system_usermanager")) { cert_create($cert, $_POST['caref'], $_POST['keylen'], (int)$_POST['lifetime'], $dn); - $userent['cert'][] = $cert; + if (!is_array($config['cert'])) + $config['cert'] = array(); + $config['cert'][] = $cert; + $userent['cert'][] = $cert['refid']; } $userent['uid'] = $config['system']['nextuid']++; /* Add the user to All Users group. */ @@ -634,8 +638,9 @@ function sshkeyClicked(obj) { $a_cert = $a_user[$id]['cert']; if(is_array($a_cert)): $i = 0; - foreach ($a_cert as $cert): - $ca = lookup_ca($cert['caref']); + foreach ($a_cert as $certref): + $cert = lookup_cert($certref); + $ca = lookup_ca($cert['caref']); ?> <tr> <td class="listlr"> |