diff --git a/src/www/diag_authentication.php b/src/www/diag_authentication.php
index e8a07ecc8..2f521a0c1 100644
--- a/src/www/diag_authentication.php
+++ b/src/www/diag_authentication.php
@@ -79,8 +79,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
}
-$shortcut_section = "authentication";
-
include("head.inc");
?>
diff --git a/src/www/fbegin.inc b/src/www/fbegin.inc
index 0e2ca865e..6e101dcc0 100644
--- a/src/www/fbegin.inc
+++ b/src/www/fbegin.inc
@@ -111,8 +111,6 @@ if($need_alert_display == true) {
'.get_shortcut_main_link($shortcut_section, false).'';
- echo '
'.get_shortcut_status_link($shortcut_section, false).'';
echo ''.get_shortcut_log_link($shortcut_section, false).'';
}
?>
diff --git a/src/www/load_balancer_virtual_server_edit.php b/src/www/load_balancer_virtual_server_edit.php
index 9facad1be..4679e3a62 100644
--- a/src/www/load_balancer_virtual_server_edit.php
+++ b/src/www/load_balancer_virtual_server_edit.php
@@ -126,7 +126,7 @@ if ($_POST) {
}
}
-$shortcut_section = "relayd-virtualservers";
+$shortcut_section = 'relayd';
include("head.inc");
diff --git a/src/www/shortcuts.inc b/src/www/shortcuts.inc
index 4837f9f46..6308ea175 100644
--- a/src/www/shortcuts.inc
+++ b/src/www/shortcuts.inc
@@ -30,87 +30,23 @@
$shortcuts = array();
-/* Load and process custom shortcuts. */
-function get_shortcut_files($directory)
+function get_shortcut_by_service_name($servicename)
{
- $dir_array = array();
-
- if ($dh = @opendir($directory)) {
- while (($file = readdir($dh)) !== false) {
- $canadd = 0;
- if($file == ".")
- $canadd = 1;
- if($file == "..")
- $canadd = 1;
- if($canadd == 0)
- array_push($dir_array, $file);
- }
- closedir($dh);
- }
-
- return $dir_array;
-}
-
-function get_shortcut_by_service_name($servicename) {
global $shortcuts;
+
foreach ($shortcuts as $name => $shortcut) {
- if (!empty($shortcut['service']) && ($shortcut['service'] == $servicename))
+ if (!empty($shortcut['service']) && ($shortcut['service'] == $servicename)) {
return $name;
+ }
}
+
return null;
}
-function get_shortcut_main_link($shortcut_section, $addspace = true, $service = array()) {
- global $g, $shortcuts;
- if(empty($shortcut_section))
- return "";
- $space = ($addspace) ? " " : "" ;
- switch ($shortcut_section) {
- case "openvpn":
- if (!empty($service['mode']) && is_numeric($service['id']))
- $link = "vpn_openvpn_{$service['mode']}.php?act=edit&id={$service['id']}";
- else
- $link = $shortcuts[$shortcut_section]['main'];
- break;
- default:
- $link = $shortcuts[$shortcut_section]['main'];
- break;
- }
- if (!empty($link)) {
- if (strtok($_SERVER['REQUEST_URI'],'?') != "/status_services.php")
- return "{$space}Main page";
- else
- return "{$space}";
- }
-}
-
-function get_shortcut_status_link($shortcut_section, $addspace = true, $service = array())
+function get_shortcut_log_link($shortcut_section, $addspace = true)
{
global $g, $shortcuts;
- if (empty($shortcut_section)) {
- return '';
- }
-
- $space = ($addspace) ? " " : "" ;
-
- if (isset($shortcuts[$shortcut_section]['status'])) {
- $link = $shortcuts[$shortcut_section]['status'];
- } else {
- $link = null;
- }
-
- if (!empty($link)) {
- if (strtok($_SERVER['REQUEST_URI'],'?') != "/status_services.php") {
- return "{$space}Status";
- } else {
- return "{$space}";
- }
- }
-}
-
-function get_shortcut_log_link($shortcut_section, $addspace = true) {
- global $g, $shortcuts;
$space = ($addspace) ? " " : "" ;
if(!empty($shortcut_section) && !empty($shortcuts[$shortcut_section]['log'])) {
if (strtok($_SERVER['REQUEST_URI'],'?') != "/status_services.php")
@@ -124,7 +60,6 @@ $shortcuts['upnp'] = array();
$shortcuts['upnp']['log'] = "diag_logs_routing.php";
$shortcuts['upnp']['service'] = "miniupnpd";
-
$shortcuts['relayd'] = array();
$shortcuts['relayd']['service'] = "relayd";
@@ -134,7 +69,6 @@ $shortcuts['dhcp']['service'] = "dhcpd";
$shortcuts['dhcp6'] = array();
$shortcuts['dhcp6']['log'] = "diag_logs_dhcp.php";
-$shortcuts['dhcp6']['status'] = "status_dhcpv6_leases.php";
$shortcuts['ipsec'] = array();
$shortcuts['ipsec']['service'] = "ipsec";
@@ -155,18 +89,10 @@ $shortcuts['gateways'] = array();
$shortcuts['gateways']['service'] = "apinger";
$shortcuts['pppoes'] = array();
-$shortcuts['pppoes']['main'] = "vpn_pppoe.php";
$shortcuts['pppoes']['log'] = "diag_logs_vpn.php?vpntype=poes";
$shortcuts['snmp'] = array();
-$shortcuts['snmp']['main'] = "services_snmp.php";
$shortcuts['snmp']['service'] = "bsnmpd";
-$shortcuts['authentication'] = array();
-$shortcuts['authentication']['main'] = "system_authservers.php";
-$shortcuts['authentication']['status'] = "diag_authentication.php";
-
$shortcuts['squid'] = array();
-$shortcuts['squid']['main'] = "ui/proxy/";
-$shortcuts['squid']['log'] = "diag_logs_proxy.php";
$shortcuts['squid']['service'] = "squid";
diff --git a/src/www/status_services.php b/src/www/status_services.php
index 94289893b..c44e37a27 100644
--- a/src/www/status_services.php
+++ b/src/www/status_services.php
@@ -321,8 +321,6 @@ include("head.inc");
echo "" . get_service_control_links($service);
$scut = get_shortcut_by_service_name($service['name']);
if (!empty($scut)) {
- echo get_shortcut_main_link($scut, true, $service);
- echo get_shortcut_status_link($scut, true, $service);
echo get_shortcut_log_link($scut, true);
}
echo " | \n";
diff --git a/src/www/system_authservers.php b/src/www/system_authservers.php
index 658654a4f..407a3a6c3 100644
--- a/src/www/system_authservers.php
+++ b/src/www/system_authservers.php
@@ -264,8 +264,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
-$shortcut_section = "authentication";
-
// list of all possible fields for auth item (used for form init)
$all_authfields = array('type','name','ldap_caref','ldap_host','ldap_port','ldap_urltype','ldap_protver','ldap_scope',
'ldap_basedn','ldap_authcn','ldap_extended_query','ldap_binddn','ldap_bindpw','ldap_attr_user','radius_host',