mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Upgrade code to merge user certificates with normal certificates.
This commit is contained in:
parent
395ba5d1af
commit
8fefb9dd22
@ -2167,4 +2167,29 @@ function upgrade_067_to_068() {
|
||||
}
|
||||
}
|
||||
|
||||
function upgrade_067_to_068() {
|
||||
global $config;
|
||||
if (!is_array($config['system']['user']))
|
||||
return;
|
||||
foreach ($config['system']['user'] as & $user) {
|
||||
if (!is_array($user['cert']))
|
||||
continue;
|
||||
$rids = array();
|
||||
foreach ($user['cert'] as $id => $cert) {
|
||||
if (!isset($cert['name']))
|
||||
continue;
|
||||
$tcert = $cert;
|
||||
// Make sure each cert gets a refid
|
||||
if (!isset($tcert['refid']))
|
||||
$tcert['refid'] = uniqid();
|
||||
// Keep the cert references for this user
|
||||
$rids[] = $tcert['refid'];
|
||||
$config['cert'][] = $tcert;
|
||||
}
|
||||
// Replace user certs with cert references instead.
|
||||
if (count($rids) > 0)
|
||||
$user['cert'] = $rids;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user