%@ LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% Option Explicit %>
<% On Error Resume Next %>
<% Response.Charset="UTF-8" %>
<%
Dim bError
bError=False
Call System_Initialize()
'检查非法链接
Call CheckReference("")
'检查权限
If BlogUser.Level>1 Then Call ShowError(6)
If CheckPluginState("AppCentre")=False Then Call ShowError(48)
Call AppCentre_InitConfig
If Request.QueryString("restore")="now" Then
Response.Clear
Response.Write AppCentre_Update_Restore(Request.Form("build"),Request.Form("filename"),Request.Form("crc32"))
Response.End
End If
If Request.QueryString("update")="download" Then
Response.Clear
Response.Write AppCentre_Update_Download(Request.Form("filename"))
Response.End
End If
If Request.QueryString("update")="install" Then
Response.Clear
Response.Write AppCentre_Update_Install()
Response.End
End If
If Request.QueryString("update")="success" Then
Response.Clear
Call SetBlogHint_Custom("恭喜您升级到最新版的Z-Blog.")
Response.Redirect BlogHost & "zb_system/cmd.asp?act=SettingMng&update=" & Request.QueryString("file")
Response.End
End If
If Request.QueryString("last")="now" Then
Response.Clear
Response.Write AppCentre_CheckSystemLast
Response.End
End If
If Request.QueryString("check")="now" Then
Call AppCentre_CheckSystemIndex(BlogVersion)
End If
Dim PathAndCrc32
Set PathAndCrc32=New TMeta
Dim objXmlFile,strXmlFile,item
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(BlogPath & "zb_users/cache/"&BlogVersion&".xml") Then
strXmlFile =BlogPath & "zb_users/cache/"&BlogVersion&".xml"
Set objXmlFile=Server.CreateObject("Microsoft.XMLDOM")
objXmlFile.async = False
objXmlFile.ValidateOnParse=False
objXmlFile.load(strXmlFile)
If objXmlFile.readyState=4 Then
If objXmlFile.parseError.errorCode <> 0 Then
Else
for each item in objXmlFile.documentElement.SelectNodes("file")
PathAndCrc32.SetValue item.getAttributeNode("name").Value,item.getAttributeNode("crc32").Value
next
End If
End If
End If
If CLng(Request.QueryString("crc32"))>0 Then
Response.Clear
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
If CLng(Request.QueryString("crc32"))<=Round(PathAndCrc32.Count/10)+1 Then
Dim i,j,k,l,m,n
k=CLng(Request.QueryString("crc32"))
i=(k-1)*10+1
j=k*10
m="
"
n="
"
For l=i To j
If l>PathAndCrc32.Count Then Exit For
If CRC32(BlogPath & vbsunescape(PathAndCrc32.Names(l)))<>PathAndCrc32.Values(l) Then
Response.Write "$('#td"&l&"').html('"&n&"').parent().addClass(""check_conflict"");_conflict+=1;_count.html(_conflict);"
Else
Response.Write "$('#td"&l&"').html('"&m&"').parent().addClass(""check_normal"");"
End If
Next
Else
Call DelToFile(BlogPath & "zb_users/cache/"&BlogVersion&".xml")
End If
Response.End
End If
BlogTitle="应用中心-系统更新检查"
%>