<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit2, com.novell.emframe.dev.eMFrameUtils" %>
<%   JSPConduit2 c = JSPConduit2.getJSPConduit(request);

   c.stringTable("DevResources");
   c.stringTable("BaseResources");
   c.stringTable("FwResources"); %>

<% try  { %><HTML>
<HEAD>
   <TITLE><%= c.string("CreateUser.CreateUserTitle") %></TITLE>
   <% if (session.getAttribute("DeviceType").equals("default")) { %>
      <LINK rel='stylesheet' href='<%= c.getModulesUrl() %>/dev/css/hf_style.css'>
   <% } %>
   <jsp:include page='<%= c.getPath("dev/eMFrameScripts_inc.jsp") %>' flush="true" />
   <jsp:include page='<%= c.getPath("dev/OSScripts_inc.jsp") %>' flush="true" />
   <script language="JavaScript">

      function setSelection(strSelection)
      {
         document.CreateUserForm.CreateUserContext.value = urlDecode(strSelection);
      }

      function checkCreateUserNullInput()
      {
         var strContainerInput = document.CreateUserForm.CreateUserContext.value;
         var strUserNameInput = document.CreateUserForm.CreateUserName.value;
         var strSurnameInput = document.CreateUserForm.CreateUserSurName.value;
         if ((null == strContainerInput) || (0 == strContainerInput.length))
         {
            alert("<%= c.string("CreateUser.InvalidContext") %>");
            return false;
         }
         if ((null == strUserNameInput) || (0 == strUserNameInput.length))
         {
            alert("<%= c.string("CreateUser.InvalidUserName") %>");
            return false;
         }
         if ((null == strSurnameInput) || (0 == strSurnameInput.length))
         {
            alert("<%= c.string("CreateUser.InvalidSurName") %>");
            return false;
         }
         return true;
      }

      function setFocusToFormElement()
      {
         document.CreateUserForm.CreateUserName.focus();
      }

      function populateList()
      {
         var boxLength = document.CreateUserForm.choices.length;
         newoption = new Option("four", "4");
         document.CreateUserForm.choices.options[boxLength] = newoption;
      }

      function myCallback(controlName, resultArray)
      {
         alert("myCallback called...");
         sResultArray = ""+resultArray;
         cmd = 'document.CreateUserForm.'+toScript(controlName)+'.value="'+toScript(sResultArray)+'"';
         //alert("cmd = "+cmd);
         eval(cmd);
      }
   </script>
</HEAD>

<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF" onLoad="returnFromOS()">
<form name="CreateUserForm" method=post action="webacc" onSubmit="return(checkCreateUserNullInput())">
<% c.set("TaskHeader.title", c.string("CreateUser.CreateUserTitle")); %>
<jsp:include page='<%= c.getPath("dev/TaskHeader_inc.jsp") %>' flush="true" />
   <INPUT type=hidden name="taskId" value="<%= c.var("taskId") %>">
   <INPUT type=hidden name="merge" value="dev.GenConf">
   <INPUT type=hidden name="error" value="dev.GenErr">
   <INPUT type=hidden name="User.context" value="<%= c.var("User.context") %>">
   <INPUT type=hidden name="nextState" value="doCreateUser">

   <FONT face="Helvetica,Arial" size=-1><NOBR><BR>
   <%= c.string("CreateUser.UserName") %></NOBR><BR>
   <INPUT type=text name="CreateUserName" value="" size=20 maxlength=64><BR><BR><NOBR>
   <%= c.string("CreateUser.LastName") %></NOBR><BR>
   <INPUT type=text name="CreateUserSurName" value="" size=20 maxlength=64><BR><BR>
   <%= c.string("Creator.Context") %><NOBR><BR>
   <input type=checkbox name="check" value="hello checkbox">Checkbox<br>
   <br>
   <INPUT type=radio name="radio" value="radio1"CHECKED>1-10 years old<br>
   <INPUT type=radio name="radio" value="radio2">11 years old<br>
   <INPUT type=radio name="radio" value="radio3">12-120 years old<br>
   <br>
   Specify File Location:<BR>
	<input type="file" name="FileName" size="50" accept="text/xml">
	<BR><BR>
   <select name="choices" size=4 multiple>
   <option value="1">one
   <option value="2">two
   <option value="3">three
   </select>
   <a href="#" onClick="populateList()">Add Four</a>
   <br><br>
   <INPUT type=text name="CreateUserContext" size="60" value="Organization,Organizational Unit,User,[root],[public],[this],[containers]" size=20>
   <% c.set("OS.TypeFilter", "Alias,Organization,Organizational Unit,User,[root],[public],[this],[containers]");
      c.set("OS.Control", "CreateUserContext");
      c.set("OS.Mode", "Search"); %>
   <jsp:include page='<%= c.getPath("dev/OS_inc.jsp") %>' flush="true" />
   <BR></NOBR>
   <BR>
   <fieldset>
   <legend>Note</legend>
   The following field has an associated callback.
   </fieldset>
   <BR>
   <input type=text name="Junk" value="" size=20>
   <% c.set("OS.Control", "Junk");
      c.set("OS.TypeFilter", "User");
      c.set("OS.CallBack", "myCallback");
      c.set("OS.AltText", "Down with terrorism!"); %>
   <jsp:include page='<%= c.getPath("dev/OS_inc.jsp") %>' flush="true" />
   <BR><BR>

   <INPUT type=image name="Create" alt="Create" src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.OK.image") %>" border=0>
   <jsp:include page='<%= c.getPath("dev/Cancel_inc.jsp") %>' flush="true" />
   </FONT>
</form>
<jsp:include page='<%= c.getPath("dev/OSFooter_inc.jsp") %>' flush="true" />
</BODY></HTML> <% } catch (Exception e) { e.printStackTrace(); %>Exception occured processing JSP page<% } %>
