<%@ page contentType="text/html; charset=iso-8859-1" language="java" errorPage="" %> <%@ page import="java.util.*" %> <%@ page import="java.io.*" %> <%@ page import="java.lang.*" %> <%@ page import="dcnPackage.*" %> displayForm v0.5 <%! %> <% String[] argSet1=null; String userName=""; String userPwd=""; String fName=""; String rmFileArg=""; boolean validLogin=false; boolean newAccount=false; boolean rmFile=false; int index=0; String fpath="C:/temp"; String delfpath=""; if ((argSet1=request.getParameterValues("username"))!=null){ userName=argSet1[0]; if ((argSet1=request.getParameterValues("userpwd"))!=null) userPwd=argSet1[0]; if ((argSet1=request.getParameterValues("newUser"))!=null) if(argSet1[0].indexOf("new")!=-1) newAccount=true; if ((argSet1=request.getParameterValues("flnm1"))!=null){ fName=argSet1[0]; if ((argSet1=request.getParameterValues("rmfile"))!=null){ rmFileArg=argSet1[0]; //ok we are deleting a file if (rmFileArg.indexOf("true")!=-1) rmFile=true; } // if we are deleting a file } // if we have a file name } // if we have a user name if (rmFile){ //create the fully qualified name, delete the file delfpath= new String(fpath+"//"+userName+"_"+userPwd+"//"+fName); File rmfx=new File(delfpath); rmfx.delete(); } // move on and display the user directory contents fpath= new String(fpath+"//"+userName+"_"+userPwd); validLogin=true; if (validLogin) { File fx=new File(fpath); if (!fx.isDirectory()){ // there is no user directory if (newAccount==true){ // this is a new account, make the directory fx.mkdir(); } else{ // no directory exists and not a new account..back to login %> <% } } if (fx.isDirectory()) { // all is good, list the contents argSet1=fx.list(); index=argSet1.length; } %>
your documents for <%=fpath%> <%=userName%>
select one of the following files to edit

<% for (int i=0;i
<% } // end for } // end if validLogin %>

> > >
<% // do help layer if less than 10 files in directory if (index<10){ %>
Welcome to the TinyWriter online editor. Select a file and click the editor button to edit your file. First time users or to create a new file, just click on the button to go directly to the editor.
<% } %>