Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

308 lines
7.1 KiB

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4. <% if Session("FONTSIZE") = "" then %>
  5. <!--#include file="iito.inc"-->
  6. <% else %>
  7. <!--#include file="iiadmhd.str"-->
  8. <!--#include file="iianoncm.str"-->
  9. <%
  10. On Error Resume Next
  11. Dim path, currentobj
  12. path=Session("spath")
  13. Session("path")=path
  14. Set currentobj=GetObject(path)
  15. Session("SpecObj")="Operators"
  16. Session("SpecProps")="Trustee"
  17. %>
  18. <!--#include file="iiset.inc"-->
  19. <!--#include file="iisetfnt.inc"-->
  20. <HTML>
  21. <HEAD>
  22. <TITLE></TITLE>
  23. </HEAD>
  24. <BODY BGCOLOR="<%= Session("BGCOLOR") %>" TOPMARGIN=5 TEXT="#000000" LINK="#FFFFFF" onLoad="loadList();">
  25. <TABLE WIDTH = 500 BORDER = 0>
  26. <TR>
  27. <TD>
  28. <%= sFont("","","",True) %>
  29. <FORM NAME="userform">
  30. <% if Session("stype")="www" then %>
  31. <B><%= L_ADDWEBUSERS_TEXT %></B><P>
  32. <% else %>
  33. <B><%= L_SECACCTS_TEXT %></B>
  34. <P>
  35. <TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0>
  36. <TR>
  37. <TD VALIGN="top" COLSPAN = 2>
  38. <%= sFont("","","",True) %>
  39. <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">
  40. <%= checkbox("AllowAnonymous","",false) %>
  41. <%= L_ANON_TEXT %>
  42. <IMG SRC="images/hr.gif" WIDTH=<%= L_ANON_HR_W %> HEIGHT=2 BORDER=0 ALIGN="middle">
  43. <P>
  44. <%= L_NOUSERNEEDED_TEXT %>
  45. </TD>
  46. </TR>
  47. <TD >
  48. <%= sFont("","","",True) %>
  49. <%= L_ACCOUNTUSED_TEXT %>
  50. </TD>
  51. <TD ALIGN="right">
  52. <%= sFont("","","",True) %>
  53. <INPUT TYPE="button" NAME="btnAnonUser" VALUE="<%= L_EDIT_TEXT %>" OnClick="SetUser();">
  54. <INPUT TYPE="hidden" NAME="AnonymousUserName" VALUE="<%= currentobj.AnonymousUserName %>">
  55. <INPUT TYPE="hidden" NAME="AnonymousUserPass" VALUE="<%= currentobj.AnonymousUserPass %>">
  56. <INPUT TYPE="hidden" NAME="AnonymousPasswordSync" VALUE="<%= currentobj.AnonymousPasswordSync %>">
  57. </FONT>
  58. </TD>
  59. </TR>
  60. <TR>
  61. <TD>
  62. <%= sFont("","","",True) %>
  63. <%= checkbox("AnonymousOnly","",false) %>
  64. <%= L_ANONONLY_TEXT %><P>
  65. </TD>
  66. </TR>
  67. </TABLE>
  68. <P>
  69. <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">
  70. <%= L_ADDFTPUSERS_TEXT %>
  71. <IMG SRC="images/hr.gif" WIDTH=<%= L_ADDFTPUSERS_HR_W %> HEIGHT=2 BORDER=0 ALIGN="middle">
  72. <P>
  73. <% end if %>
  74. </B>
  75. <%= sFont("","","",True) %>
  76. <%= L_LISTNAMES_TEXT %>
  77. </FONT>
  78. </FORM>
  79. </TD>
  80. </TR>
  81. </TABLE>
  82. <SCRIPT LANGUAGE="JavaScript">
  83. <% if Session("stype")="www" then %>
  84. top.title.Global.helpFileName="iipy_29";
  85. <% else %>
  86. top.title.Global.helpFileName="iipz_1";
  87. <% end if %>
  88. top.title.Global.siteProperties = true;
  89. <!--#include file="iijsfuncs.inc"-->
  90. function loadList(){
  91. <% if Session("IsIE") then %>
  92. parent.list.location.href = "iiadmls.asp";
  93. <% else %>
  94. parent.frames[1].location.href="iiadmls.asp";
  95. <% end if %>
  96. }
  97. function addItem()
  98. {
  99. var sTrustee;
  100. var sUName;
  101. var sDomain;
  102. var i;
  103. sTrustee=prompt("<%= L_ENTERTRUSTEE_TEXT %>","<%= L_SAMPTRUSTEE_TEXT %>");
  104. if ((sTrustee != "") && (sTrustee != null))
  105. {
  106. var iSlashIndex = sTrustee.indexOf("<%= L_FWDSLASH_TEXT %>");
  107. if (iSlashIndex > 0)
  108. {
  109. sTrustee = sTrustee.substring(0,iSlashIndex) + "<%= L_BACKSLASH_TEXT %>" + sTrustee.substr(iSlashIndex+1);
  110. }
  111. iSlashIndex = sTrustee.indexOf("<%= L_BACKSLASH_TEXT %>");
  112. if (iSlashIndex > 0)
  113. {
  114. sDomain = sTrustee.substring(0,iSlashIndex);
  115. sUName = sTrustee.substring(iSlashIndex+1,sTrustee.length);
  116. chkUser(sDomain,sUName)
  117. }
  118. else
  119. {
  120. alert("<%= L_NOUSER_ERROR %>");
  121. }
  122. }
  123. }
  124. function chkUser(sDomain,sUName)
  125. {
  126. if (sDomain == "" || sUName == "")
  127. {
  128. alert("<%= L_NOUSER_ERROR %>");
  129. return false;
  130. }
  131. else
  132. {
  133. if (isNewUser(sDomain,sUName))
  134. {
  135. top.body.iisstatus.location.href = "iistat.asp?thisState=" + escape("<%= L_SEARCHING_TEXT %>") + "&moving=yes";
  136. top.connect.location.href = "iichkuser.asp?domain=" + escape(sDomain) + "&uname=" + escape(sUName);
  137. }
  138. }
  139. return true;
  140. }
  141. function isNewUser(sDomain, sUName)
  142. {
  143. for (i=0; i<cachedList.length;i++)
  144. {
  145. if ((sDomain + "<%= L_BACKSLASH_TEXT %>" + sUName) == cachedList[i].trustee)
  146. {
  147. return false;
  148. }
  149. }
  150. return true;
  151. }
  152. function addUser(sTrustee)
  153. {
  154. top.title.Global.updated=true;
  155. i=cachedList.length;
  156. cachedList[i]=new listObj(sTrustee);
  157. cachedList[i].updated=true;
  158. cachedList[i].newitem=true;
  159. loadList();
  160. top.body.iisstatus.location.href="iistat.asp?thisState=";
  161. }
  162. function delItem(){
  163. ndxnum=parent.list.document.userform.selTrustee.options.selectedIndex;
  164. if (ndxnum != -1){
  165. var i=parent.list.document.userform.selTrustee.options[ndxnum].value;
  166. if (i != ""){
  167. if (cachedList[i].trustee != "<%= L_ADMINISTRATORS_TEXT %>"){
  168. cachedList[i].deleted=true;
  169. cachedList[i].updated=true;
  170. top.title.Global.updated=true;
  171. loadList();
  172. }
  173. else{
  174. alert("<%= L_DELERROR_TEXT %>");
  175. }
  176. }
  177. }
  178. else{
  179. alert("<%= L_SELECTITEM_TEXT %>");
  180. }
  181. }
  182. function buildListForm(){
  183. numrows=0;
  184. for (var i=0; i < cachedList.length; i++) {
  185. if ((!cachedList[i].deleted) && (cachedList[i].header !="")){
  186. numrows=numrows + 1;
  187. }
  188. }
  189. qstr="numrows="+numrows;
  190. qstr=qstr+"&cols=Trustee"
  191. top.body.hlist.location.href="iihdn.asp?"+qstr;
  192. <% 'the list values will be grabbed by the hiddenlistform script... %>
  193. }
  194. function SetListVals(){
  195. listForm=parent.parent.hlist.document.hiddenlistform;
  196. j=0;
  197. for (var i=0; i < cachedList.length; i++) {
  198. if ((!cachedList[i].deleted) && (cachedList[i].trustee !="")){
  199. listForm.elements[j++].value=cachedList[i].trustee;
  200. //cachedList[i].updated=false;
  201. }
  202. }
  203. }
  204. function listFuncs(){
  205. this.bHasList = true;
  206. this.loadList=loadList;
  207. this.addItem=addItem;
  208. this.addUser=addUser;
  209. this.delItem=delItem;
  210. this.writeList=buildListForm;
  211. this.popBox=popBox;
  212. this.SetListVals=SetListVals;
  213. this.ndx=0;
  214. }
  215. function listObj(trustee){
  216. this.trustee=trustee;
  217. this.deleted=false;
  218. this.updated=false;
  219. this.newitem=false;
  220. }
  221. cachedList=new Array()
  222. listFunc=new listFuncs();
  223. function SetUser()
  224. {
  225. thefile="iipop.asp?pg=iianon.asp&tools=no";
  226. title="AnonymousUser"
  227. width = <%= iHScale(L_IIANON_W) %>;
  228. height = <%= iVScale(L_IIANON_H) %>;
  229. popbox=window.open(thefile,title,"toolbar=no,scrollbars=yes,directories=no,menubar=no,width="+width+",height="+height);
  230. if(popbox !=null){
  231. if (popbox.opener==null){
  232. popbox.opener=self;
  233. }
  234. }
  235. }
  236. <% if Session("stype")="ftp" then %>
  237. setCntrlState(document.userform.chkAllowAnonymous.checked,document.userform.btnAnonUser);
  238. <% end if %>
  239. <%
  240. Dim ACLs, dACLs, i, Ace, User
  241. set ACLs=currentobj.AdminACL
  242. set dACLs = ACLs.DiscretionaryACL
  243. 'First, add administrator to the list. We'll always have admin...
  244. %>cachedList[0]=new listObj("<%= L_ADMINISTRATORS_TEXT %>");<%
  245. 'We just added @ 0, so start with 1...
  246. i = 1
  247. For Each Ace in dACLs
  248. 'Now, add all users with operator privilages...
  249. 'AccessMask can be set to 8, which is enum only. We ignore these.
  250. 'The admin account will also have a different AccessMask, so it shouldn't appear twice.
  251. if Ace.AccessMask = 11 then
  252. User = Ace.Trustee
  253. User = Replace(User,"\","\\")
  254. %>cachedList[<%= i %>]=new listObj("<%= User %>");<%
  255. i = i+1
  256. end if
  257. Next
  258. %>
  259. </SCRIPT>
  260. </BODY>
  261. </HTML>
  262. <% end if %>