home *** CD-ROM | disk | FTP | other *** search
- <%@ LANGUAGE=VBScript %>
- <%Option Explicit %>
-
- <%
- ' strings for localization
- Const L_ACCESSDENIED_TEXT="Access Denied"
- Const L_ENABLEEXPIRE_TEXT="Enable Content Expiration"
- Const L_CONTENTSHOULD_TEXT="Content should:"
- Const L_EXPIMM_TEXT="Expire Immediately"
- Const L_EXPAFT_TEXT="Expire after"
- Const L_SECONDS_TEXT="Second(s)"
- Const L_MINUTES_TEXT="Minute(s)"
- Const L_HOURS_TEXT="Hour(s)"
- Const L_DAYS_TEXT="Day(s)"
- Const L_EXPON_TEXT="Expire on"
- Const L_MIDNIGHT_TEXT="Midnight"
- Const L_MONTH_TEXT="Month"
- Const L_DAY_TEXT="Day"
- Const L_YEAR_TEXT="Year"
- Const L_TIME_TEXT="Time"
- Const L_CUSTOM_TEXT="Custom Headers"
- Const L_ENTERHEADER_TEXT="Enter a custom name and value pair below:"
- Const L_SAMPHDR_TEXT="Custom Header:Value"
- Const L_SELECTITEM_TEXT="Select a header to delete."
-
- On Error Resume Next
-
- Dim path, currentobj, httpexp, timeunit,expireon
-
- path=Session("dpath")
- Session("path")=path
- Set currentobj=GetObject(path)
- Session("SpecObj")=path
- Session("SpecProps")="HttpExpires"
-
-
- httpexp=currentobj.HttpExpires
-
- if err <> 0 then
- httpexp="d,-1"
- end if
- httpexp = UCase(trim(httpexp))
-
- timeunit="<OPTION VALUE=0 SELECTED>" & L_SECONDS_TEXT & "<OPTION VALUE=1>" & L_MINUTES_TEXT & "<OPTION VALUE=2>" & L_HOURS_TEXT & "<OPTION VALUE=3 >" & L_DAYS_TEXT
-
- function expires()
- httpexp = UCase(Trim(httpexp))
- if len(httpexp)= 0 then
- expires="<INPUT TYPE='checkbox' NAME='hdnchkHttpExpires' OnClick='SetExp(null);top.head.Global.updated=true;'>"
- elseif httpexp="D,-1" then
- expires="<INPUT TYPE='checkbox' NAME='hdnchkHttpExpires' OnClick='SetExp(null);top.head.Global.updated=true;'>"
- elseif Left(httpexp,2)="S," then
- expires="<INPUT TYPE='checkbox' NAME='hdnchkHttpExpires' CHECKED OnClick='SetExp(null);top.head.Global.updated=true;'>"
- elseif Left(httpexp,2)="D," then
- expires="<INPUT TYPE='checkbox' NAME='hdnchkHttpExpires' CHECKED OnClick='SetExp(null);top.head.Global.updated=true;'>"
- else
- expires="<INPUT TYPE='checkbox' NAME='hdnchkHttpExpires' OnClick='SetExp(null);top.head.Global.updated=true;'>"
- end if
- end function
-
- function expireType(thisbutton)
-
- Dim typestr, etype
-
- typestr=Mid(httpexp,1,4)
- if typestr="" then
- etype=""
- elseif Mid(httpexp,1,2)="D," then
- if len(httpexp) > 4 then
- etype=1
- else
- etype=0
- end if
- elseif Mid(httpexp,1,2)="S," then
- etype=2
- else
- etype=""
- end if
-
- if thisbutton=etype then
- expireType="<INPUT TYPE='radio' NAME='hdnrdoHttpExpires' CHECKED OnClick='SetExp(" & thisbutton & ");top.head.Global.updated=true;'>"
- else
- expireType="<INPUT TYPE='radio' NAME='hdnrdoHttpExpires' OnClick='SetExp(" & thisbutton & ");top.head.Global.updated=true;'>"
- end if
-
- end function
-
- function hexToDec(hexstr)
- hexToDec = CLng("&H" & hexstr)
- end function
-
- function writeExpires(fieldname,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
-
- On Error Resume Next
- Dim SetLocale, strExpires, numsecs, timeelapse, thisdate
-
- SetLocale = False
- strExpires=httpexp
-
- 'global
- expireon=""
-
- 'httpexp is global
- if Mid(httpexp,1,2) = "D," then
- numsecs = Trim(Mid(strExpires,Instr(strExpires,",")+1))
- if fieldname="Seconds" then
- if instr(numsecs,"X") then
- numsecs=hexToDec(Trim(Mid(numsecs, Instr(numsecs,"X")+1)))
- end if
- timeelapse=numsecs
- if numsecs mod 86400=0 then
- timeelapse=numsecs/86400
- 'timeunit is global
- timeunit="<OPTION VALUE=0 >" & L_SECONDS_TEXT & "<OPTION VALUE=1>" & L_MINUTES_TEXT & "<OPTION VALUE=2>" & L_HOURS_TEXT & "<OPTION SELECTED VALUE=3>" & L_DAYS_TEXT
-
- elseif numsecs mod 3600=0 then
- timeelapse=numsecs/3600
- 'timeunit is global
- timeunit="<OPTION VALUE=0 >" & L_SECONDS_TEXT & "<OPTION VALUE=1>" & L_MINUTES_TEXT & "<OPTION SELECTED VALUE=2 >" & L_HOURS_TEXT & "<OPTION VALUE=3>" & L_DAYS_TEXT
-
- elseif numsecs mod 60=0 then
- timeelapse=numsecs/60
- 'timeunit is global
- timeunit="<OPTION VALUE=0 >" & L_SECONDS_TEXT & "<OPTION SELECTED VALUE=1>" & L_MINUTES_TEXT & "<OPTION VALUE=2>" & L_HOURS_TEXT & "<OPTION VALUE=3>" & L_DAYS_TEXT
- end if
-
- if timeelapse > 0 then
- expireon=timeelapse
- else
- expireon=""
- end if
- end if
-
- elseif Mid(httpexp,1,2) = "S," then
-
- SetLocale = True
-
- 'trim off the "S,"
- strExpires = Mid(strExpires,Instr(strExpires,",")+1)
- 'trim off the "Day,"
- strExpires = Mid(strExpires,Instr(strExpires,",")+1)
-
- 'trim off the GMT... plus any spaces...
- strExpires=Trim(Mid(strExpires,1, len(strExpires)-3))
-
- if isDate(strExpires) then
- thisdate=CDate(strExpires)
- end if
-
- Select Case fieldname
- Case "Day"
- expireon=Day(thisdate)
- Case "Month"
- expireon=Month(thisdate)
- Case "Year"
- expireon=Year(thisdate)
- Case "Hours"
- expireon=Hour(thisdate)
- Case "Minutes"
- expireon=Minute(thisdate)
- End Select
- else
- expireon=""
- end if
- writeExpires=inputbox(err,"TEXT", ("hdn" & "HttpExpires" & fieldname), expireon ,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
-
- end function
-
- %>
-
- <!--#include file="iiset.inc"-->
-
- <HTML>
- <HEAD>
- <TITLE></TITLE>
- <SCRIPT LANGUAGE="JavaScript">
-
- top.head.Global.helpFileName="iipy_9";
- userSet=true;
-
- EXP_NONE = 0
- EXP_DYNAMIC = 1
- EXP_STATIC = 2
-
- function isNum(txtcntrl,min) {
- str=txtcntrl.value;
- for (var i=0; i < str.length; i++) {
- num = parseInt(str);
- if (isNaN(num)){
- alert("Please enter an integer.");
- return false;
- }
- if (num < min) {
- alert("Please enter an integer greater than " + (min-1) + ".");
- return false;
- }
- }
- return true;
- }
-
- function SetRdo(rdo,fromCntrl, toCntrl){
- if (!rdo){
- if (fromCntrl.value !=""){
- toCntrl.value=fromCntrl.value;
- fromCntrl.value="";
- }
- }
- else{
- if (toCntrl.value !=""){
- fromCntrl.value=toCntrl.value;
- toCntrl.value="";
- }
- }
- }
-
- function SetExp(expType){
- if (expType==null){
- if (document.userform.hdnchkHttpExpires.checked){
- //bugbug this breaks in some installs of IE3.02
- //document.userform.hdnrdoHttpExpires[0].checked=true;
- document.userform.HttpExpires.value=document.userform.hdnHttpExpires.value;
- }
- else{
- document.userform.hdnHttpExpires.value=document.userform.HttpExpires.value;
- document.userform.HttpExpires.value="d,-1";
- clearSeconds();
- clearGMT();
- }
- }
-
- else{
- document.userform.hdnchkHttpExpires.checked=true;
-
- if (expType == EXP_NONE){
- document.userform.HttpExpires.value="D,0";
- clearSeconds();
- clearGMT();
- }
- if (expType == EXP_DYNAMIC){
- clearGMT();
- expsecs=document.userform.hdnhdnHttpExpiresSeconds.value
- if (parseInt(expsecs) != parseInt("")){
- document.userform.hdnHttpExpiresSeconds.value=document.userform.hdnhdnHttpExpiresSeconds.value;
- }
- secval = parseInt(document.userform.hdnHttpSeconds.value);
- if (isNaN(secval)){
- secval = 0
- }
-
- secstr = secval.toString(16);
-
- <% ' Netscape's toString is broken... this hack should fix it... %>
- <% if not Session("IsIE") then %>
- while (secstr.indexOf(":") > -1){
- secstr = secstr.substring(0,secstr.indexOf(":")) + "a" + secstr.substring(secstr.indexOf(":")+1,secstr.length);
- }
-
- <% end if %>
- document.userform.HttpExpires.value="D,0X"+secstr;
-
-
- }
- if (expType == EXP_STATIC){
- clearSeconds();
- expdate=new Date();
- SetDateCntrls(expdate)
- }
- }
- }
-
- function clearSeconds(){
- if (document.userform.hdnHttpExpiresSeconds.value !=""){
- userSet=false;
- document.userform.hdnhdnHttpExpiresSeconds.value=document.userform.hdnHttpExpiresSeconds.value ;
- document.userform.hdnHttpExpiresSeconds.value="";
- userSet=true;
- }
- }
-
- function clearGMT(){
- document.userform.hdnHttpExpiresYear.value="";
- document.userform.hdnHttpExpiresMonth.value="";
- document.userform.hdnHttpExpiresDay.value="";
- document.userform.hdnHttpExpiresHours.value="";
- document.userform.hdnHttpExpiresMinutes.value="";
- }
-
- function SetSeconds(){
-
- tp=document.userform.hdnHttpExpiresTimeUnit.selectedIndex;
-
- if (document.userform.hdnHttpExpiresSeconds.value==""){
- expsecval=0;
- }
- else{
- expsecval=parseInt(document.userform.hdnHttpExpiresSeconds.value);
- }
-
-
- if (tp==0){
- document.userform.hdnHttpSeconds.value=expsecval ;
- }
- if (tp==1){
- document.userform.hdnHttpSeconds.value=expsecval * 60;
- }
- if (tp==2){
- document.userform.hdnHttpSeconds.value=expsecval * 3600;
- }
- if (tp==3){
- document.userform.hdnHttpSeconds.value=expsecval * 86400;
- }
- document.userform.hdnrdoHttpExpires[1].checked=true;
- document.userform.hdnhdnHttpExpiresSeconds.value=document.userform.hdnHttpExpiresSeconds.value;
- SetExp(EXP_DYNAMIC);
- }
-
-
- function SetLocale(){
-
- expdate=new Date();
-
- if (document.userform.hdnHttpExpiresYear.value != ""){
- expdate.setYear(document.userform.hdnHttpExpiresYear.value);
- expdate.setMonth(document.userform.hdnHttpExpiresMonth.value-1);
- expdate.setDate(document.userform.hdnHttpExpiresDay.value);
-
- tzdiff=expdate.getTimezoneOffset()
- hrsdiff=parseInt(tzdiff/60)
- mindiff=tzdiff%(hrsdiff*60)
-
- expdate.setHours(document.userform.hdnHttpExpiresHours.value - hrsdiff);
- expdate.setMinutes(document.userform.hdnHttpExpiresMinutes.value -mindiff);
-
- SetDateCntrls(expdate)
- }
- }
-
- function SetGMT(dateCntrl){
- if (userSet){
- if (dateCntrl.value != ""){
- if (isNum(dateCntrl,0)){
- expdate=new Date();
-
- expdate.setYear(document.userform.hdnHttpExpiresYear.value);
- expdate.setMonth(document.userform.hdnHttpExpiresMonth.value-1);
- expdate.setDate(document.userform.hdnHttpExpiresDay.value);
- expdate.setHours(document.userform.hdnHttpExpiresHours.value);
- expdate.setMinutes(document.userform.hdnHttpExpiresMinutes.value);
-
- SetDateCntrls(expdate)
- }
- }
- }
-
- }
-
- function SetDateCntrls(dateObj){
- year=dateObj.getYear();
-
- if (year < 100){
- year="19" + year;
- }
- document.userform.hdnHttpExpiresYear.value=year;
- document.userform.hdnHttpExpiresMonth.value=dateObj.getMonth()+1;
- document.userform.hdnHttpExpiresDay.value=dateObj.getDate();
- document.userform.hdnHttpExpiresHours.value=dateObj.getHours();
- document.userform.hdnHttpExpiresMinutes.value=dateObj.getMinutes();
-
- if (document.userform.hdnHttpExpiresMinutes.value < 10){
- document.userform.hdnHttpExpiresMinutes.value="0" + document.userform.hdnHttpExpiresMinutes.value;
- }
-
- document.userform.hdnHttpGMTDate.value=expdate.toGMTString();
- document.userform.HttpExpires.value="s," + expdate.toGMTString();
-
-
- }
-
-
- function popBox(title, width, height, filename){
- thefile=(filename + ".asp");
- thefile="iipop.asp?pg="+thefile;
- <% if Session("Browser") <> "IE3" then %>
- width=width +25;
- height=height + 50;
- <% end if %>
-
- popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
- if(popbox !=null){
- if (popbox.opener==null){
- popbox.opener=self;
- }
- }
- }
-
- </SCRIPT>
- </HEAD>
-
-
- <BODY BGCOLOR="#CCCCCC" TOPMARGIN=5 TEXT="#000000" LINK="#FFFFFF" onLoad="loadList();" STYLE="font-face: Helv; font-size: 8pt;">
- <FONT SIZE=1 FACE="Helv">
-
- <FORM NAME="userform">
-
- <B>
- <%= expires %>
- <%= L_ENABLEEXPIRE_TEXT %>
- </B>
- <P>
-
- <TABLE BORDER=0 CELLPADDING=0>
- <TR>
- <TD VALIGN="top" WIDTH = 100>
- <FONT SIZE=1 FACE="Helv">
- <%= L_CONTENTSHOULD_TEXT %>
- </FONT>
- </TD>
- <TD VALIGN="top">
- <FONT SIZE=1 FACE="Helv">
- <%= expireType(0) %>
- </FONT>
- </TD>
- <TD>
- <FONT SIZE=1 FACE="Helv">
- <%= L_EXPIMM_TEXT %>
- </FONT>
- </TD>
- </TR>
-
- <TR>
- <TD VALIGN="top">
- </TD>
- <TD VALIGN="top">
- <FONT SIZE=1 FACE="Helv">
- <%= expireType(1) %>
- </FONT>
- </TD>
- <TD>
- <FONT SIZE=1 FACE="Helv">
- <%= L_EXPAFT_TEXT %>
- <%= writeExpires("Seconds",5,"isNum(this,0);SetSeconds();","","",true,false) %>
- <INPUT TYPE="hidden" NAME="hdnHttpSeconds">
- <SELECT NAME="hdnHttpExpiresTimeUnit" OnChange="SetSeconds();top.head.Global.updated=true;">
- <%= timeunit %>
- </SELECT>
- </FONT>
- </TD>
- </TR>
-
- <TR>
- <TD VALIGN="top">
- </TD>
- <TD VALIGN="top">
- <FONT SIZE=1 FACE="Helv">
- <%= expireType(2) %>
- </FONT>
- </TD>
- <TD>
- <FONT SIZE=1 FACE="Helv">
- <%= L_EXPON_TEXT %>
- </FONT>
- </TD>
- </TR>
- <TR>
- <TD COLSPAN=2>
- </TD>
- <TD>
- <TABLE>
- <TR>
- <TD><FONT SIZE=1 FACE="Helv"><%= writeExpires("Month",2,"","","SetGMT(this);",false,false) %></FONT></TD>
- <TD> </TD>
- <TD><FONT SIZE=1 FACE="Helv"><%= writeExpires("Day",2,"","","SetGMT(this);",false,false) %></FONT></TD>
- <TD> </TD>
- <TD><FONT SIZE=1 FACE="Helv"><%= writeExpires("Year",4,"","","SetGMT(this);",false,false) %></FONT></TD>
- <TD> </TD>
- <TD><FONT SIZE=1 FACE="Helv"><%= writeExpires("Hours",2,"","","SetGMT(this);",false,false) %>: <%= writeExpires("Minutes",2,"SetGMT(this)","","",false,false) %></FONT></TD>
- </TR>
- <TR>
- <TD ALIGN="center"><FONT SIZE=1 FACE="Helv"><%= L_MONTH_TEXT %></FONT></TD>
- <TD> </TD>
- <TD ALIGN="center"><FONT SIZE=1 FACE="Helv"><%= L_DAY_TEXT %></FONT></TD>
- <TD> </TD>
- <TD ALIGN="center"><FONT SIZE=1 FACE="Helv"><%= L_YEAR_TEXT %></FONT></TD>
- <TD> </TD>
- <TD ALIGN="center"><FONT SIZE=1 FACE="Helv"><%= L_TIME_TEXT %></FONT></TD>
- </TR>
- </TABLE>
- </TD>
- </TR>
- </TABLE>
- </FONT>
- </TD>
- </TR>
-
- </TABLE>
- <INPUT TYPE="hidden" NAME="hdnHttpGMTDate">
- <INPUT TYPE="hidden" NAME="HttpExpires" VALUE="<%= currentobj.HttpExpires %>">
- <INPUT TYPE="hidden" NAME="hdnHttpExpires" VALUE="<%= currentobj.HttpExpires %>">
-
- </FORM>
- <HR>
- <FONT SIZE=1 FACE="Helv">
- <B>
- <%= L_CUSTOM_TEXT %>
- </B>
- </FONT>
-
- <SCRIPT LANGUAGE="JavaScript">
-
- function loadList(){
- <% if SetLocale then %>
- SetLocale();
- <% end if %>
-
- <% if Session("IsIE") then %>
- parent.list.location.href = "iihdrls.asp";
- <% else %>
- parent.frames[1].location.href="iihdrls.asp";
- <% end if %>
- }
-
- function addItem(){
- header=prompt("<%= L_ENTERHEADER_TEXT %>","<%= L_SAMPHDR_TEXT %>");
-
- <% if Session("IsIE") then %>
- if (header != ""){
- <% else %>
- if (header != null){
- <% end if %>
-
- i=cachedList.length;
- cachedList[i]=new listObj(header);
- cachedList[i].updated=true;
- cachedList[i].newitem=true;
- loadList();
- }
- }
-
- function delItem(){
- ndxnum=parent.list.document.userform.selHttpCustomHeader.options.selectedIndex;
- if (ndxnum != -1){
- var i=parent.list.document.userform.selHttpCustomHeader.options[ndxnum].value;
- if (i !=""){
- cachedList[i].deleted=true;
- cachedList[i].updated=true;
- loadList();
- }
- }
- else{
- alert("<%= L_SELECTITEM_TEXT %>");
- }
- }
-
- function buildListForm(){
- numrows=0;
- for (var i=0; i < cachedList.length; i++) {
- if ((!cachedList[i].deleted) && (cachedList[i].header !="")){
- numrows=numrows + 1;
- }
- }
- qstr="numrows="+numrows;
- qstr=qstr+"&cols=HttpCustomHeaders"
-
- top.body.hlist.location.href="iihdn.asp?"+qstr;
- <% 'the list values will be grabbed by the hiddenlistform script... %>
- }
-
- function SetListVals(){
- listForm=parent.parent.hlist.document.hiddenlistform;
- j=0;
- for (var i=0; i < cachedList.length; i++) {
- if ((!cachedList[i].deleted) && (cachedList[i].header !="")){
- listForm.elements[j++].value=cachedList[i].header;
- //cachedList[i].updated=false;
- }
- }
- }
-
- function popBox(title, width, height, filename){
- thefile=(filename + ".asp");
- thefile="iipop.asp?pg="+thefile;
- <% if not Session("IsIE") then %>
- width=width +25;
- height=height + 50;
- <% end if %>
-
- popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
- if(popbox !=null){
- if (popbox.opener==null){
- popbox.opener=self;
- }
- }
- }
-
- function listFuncs(){
- this.loadList=loadList;
- this.addItem=addItem;
- this.delItem=delItem;
- this.writeList=buildListForm;
- this.popBox=popBox;
- this.SetListVals=SetListVals;
- this.ndx=0;
- }
-
-
-
- function listObj(header){
- this.header=header;
- this.deleted=false;
- this.updated=false;
- this.newitem=false;
- }
-
- cachedList=new Array()
-
- listFunc=new listFuncs();
-
- <%
-
- Dim aHdrs,arraybound, i
-
- aHdrs=currentobj.HttpCustomHeaders
- arraybound=UBound(aHdrs)
- if aHdrs(arraybound) <> "" then
- for i=0 to arraybound
- %>cachedList[<%= i %>]=new listObj("<%= aHdrs(i) %>");<%
- Next
- end if
- %>
-
- </SCRIPT>
-
- </FONT>
- </BODY>
-
- </HTML>
-