Skip to content

Commit

Permalink
6.11
Browse files Browse the repository at this point in the history
  • Loading branch information
starlying committed Jul 1, 2019
1 parent 3b7eb6e commit b2d5f56
Show file tree
Hide file tree
Showing 71 changed files with 527 additions and 399 deletions.
6 changes: 6 additions & 0 deletions .vscode/iisexpress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"port": 23709,
"path": "d:\\siteserver\\netfx-staging",
"clr": "v4.0",
"protocol": "http"
}
2 changes: 1 addition & 1 deletion SS.CMS.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<copyright>Copyright © SiteServer CMS</copyright>
<tags>SiteServer CMS</tags>
<releaseNotes>
SiteServer CMS V6.10正式版
SiteServer CMS V6.11正式版
</releaseNotes>
</metadata>
</package>
5 changes: 4 additions & 1 deletion SiteServer.BackgroundPages/Controls/AuxiliaryControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ protected override void Render(HtmlTextWriter output)
{
try
{
html = service.OnContentFormLoad(eventArgs);
if (service.OnContentFormLoad(eventArgs, out var val))
{
html = val;
}
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)

ltlPreviewUrl.Text = $@"<a href=""{templateUrl}"" target=""_blank"">模板详情</a>";

var urlAdd = PageSiteAdd.GetRedirectUrl(string.Empty, title);
var urlAdd = PageUtils.GetSettingsUrl("siteAdd");
PageSiteAdd.GetRedirectUrl(string.Empty, title);
ltlCreateUrl.Text = $@"<a href=""{urlAdd}"">创建站点</a>";

//if (_directoryNameLowerList.Contains($"T_{title}".ToLower().Trim()))
Expand Down
37 changes: 17 additions & 20 deletions SiteServer.BackgroundPages/SiteServer.BackgroundPages.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,38 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.3.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
<HintPath>..\packages\BouncyCastle.1.8.3.1\lib\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Dapper, Version=1.60.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Dapper.1.60.6\lib\net451\Dapper.dll</HintPath>
</Reference>
<Reference Include="Datory, Version=0.1.15.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Datory.0.1.15\lib\net452\Datory.dll</HintPath>
<Reference Include="Datory, Version=0.1.20.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Datory.0.1.20\lib\net452\Datory.dll</HintPath>
</Reference>
<Reference Include="Google.Protobuf, Version=3.5.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll</HintPath>
<Reference Include="Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.6.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=8.0.15.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.8.0.15\lib\net452\MySql.Data.dll</HintPath>
<Reference Include="MySql.Data, Version=8.0.16.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.8.0.16\lib\net452\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Npgsql, Version=4.0.6.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7, processorArchitecture=MSIL">
<HintPath>..\packages\Npgsql.4.0.6\lib\net451\Npgsql.dll</HintPath>
<Reference Include="Npgsql, Version=4.0.7.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7, processorArchitecture=MSIL">
<HintPath>..\packages\Npgsql.4.0.7\lib\net451\Npgsql.dll</HintPath>
</Reference>
<Reference Include="Oracle.ManagedDataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSIL">
<HintPath>..\packages\Oracle.ManagedDataAccess.18.6.0\lib\net40\Oracle.ManagedDataAccess.dll</HintPath>
</Reference>
<Reference Include="QueryBuilder, Version=1.1.7.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SqlKata.1.1.7\lib\net45\QueryBuilder.dll</HintPath>
</Reference>
<Reference Include="SiteServer.Plugin, Version=2.3.7.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SiteServer.Plugin.2.3.7\lib\net452\SiteServer.Plugin.dll</HintPath>
<Reference Include="SiteServer.Plugin, Version=2.3.11.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SiteServer.Plugin.2.3.11\lib\net452\SiteServer.Plugin.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
Expand All @@ -78,13 +81,13 @@
<HintPath>..\packages\System.Data.Common.4.3.0\lib\net451\System.Data.Common.dll</HintPath>
</Reference>
<Reference Include="System.Data.SqlClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SqlClient.4.6.0\lib\net451\System.Data.SqlClient.dll</HintPath>
<HintPath>..\packages\System.Data.SqlClient.4.6.1\lib\net451\System.Data.SqlClient.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" />
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.2\lib\netstandard1.1\System.Memory.dll</HintPath>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard1.1\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
Expand Down Expand Up @@ -634,9 +637,6 @@
<Compile Include="Settings\PageSite.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Settings\PageSiteAdd.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Settings\PageSiteDelete.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
Expand All @@ -658,9 +658,6 @@
<Compile Include="Settings\PageSiteTemplate.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Settings\PageSiteTemplateOnline.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Settings\PageSiteUrlApi.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
Expand Down
17 changes: 9 additions & 8 deletions SiteServer.BackgroundPages/packages.config
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.8.3.1" targetFramework="net452" />
<package id="Dapper" version="1.60.6" targetFramework="net452" />
<package id="Datory" version="0.1.15" targetFramework="net452" />
<package id="Google.Protobuf" version="3.5.1" targetFramework="net452" />
<package id="Datory" version="0.1.20" targetFramework="net452" />
<package id="Google.Protobuf" version="3.6.1" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.7" targetFramework="net452" />
<package id="Microsoft.CSharp" version="4.5.0" targetFramework="net452" />
<package id="Microsoft.Net.Compilers" version="3.0.0" targetFramework="net452" developmentDependency="true" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
<package id="MySql.Data" version="8.0.15" targetFramework="net452" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net452" />
<package id="Npgsql" version="4.0.6" targetFramework="net452" />
<package id="MySql.Data" version="8.0.16" targetFramework="net452" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net452" />
<package id="Npgsql" version="4.0.7" targetFramework="net452" />
<package id="Oracle.ManagedDataAccess" version="18.6.0" targetFramework="net452" />
<package id="SiteServer.Plugin" version="2.3.7" targetFramework="net452" />
<package id="SiteServer.Plugin" version="2.3.11" targetFramework="net452" />
<package id="SqlKata" version="1.1.7" targetFramework="net452" />
<package id="System.Buffers" version="4.4.0" targetFramework="net452" />
<package id="System.Data.Common" version="4.3.0" targetFramework="net452" />
<package id="System.Data.SqlClient" version="4.6.0" targetFramework="net452" />
<package id="System.Memory" version="4.5.2" targetFramework="net452" />
<package id="System.Data.SqlClient" version="4.6.1" targetFramework="net452" />
<package id="System.Memory" version="4.5.3" targetFramework="net452" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net452" />
<package id="System.Threading.Tasks.Extensions" version="4.5.2" targetFramework="net452" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net452" />
Expand Down
8 changes: 4 additions & 4 deletions SiteServer.CMS/Core/OnlineTemplateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace SiteServer.CMS.Core
{
public static class OnlineTemplateManager
{
private const string UrlTemplatesXml = "http://templates.siteserver.cn/templates.xml";
private const string UrlTemplatesXml = "https://www.siteserver.cn/templates/templates.xml";

public const string UrlHome = "http://templates.siteserver.cn";
public const string UrlHome = "https://www.siteserver.cn/templates/";

public static bool TryGetOnlineTemplates(out List<Dictionary<string, string>> list)
{
Expand All @@ -34,7 +34,7 @@ public static bool TryGetOnlineTemplates(out List<Dictionary<string, string>> li

while (ie.MoveNext())
{
var childNode = (XmlNode) ie.Current;
var childNode = (XmlNode)ie.Current;
if (childNode == null) continue;

var nodeName = childNode.Name;
Expand Down Expand Up @@ -84,7 +84,7 @@ public static bool TryGetOnlineTemplates(out List<Dictionary<string, string>> li

public static string GetTemplateUrl(string name)
{
return $"http://templates.siteserver.cn/t-{name.ToLower()}/index.html";
return $"https://www.siteserver.cn/templates/t-{name.ToLower()}/index.html";
}

public static string GetDownloadUrl(string name)
Expand Down
22 changes: 8 additions & 14 deletions SiteServer.CMS/Core/PathUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,22 +200,16 @@ public static string GetUploadFileName(SiteInfo siteInfo, string filePath)

public static string GetUploadFileName(SiteInfo siteInfo, string filePath, bool isUploadChangeFileName)
{
var retVal = isUploadChangeFileName
? $"{StringUtils.GetShortGuid(false)}{PathUtils.GetExtension(filePath)}"
: PathUtils.GetFileName(filePath);

retVal = StringUtils.ReplaceIgnoreCase(retVal, "as", string.Empty);
retVal = StringUtils.ReplaceIgnoreCase(retVal, ";", string.Empty);
return retVal;
}
if (isUploadChangeFileName)
{
return $"{StringUtils.GetShortGuid(false)}{PathUtils.GetExtension(filePath)}";
}

public static string GetUploadSpecialName(SiteInfo siteInfo, string filePath, bool isUploadChangeFileName)
{
var retVal = isUploadChangeFileName ? $"{StringUtils.GetShortGuid(false)}{PathUtils.GetExtension(filePath)}" : PathUtils.GetFileName(filePath);
var fileName = PathUtils.GetFileNameWithoutExtension(filePath);

retVal = StringUtils.ReplaceIgnoreCase(retVal, "as", string.Empty);
retVal = StringUtils.ReplaceIgnoreCase(retVal, ";", string.Empty);
return retVal;
fileName = StringUtils.ReplaceIgnoreCase(fileName, "as", string.Empty);
fileName = StringUtils.ReplaceIgnoreCase(fileName, ";", string.Empty);
return $"{fileName}{PathUtils.GetExtension(filePath)}";
}

public static SiteInfo GetSiteInfo(string path)
Expand Down
33 changes: 29 additions & 4 deletions SiteServer.CMS/DataCache/Content/ContentManager.CountCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,37 @@ public static void Remove(string tableName, ContentInfo contentInfo)
}
}

public static int GetSiteCountByIsChecked(SiteInfo siteInfo, bool isChecked)
public static int GetSiteCountIsChecked(SiteInfo siteInfo)
{
var tableNames = SiteManager.GetTableNameList(siteInfo);
var isChecked = true.ToString();

lock (LockObject)
{
var count = 0;
foreach (var tableName in tableNames)
{
var list = GetContentCountInfoList(tableName);
count += list.Where(x => x.SiteId == siteInfo.Id && x.IsChecked == isChecked.ToString())
count += list.Where(x => x.SiteId == siteInfo.Id && x.IsChecked == isChecked)
.Sum(x => x.Count);
}

return count;
}
}

public static int GetSiteCountIsChecking(SiteInfo siteInfo)
{
var tableNames = SiteManager.GetTableNameList(siteInfo);
var isChecked = false.ToString();

lock (LockObject)
{
var count = 0;
foreach (var tableName in tableNames)
{
var list = GetContentCountInfoList(tableName);
count += list.Where(x => x.SiteId == siteInfo.Id && x.IsChecked == isChecked && x.CheckedLevel != -siteInfo.Additional.CheckContentLevel && x.CheckedLevel != CheckManager.LevelInt.CaoGao)
.Sum(x => x.Count);
}

Expand Down Expand Up @@ -168,9 +188,14 @@ public static int GetChannelCountByIsChecked(SiteInfo siteInfo, ChannelInfo chan
}
}

public static int GetCount(SiteInfo siteInfo, bool isChecked)
public static int GetCountIsChecked(SiteInfo siteInfo)
{
return CountCache.GetSiteCountIsChecked(siteInfo);
}

public static int GetCountChecking(SiteInfo siteInfo)
{
return CountCache.GetSiteCountByIsChecked(siteInfo, isChecked);
return CountCache.GetSiteCountIsChecking(siteInfo);
}

public static int GetCount(SiteInfo siteInfo, ChannelInfo channelInfo, int? onlyAdminId)
Expand Down
4 changes: 2 additions & 2 deletions SiteServer.CMS/ImportExport/AtomUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static AtomFeed GetEmptyFeed()
{
Title = new AtomContentConstruct("title", "siteserver channel"),
Author = new AtomPersonConstruct("author",
"siteserver", new Uri("http://www.siteserver.cn")),
"siteserver", new Uri("https://www.siteserver.cn")),
Modified = new AtomDateConstruct("modified", DateTime.Now,
TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now))
};
Expand All @@ -88,7 +88,7 @@ public static AtomEntry GetEmptyEntry()
{
var entry = new AtomEntry
{
Id = new Uri("http://www.siteserver.cn/"),
Id = new Uri("https://www.siteserver.cn/"),
Title = new AtomContentConstruct("title", "title"),
Modified = new AtomDateConstruct("modified", DateTime.Now,
TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now)),
Expand Down
4 changes: 3 additions & 1 deletion SiteServer.CMS/Model/Attributes/ContentAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ public static string GetExtendAttributeName(string attributeName)
"Reply",
"CheckTaskDate",
"UnCheckTaskDate",
"Photos"
"Photos",
"Teleplays",
"MemberName"
});
}
}
7 changes: 5 additions & 2 deletions SiteServer.CMS/Plugin/Impl/ServiceImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ public void OnContentTranslateCompleted(ContentTranslateEventArgs e)

public event ContentFormLoadEventHandler ContentFormLoad;

public string OnContentFormLoad(ContentFormLoadEventArgs e)
public bool OnContentFormLoad(ContentFormLoadEventArgs e, out string html)
{
return ContentFormLoad?.Invoke(this, e);
html = null;
if (ContentFormLoad == null) return false;
html = ContentFormLoad.Invoke(this, e);
return true;
}

public event EventHandler<ContentFormSubmitEventArgs> ContentFormSubmit;
Expand Down
Loading

0 comments on commit b2d5f56

Please sign in to comment.