- Contunue gatway support implementation.
This commit is contained in:
76
var/www/cgi-bin/vpn-admin_board.cgi
Executable file → Normal file
76
var/www/cgi-bin/vpn-admin_board.cgi
Executable file → Normal file
@@ -109,10 +109,10 @@ Destination_Status_Board()
|
||||
echo " <H2>Destination Status Board</H2>"
|
||||
echo ""
|
||||
echo " <TABLE BORDER=\"1\" WIDTH=\"100%\">"
|
||||
echo " <TR class=\"header\"><TD class=\"header\">#</TD><TD>Name</TD><TD>Type</TD><TD>Device</TD><TD>IP</TD><TD>Host Name</TD><TD>Config</TD><TD>Table</TD><TD>Status</TD><TD>Bytes In</TD><TD>Bytes Out</TD><TD>UpTime</TD></TR>"
|
||||
echo " <TR class=\"header\"><TD class=\"header\">#</TD><TD>Name</TD><TD>Type</TD><TD>Device</TD><TD>Status</TD><TD>IP</TD><TD>Host Name</TD><TD>Config</TD><TD>Table</TD><TD>Bytes In</TD><TD>Bytes Out</TD><TD>UpTime</TD></TR>"
|
||||
else
|
||||
echo "TABLE: Destination_Status_Board"
|
||||
echo "#;Name;Type;Device;IP;Host Name;Config;Table;Status;Bytes In;Bytes Out;UpTime"
|
||||
echo "#;Name;Type;Device;Status;IP;Host Name;Config;Table;Bytes In;Bytes Out;UpTime"
|
||||
fi
|
||||
|
||||
|
||||
@@ -127,18 +127,18 @@ Destination_Status_Board()
|
||||
|
||||
if [[ "${format}" == "html" ]]
|
||||
then
|
||||
echo -n "<TR><TD class="header">${dst_id}</TD><TD>${dst_name}</TD><TD>${NETWORK_DST_TYPE[${dst_type}]}</TD><TD>${dst_device}</TD><TD>${dst_ip}</TD><TD>${dst_host_name}</TD><TD>${dst_config:--}</TD><TD>${dst_table}</TD><TD>"
|
||||
echo -n "<TR><TD class="header">${dst_id}</TD><TD>${dst_name}</TD><TD>${NETWORK_DST_TYPE[${dst_type}]}</TD><TD>${dst_device}</TD>"
|
||||
|
||||
if [[ "${dst_status}" == 1 ]]
|
||||
then
|
||||
echo -n "<IMG SRC=\"/icons/user-online.png\" TITLE=\"Up\" ALT=\"Up\"></TD>"
|
||||
echo -n "<TD><IMG SRC=\"/icons/user-online.png\" TITLE=\"Up\" ALT=\"Up\"></TD>"
|
||||
else
|
||||
echo -n "<IMG SRC=\"/icons/user-busy.png\" TITLE=\"Down\" ALT=\"Down\"></TD>"
|
||||
echo -n "<TD><IMG SRC=\"/icons/user-busy.png\" TITLE=\"Down\" ALT=\"Down\"></TD>"
|
||||
fi
|
||||
|
||||
echo "<TD>${dst_bytes_received:--}</TD><TD>${dst_bytes_sent:--}</TD><TD>${dst_uptime:--}</TD>"
|
||||
echo "<TD>${dst_ip:--}</TD><TD>${dst_host_name:--}</TD><TD>${dst_config:--}</TD><TD>${dst_table}</TD><TD>${dst_bytes_received:--}</TD><TD>${dst_bytes_sent:--}</TD><TD>${dst_uptime:--}</TD>"
|
||||
else
|
||||
echo "${dst_id};${dst_name};${NETWORK_DST_TYPE[${dst_type}]};${dst_device};${dst_ip};${dst_host_name};${dst_config};${dst_table};${dst_status};${dst_bytes_received};${dst_bytes_sent};${dst_uptime}"
|
||||
echo "${dst_id};${dst_name};${NETWORK_DST_TYPE[${dst_type}]};${dst_device};${dst_status};${dst_ip};${dst_host_name};${dst_config};${dst_table};${dst_bytes_received};${dst_bytes_sent};${dst_uptime}"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -219,32 +219,35 @@ Source_Routing_Board_Line()
|
||||
do
|
||||
network_dst_tab_get ${dst_id}
|
||||
|
||||
if [[ "${format}" == "html" ]]
|
||||
if [[ ( "${admin}" == "true") || ( "${dst_type}" != 1) ]]
|
||||
then
|
||||
echo -n "<TD><TABLE class=\"${class}\" BORDER=\"0\" WIDTH=\"100%\"><TR><TD class=\"half\">"
|
||||
|
||||
if [[ "${dst_table}" == "${src_table}" ]]
|
||||
if [[ "${format}" == "html" ]]
|
||||
then
|
||||
echo -n "<IMG SRC=\"/icons/user-online.png\" TITLE=\"Up\" ALT=\"Up\"></TD><TD> "
|
||||
else
|
||||
echo -n "<IMG SRC=\"/icons/user-busy.png\" TITLE=\"Down\" ALT=\"Down\"></TD><TD>"
|
||||
|
||||
if [[ ( ${admin} == "true") || ( "${REMOTE_USER}" == "${src_owner}") ]]
|
||||
echo -n "<TD><TABLE class=\"${class}\" BORDER=\"0\" WIDTH=\"100%\"><TR><TD class=\"half\">"
|
||||
|
||||
if [[ "${dst_table}" == "${src_table}" ]]
|
||||
then
|
||||
echo -n "<A HREF=\"?cmd=route_set&admin=${admin}&filter=${filter}&ip=${src_ip}&vpn=${dst_id}\"><IMG SRC=\"/icons/user-invisible.png\" TITLE=\"Activate\" ALT=\"Activate\"></A>"
|
||||
echo -n "<IMG SRC=\"/icons/user-online.png\" TITLE=\"Up\" ALT=\"Up\"></TD><TD> "
|
||||
else
|
||||
echo -n " "
|
||||
echo -n "<IMG SRC=\"/icons/user-busy.png\" TITLE=\"Down\" ALT=\"Down\"></TD><TD>"
|
||||
|
||||
if [[ ( ${admin} == "true") || ( "${REMOTE_USER}" == "${src_owner}") ]]
|
||||
then
|
||||
echo -n "<A HREF=\"?cmd=route_set&admin=${admin}&filter=${filter}&ip=${src_ip}&vpn=${dst_id}\"><IMG SRC=\"/icons/user-invisible.png\" TITLE=\"Activate\" ALT=\"Activate\"></A>"
|
||||
else
|
||||
echo -n " "
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -n "</TD></TR></TABLE></TD>"
|
||||
else
|
||||
|
||||
if [[ "${dst_table}" == "${src_table}" ]]
|
||||
then
|
||||
echo -n "1;"
|
||||
echo -n "</TD></TR></TABLE></TD>"
|
||||
else
|
||||
echo -n "0;"
|
||||
|
||||
if [[ "${dst_table}" == "${src_table}" ]]
|
||||
then
|
||||
echo -n "1;"
|
||||
else
|
||||
echo -n "0;"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -293,12 +296,15 @@ Source_Routing_Board()
|
||||
for dst_id in ${NETWORK_DST_ID_LIST}
|
||||
do
|
||||
network_dst_tab_get ${dst_id}
|
||||
|
||||
if [[ "${format}" == "html" ]]
|
||||
|
||||
if [[ ( "${admin}" == "true") || ( "${dst_type}" != 1) ]]
|
||||
then
|
||||
echo -n "<TD>${dst_name}</TD>"
|
||||
else
|
||||
echo -n "${dst_name};"
|
||||
if [[ "${format}" == "html" ]]
|
||||
then
|
||||
echo -n "<TD>${dst_name}</TD>"
|
||||
else
|
||||
echo -n "${dst_name};"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -684,10 +690,10 @@ else
|
||||
network_src_tab_ip_lookup "${ip}"
|
||||
network_src_tab_get "${src_id}"
|
||||
|
||||
if [[ ( ${admin} == "true") || ( "${REMOTE_USER}" == "${src_owner}") ]]
|
||||
network_dst_tab_get "${vpn}"
|
||||
|
||||
if [[ ( ${admin} == "true") || ( ( "${REMOTE_USER}" == "${src_owner}") && ( "${dst_type}" != 1)) ]]
|
||||
then
|
||||
network_dst_tab_get "${vpn}"
|
||||
|
||||
sudo /usr/local/sbin/rx3_net_adm table_set ${ip} ${dst_table} 1>&2
|
||||
|
||||
if [[ "$?" == 0 ]]
|
||||
@@ -697,7 +703,7 @@ else
|
||||
cmd_status="route_set: KO"
|
||||
fi
|
||||
else
|
||||
cmd_status="route_set: NOT_AUTHORIZED [${REMOTE_USER}]/[${src_owner}]"
|
||||
cmd_status="route_set: NOT_AUTHORIZED [${REMOTE_USER}]/[${src_owner}]/[${dst_type}]"
|
||||
fi
|
||||
|
||||
redirect="?admin=${admin}&filter=${filter}"
|
||||
|
||||
Reference in New Issue
Block a user