Commit fc3fcf8a authored by Franco Fichtner's avatar Franco Fichtner

wizard: split modelling, fix navigation while at it

PR: https://github.com/opnsense/core/issues/1359
parent 4b5c80b9
......@@ -71,8 +71,8 @@
</Tunables>
</Settings>
<LogFile order="150" VisibleName="Log File" url="/diag_logs.php" cssClass="fa fa-eye fa-fw"/>
<Wizard order="140" url="/wizard.php" cssClass="fa fa-magic fa-fw">
<Step url="/wizard.php*" visibility="hidden"/>
<Wizard order="140" url="/wizard.php?xml=setup" cssClass="fa fa-magic fa-fw">
<Step url="/wizard.php?xml=setup*" visibility="hidden"/>
</Wizard>
<Access order="10" cssClass="fa fa-users fa-fw">
<Users order="10" url="/system_usermanager.php">
......@@ -283,6 +283,7 @@
<OpenVPN cssClass="fa fa-lock fa-fw" order="20">
<Servers order="10" url="/vpn_openvpn_server.php">
<Edit url="/vpn_openvpn_server.php?*" visibility="hidden"/>
<Step url="/wizard.php?xml=openvpn*" visibility="hidden"/>
</Servers>
<Clients order="20" url="/vpn_openvpn_client.php">
<Edit url="/vpn_openvpn_client.php?*" visibility="hidden"/>
......
......@@ -449,12 +449,18 @@
<pattern>interfaces_wireless.php*</pattern>
</patterns>
</page-interfaces-wireless>
<page-pfsensewizardsubsystem>
<name>Wizard subsystem</name>
<page-wizard-general>
<name>General Setup Wizard</name>
<patterns>
<pattern>wizard.php*</pattern>
<pattern>wizard.php?xml=general*</pattern>
</patterns>
</page-pfsensewizardsubsystem>
</page-wizard-general>
<page-wizard-openvpn>
<name>OpenVPN Server Wizard</name>
<patterns>
<pattern>wizard.php?xml=openvpn*</pattern>
</patterns>
</page-wizard-openvpn>
<page-services-dhcprelay>
<name>Services: DHCP Relay</name>
<patterns>
......
......@@ -29,34 +29,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/* Determine automated help URL. Should output the page name and
parameters separately */
$uri_split = "";
preg_match("/\/(.*)\?(.*)/", $_SERVER["REQUEST_URI"], $uri_split);
/* If there was no match, there were no parameters, just grab the filename
Otherwise, use the matched filename from above. */
if (empty($uri_split[0])) {
$pagename = ltrim($_SERVER["REQUEST_URI"], '/');
} else {
$pagename = $uri_split[1];
}
/* If the page name is still empty, the user must have requested / (index.php) */
if (empty($pagename)) {
$pagename = "index.php";
}
/* If the filename is wizard.php, reparse looking for the .xml filename */
if ($pagename == 'wizard.php') {
$param_split = explode('&', $uri_split[2]);
foreach ($param_split as $param) {
if (substr($param, 0, 4) == "xml=") {
$xmlfile = explode('=', $param);
$pagename = $xmlfile[1];
}
}
}
$aclObj = new \OPNsense\Core\ACL();
/* display a top alert bar if need be */
......
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