home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_03.cab / iis.asp < prev    next >
Encoding:
Text File  |  1997-08-29  |  2.3 KB  |  95 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <%Option Explicit %>
  3.  
  4. <% 
  5.  
  6. '    strings for localization
  7. Const L_ACCESSDENIED_TEXT="Unauthorized - Logon failed" 
  8. Const L_ISM_TEXT="Microsoft Internet Service Manager"
  9. Const L_JSCRIPTVER_TEXT="IIS Web administration requires JScript version 3.0 or greater. You can download the lastest javascript files from http://www.microsoft.com/jscript"
  10.  
  11. On Error Resume Next
  12.  
  13. Dim currentobj
  14. Dim adminserver, lasterr, cont, logonfailure, thisinst
  15.  
  16. ' check for our session vars... if they are missing we need to regrab from the cookies...
  17. %>
  18. <% if Session("Browser") = "" or  Session("FONTSIZE") = "" then %>
  19. <%        Response.write ("<META HTTP-EQUIV='Refresh' CONTENT='0;URL=default.asp'>") %>
  20. <% else %>
  21. <%    
  22.     Set currentobj=GetObject("IIS://localhost/w3svc")
  23.     adminserver = currentobj.AdminServer
  24.     lasterr = err
  25.     if err = -2147463162 then        
  26.         Response.Status = "401 access denied"
  27.         cont = False
  28.         logonfailure = True
  29.     else
  30.         if err=0 then     
  31.             cont=True
  32.         else
  33.             cont=False
  34.             logonfailure = False
  35.         end if
  36.     end if
  37.     %>
  38.     
  39.     <% if cont then %>
  40.     
  41.         <%
  42.         if (Request.ServerVariables("INSTANCE_ID")=currentobj.AdminServer) then
  43.             Session("isAdmin")=true
  44.         else
  45.             Session("isAdmin")=false
  46.         end if
  47.         %>
  48.     
  49.         <HTML>
  50.         <HEAD>
  51.         <TITLE><%= L_ISM_TEXT %></TITLE>
  52.         </HEAD>
  53.         
  54.     
  55.         <% if Session("Browser") = "IE3" then %>
  56.         
  57.             <FRAMESET ROWS="35,*,0" FRAMEBORDER=0 FRAMESPACING=1>
  58.         
  59.                 <FRAME SRC="iihd.asp" NAME="head" SCROLLING="no">
  60.         
  61.                 <FRAME SRC="blank.htm" NAME="body">
  62.                 <FRAME SRC="blank.htm" NAME="connect" FRAMEBORDER=0 FRAMESPACING=1 SCROLLING="auto">
  63.         
  64.             </FRAMESET>
  65.         
  66.         <% else %>
  67.             
  68.             <FRAMESET ROWS="35,*,0" FRAMEBORDER="no" BORDER=0 FRAMESPACING=0>
  69.         
  70.                 <FRAME SRC="iihd.asp" NAME="head" SCROLLING="no" MARGINHEIGHT=0 MARGINWIDTH=0>
  71.         
  72.                 <FRAME SRC="blank.htm" NAME="body">
  73.                 <FRAME SRC="blank.htm" NAME="connect" FRAMEBORDER=0 FRAMESPACING=0 SCROLLING="no">
  74.         
  75.             </FRAMESET>
  76.         
  77.         <% end if %>
  78.         </HTML>
  79.     <% else %>
  80.         <% if not logonfailure then %>
  81.         <HTML>
  82.         <BODY>
  83.             Unable to connect to the Active Directory Service Object. Please contact your system adminstrator.<P>
  84.     
  85.             Error: <B><%= err %> <%= err.description %></B>
  86.         </BODY>
  87.         </HTML>
  88.         <% end if %>
  89.     
  90.     <% end if %>
  91.  
  92. <% end if %>
  93.  
  94.  
  95.