home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / iis.asp < prev    next >
Text File  |  1997-11-12  |  2KB  |  97 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% 
  6.  
  7. '    strings for localization
  8. Const L_ACCESSDENIED_TEXT="Unauthorized - Logon failed" 
  9. Const L_ISM_TEXT="Microsoft Internet Service Manager"
  10. 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"
  11.  
  12. On Error Resume Next
  13.  
  14. Dim currentobj, adminobj
  15. Dim adminserver, lasterr, cont, logonfailure, thisinst
  16.  
  17. ' check for our session vars... if they are missing we need to regrab from the cookies...
  18. %>
  19. <% if Session("Browser") = "" or  Session("FONTSIZE") = "" then %>
  20. <%        Response.write ("<META HTTP-EQUIV='Refresh' CONTENT='0;URL=default.asp'>") %>
  21. <% else %>
  22. <%    
  23.     Set currentobj=GetObject("IIS://localhost/w3svc/"+Request.ServerVariables("INSTANCE_ID"))    
  24.     lasterr = err
  25.     if err = &H800401E4 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.     
  40.     <% if cont then %>
  41.     
  42.         <%
  43.         Set adminobj=GetObject("IIS://localhost/w3svc/info")        
  44.         if (Request.ServerVariables("INSTANCE_ID")=adminobj.AdminServer) then
  45.             Session("isAdmin")=true
  46.         else
  47.             Session("isAdmin")=false
  48.         end if
  49.         %>
  50.     
  51.         <HTML>
  52.         <HEAD>
  53.         <TITLE><%= L_ISM_TEXT %></TITLE>        
  54.         </HEAD>
  55.         
  56.     
  57.         <% if Session("Browser") = "IE3" then %>
  58.         
  59.             <FRAMESET ROWS="35,*,0" FRAMEBORDER=0 FRAMESPACING=0>
  60.         
  61.                 <FRAME SRC="iihd.asp" NAME="title" SCROLLING="no">
  62.         
  63.                 <FRAME SRC="blank.htm" NAME="body">
  64.                 <FRAME SRC="blank.htm" NAME="connect" FRAMEBORDER=0 FRAMESPACING=0 SCROLLING="auto">
  65.         
  66.             </FRAMESET>
  67.         
  68.         <% else %>
  69.             
  70.             <FRAMESET ROWS="35,*,0" FRAMEBORDER="no" BORDER=0 FRAMESPACING=0>
  71.         
  72.                 <FRAME SRC="iihd.asp" NAME="title" SCROLLING="no" MARGINHEIGHT=0 MARGINWIDTH=0>
  73.         
  74.                 <FRAME SRC="blank.htm" NAME="body">
  75.                 <FRAME SRC="blank.htm" NAME="connect" FRAMEBORDER=0 FRAMESPACING=0 SCROLLING="no">
  76.         
  77.             </FRAMESET>
  78.         
  79.         <% end if %>
  80.         </HTML>
  81.     <% else %>
  82.         <% if not logonfailure then %>
  83.         <HTML>
  84.         <BODY>
  85.             Unable to connect to the Active Directory Service Object. Please contact your system adminstrator.<P>
  86.     
  87.             Error: <B><%= err %> <%= err.description %></B>
  88.         </BODY>
  89.         </HTML>
  90.         <% end if %>
  91.     
  92.     <% end if %>
  93.  
  94. <% end if %>
  95.  
  96.  
  97.