|
<%
String[] strStatus = Request.QueryString.GetValues("Status");
String[] strDocument = Request.QueryString.GetValues("Document");
String[] strNext = Request.QueryString.GetValues("useNext");
if (strStatus == null) { strStatus = new String[3]; strStatus[0] = "0"; }
if (strDocument == null) { strDocument = new String[1]; strDocument[0] = ""; }
String strDoc = "";
String strBack = null;
String strDocDisplay = "";
try
{
SPWeb spWeb = SPControl.GetContextWeb(Context);
if (strNext != null && strNext[0].Length > 0)
{
strBack = strNext[0];
System.Uri uriBack = null;
try
{
uriBack = new System.Uri(strBack);
}
catch(System.UriFormatException exUri)
{
System.Uri uriWeb = new System.Uri(spWeb.Url);
uriBack = new System.Uri(uriWeb, strBack);
}
if(string.Compare(uriBack.Host, spWeb.Site.HostName, true) != 0 ||
string.Compare(uriBack.Scheme.Substring(0,4), "http", true) != 0)
{
throw new System.Exception();
}
}
if (strDocument != null && strDocument[0].Length > 0)
{
strDoc = strDocument[0];
bool fDocExists = spWeb.GetFile(strDoc).Exists;
if (strDoc[0]== '/')
strDocDisplay = strDoc.Substring(1);
else
strDocDisplay = strDoc;
if (strBack == null)
{
int i = strDoc.LastIndexOf('/');
if (i > 0 && fDocExists)
strBack = strDoc.Substring(0, i);
else
strBack = "/";
}
}
}
catch
{
throw new SPException(SPResource.GetString(Strings.HTUnknownError));
}
%>
<% if (strStatus[0] == "0") { %>
<% } else if (strStatus[0] == "4") { %>
<% } else if (strStatus[0] == "6") { %>
<% } else if (strStatus[0] == "7") { %>
<% } else if (strStatus[0] == "1" && strStatus[1] == "0" && strStatus[2] == "0") { %>
<% } else if (strStatus[0] == "1" && strStatus[1] == "0" && strStatus[2] == "1") { %>
<% } else { %>
<% } %>
|