From 30c5204a49491013ffa95836a5ba9b63f1822e53 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Sat, 28 Aug 2010 09:32:35 +0000 Subject: [PATCH] LocalNetworks list implemented --- Builder/IISMainHandler/build.txt | 2 +- IISMainHandler/HandlersFactory.cs | 2 + IISMainHandler/IISMainHandler.csproj | 1 + .../response/LocalNetworksListHandler.cs | 37 ++++++++++ templates/Full/LocalNetworks.xslt | 70 +++++++++++++++++++ templates/Full/Login.xslt | 3 + 6 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 IISMainHandler/handlers/response/LocalNetworksListHandler.cs create mode 100644 templates/Full/LocalNetworks.xslt diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 1c8a8a8..1fb6394 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -932 \ No newline at end of file +936 \ No newline at end of file diff --git a/IISMainHandler/HandlersFactory.cs b/IISMainHandler/HandlersFactory.cs index 16126e6..9698f2b 100644 --- a/IISMainHandler/HandlersFactory.cs +++ b/IISMainHandler/HandlersFactory.cs @@ -154,6 +154,8 @@ namespace FLocal.IISHandler { default: return new handlers.response.PollHandler(); } + case "localnetworks": + return new handlers.response.LocalNetworksListHandler(); case "static": return new handlers.StaticHandler(context.requestParts); case "do": diff --git a/IISMainHandler/IISMainHandler.csproj b/IISMainHandler/IISMainHandler.csproj index eebe6d0..f611118 100644 --- a/IISMainHandler/IISMainHandler.csproj +++ b/IISMainHandler/IISMainHandler.csproj @@ -90,6 +90,7 @@ + diff --git a/IISMainHandler/handlers/response/LocalNetworksListHandler.cs b/IISMainHandler/handlers/response/LocalNetworksListHandler.cs new file mode 100644 index 0000000..ffa1f48 --- /dev/null +++ b/IISMainHandler/handlers/response/LocalNetworksListHandler.cs @@ -0,0 +1,37 @@ +п»їusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Xml.Linq; +using FLocal.Common; +using FLocal.Common.dataobjects; +using FLocal.Core.DB; +using FLocal.Core.DB.conditions; + +namespace FLocal.IISHandler.handlers.response { + + class LocalNetworksListHandler : AbstractGetHandler { + + override protected string templateName { + get { + return "LocalNetworks.xslt"; + } + } + + override protected IEnumerable getSpecificData(WebContext context) { + IEnumerable localNetworks = LocalNetwork.LoadByIds( + from stringId in Config.instance.mainConnection.LoadIdsByConditions( + LocalNetwork.TableSpec.instance, + new Core.DB.conditions.EmptyCondition(), + Diapasone.unlimited + ) select int.Parse(stringId) + ); + return new XElement[] { + new XElement("localNetworks", from localNetwork in localNetworks select localNetwork.exportToXml(context)), + }; + } + + } + +} \ No newline at end of file diff --git a/templates/Full/LocalNetworks.xslt b/templates/Full/LocalNetworks.xslt new file mode 100644 index 0000000..e01f6d1 --- /dev/null +++ b/templates/Full/LocalNetworks.xslt @@ -0,0 +1,70 @@ + + + + Локальные сети + + + + + +
+ + + + +
+ + + + +
+ + Локальные сети + +
+
+
+
+ + + + + + + + +
ПодсетьОписаниеСостояние
+
+
+
+ + + + + + lighttable + + + darktable + + + + + + + + + + + + Включена + + + Отключена + + + + + + +
\ No newline at end of file diff --git a/templates/Full/Login.xslt b/templates/Full/Login.xslt index 5629524..9cbbcc5 100644 --- a/templates/Full/Login.xslt +++ b/templates/Full/Login.xslt @@ -81,13 +81,16 @@ не входит в список разрешённых подсетей.
Если вы считаете, что это ошибка, сообщите администратору свой IP-адрес и описание сети (общежитие/учебный корпус, университет и прочее). +
Ваш IP входит в список разрешённых подсетей. +
+ Список разрешённых подсетей