home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 March / VPR0003B.ISO / alpha / iiadmhd.asp < prev    next >
Text File  |  1999-10-14  |  5KB  |  190 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% if Session("FONTSIZE") = "" then %>
  6.     <!--#include file="iito.inc"-->
  7. <% else %>
  8.  
  9. <% 
  10. Const L_ADDWEBUSERS_TEXT = "Web サイト オペレータ"
  11. Const L_ADDFTPUSERS_TEXT = "FTP サイト オペレータ"
  12. Const L_LISTNAMES_TEXT = "以下の Windows NT ユーザー アカウントに、このサイトのオペレータ権限を許可します:"
  13. Const L_BUILTIN_TEXT = "BUILTIN\"
  14. Const L_ENTERTRUSTEE_TEXT = "ドメイン名とユーザー名を入力してください。"
  15. Const L_ADMINISTRATORS_TEXT = "Administrators"
  16. Const L_DELERROR_TEXT = "このサイトのローカル管理者権限は削除できません。"
  17. Const L_SAMPTRUSTEE_TEXT = "DOMAIN\\username"
  18. Const L_SELECTITEM_TEXT = "最初に、一覧から削除するユーザーを選択する必要があります。"
  19. Const L_EVERYONE_TEXT = "Everyone"
  20. On Error Resume Next 
  21.  
  22. Dim path, currentobj
  23.  
  24. path=Session("spath")
  25. Session("path")=path
  26. Set currentobj=GetObject(path)
  27. Session("SpecObj")="Operators"
  28. Session("SpecProps")="Trustee"
  29. %>
  30.  
  31. <HTML>
  32. <HEAD>
  33. <TITLE></TITLE>
  34. </HEAD>
  35.  
  36. <BODY BGCOLOR="#CCCCCC" TOPMARGIN=5 TEXT="#000000" LINK="#FFFFFF" onLoad="loadList();" STYLE="font-size:10pt;">
  37.  
  38. <FONT SIZE=2>
  39. <% if Session("stype")="www" then %>
  40.     <B><%= L_ADDWEBUSERS_TEXT %></B><P>
  41. <% else %>
  42.     <B><%= L_ADDFTPUSERS_TEXT %></B><P>
  43. <% end if %>
  44. <%= L_LISTNAMES_TEXT %>
  45. </FONT>
  46.  
  47. <FORM NAME="userform"></FORM>
  48.  
  49.  
  50. <SCRIPT LANGUAGE="JavaScript">
  51.  
  52.     top.title.Global.helpFileName="iipy_29";
  53.     top.title.Global.siteProperties = true;    
  54.     
  55.     function loadList(){    
  56.         <% if Session("IsIE") then %>
  57.             parent.list.location.href = "iiadmls.asp";
  58.         <% else %>
  59.             parent.frames[1].location.href="iiadmls.asp";
  60.         <% end if %>
  61.     }
  62.  
  63.     function addItem(){
  64.         trustee=prompt("<%= L_ENTERTRUSTEE_TEXT %>","<%= L_SAMPTRUSTEE_TEXT %>");
  65.         if ((trustee != "") && (trustee != null)){    
  66.  
  67.             top.title.Global.updated=true;            
  68.             i=cachedList.length;    
  69.             cachedList[i]=new listObj(trustee);
  70.             cachedList[i].updated=true;    
  71.             cachedList[i].newitem=true;
  72.             loadList();
  73.         }
  74.     }
  75.  
  76.     function delItem(){
  77.         ndxnum=parent.list.document.userform.selTrustee.options.selectedIndex;
  78.         if (ndxnum != -1){
  79.         var i=parent.list.document.userform.selTrustee.options[ndxnum].value;
  80.             if (i != ""){
  81.                 if (cachedList[i].trustee != "<%= L_ADMINISTRATORS_TEXT %>"){
  82.                     cachedList[i].deleted=true;
  83.                     cachedList[i].updated=true;    
  84.                     top.title.Global.updated=true;                    
  85.                     loadList();
  86.                 }
  87.                 else{
  88.                     alert("<%= L_DELERROR_TEXT %>");
  89.                 }
  90.             }
  91.         }
  92.         else{
  93.             alert("<%= L_SELECTITEM_TEXT %>");
  94.         }
  95.     }
  96.  
  97.     function buildListForm(){
  98.         numrows=0;
  99.         for (var i=0; i < cachedList.length; i++) {
  100.             if ((!cachedList[i].deleted) && (cachedList[i].header !="")){
  101.                 numrows=numrows + 1;
  102.             }
  103.         }
  104.         qstr="numrows="+numrows;
  105.         qstr=qstr+"&cols=Trustee"
  106.  
  107.         top.body.hlist.location.href="iihdn.asp?"+qstr;
  108.         <% 'the list values will be grabbed by the hiddenlistform script... %>
  109.     }
  110.  
  111.     function SetListVals(){
  112.         listForm=parent.parent.hlist.document.hiddenlistform;    
  113.         j=0;
  114.         for (var i=0; i < cachedList.length; i++) {
  115.             if ((!cachedList[i].deleted) && (cachedList[i].trustee !="")){
  116.                 listForm.elements[j++].value=cachedList[i].trustee;
  117.                 //cachedList[i].updated=false;
  118.             }
  119.         }
  120.     }
  121.  
  122.     function popBox(title, width, height, filename){
  123.         thefile=(filename + ".asp");
  124.         thefile="iipop.asp?pg="+thefile;
  125.         <% if Session("Browser") <> "IE3" then %>
  126.             width=width +25;
  127.             height=height + 50;                
  128.         <% end if %>
  129.  
  130.         popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
  131.         if(popbox !=null){
  132.             if (popbox.opener==null){
  133.                 popbox.opener=self;
  134.             }
  135.         }
  136.     }
  137.  
  138.     function listFuncs(){
  139.         this.loadList=loadList;
  140.         this.addItem=addItem;
  141.         this.delItem=delItem;
  142.         this.writeList=buildListForm;
  143.         this.popBox=popBox;
  144.         this.SetListVals=SetListVals;
  145.         this.ndx=0;        
  146.     }
  147.  
  148.  
  149.  
  150.     function listObj(trustee){
  151.         this.trustee=trustee;
  152.         this.deleted=false;
  153.         this.updated=false;
  154.         this.newitem=false;
  155.     }
  156.  
  157.     cachedList=new Array()
  158.  
  159. listFunc=new listFuncs();
  160.  
  161. <%  
  162.  
  163. Dim ACLs, dACLs, i, Ace, User
  164. set ACLs=currentobj.AdminACL
  165. set dACLs = ACLs.DiscretionaryACL
  166.  
  167. i = 0
  168. For Each Ace in dACLs
  169.     
  170.     User = Ace.Trustee    
  171.     if NOT ((Ace.Trustee = L_EVERYONE_TEXT ) and (Ace.AccessMask=8)) then
  172.         if InStr(Ace.Trustee,L_BUILTIN_TEXT) then
  173.             User = Mid(User,InStr(User,L_BUILTIN_TEXT)+Len(L_BUILTIN_TEXT))
  174.         end if
  175.         User = Replace(User,"\","\\")
  176.          %>cachedList[<%= i %>]=new listObj("<%= User %>");<% 
  177.          i = i+1
  178.     end if
  179. Next
  180.  
  181.  
  182. %>
  183.  
  184. </SCRIPT>
  185.  
  186. </FONT>
  187. </BODY>
  188. </HTML>
  189. <% end if %>
  190.