Port license page to MVC (#3118)

* Port license page to MVC

* Use more template variables on the license page.

Also make sure to handle cases where someone changes one of the variables (e.g. when creating their own product based on OPNsense). Discussed with Jos Schellevis.

* Move legacy menu to Core

* Use another approach to display ®

* ACL fix
This commit is contained in:
Michael Steenbeek 2019-01-11 11:52:59 +01:00 committed by Franco Fichtner
parent 12b72e0edb
commit 8aadeb2807
6 changed files with 81 additions and 74 deletions

5
plist
View File

@ -332,6 +332,7 @@
/usr/local/opnsense/mvc/app/controllers/OPNsense/Core/Api/repositories/opnsense.xml
/usr/local/opnsense/mvc/app/controllers/OPNsense/Core/FirmwareController.php
/usr/local/opnsense/mvc/app/controllers/OPNsense/Core/IndexController.php
/usr/local/opnsense/mvc/app/controllers/OPNsense/Core/LicenseController.php
/usr/local/opnsense/mvc/app/controllers/OPNsense/Cron/Api/ServiceController.php
/usr/local/opnsense/mvc/app/controllers/OPNsense/Cron/Api/SettingsController.php
/usr/local/opnsense/mvc/app/controllers/OPNsense/Cron/IndexController.php
@ -476,7 +477,6 @@
/usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/UniqueIdField.php
/usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/UpdateOnlyTextField.php
/usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/UrlField.php
/usr/local/opnsense/mvc/app/models/OPNsense/Base/Menu/Menu.xml
/usr/local/opnsense/mvc/app/models/OPNsense/Base/Menu/MenuInitException.php
/usr/local/opnsense/mvc/app/models/OPNsense/Base/Menu/MenuItem.php
/usr/local/opnsense/mvc/app/models/OPNsense/Base/Menu/MenuSystem.php
@ -495,6 +495,7 @@
/usr/local/opnsense/mvc/app/models/OPNsense/Core/ACL.php
/usr/local/opnsense/mvc/app/models/OPNsense/Core/ACL/ACL.php
/usr/local/opnsense/mvc/app/models/OPNsense/Core/ACL/ACL.xml
/usr/local/opnsense/mvc/app/models/OPNsense/Core/Menu/Menu.xml
/usr/local/opnsense/mvc/app/models/OPNsense/Cron/ACL/ACL.xml
/usr/local/opnsense/mvc/app/models/OPNsense/Cron/Cron.php
/usr/local/opnsense/mvc/app/models/OPNsense/Cron/Cron.xml
@ -547,6 +548,7 @@
/usr/local/opnsense/mvc/app/views/OPNsense/CaptivePortal/index.volt
/usr/local/opnsense/mvc/app/views/OPNsense/CaptivePortal/vouchers.volt
/usr/local/opnsense/mvc/app/views/OPNsense/Core/firmware.volt
/usr/local/opnsense/mvc/app/views/OPNsense/Core/license.volt
/usr/local/opnsense/mvc/app/views/OPNsense/Core/not_found.volt
/usr/local/opnsense/mvc/app/views/OPNsense/Cron/index.volt
/usr/local/opnsense/mvc/app/views/OPNsense/Diagnostics/arp.volt
@ -1656,7 +1658,6 @@
/usr/local/www/javascript/wizard/autosuggest.js
/usr/local/www/javascript/wizard/disablekeys.js
/usr/local/www/javascript/wizard/suggestions.js
/usr/local/www/license.php
/usr/local/www/reboot.php
/usr/local/www/reporting_settings.php
/usr/local/www/services_dhcp.php

View File

@ -0,0 +1,46 @@
<?php
/**
* Copyright (C) 2018 Deciso B.V.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
namespace OPNsense\Core;
/**
* Class LicenseController
* @package OPNsense\Core
*/
class LicenseController extends \OPNsense\Base\IndexController
{
/**
* return to / for non existent actions
*/
public function indexAction()
{
$this->view->pick('OPNsense/Core/license');
}
}

View File

@ -20,14 +20,14 @@
<page-getserviceproviders>
<name>AJAX: Get Service Providers</name>
<patterns>
<pattern>license.php</pattern>
<pattern>ui/core/license</pattern>
<pattern>getserviceproviders.php*</pattern>
</patterns>
</page-getserviceproviders>
<page-getstats>
<name>AJAX: Get Stats</name>
<patterns>
<pattern>license.php</pattern>
<pattern>ui/core/license</pattern>
<pattern>widgets/api/get.php*</pattern>
</patterns>
</page-getstats>
@ -705,7 +705,7 @@
<page-system-license>
<name>System: License</name>
<patterns>
<pattern>license.php*</pattern>
<pattern>ui/core/license*</pattern>
</patterns>
</page-system-license>
<page-system-staticroutes>

View File

@ -5,7 +5,7 @@
<Root url="/" visibility="hidden"/>
<RootArgs url="/?*" visibility="hidden"/>
</Dashboard>
<License order="1" url="/license.php" cssClass="fa fa-balance-scale fa-fw"/>
<License order="1" url="/ui/core/license" cssClass="fa fa-balance-scale fa-fw"/>
<Password order="2" url="/system_usermanager_passwordmg.php" cssClass="fa fa-key fa-fw">
<Edit url="/system_usermanager_passwordmg.php*" visibility="hidden"/>
</Password>
@ -149,13 +149,13 @@
<Rules order="20" cssClass="fa fa-check fa-fw" />
<NAT order="30" cssClass="fa fa-exchange fa-fw">
<PortForward order="100" VisibleName="Port Forward" url="/firewall_nat.php">
<Edit url="/firewall_nat_edit.php*" visibility="hidden"/>
<Edit url="/firewall_nat_edit.php*" visibility="hidden"/>
</PortForward>
<OneToOne order="200" VisibleName="One-to-One" url="/firewall_nat_1to1.php">
<Edit url="/firewall_nat_1to1_edit.php*" visibility="hidden"/>
<Edit url="/firewall_nat_1to1_edit.php*" visibility="hidden"/>
</OneToOne>
<Outbound order="300" VisibleName="Outbound" url="/firewall_nat_out.php">
<Edit url="/firewall_nat_out_edit.php*" visibility="hidden"/>
<Edit url="/firewall_nat_out_edit.php*" visibility="hidden"/>
</Outbound>
<NPTv6 order="400" url="/firewall_nat_npt.php">
<Edit url="/firewall_nat_npt_edit.php*" visibility="hidden"/>

View File

@ -0,0 +1,25 @@
<section class="col-xs-11">
<p><a href="{{ product_website }}" target="_blank">{{ product_name }}{% if product_name == 'OPNsense' %}®{% endif %}</a> is Copyright &copy; {{ product_copyright_years }} {{ product_copyright_owner }}<br>All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ol><li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li></ol>
<p>THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
{% if product_name != 'OPNsense' %}
<p>{{ product_name }} is based on <a href="https://opnsense.org/" target="_blank">OPNsense&reg;</a>, copyright &copy; Deciso B.V. All rights reserved.</p>
{% endif %}
<p>OPNsense is based on <a href="http://www.freebsd.org" target="_blank">FreeBSD</a>, copyright &copy; The FreeBSD Project. All rights reserved.</p>
<p>OPNsense is a fork of <a href="http://www.pfsense.org" target="_blank">pfSense&reg;</a> <small>(Copyright &copy; 2004-2014 Electric Sheep Fencing, LLC. All rights reserved.)</small>, which is a fork of <a href="http://m0n0.ch/wall" target="_blank">m0n0wall&reg;</a> <small>(Copyright &copy; 2002-2013 Manuel Kasper)</small>.</p>
<p>OPNsense includes various freely available software packages and ports.
The incorporated third party tools are listed <a href="/ui/core/firmware#packages">here</a>.</p>
<p>The authors of OPNsense would like to thank all contributors for their efforts.</p>
</section>
'

View File

@ -1,65 +0,0 @@
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
require_once("guiconfig.inc");
include("head.inc");
?>
<body>
<?php include("fbegin.inc"); ?>
<section class="page-content-main">
<div class="container-fluid ">
<div class="row">
<section class="col-xs-11">
<p><a href="https://opnsense.org/" target="_blank">OPNsense&reg;</a> is Copyright &copy; <?=$g['product_copyright_years'];?> <?= $g['product_copyright_owner'] ?><br>All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ol><li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li></ol>
<p>THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
<p>OPNsense is based on <a href="http://www.freebsd.org" target="_blank">FreeBSD</a> Copyright &copy; The FreeBSD Project. All rights reserved.</p>
<p>OPNsense is a fork of <a href="http://www.pfsense.org" target="_blank">pfSense&reg;</a> <small>(Copyright &copy; 2004-2014 Electric Sheep Fencing, LLC. All rights reserved.)</small> a fork from <a href="http://m0n0.ch/wall" target="_blank">m0n0wall&reg;</a> <small>(Copyright &copy; 2002-2013 Manuel Kasper)</small>.</p>
<p>OPNsense includes various freely available software packages and ports.
The incorporated third party tools are listed <a href="/ui/core/firmware#packages">here</a>.</p>
<p>The authors of OPNsense would like to thank all contributors for their efforts.</p>
</section>
</div>
</div>
</section>
<?php include("foot.inc");