mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
www: main and status shortcuts removed
They are replaced by the navigation. Log files need to be cleaned up further. Progress is good. :)
This commit is contained in:
parent
32beb6e90e
commit
0d28ce2528
@ -79,8 +79,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
}
|
||||
}
|
||||
|
||||
$shortcut_section = "authentication";
|
||||
|
||||
include("head.inc");
|
||||
|
||||
?>
|
||||
|
||||
@ -111,8 +111,6 @@ if($need_alert_display == true) {
|
||||
</li>
|
||||
<?php
|
||||
if (isset($shortcut_section)) {
|
||||
echo '<li>'.get_shortcut_main_link($shortcut_section, false).'</li>';
|
||||
echo '<li>'.get_shortcut_status_link($shortcut_section, false).'</li>';
|
||||
echo '<li>'.get_shortcut_log_link($shortcut_section, false).'</li>';
|
||||
}
|
||||
?>
|
||||
|
||||
@ -126,7 +126,7 @@ if ($_POST) {
|
||||
}
|
||||
}
|
||||
|
||||
$shortcut_section = "relayd-virtualservers";
|
||||
$shortcut_section = 'relayd';
|
||||
|
||||
include("head.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}<a href=\"{$link}\" title=\"" . gettext("Main page for this section") . "\">Main page</a>";
|
||||
else
|
||||
return "{$space}<a href=\"{$link}\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . gettext("Main page for this section") . "\"><span class=\"glyphicon glyphicon-home\"></span></a>";
|
||||
}
|
||||
}
|
||||
|
||||
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}<a href=\"{$link}\" title=\"" . gettext("Status of items on this page") . "\">Status</a>";
|
||||
} else {
|
||||
return "{$space}<a href=\"{$link}\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . gettext("Status of items on this page") . "\"><span class=\"glyphicon glyphicon-eye-open\"></span></a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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";
|
||||
|
||||
@ -321,8 +321,6 @@ include("head.inc");
|
||||
echo "<td valign=\"middle\" class=\"list nowrap\">" . 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 "</td></tr>\n";
|
||||
|
||||
@ -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',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user