LocalNetworks list implemented

main
Inga 🏳‍🌈 15 years ago
parent a524e7641b
commit 30c5204a49
  1. 2
      Builder/IISMainHandler/build.txt
  2. 2
      IISMainHandler/HandlersFactory.cs
  3. 1
      IISMainHandler/IISMainHandler.csproj
  4. 37
      IISMainHandler/handlers/response/LocalNetworksListHandler.cs
  5. 70
      templates/Full/LocalNetworks.xslt
  6. 3
      templates/Full/Login.xslt

@ -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":

@ -90,6 +90,7 @@
<Compile Include="handlers\response\EditHandler.cs" />
<Compile Include="handlers\response\LegacyPHPHandler.cs" />
<Compile Include="handlers\response\LegacyUploadHandler.cs" />
<Compile Include="handlers\response\LocalNetworksListHandler.cs" />
<Compile Include="handlers\response\LoginHandler.cs" />
<Compile Include="handlers\response\maintenance\CleanCacheHandler.cs" />
<Compile Include="handlers\response\MigrateAccountHandler.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<XElement> getSpecificData(WebContext context) {
IEnumerable<LocalNetwork> 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)),
};
}
}
}

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="Windows-1251"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:import href="elems\Main.xslt"/>
<xsl:template name="specificTitle">Ëîêàëüíûå ñåòè</xsl:template>
<xsl:template name="specific">
<table width="95%" align="center" cellpadding="1" cellspacing="1" class="tablesurround">
<tr>
<td>
<table cellpadding="3" cellspacing="1" width="100%" class="tableborders">
<tr class="darktable">
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr class="darktable">
<td align="left" width="33%">
<font class="catandforum">
<xsl:text>Ëîêàëüíûå ñåòè</xsl:text>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<xsl:if test="localNetworks/localNetwork">
<table width="95%" align="center" class="tableborders" border="1">
<tr>
<td class="tdheader" align="center" width="15%">Ïîäñåòü</td>
<td class="tdheader" width="70%">Îïèñàíèå</td>
<td class="tdheader" align="center" width="15%">Ñîñòîÿíèå</td>
</tr>
<xsl:apply-templates select="localNetworks/localNetwork"/>
</table>
<br/>
</xsl:if>
</xsl:template>
<xsl:template match="localNetwork">
<tr>
<xsl:choose>
<xsl:when test="position() mod 2 = 0">
<xsl:attribute name="class">lighttable</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class">darktable</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<td align="center">
<xsl:value-of select="network"/>
</td>
<td align="left">
<xsl:value-of select="comment"/>
</td>
<td align="center">
<xsl:choose>
<xsl:when test="isEnabled='true'">
<xsl:text>Âêëþ÷åíà</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Îòêëþ÷åíà</xsl:text>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>

@ -81,13 +81,16 @@
<xsl:text> не входит в список разрешённых подсетей.</xsl:text>
<br/>
<xsl:text>Если вы считаете, что это ошибка, сообщите администратору свой IP-адрес и описание сети (общежитие/учебный корпус, университет и прочее).</xsl:text>
<br/>
</xsl:when>
<xsl:otherwise>
<xsl:text>Ваш IP </xsl:text>
<xsl:value-of select="ip"/>
<xsl:text> входит в список разрешённых подсетей.</xsl:text>
<br/>
</xsl:otherwise>
</xsl:choose>
<a href="/LocalNetworks/">Ñïèñîê ðàçðåø¸ííûõ ïîäñåòåé</a>
</td>
</tr>
<xsl:if test="isLocalNetwork='true'">

Loading…
Cancel
Save