mirror of
https://github.com/Ylianst/MeshCentralRouter
synced 2025-12-06 00:13:33 +00:00
Added support for mapping name in URL.
This commit is contained in:
@@ -29,6 +29,7 @@ using System.Security.Cryptography.X509Certificates;
|
||||
using Microsoft.Win32;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
|
||||
namespace MeshCentralRouter
|
||||
{
|
||||
@@ -268,6 +269,7 @@ namespace MeshCentralRouter
|
||||
// Set automatic port map values
|
||||
if (authLoginUrl != null)
|
||||
{
|
||||
string autoName = null;
|
||||
string autoNodeId = null;
|
||||
string autoRemoteIp = null;
|
||||
int autoRemotePort = 0;
|
||||
@@ -279,6 +281,7 @@ namespace MeshCentralRouter
|
||||
try
|
||||
{
|
||||
// Automatic mappings
|
||||
autoName = getValueFromQueryString(authLoginUrl.Query, "name");
|
||||
autoNodeId = getValueFromQueryString(authLoginUrl.Query, "nodeid");
|
||||
autoRemoteIp = getValueFromQueryString(authLoginUrl.Query, "remoteip");
|
||||
int.TryParse(getValueFromQueryString(authLoginUrl.Query, "remoteport"), out autoRemotePort);
|
||||
@@ -293,6 +296,7 @@ namespace MeshCentralRouter
|
||||
if (((autoRemotePort != 0) && (autoProtocol != 0) && (autoNodeId != null)) || ((autoNodeId != null) && ((autoAppId == 6) || (autoAppId == 7))))
|
||||
{
|
||||
Dictionary<string, object> map = new Dictionary<string, object>();
|
||||
if (autoName != null) { map.Add("name", HttpUtility.UrlDecode(autoName)); }
|
||||
map.Add("nodeId", autoNodeId);
|
||||
if (autoRemoteIp != null) { map.Add("remoteIP", autoRemoteIp); }
|
||||
map.Add("remotePort", autoRemotePort);
|
||||
|
||||
Reference in New Issue
Block a user