slight fix in msibuilder

main
Inga 🏳‍🌈 14 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 {
public static ISpecificHandler getHandler(WebContext context) {
if(!context.httprequest.Path.EndsWith("/")) {
return new handlers.WrongUrlHandler();
// if(!context.httprequest.Path.EndsWith("/")) {
// return new handlers.WrongUrlHandler();
// throw new FLocalException("Malformed url");
}
// }
string[] requestParts = context.httprequest.Path.Split("/", StringSplitOptions.RemoveEmptyEntries);
if(requestParts.Length < 1) return new handlers.RootHandler();
switch(requestParts[0]) {
case "boards":
return new handlers.BoardsHandler();
case "static":
return new handlers.StaticHandler(requestParts);
default:
return new handlers.DebugHandler(requestParts[0]);
}

@ -56,6 +56,7 @@
<Compile Include="handlers\BoardsHandler.cs" />
<Compile Include="handlers\DebugHandler.cs" />
<Compile Include="handlers\RootHandler.cs" />
<Compile Include="handlers\StaticHandler.cs" />
<Compile Include="handlers\WrongUrlHandler.cs" />
<Compile Include="ISpecificHandler.cs" />
<Compile Include="MainHandler.cs" />
@ -75,14 +76,6 @@
<Project>{6F532626-E9F8-498E-9683-1538E7CD62CB}</Project>
<Name>Core</Name>
</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>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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) {
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);
WebContext context = new WebContext(httpcontext);

@ -4,13 +4,9 @@
<xsl:template match="/root">
<html>
<head>
<base href="http://forumlocal.ru/"/>
<link rel="stylesheet" href="/stylesheets/global.css" type="text/css" />
<link rel="stylesheet" href="/stylesheets/coffeehaus.css" type="text/css" />
<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" />
<link rel="stylesheet" href="/static/css/global.css" type="text/css" />
<link rel="stylesheet" href="/static/css/coffeehaus.css" type="text/css" />
<link rel="shortcut icon" href="/static/favicons/smirk.ico" type="image/x-icon" />
<title><xsl:value-of select="title"/></title>
</head>
<body>
@ -108,10 +104,10 @@
<td class="small" valign="top">
<b>Ëåãåíäà:</b>
<br />
<img src="/images/newposts.gif" alt="*" />
<img src="/static/images/newposts.gif" alt="*" />
Íîâûå ñîîáùåíèÿ
<br />
<img src="/images/nonewposts.gif" alt="*" />
<img src="/static/images/nonewposts.gif" alt="*" />
Íåò íîâûõ ñîîáùåíèé
</td>
</tr>
@ -142,7 +138,7 @@
<td valign="top" width="1%" class="darktable">
<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>
<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>
</td>
<td width="55%" class="darktable">

Loading…
Cancel
Save