slight fix in msibuilder

main
Inga 🏳‍🌈 15 years ago
parent 7387dc89c3
commit 4f15c8bdd9
  1. 8
      IISMainHandler/HandlersFactory.cs
  2. 9
      IISMainHandler/IISMainHandler.csproj
  3. 6
      IISMainHandler/MainHandler.cs
  4. 16
      templates/Full/Boards.xslt

@ -9,15 +9,17 @@ namespace FLocal.IISHandler {
class HandlersFactory { class HandlersFactory {
public static ISpecificHandler getHandler(WebContext context) { public static ISpecificHandler getHandler(WebContext context) {
if(!context.httprequest.Path.EndsWith("/")) { // if(!context.httprequest.Path.EndsWith("/")) {
return new handlers.WrongUrlHandler(); // return new handlers.WrongUrlHandler();
// throw new FLocalException("Malformed url"); // throw new FLocalException("Malformed url");
} // }
string[] requestParts = context.httprequest.Path.Split("/", StringSplitOptions.RemoveEmptyEntries); string[] requestParts = context.httprequest.Path.Split("/", StringSplitOptions.RemoveEmptyEntries);
if(requestParts.Length < 1) return new handlers.RootHandler(); if(requestParts.Length < 1) return new handlers.RootHandler();
switch(requestParts[0]) { switch(requestParts[0]) {
case "boards": case "boards":
return new handlers.BoardsHandler(); return new handlers.BoardsHandler();
case "static":
return new handlers.StaticHandler(requestParts);
default: default:
return new handlers.DebugHandler(requestParts[0]); return new handlers.DebugHandler(requestParts[0]);
} }

@ -56,6 +56,7 @@
<Compile Include="handlers\BoardsHandler.cs" /> <Compile Include="handlers\BoardsHandler.cs" />
<Compile Include="handlers\DebugHandler.cs" /> <Compile Include="handlers\DebugHandler.cs" />
<Compile Include="handlers\RootHandler.cs" /> <Compile Include="handlers\RootHandler.cs" />
<Compile Include="handlers\StaticHandler.cs" />
<Compile Include="handlers\WrongUrlHandler.cs" /> <Compile Include="handlers\WrongUrlHandler.cs" />
<Compile Include="ISpecificHandler.cs" /> <Compile Include="ISpecificHandler.cs" />
<Compile Include="MainHandler.cs" /> <Compile Include="MainHandler.cs" />
@ -75,14 +76,6 @@
<Project>{6F532626-E9F8-498E-9683-1538E7CD62CB}</Project> <Project>{6F532626-E9F8-498E-9683-1538E7CD62CB}</Project>
<Name>Core</Name> <Name>Core</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\MySQLConnector\MySQLConnector.csproj">
<Project>{E38DE5B1-F9C2-43BA-A5DF-0743ABD4DFC7}</Project>
<Name>MySQLConnector</Name>
</ProjectReference>
<ProjectReference Include="..\ThirdParty\mysql-connector-net-6.2.3\MySql.Data\Provider\MySql.Data.csproj">
<Project>{E9DF5ED1-4CBD-4226-B931-9A51610AC14D}</Project>
<Name>MySql.Data</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

@ -13,6 +13,12 @@ namespace FLocal.IISHandler {
} }
public void ProcessRequest(HttpContext httpcontext) { public void ProcessRequest(HttpContext httpcontext) {
Uri referer = httpcontext.Request.UrlReferrer;
if(referer != null && referer.PathAndQuery.StartsWith("/static")) {
throw new HttpException(403, "You have come from the static page");
}
if(!FLocal.Common.Config.isInitialized) FLocal.Common.Config.Init(ConfigurationManager.AppSettings); if(!FLocal.Common.Config.isInitialized) FLocal.Common.Config.Init(ConfigurationManager.AppSettings);
WebContext context = new WebContext(httpcontext); WebContext context = new WebContext(httpcontext);

@ -4,13 +4,9 @@
<xsl:template match="/root"> <xsl:template match="/root">
<html> <html>
<head> <head>
<base href="http://forumlocal.ru/"/> <link rel="stylesheet" href="/static/css/global.css" type="text/css" />
<link rel="stylesheet" href="/stylesheets/global.css" type="text/css" /> <link rel="stylesheet" href="/static/css/coffeehaus.css" type="text/css" />
<link rel="stylesheet" href="/stylesheets/coffeehaus.css" type="text/css" /> <link rel="shortcut icon" href="/static/favicons/smirk.ico" type="image/x-icon" />
<link rel="stylesheet" href="/stylesheets/decoration.css" type="text/css" />
<link type="text/css" rel="stylesheet" href="SyntaxHighlighter/styles/shCore.css"/>
<link type="text/css" rel="stylesheet" href="SyntaxHighlighter/styles/shThemeDefault.css"/>
<link rel="shortcut icon" href="/favicons/smirk.ico" type="image/x-icon" />
<title><xsl:value-of select="title"/></title> <title><xsl:value-of select="title"/></title>
</head> </head>
<body> <body>
@ -108,10 +104,10 @@
<td class="small" valign="top"> <td class="small" valign="top">
<b>Ëåãåíäà:</b> <b>Ëåãåíäà:</b>
<br /> <br />
<img src="/images/newposts.gif" alt="*" /> <img src="/static/images/newposts.gif" alt="*" />
Íîâûå ñîîáùåíèÿ Íîâûå ñîîáùåíèÿ
<br /> <br />
<img src="/images/nonewposts.gif" alt="*" /> <img src="/static/images/nonewposts.gif" alt="*" />
Íåò íîâûõ ñîîáùåíèé Íåò íîâûõ ñîîáùåíèé
</td> </td>
</tr> </tr>
@ -142,7 +138,7 @@
<td valign="top" width="1%" class="darktable"> <td valign="top" width="1%" class="darktable">
<a href="/ubbthreads.php?Cat=&amp;C=&amp;check=Common&amp;src="> <a href="/ubbthreads.php?Cat=&amp;C=&amp;check=Common&amp;src=">
<xsl:attribute name="onClick">if (!confirm('Ïîìåòèòü âñå ñîîáùåíèÿ êàê ïðî÷èòàííûå?')) {event.returnValue=false; return false;}</xsl:attribute> <xsl:attribute name="onClick">if (!confirm('Ïîìåòèòü âñå ñîîáùåíèÿ êàê ïðî÷èòàííûå?')) {event.returnValue=false; return false;}</xsl:attribute>
<img border="0" width="17" height="21" src="/images/newposts.gif" alt=""/> <img border="0" width="17" height="21" src="/static/images/newposts.gif" alt=""/>
</a> </a>
</td> </td>
<td width="55%" class="darktable"> <td width="55%" class="darktable">

Loading…
Cancel
Save