summaryrefslogtreecommitdiffstats
path: root/src/usr/local
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2016-03-11 22:02:25 +0545
committerPhil Davis <phil.davis@inf.org>2016-03-11 22:02:25 +0545
commit2f62ed872c59dd308c6eb5aa29028dd93274fed6 (patch)
tree3c386f61bd0c24fc0eb3cb7208cd769ada535a50 /src/usr/local
parentbc3c30ebc548c9b1b184166e940d66cc91752a28 (diff)
parentb95e3de4cb39e0b3ef6a0f042b2c96b041019522 (diff)
downloadpfsense-2f62ed872c59dd308c6eb5aa29028dd93274fed6.zip
pfsense-2f62ed872c59dd308c6eb5aa29028dd93274fed6.tar.gz
Resolve conflicts with master
Diffstat (limited to 'src/usr/local')
-rw-r--r--src/usr/local/www/classes/Form.class.php7
-rwxr-xr-xsrc/usr/local/www/diag_defaults.php4
-rwxr-xr-xsrc/usr/local/www/diag_halt.php6
-rwxr-xr-xsrc/usr/local/www/diag_reboot.php6
-rw-r--r--src/usr/local/www/diag_tables.php4
-rw-r--r--src/usr/local/www/jquery/pfSense.js2
-rw-r--r--src/usr/local/www/services_dhcpv6.php4
-rw-r--r--src/usr/local/www/services_wol.php12
-rw-r--r--src/usr/local/www/system_advanced_admin.php2
-rw-r--r--src/usr/local/www/system_certmanager.php568
10 files changed, 289 insertions, 326 deletions
diff --git a/src/usr/local/www/classes/Form.class.php b/src/usr/local/www/classes/Form.class.php
index 0446541..2285865 100644
--- a/src/usr/local/www/classes/Form.class.php
+++ b/src/usr/local/www/classes/Form.class.php
@@ -41,8 +41,9 @@ class Form extends Form_Element
public function __construct($submit = null)
{
- if (!isset($submit))
- $submit = 'Save';
+ if (!isset($submit)) {
+ $submit = gettext('Save');
+ }
if (gettype($submit) == 'string') {
$submit = new Form_Button(
@@ -123,4 +124,4 @@ class Form extends Form_Element
</form>
EOT;
}
-} \ No newline at end of file
+}
diff --git a/src/usr/local/www/diag_defaults.php b/src/usr/local/www/diag_defaults.php
index 3ab3362..3520e68 100755
--- a/src/usr/local/www/diag_defaults.php
+++ b/src/usr/local/www/diag_defaults.php
@@ -104,11 +104,11 @@ include("head.inc");
<p>
<button name="Submit" type="submit" class="btn btn-sm btn-danger" value=" <?=gettext("Yes")?> " title="<?=gettext("Perform a factory reset")?>">
<i class="fa fa-undo"></i>
- <?=gettext("Yes, Factory reset")?>
+ <?=gettext("Factory Reset")?>
</button>
<button name="Submit" type="submit" class="btn btn-sm btn-success" value=" <?=gettext("No")?> " title="<?=gettext("Return to the dashboard")?>">
<i class="fa fa-save"></i>
- <?=gettext("No, Keep this configuration")?>
+ <?=gettext("Keep Configuration")?>
</button>
</p>
</form>
diff --git a/src/usr/local/www/diag_halt.php b/src/usr/local/www/diag_halt.php
index 3b1b01c..da4cc48 100755
--- a/src/usr/local/www/diag_halt.php
+++ b/src/usr/local/www/diag_halt.php
@@ -106,9 +106,9 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
<i class="fa fa-stop-circle"></i>
<?=gettext("Halt")?>
</button>
- <a href="/" class="btn btn-success">
- <i class="fa fa-play"></i>
- <?=gettext("No")?>
+ <a href="/" class="btn btn-info">
+ <i class="fa fa-undo"></i>
+ <?=gettext("Cancel")?>
</a>
</form>
</div>
diff --git a/src/usr/local/www/diag_reboot.php b/src/usr/local/www/diag_reboot.php
index bfdf873..e8e4535 100755
--- a/src/usr/local/www/diag_reboot.php
+++ b/src/usr/local/www/diag_reboot.php
@@ -147,9 +147,9 @@ events.push(function() {
<i class="fa fa-refresh"></i>
<?=gettext("Reboot")?>
</button>
- <a href="/" class="btn btn-success">
- <i class="fa fa-play"></i>
- <?=gettext("No")?>
+ <a href="/" class="btn btn-info">
+ <i class="fa fa-undo"></i>
+ <?=gettext("Cancel")?>
</a>
</form>
</div>
diff --git a/src/usr/local/www/diag_tables.php b/src/usr/local/www/diag_tables.php
index 6c7f027..90d1a91 100644
--- a/src/usr/local/www/diag_tables.php
+++ b/src/usr/local/www/diag_tables.php
@@ -184,9 +184,9 @@ if ($bogons || $urltable || !empty($entries)) {
} elseif (!empty($entries)) {
$group->add(new Form_Button(
'clearall',
- gettext('Clear Table'),
+ gettext('Empty Table'),
null,
- 'fa-undo'
+ 'fa-trash'
))->addClass('btn-danger btn-sm');
}
}
diff --git a/src/usr/local/www/jquery/pfSense.js b/src/usr/local/www/jquery/pfSense.js
index bd6ee7e..3ca74c4 100644
--- a/src/usr/local/www/jquery/pfSense.js
+++ b/src/usr/local/www/jquery/pfSense.js
@@ -143,7 +143,7 @@ $(function() {
// Add toggle-all when there are multiple checkboxes
$('.control-label + .checkbox.multi').each(function() {
- var a = $('<a name="btntoggleall" class="btn btn-xs btn-default">toggle all</a>');
+ var a = $('<a name="btntoggleall" class="btn btn-xs btn-info"><i class="fa fa-check-square-o icon-embed-btn"></i>Toggle All</a>');
a.on('click', function() {
var wrap = $(this).parents('.form-group').find('.checkbox.multi'),
diff --git a/src/usr/local/www/services_dhcpv6.php b/src/usr/local/www/services_dhcpv6.php
index 2640e7f..5ea233f 100644
--- a/src/usr/local/www/services_dhcpv6.php
+++ b/src/usr/local/www/services_dhcpv6.php
@@ -220,9 +220,9 @@ if (is_array($dhcrelaycfg) && isset($dhcrelaycfg['enable']) && isset($dhcrelaycf
}
}
-if ($_POST['apply'] == "Apply Changes") {
+if (isset($_POST['apply'])) {
$savemsg = dhcpv6_apply_changes(false);
-} elseif ($_POST['save'] == "Save") {
+} elseif (isset($_POST['save'])) {
unset($input_errors);
$old_dhcpdv6_enable = ($pconfig['enable'] == true);
diff --git a/src/usr/local/www/services_wol.php b/src/usr/local/www/services_wol.php
index 82f243e..4b9585a 100644
--- a/src/usr/local/www/services_wol.php
+++ b/src/usr/local/www/services_wol.php
@@ -182,14 +182,15 @@ $section->addInput(new Form_Input(
$mac
))->setHelp(gettext('Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx'));
-$section->addInput(new Form_Button(
+$form->add($section);
+
+$form->addGlobal(new Form_Button(
'Submit',
gettext('Send'),
null,
'fa-power-off'
))->addClass('btn-primary');
-$form->add($section);
print $form;
?>
@@ -223,8 +224,9 @@ print $form;
<?=htmlspecialchars($wolent['descr']);?>
</td>
<td>
- <a class="fa fa-pencil" title="<?=gettext('Edit device')?>" href="services_wol_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete device')?>" href="services_wol.php?act=del&amp;id=<?=$i?>"></a>
+ <a class="fa fa-pencil" title="<?=gettext('Edit Device')?>" href="services_wol_edit.php?id=<?=$i?>"></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete Device')?>" href="services_wol.php?act=del&amp;id=<?=$i?>"></a>
+ <a class="fa fa-power-off" title="<?=gettext('Wake Device')?>" href="?mac=<?=$wolent['mac'];?>&amp;if=<?=$wolent['interface'];?>"></a>
</td>
</tr>
<?php endforeach?>
@@ -240,7 +242,7 @@ print $form;
<a href="services_wol.php?wakeall=true" role="button" class="btn btn-primary">
<i class="fa fa-power-off icon-embed-btn"></i>
- <?=gettext("Wake all devices")?>
+ <?=gettext("Wake All Devices")?>
</a>
</div>
</div>
diff --git a/src/usr/local/www/system_advanced_admin.php b/src/usr/local/www/system_advanced_admin.php
index 28e9324..719f69b 100644
--- a/src/usr/local/www/system_advanced_admin.php
+++ b/src/usr/local/www/system_advanced_admin.php
@@ -94,6 +94,8 @@ $certs_available = false;
if (is_array($a_cert) && count($a_cert)) {
$certs_available = true;
+} else {
+ $a_cert = array();
}
if (!$pconfig['webguiproto'] || !$certs_available) {
diff --git a/src/usr/local/www/system_certmanager.php b/src/usr/local/www/system_certmanager.php
index 6a75e98..2475244 100644
--- a/src/usr/local/www/system_certmanager.php
+++ b/src/usr/local/www/system_certmanager.php
@@ -589,12 +589,17 @@ if (file_exists("/etc/ca_countries")) {
}
if ($act == "new" || (($_POST['save'] == gettext("Save")) && $input_errors)) {
-$form = new Form;
+ $form = new Form();
+ $form->setAction('system_certmanager.php?act=edit');
-if ($act == "csr" || (($_POST['save'] == gettext("Update")) && $input_errors)) {
- $form->setAction('system_certmanager.php?act=csr');
-
- $section = new Form_Section('Complete Signing Request');
+ if (isset($userid) && $a_user) {
+ $form->addGlobal(new Form_Input(
+ 'userid',
+ null,
+ 'hidden',
+ $userid
+ ));
+ }
if (isset($id) && $a_cert[$id]) {
$form->addGlobal(new Form_Input(
@@ -605,353 +610,306 @@ if ($act == "csr" || (($_POST['save'] == gettext("Update")) && $input_errors)) {
));
}
+ $section = new Form_Section('Add a New Certificate');
+
+ if (!isset($id)) {
+ $section->addInput(new Form_Select(
+ 'method',
+ 'Method',
+ $pconfig['method'],
+ $cert_methods
+ ))->toggles();
+ }
+
$section->addInput(new Form_Input(
'descr',
'Descriptive name',
'text',
- $pconfig['descr']
- ));
+ ($a_user && empty($pconfig['descr'])) ? $a_user[$userid]['name'] : $pconfig['descr']
+ ))->addClass('toggle-existing');
- $section->addInput(new Form_Textarea(
- 'csr',
- 'Signing request data',
- $pconfig['csr']
- ))->setReadonly()->setHelp('Copy the certificate signing data from here and '.
- 'forward it to your certificate authority for signing.');
+ $form->add($section);
+ $section = new Form_Section('Import Certificate');
+ $section->addClass('toggle-import collapse');
$section->addInput(new Form_Textarea(
'cert',
- 'Final certificate data',
+ 'Certificate data',
$pconfig['cert']
- ))->setHelp('Paste the certificate received from your certificate authority here.');
+ ))->setHelp('Paste a certificate in X.509 PEM format here.');
+
+ $section->addInput(new Form_Textarea(
+ 'key',
+ 'Private key data',
+ $pconfig['key']
+ ))->setHelp('Paste a private key in X.509 PEM format here.');
$form->add($section);
- print $form;
+ $section = new Form_Section('Internal Certificate');
+ $section->addClass('toggle-internal collapse');
+
+ if (!$internal_ca_count) {
+ $section->addInput(new Form_StaticText(
+ 'Certificate authority',
+ gettext('No internal Certificate Authorities have been defined. You must ').
+ '<a href="system_camanager.php?act=new&amp;method=internal"> '. gettext(" create") .'</a>'.
+ gettext(' an internal CA before creating an internal certificate.')
+ ));
+ } else {
+ $allCas = array();
+ foreach ($a_ca as $ca) {
+ if (!$ca['prv']) {
+ continue;
+ }
- include("foot.inc");
- exit;
-}
+ $allCas[ $ca['refid'] ] = $ca['descr'];
+ }
-$form->setAction('system_certmanager.php?act=edit');
+ $section->addInput(new Form_Select(
+ 'caref',
+ 'Certificate authority',
+ $pconfig['caref'],
+ $allCas
+ ));
+ }
-if (isset($userid) && $a_user) {
- $form->addGlobal(new Form_Input(
- 'userid',
- null,
- 'hidden',
- $userid
+ $section->addInput(new Form_Select(
+ 'keylen',
+ 'Key length',
+ $pconfig['keylen'],
+ array_combine($cert_keylens, $cert_keylens)
));
-}
-if (isset($id) && $a_cert[$id]) {
- $form->addGlobal(new Form_Input(
- 'id',
- null,
- 'hidden',
- $id
- ));
-}
+ $section->addInput(new Form_Select(
+ 'digest_alg',
+ 'Digest Algorithm',
+ $pconfig['digest_alg'],
+ array_combine($openssl_digest_algs, $openssl_digest_algs)
+ ))->setHelp('NOTE: It is recommended to use an algorithm stronger than '.
+ 'SHA1 when possible.');
-$section = new Form_Section('Add a New Certificate');
+ $section->addInput(new Form_Select(
+ 'type',
+ 'Certificate Type',
+ $pconfig['type'],
+ $cert_types
+ ))->setHelp('Type of certificate to generate. Used for placing '.
+ 'restrictions on the usage of the generated certificate.');
+
+ $section->addInput(new Form_Input(
+ 'lifetime',
+ 'Lifetime (days)',
+ 'number',
+ $pconfig['lifetime']
+ ));
-if (!isset($id)) {
$section->addInput(new Form_Select(
- 'method',
- 'Method',
- $pconfig['method'],
- $cert_methods
- ))->toggles();
-}
+ 'dn_country',
+ 'Country Code',
+ $pconfig['dn_country'],
+ $dn_cc
+ ));
-$section->addInput(new Form_Input(
- 'descr',
- 'Descriptive name',
- 'text',
- ($a_user && empty($pconfig['descr'])) ? $a_user[$userid]['name'] : $pconfig['descr']
-))->addClass('toggle-existing');
-
-$form->add($section);
-$section = new Form_Section('Import Certificate');
-$section->addClass('toggle-import collapse');
-
-$section->addInput(new Form_Textarea(
- 'cert',
- 'Certificate data',
- $pconfig['cert']
-))->setHelp('Paste a certificate in X.509 PEM format here.');
-
-$section->addInput(new Form_Textarea(
- 'key',
- 'Private key data',
- $pconfig['key']
-))->setHelp('Paste a private key in X.509 PEM format here.');
-
-$form->add($section);
-$section = new Form_Section('Internal Certificate');
-$section->addClass('toggle-internal collapse');
-
-if (!$internal_ca_count) {
- $section->addInput(new Form_StaticText(
- 'Certificate authority',
- gettext('No internal Certificate Authorities have been defined. You must ').
- '<a href="system_camanager.php?act=new&amp;method=internal"> '. gettext(" create") .'</a>'.
- gettext(' an internal CA before creating an internal certificate.')
+ $section->addInput(new Form_Input(
+ 'dn_state',
+ 'State or Province',
+ 'text',
+ $pconfig['dn_state'],
+ ['placeholder' => 'e.g. Texas']
));
-} else {
- $allCas = array();
- foreach ($a_ca as $ca) {
- if (!$ca['prv']) {
- continue;
- }
- $allCas[ $ca['refid'] ] = $ca['descr'];
+ $section->addInput(new Form_Input(
+ 'dn_city',
+ 'City',
+ 'text',
+ $pconfig['dn_city'],
+ ['placeholder' => 'e.g. Austin']
+ ));
+
+ $section->addInput(new Form_Input(
+ 'dn_organization',
+ 'Organization',
+ 'text',
+ $pconfig['dn_organization'],
+ ['placeholder' => 'e.g. My Company Inc.']
+ ));
+
+ $section->addInput(new Form_Input(
+ 'dn_email',
+ 'Email Address',
+ 'text',
+ $pconfig['dn_email'],
+ ['placeholder' => 'e.g. admin@mycompany.com']
+ ));
+
+ $section->addInput(new Form_Input(
+ 'dn_commonname',
+ 'Common Name',
+ 'text',
+ $pconfig['dn_commonname'],
+ ['placeholder' => 'e.g. www.example.com']
+ ));
+
+ if (empty($pconfig['altnames']['item'])) {
+ $pconfig['altnames']['item'] = array(
+ array('type' => null, 'value' => null)
+ );
+ }
+
+ $counter = 0;
+ $numrows = count($pconfig['altnames']['item']) - 1;
+
+ foreach ($pconfig['altnames']['item'] as $item) {
+
+ $group = new Form_Group($counter == 0 ? 'Alternative Names':'');
+
+ $group->add(new Form_Select(
+ 'altname_type' . $counter,
+ 'Type',
+ $item['type'],
+ array(
+ 'DNS' => gettext('FQDN or Hostname'),
+ 'IP' => gettext('IP address'),
+ 'URI' => gettext('URI'),
+ 'email' => gettext('email address'),
+ )
+ ))->setHelp(($counter == $numrows) ? 'Type':null);
+
+ $group->add(new Form_Input(
+ 'altname_value' . $counter,
+ null,
+ 'text',
+ $item['value']
+ ))->setHelp(($counter == $numrows) ? 'Value':null);
+
+ $group->add(new Form_Button(
+ 'deleterow' . $counter,
+ gettext('Delete'),
+ null,
+ 'fa-trash'
+ ))->addClass('btn-warning');
+
+ $group->addClass('repeatable');
+
+ $section->add($group);
+
+ $counter++;
}
+ $section->addInput(new Form_Button(
+ 'addrow',
+ gettext('Add'),
+ null,
+ 'fa-plus'
+ ))->addClass('btn-success');
+
+ $form->add($section);
+ $section = new Form_Section('External Signing Request');
+ $section->addClass('toggle-external collapse');
+
$section->addInput(new Form_Select(
- 'caref',
- 'Certificate authority',
- $pconfig['caref'],
- $allCas
+ 'csr_keylen',
+ 'Key length',
+ $pconfig['csr_keylen'],
+ array_combine($cert_keylens, $cert_keylens)
));
-}
-$section->addInput(new Form_Select(
- 'keylen',
- 'Key length',
- $pconfig['keylen'],
- array_combine($cert_keylens, $cert_keylens)
-));
-
-$section->addInput(new Form_Select(
- 'digest_alg',
- 'Digest Algorithm',
- $pconfig['digest_alg'],
- array_combine($openssl_digest_algs, $openssl_digest_algs)
-))->setHelp('NOTE: It is recommended to use an algorithm stronger than '.
- 'SHA1 when possible.');
-
-$section->addInput(new Form_Select(
- 'type',
- 'Certificate Type',
- $pconfig['type'],
- $cert_types
-))->setHelp('Type of certificate to generate. Used for placing '.
- 'restrictions on the usage of the generated certificate.');
-
-$section->addInput(new Form_Input(
- 'lifetime',
- 'Lifetime (days)',
- 'number',
- $pconfig['lifetime']
-));
-
-$section->addInput(new Form_Select(
- 'dn_country',
- 'Country Code',
- $pconfig['dn_country'],
- $dn_cc
-));
-
-$section->addInput(new Form_Input(
- 'dn_state',
- 'State or Province',
- 'text',
- $pconfig['dn_state'],
- ['placeholder' => 'e.g. Texas']
-));
-
-$section->addInput(new Form_Input(
- 'dn_city',
- 'City',
- 'text',
- $pconfig['dn_city'],
- ['placeholder' => 'e.g. Austin']
-));
-
-$section->addInput(new Form_Input(
- 'dn_organization',
- 'Organization',
- 'text',
- $pconfig['dn_organization'],
- ['placeholder' => 'e.g. My Company Inc.']
-));
-
-$section->addInput(new Form_Input(
- 'dn_email',
- 'Email Address',
- 'text',
- $pconfig['dn_email'],
- ['placeholder' => 'e.g. admin@mycompany.com']
-));
-
-$section->addInput(new Form_Input(
- 'dn_commonname',
- 'Common Name',
- 'text',
- $pconfig['dn_commonname'],
- ['placeholder' => 'e.g. www.example.com']
-));
-
-if (empty($pconfig['altnames']['item'])) {
- $pconfig['altnames']['item'] = array(
- array('type' => null, 'value' => null)
- );
-}
+ $section->addInput(new Form_Select(
+ 'csr_digest_alg',
+ 'Digest Algorithm',
+ $pconfig['csr_digest_alg'],
+ array_combine($openssl_digest_algs, $openssl_digest_algs)
+ ))->setHelp('NOTE: It is recommended to use an algorithm stronger than '.
+ 'SHA1 when possible');
-$counter = 0;
-$numrows = count($pconfig['altnames']['item']) - 1;
+ $section->addInput(new Form_Select(
+ 'csr_dn_country',
+ 'Country Code',
+ $pconfig['csr_dn_country'],
+ $dn_cc
+ ));
-foreach ($pconfig['altnames']['item'] as $item) {
+ $section->addInput(new Form_Input(
+ 'csr_dn_state',
+ 'State or Province',
+ 'text',
+ $pconfig['csr_dn_state'],
+ ['placeholder' => 'e.g. Texas']
+ ));
- $group = new Form_Group($counter == 0 ? 'Alternative Names':'');
+ $section->addInput(new Form_Input(
+ 'csr_dn_city',
+ 'City',
+ 'text',
+ $pconfig['csr_dn_city'],
+ ['placeholder' => 'e.g. Austin']
+ ));
- $group->add(new Form_Select(
- 'altname_type' . $counter,
- 'Type',
- $item['type'],
- array(
- 'DNS' => gettext('FQDN or Hostname'),
- 'IP' => gettext('IP address'),
- 'URI' => gettext('URI'),
- 'email' => gettext('email address'),
- )
- ))->setHelp(($counter == $numrows) ? 'Type':null);
+ $section->addInput(new Form_Input(
+ 'csr_dn_organization',
+ 'Organization',
+ 'text',
+ $pconfig['csr_dn_organization'],
+ ['placeholder' => 'e.g. My Company Inc.']
+ ));
- $group->add(new Form_Input(
- 'altname_value' . $counter,
- null,
+ $section->addInput(new Form_Input(
+ 'csr_dn_email',
+ 'Email Address',
'text',
- $item['value']
- ))->setHelp(($counter == $numrows) ? 'Value':null);
+ $pconfig['csr_dn_email'],
+ ['placeholder' => 'e.g. admin@mycompany.com']
+ ));
- $group->add(new Form_Button(
- 'deleterow' . $counter,
- gettext('Delete'),
- null,
- 'fa-trash'
- ))->addClass('btn-warning');
+ $section->addInput(new Form_Input(
+ 'csr_dn_commonname',
+ 'Common Name',
+ 'text',
+ $pconfig['csr_dn_commonname'],
+ ['placeholder' => 'e.g. internal-ca']
+ ));
- $group->addClass('repeatable');
+ $form->add($section);
+ $section = new Form_Section('Choose an Existing Certificate');
+ $section->addClass('toggle-existing collapse');
- $section->add($group);
+ $existCerts = array();
- $counter++;
-}
+ foreach ($config['cert'] as $cert) {
+ if (is_array($config['system']['user'][$userid]['cert'])) { // Could be MIA!
+ if (isset($userid) && in_array($cert['refid'], $config['system']['user'][$userid]['cert'])) {
+ continue;
+ }
+ }
-$section->addInput(new Form_Button(
- 'addrow',
- gettext('Add'),
- null,
- 'fa-plus'
-))->addClass('btn-success');
-
-$form->add($section);
-$section = new Form_Section('External Signing Request');
-$section->addClass('toggle-external collapse');
-
-$section->addInput(new Form_Select(
- 'csr_keylen',
- 'Key length',
- $pconfig['csr_keylen'],
- array_combine($cert_keylens, $cert_keylens)
-));
-
-$section->addInput(new Form_Select(
- 'csr_digest_alg',
- 'Digest Algorithm',
- $pconfig['csr_digest_alg'],
- array_combine($openssl_digest_algs, $openssl_digest_algs)
-))->setHelp('NOTE: It is recommended to use an algorithm stronger than '.
- 'SHA1 when possible');
-
-$section->addInput(new Form_Select(
- 'csr_dn_country',
- 'Country Code',
- $pconfig['csr_dn_country'],
- $dn_cc
-));
-
-$section->addInput(new Form_Input(
- 'csr_dn_state',
- 'State or Province',
- 'text',
- $pconfig['csr_dn_state'],
- ['placeholder' => 'e.g. Texas']
-));
-
-$section->addInput(new Form_Input(
- 'csr_dn_city',
- 'City',
- 'text',
- $pconfig['csr_dn_city'],
- ['placeholder' => 'e.g. Austin']
-));
-
-$section->addInput(new Form_Input(
- 'csr_dn_organization',
- 'Organization',
- 'text',
- $pconfig['csr_dn_organization'],
- ['placeholder' => 'e.g. My Company Inc.']
-));
-
-$section->addInput(new Form_Input(
- 'csr_dn_email',
- 'Email Address',
- 'text',
- $pconfig['csr_dn_email'],
- ['placeholder' => 'e.g. admin@mycompany.com']
-));
-
-$section->addInput(new Form_Input(
- 'csr_dn_commonname',
- 'Common Name',
- 'text',
- $pconfig['csr_dn_commonname'],
- ['placeholder' => 'e.g. internal-ca']
-));
-
-$form->add($section);
-$section = new Form_Section('Choose an Existing Certificate');
-$section->addClass('toggle-existing collapse');
-
-$existCerts = array();
-
-foreach ($config['cert'] as $cert) {
- if (is_array($config['system']['user'][$userid]['cert'])) { // Could be MIA!
- if (isset($userid) && in_array($cert['refid'], $config['system']['user'][$userid]['cert'])) {
- continue;
+ $ca = lookup_ca($cert['caref']);
+ if ($ca) {
+ $cert['descr'] .= " (CA: {$ca['descr']})";
}
- }
- $ca = lookup_ca($cert['caref']);
- if ($ca) {
- $cert['descr'] .= " (CA: {$ca['descr']})";
- }
+ if (cert_in_use($cert['refid'])) {
+ $cert['descr'] .= " <i>In Use</i>";
+ }
+ if (is_cert_revoked($cert)) {
+ $cert['descr'] .= " <b>Revoked</b>";
+ }
- if (cert_in_use($cert['refid'])) {
- $cert['descr'] .= " <i>In Use</i>";
- }
- if (is_cert_revoked($cert)) {
- $cert['descr'] .= " <b>Revoked</b>";
+ $existCerts[ $cert['refid'] ] = $cert['descr'];
}
- $existCerts[ $cert['refid'] ] = $cert['descr'];
-}
-
-
-$section->addInput(new Form_Select(
- 'certref',
- 'Existing Certificates',
- $pconfig['certref'],
- $existCerts
-));
+ $section->addInput(new Form_Select(
+ 'certref',
+ 'Existing Certificates',
+ $pconfig['certref'],
+ $existCerts
+ ));
-$form->add($section);
-print $form;
+ $form->add($section);
+ print $form;
} else if ($act == "csr" || (($_POST['save'] == gettext("Update")) && $input_errors)) {
$form = new Form(false);
+ $form->setAction('system_certmanager.php?act=csr');
$section = new Form_Section("Complete Signing Request for " . $pconfig['descr']);
OpenPOWER on IntegriCloud