浏览代码

Initial commit: homepage (registration & co)

Mathias Landhäußer 11 年之前
父节点
当前提交
6b9a50a9f3
共有 34 个文件被更改,包括 1043 次插入 和 0 次删除
  1. 32 0
      jplag.homepage/pom.xml
  2. 140 0
      jplag.homepage/src/main/java/jplagHomepage/JPlagBean.java
  3. 122 0
      jplag.homepage/src/main/java/jplagHomepage/JSPDeveloperData.java
  4. 310 0
      jplag.homepage/src/main/java/jplagHomepage/JSPRequestData.java
  5. 40 0
      jplag.homepage/src/main/webapp/ActivateRequest.jsp
  6. 23 0
      jplag.homepage/src/main/webapp/CheckRequest.jsp
  7. 42 0
      jplag.homepage/src/main/webapp/ExtendAccount.jsp
  8. 21 0
      jplag.homepage/src/main/webapp/JPlagTest.jsp
  9. 98 0
      jplag.homepage/src/main/webapp/RequestForm.jsp
  10. 13 0
      jplag.homepage/src/main/webapp/WEB-INF/web.xml
  11. 58 0
      jplag.homepage/src/main/webapp/develop.jsp
  12. 2 0
      jplag.homepage/src/main/webapp/footer.jsp
  13. 123 0
      jplag.homepage/src/main/webapp/header.jsp
  14. 19 0
      jplag.homepage/src/main/webapp/index.html
  15. 二进制
      jplag.homepage/src/main/webapp/pics/background.png
  16. 二进制
      jplag.homepage/src/main/webapp/pics/client.gif
  17. 二进制
      jplag.homepage/src/main/webapp/pics/client_lit.gif
  18. 二进制
      jplag.homepage/src/main/webapp/pics/contentforeground.gif
  19. 二进制
      jplag.homepage/src/main/webapp/pics/credits.gif
  20. 二进制
      jplag.homepage/src/main/webapp/pics/credits_lit.gif
  21. 二进制
      jplag.homepage/src/main/webapp/pics/develop.gif
  22. 二进制
      jplag.homepage/src/main/webapp/pics/develop_lit.gif
  23. 二进制
      jplag.homepage/src/main/webapp/pics/example.gif
  24. 二进制
      jplag.homepage/src/main/webapp/pics/example_lit.gif
  25. 二进制
      jplag.homepage/src/main/webapp/pics/help.gif
  26. 二进制
      jplag.homepage/src/main/webapp/pics/help_lit.gif
  27. 二进制
      jplag.homepage/src/main/webapp/pics/home.gif
  28. 二进制
      jplag.homepage/src/main/webapp/pics/home_lit.gif
  29. 二进制
      jplag.homepage/src/main/webapp/pics/navbar.png
  30. 二进制
      jplag.homepage/src/main/webapp/pics/navbarback.png
  31. 二进制
      jplag.homepage/src/main/webapp/pics/register.gif
  32. 二进制
      jplag.homepage/src/main/webapp/pics/register_lit.gif
  33. 二进制
      jplag.homepage/src/main/webapp/pics/top.png
  34. 二进制
      jplag.homepage/src/main/webapp/pics/topback.png

+ 32 - 0
jplag.homepage/pom.xml

@@ -0,0 +1,32 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>jplag.homepage</artifactId>
+	<version>0.0.2-SNAPSHOT</version>
+	<packaging>war</packaging>
+
+	<parent>
+		<groupId>edu.kit.ipd.jplag</groupId>
+		<version>0.3-SNAPSHOT</version>
+		<artifactId>parent</artifactId>
+	</parent>
+
+	<repositories>
+		<repository>
+			<id>ipdNexus</id>
+			<name>Recaa Repository</name>
+			<url>http://bob.ipd.kit.edu/nexus/content/repositories/public/</url>
+		</repository>
+	</repositories>
+
+	<build>
+		<finalName>JPlagWeb</finalName>
+	</build>
+
+	<dependencies>
+		<dependency>
+			<groupId>edu.kit.ipd.jplag</groupId>
+			<artifactId>wsClient</artifactId>
+		</dependency>
+	</dependencies>
+</project>

+ 140 - 0
jplag.homepage/src/main/java/jplagHomepage/JPlagBean.java

@@ -0,0 +1,140 @@
+/*
+ * Created on 27.05.2005
+ * Author: Moritz Kroll
+ */
+package jplagHomepage;
+
+import java.rmi.RemoteException;
+import java.util.Iterator;
+
+import javax.xml.rpc.handler.Handler;
+import javax.xml.rpc.handler.HandlerChain;
+
+import jplagWsClient.jplagClient.JPlagException;
+import jplagWsClient.jplagClient.JPlagService_Impl;
+import jplagWsClient.jplagClient.JPlagTyp_Stub;
+import jplagWsClient.jplagClient.RequestData;
+import jplagWsClient.jplagClient.SetDeveloperStateParams;
+import jplagWsClient.util.JPlagClientAccessHandler;
+
+public class JPlagBean {
+	private JPlagTyp_Stub stub = null;
+
+	public JPlagBean() {
+		// Setup SSL stuff to allow message encryption
+		//		System.setProperty("javax.net.ssl.trustStorePassword", "gulpie!");
+		//		System.setProperty("javax.net.ssl.trustStore", System.getProperty("catalina.home") + File.separator + "server.trust");
+		//		System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
+		//		java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
+
+		stub = (JPlagTyp_Stub) (new JPlagService_Impl().getJPlagServicePort());
+
+		// Set the server page login data
+
+		HandlerChain handlerchain = stub._getHandlerChain();
+		@SuppressWarnings("unchecked")
+		Iterator<Handler> handlers = handlerchain.iterator();
+		while (handlers.hasNext()) {
+			Handler handler = handlers.next();
+			if (handler instanceof JPlagClientAccessHandler) {
+				((JPlagClientAccessHandler) handler).setUserPassObjects("JPlagJSP", "#Ca+#h8n4un!");
+				return;
+			}
+		}
+		throw new RuntimeException("JPlagBean(): Unable to find client access" + " handler!");
+	}
+
+	/**
+	 * Converts an exception into a string depending on its type and logs a
+	 * stack trace if it's not a JPlagException
+	 */
+	public String checkException(Exception ex) {
+		if (ex instanceof JPlagException) {
+			JPlagException jex = (JPlagException) ex;
+			return "JPlagException: " + jex.getExceptionType() + ": " + jex.getDescription() + "<br />" + jex.getRepair();
+		} else if (ex instanceof RemoteException) {
+			ex.printStackTrace();
+			return "RemoteException: " + ex.toString();
+		} else {
+			ex.printStackTrace();
+			return "Unknown exception: " + ex.toString();
+		}
+	}
+
+	/**
+	 * @return an empty String if the user doesn't exist, otherwise an error
+	 *         message
+	 */
+	public String existsUsername(String username) {
+		try {
+			RequestData rd = new RequestData(null, username, null, null, null, null, null, null, null);
+
+			if (!stub.requestAccount(rd))
+				return "Username already exists, please choose another one!";
+			return "";
+		} catch (Exception ex) {
+			return checkException(ex);
+		}
+	}
+
+	/**
+	 * Sends an account request to the server
+	 * 
+	 * @return An empty string on success, an error string on failure
+	 */
+	public String requestAccount(JSPRequestData reqd) {
+		try {
+			RequestData rd = new RequestData(null, reqd.getUsername(), reqd.getPassword(), reqd.getRealname(), reqd.getEmail(),
+					reqd.getAltEmail(), reqd.getHomepage(), reqd.getReason() + "\n" + "Institution: " + reqd.getUniSchool(),
+					reqd.getNotes());
+
+			if (!stub.requestAccount(rd))
+				return "Username already exists, please choose another one!";
+			return "";
+		} catch (Exception ex) {
+			return checkException(ex);
+		}
+	}
+
+	/**
+	 * Sends a provided account activation code to the server validating it. The
+	 * username is part of the code.
+	 * 
+	 * @return An empty string on success, an error string on failure
+	 */
+	public String validateEmail(String code) {
+		try {
+			RequestData rd = new RequestData(null, null, code, null, null, null, null, null, null);
+
+			if (!stub.requestAccount(rd))
+				return "The activation code is not correct! Please make sure" + "The code is the same as the one in the email you "
+						+ "received!";
+			return "";
+		} catch (Exception ex) {
+			return checkException(ex);
+		}
+	}
+
+	public String extendAccount(String code) {
+		try {
+			stub.extendAccount(code);
+			return "";
+		} catch (Exception ex) {
+			return checkException(ex);
+		}
+	}
+
+	public String setDeveloperState(JSPDeveloperData data) {
+		try {
+			SetDeveloperStateParams dsp = new SetDeveloperStateParams(data.getUsername(), data.getPassword(), data.getSignAsDeveloper());
+			stub.setDeveloperState(dsp);
+			return "";
+		} catch (JPlagException ex) {
+			return ex.getDescription() + "<br />" + ex.getRepair();
+		} catch (Exception ex) {
+			return checkException(ex);
+		}
+
+	}
+
+}

+ 122 - 0
jplag.homepage/src/main/java/jplagHomepage/JSPDeveloperData.java

@@ -0,0 +1,122 @@
+/*
+ * Created on 04.09.2006
+ * Author: Moritz Kroll
+ */
+package jplagHomepage;
+
+import java.util.ArrayList;
+
+public class JSPDeveloperData {
+	private static final String errorBegin="<font color=\"red\">";
+	private static final String errorEnd="</font>";
+	
+	JPlagBean jplagBean = null;
+    
+    private ArrayList<String> errorList = new ArrayList<String>();
+    
+	private	String username = "";
+	private String password = "";
+	private String signwhat = "";
+    private boolean signAsDeveloper = true;
+    private String initial = "true";
+    
+	public String getUsername() { return username; }
+	public void setUsername(String val) { username = val; }
+	
+	public String getPassword() { return password; }
+	public void setPassword(String val) { password = val; }
+	
+	public String getSignwhat() { return signwhat; }
+	public void setSignwhat(String val) { signwhat = val; }
+    public boolean getSignAsDeveloper() { return signAsDeveloper; }
+    
+    public String getInitial() { return initial; }
+    public void setInitial(String val) { initial = val; }
+	
+	private boolean checkString(String str, String name) {
+		if(str != null && str.length() != 0) return true;
+        
+        errorList.add("You have to provide a " + name + "!");
+        return false;
+	}
+	
+	private JPlagBean getJPlagBean() {
+		if(jplagBean == null) jplagBean = new JPlagBean();
+		return jplagBean;
+	}
+    
+	public boolean checkUsername() {
+		return checkString(username, "username");
+	}
+	
+	public boolean checkPassword() {
+		return checkString(password, "password");
+	}
+	
+	public boolean checkSignwhat() {
+        if(signwhat.equals("signup")) {
+            signAsDeveloper = true;
+            return true;
+        }
+        else if(signwhat.equals("signoff")) {
+            signAsDeveloper = false;
+            return true;
+        }
+        errorList.add("You have to choose whether you want to sign up or sign "
+            + "off for developer mails!");
+        return false;
+	}
+	
+	public boolean checkAll() {
+		boolean bUser = checkUsername(),
+            bPass = checkPassword(), 
+            bSign = checkSignwhat();
+		return bUser && bPass && bSign;
+	}
+	
+	public String setDeveloperState() {
+        if(initial.equals("true")) return "";
+        
+        errorList.clear();
+        
+        if(checkAll())
+        {
+            String str = getJPlagBean().setDeveloperState(this);
+            if(str.length() == 0)
+            {
+                // TODO: This doesn't seem to work...
+                setPassword("");           // clear password
+                setInitial("true");        // don't reexecute
+                if(signAsDeveloper)
+                    return "You have been successfully marked as a developer!";
+                else
+                    return "You have been successfully unmarked as a developer!";
+            }
+            errorList.add(str);
+        }
+
+        String errorMessage;
+        if(errorList.size() == 1)
+            errorMessage = errorBegin + "The following error occurred:<ul>";
+        else
+            errorMessage = errorBegin + "The following errors occurred:<ul>";
+            
+        for(String errorStr : errorList)
+            errorMessage += "<li>" + errorStr;
+        
+        errorMessage += "</ul>" + errorEnd;
+        
+        return errorMessage;
+	}
+	
+	/**
+	 * This is a workaround to allow the user to clear out fields...
+	 * Stupid JSP spec...
+	 */
+	public void setReset(String ignore) {
+		username = "";
+		password = "";
+		signwhat = "";
+        initial = "true";
+	}
+}

+ 310 - 0
jplag.homepage/src/main/java/jplagHomepage/JSPRequestData.java

@@ -0,0 +1,310 @@
+/*
+ * Created on 26.05.2005
+ * Author: Moritz Kroll
+ */
+package jplagHomepage;
+
+import java.util.regex.Pattern;
+
+public class JSPRequestData {
+	private static final String errorBegin="<font color=\"red\">";
+	private static final String errorEnd="</font>";
+	private static final String[] invalidMailProvider = { "hotmail", "yahoo", "gmail", "gmx", "web", "lycos" };
+	
+	JPlagBean jplagBean=null;
+	
+	private boolean understand=false;
+	private String understandError="";
+	
+	private String username="";
+	private String usernameError="";
+	private String oldUsername="";
+	
+	private String password="";
+	private String passwordSame="";
+	private String passwordError="";
+	
+	private String realname="";
+	private String realnameError="";
+	
+	private String email="";
+	private String emailError="";
+	
+	private String altEmail="";
+	
+	private String homepage="";
+	private String homepageError="";
+	
+	private String uniSchool="";
+	private String uniSchoolError="";
+	
+	private String reason="";
+	private String reasonError="";
+	
+	private String notes="";
+	
+	public boolean getUnderstand() { return understand; }
+	public void setUnderstand(boolean val) { understand=val; }
+	
+	public String getUsername() { return username; }
+	public void setUsername(String val) { username=val; }
+	
+	public String getPassword() { return password; }
+	public void setPassword(String val) { password=val; }
+	
+	public String getPasswordSame() { return passwordSame; }
+	public void setPasswordSame(String val) { passwordSame=val; }
+	
+	public String getRealname() { return realname; }
+	public void setRealname(String val) { realname = val; }
+	
+	public String getEmail() { return email; }
+	public void setEmail(String val) { email = val; }
+	
+	public String getAltEmail() { return altEmail; }
+	public void setAltEmail(String val) { altEmail = val; }
+
+	public String getHomepage() { return homepage; }
+	public void setHomepage(String val) { homepage = val; }
+
+	public String getUniSchool() { return uniSchool; }
+	public void setUniSchool(String val) { uniSchool = val; }
+
+	public String getReason() { return reason; }
+	public void setReason(String val) { reason = val; }
+	
+	public String getNotes() { return notes; }
+	public void setNotes(String val) { notes = val; }
+
+	private static String error(String str) {
+		return errorBegin + str + errorEnd;
+	}
+	
+	private static String checkString(String str,String name) {
+		if(str!=null && str.length()!=0) return "";
+		return error("You have to provide " + name + "!");
+	}
+	
+	private JPlagBean getJPlagBean() {
+		if(jplagBean==null) jplagBean = new JPlagBean();
+		return jplagBean;
+	}
+	
+	public boolean checkUnderstand() {
+		if(understand) {
+			understandError = "";
+			return true;
+		}
+		else {
+			understandError = error("You have to acknowledge this statement!");
+			return false;
+		}
+	}
+	
+	public String getUnderstandError() {
+		return understandError;
+	}
+	
+	public boolean checkUsername() {
+		usernameError=checkString(username,"an username");
+		if(usernameError.length()!=0) return false;
+		if(!Pattern.matches("^[\\w\\@\\.]+$",username)) {
+			usernameError=error("The username may only consist of the "
+				+ "following characters: 'A'-'Z', 'a'-'z', '0'-'9', '@' "
+				+ "and '.'");
+			return false;
+		}
+		
+		if(oldUsername!=username)
+		{
+			usernameError=getJPlagBean().existsUsername(username);
+			if(usernameError.length()!=0)
+			{
+				usernameError=error(usernameError);
+				return false;
+			}
+			oldUsername=username;
+		}
+		return true;
+	}
+	
+	public String getUsernameError() {
+		return usernameError;
+	}
+	
+	public boolean checkPassword() {
+		if(password!=null && passwordSame!=null && password.length()>0)
+		{
+			if(password.length()>=6)
+			{
+				if(passwordSame.length()>0)
+				{
+					if(password.equals(passwordSame))
+					{
+						if(!password.equals(username))
+						{
+							if(!password.equals("123456") && !password.toLowerCase().equals("password"))
+							{
+								passwordError="";
+								return true;
+							}
+							else passwordError = error("Very funny... please choose a sensible password.");
+						}
+						else passwordError = error("Username and password are identical! " +
+								"They must be different!");
+					}
+					else passwordError=error("The passwords are not equal! " +
+							"Please retype!");
+				}
+				else passwordError=error("You must provide the same password " +
+						"two times!");
+			}
+			else passwordError=error("The password is too short! " +
+					"It must have at least 6 characters!");
+		}
+		else passwordError=error("You have to provide a password!");
+		password="";
+		passwordSame="";
+		return false;
+	}
+	
+	public String getPasswordError() {
+		return passwordError;
+	}
+	
+	public boolean checkRealname() {
+		realnameError=checkString(realname,"a real name");
+		if(realnameError.length()!=0) return false;
+		
+		String tokens[]=realname.split(" ");
+		if(tokens.length<2) {
+			realnameError=error("You have to provide a fore- <b>and</b> surename!");
+			return false;
+		}
+		return true;
+	}
+	
+	public String getRealnameError() {
+		return realnameError;
+	}
+    
+    /*
+     * Email verification pattern for RFC 2822 by Les Hazlewood:
+     * http://www.leshazlewood.com/?p=5
+     */
+    
+	/*
+     * RFC 2822 token definitions for valid email - only used together to form a java Pattern object:
+	 */  
+    private static final String sp = "!#$%&'*+-/=?^_`{|}~";
+    private static final String atext = "[a-zA-Z0-9" + sp + "]";
+    private static final String atom = atext + "+"; //one or more atext chars
+    private static final String dotAtom = "\\." + atom;
+    private static final String localPart = atom + "(" + dotAtom + ")*"; //one atom followed by 0 or more dotAtoms.
+
+    /*
+     * RFC 1035 tokens for domain names:
+     */
+    private static final String letter = "[a-zA-Z]";
+    private static final String letDig = "[a-zA-Z0-9]";
+    private static final String letDigHyp = "[a-zA-Z0-9-]";
+    public static final String rfcLabel = letDig + letDigHyp + "{0,61}" + letDig;
+    private static final String domain = rfcLabel + "(\\." + rfcLabel + ")*\\." + letter + "{2,6}";
+
+    /*
+     * Combined together, these form the allowed email regexp allowed by RFC 2822:
+     */
+    private static final String addrSpec = "^" + localPart + "@" + domain + "$";
+
+	public static final Pattern VALID_EMAIL_PATTERN = Pattern.compile( addrSpec );
+	
+	public boolean checkEmail() {
+		emailError=checkString(email,"a primary email address");
+		if(emailError.length()!=0) return false;
+		
+		if(VALID_EMAIL_PATTERN.matcher(email).matches())
+		{
+			String tokens[]=email.split("@");
+			String tokens2[]=tokens[1].split("\\.");
+			if(tokens2.length>=2)
+			{
+				String lowermail=tokens2[tokens2.length-2].toLowerCase();
+				for(int i=0;i<invalidMailProvider.length;i++) {
+					if(invalidMailProvider[i].equals(lowermail))
+					{
+						emailError=error(invalidMailProvider[i] + 
+							" will not be accepted!");
+						return false;
+					}
+				}
+				return true;
+			}
+		}
+		
+		emailError=error(email + " is not a valid email" +
+			" address!");
+		return false;
+	}
+	
+	public String getEmailError() {
+		return emailError;
+	}
+	
+	public boolean checkUniSchool() {
+		uniSchoolError = checkString(uniSchool, "an university or school");
+		return uniSchoolError.length()==0;
+	}
+	
+	public String getUniSchoolError() {
+		return uniSchoolError;
+	}
+	
+	public boolean checkHomepage() {
+		homepageError = checkString(homepage, "an official web page showing your email address");
+		return homepageError.length()==0;
+	}
+	
+	public String getHomepageError() {
+		return homepageError;
+	}
+	
+	public boolean checkReason() {
+		reasonError=checkString(reason,"a reason for using JPlag");
+		return reasonError.length()==0;
+	}
+	
+	public String getReasonError() {
+		return reasonError;
+	}
+	
+	public boolean checkAll() {
+		return checkUnderstand() & checkUsername() & checkPassword() & checkRealname()
+			& checkEmail() & checkUniSchool() & checkHomepage() & checkReason();
+	}
+	
+	public String sendRequest() {
+		String str=getJPlagBean().requestAccount(this);
+		if(str==null || str.length()==0) str="Account requested, check your" +
+				" mails for verification (the mail delivery could need some" +
+				" time depending on the providers)!";
+		return str;
+	}
+	
+	/**
+	 * This is a workaround to allow the user to clear out fields...
+	 * Stupid JSP spec...
+	 */
+	public void setReset(String ignore) {
+		understand=false;
+		username="";
+		password="";
+		passwordSame="";
+		realname="";
+		email="";
+		altEmail="";
+		homepage="";
+		uniSchool="";
+		reason="";
+		notes="";
+	}
+}

+ 40 - 0
jplag.homepage/src/main/webapp/ActivateRequest.jsp

@@ -0,0 +1,40 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+
+<jsp:useBean id="jplagbean" class="jplagHomepage.JPlagBean" scope="page"/>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<%
+  String code=request.getParameter("code");
+  if(code==null || code.length()==0)
+    response.sendRedirect("http://jplag.ipd.kit.edu");
+%>
+<head>
+ <title>Activate request</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+</head>
+<body background="pics/background.png" style="background-attachment:fixed">
+ <br/><br/>
+ <%
+  String str=jplagbean.validateEmail(code);
+  if(str.length()==0) {
+ %>
+ <center><h3>Thank you for your email verification!</h3></center><br/><br/>
+ 
+ The request was given to the administrator, who will decide on your request
+ soon!
+ <%
+  }
+  else {
+ %>
+ <center><h3>Following error occurred:</h3></center><br/><br/>
+ 
+<b> <%= str %> </b>
+ <br/><br/>
+ If this error message isn't very helpful, please contact the administrator!
+ <%
+  }
+ %>
+ 
+ <%@include file="footer.jsp" %>
+</body>

+ 23 - 0
jplag.homepage/src/main/webapp/CheckRequest.jsp

@@ -0,0 +1,23 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+<% request.setCharacterEncoding("UTF-8"); %>
+<jsp:useBean id="user" class="jplagHomepage.JSPRequestData" scope="session"/>
+<jsp:setProperty name="user" property="reset" value=""/>
+<jsp:setProperty name="user" property="*"/>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title>Check request</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+</head>
+<body background="pics/background.png" style="background-attachment:fixed">
+ <br/><br/>
+ <%
+  if(user.checkAll()) {
+    out.println(user.sendRequest());
+  }
+  else pageContext.forward("RequestForm.jsp");
+ %>
+ 
+ <%@include file="footer.jsp" %>
+</body>
+</html>

+ 42 - 0
jplag.homepage/src/main/webapp/ExtendAccount.jsp

@@ -0,0 +1,42 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+
+<jsp:useBean id="jplagbean" class="jplagHomepage.JPlagBean" scope="page"/>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<%
+  String code=request.getParameter("code");
+  if(code==null || code.length()==0)
+    response.sendRedirect("https://jplag.ipd.kit.edu");
+%>
+<head>
+ <title>Extend account</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+</head>
+<body>
+<%
+  String str=jplagbean.extendAccount(code);
+  if(str.length()==0) {
+ %>
+ <h3>Your account has been extended!</h3>
+ <p>
+ We hope you enjoyed using JPlag so far and continue to successfully use it
+ for the next year, too!
+ </p>
+ <%
+  }
+  else {
+ %>
+ <h3>Following error occurred:</h3>
+ <p>
+ 
+<b> <%= str %> </b>
+ <br/><br/>
+ If this error message isn't very helpful, please contact the administrator!
+ </p>
+ <%
+  }
+ %>
+ 
+ <%@include file="footer.jsp" %>
+</body>

+ 21 - 0
jplag.homepage/src/main/webapp/JPlagTest.jsp

@@ -0,0 +1,21 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+
+<HTML>
+  <HEAD>
+
+  <TITLE>JPlagTest</TITLE>
+  </HEAD>
+  <BODY>
+  <CENTER>
+  <BR>
+  <jsp:useBean id="jplagTest" class="jplagHomepage.JPlagTestBean"
+  			   scope="page" />
+  <%
+    String l_result  = jplagTest.getServerInfo();
+  %>
+  <%= l_result %>
+  </CENTER>
+ 
+ <%@include file="footer.jsp" %>
+  </BODY>
+</HTML>

+ 98 - 0
jplag.homepage/src/main/webapp/RequestForm.jsp

@@ -0,0 +1,98 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+<% request.setCharacterEncoding("UTF-8"); %>
+<jsp:useBean id="user" class="jplagHomepage.JSPRequestData" scope="session"/>
+ <%@include file="header.jsp" %>
+
+  <div class="text">
+<h1>Request a JPlag account</h1>
+
+<p>
+ In order to use JPlag, you need to have an account. With this account you
+ will be able access our service through an easy and installation-free
+ Java Web Start client.</p>
+ <p>The information you provide in the following form will be saved on the JPlag
+ server and an email verification will be sent to your email address.
+ After you have visited the link provided in this email, we will review your
+ application and activate your account.</p>
+ <p> Please note that we do not give accounts to users of anonymous email addresses
+ like Hotmail, Yahoo, Gmail, etc. Use an official email account provided by your university/school.</p>
+
+     <form method="post" action="CheckRequest.jsp">
+      <table>
+       <tr>
+         <td style="text-align: right;">
+            <input type="checkbox" name="understand" <%
+            if(user.getUnderstand()) out.print(" checked");
+            %>></td>
+            <td>I understand, that JPlag compares only among the files I send
+            in one submission.<br />
+            In no way does it compare to any external resources like books or
+            internet pages or to any previously sent files.<br /><br />
+          </td>
+        <td><%= user.getUnderstandError() %></td>
+       </tr>
+       <tr>
+        <td>Username:</td>
+        <td><input type="text" name="username" class="text"
+                           value="<%= user.getUsername() %>"></td>
+        <td><%= user.getUsernameError() %></td>
+       </tr>
+       <tr>
+        <td>Password:</td>
+        <td><input type="password" name="password" class="text"
+                           value="<%= user.getPassword() %>"></td>
+        <td><%= user.getPasswordError() %></td>
+       </tr>
+       <tr>
+        <td>Confirm password:</td>
+        <td><input type="password" name="passwordSame" class="text"
+                           value="<%= user.getPasswordSame() %>"></td>
+       </tr>
+       <tr>
+        <td>Full name:</td>
+        <td><input type="text" name="realname" class="text"
+                           value="<%= user.getRealname() %>"></td>
+        <td><%= user.getRealnameError() %></td>
+       </tr>
+       <tr>
+        <td>Email address:</td>
+        <td><input type="text" name="email" class="text"
+                           value="<%= user.getEmail() %>"></td>
+        <td><%= user.getEmailError() %></td>
+       </tr>
+       <tr>
+        <td>Alternative email address (optional):</td>
+        <td><input type="text" name="altEmail" class="text"
+                           value="<%= user.getAltEmail() %>"></td>
+       </tr>
+       <tr>
+        <td>University/school you are working for:</td>
+        <td><input type="text" name="uniSchool" class="text"
+                           value="<%= user.getUniSchool() %>"></td>
+        <td><%= user.getUniSchoolError() %></td>
+       </tr>
+       <tr>
+        <td>Official web page of the university/school&nbsp;&nbsp;&nbsp;<br />
+                        showing your email address<br />
+                        (allowing us to verify your identity):</td>
+        <td valign="bottom"><input type="text" name="homepage" class="text"
+                           value="<%= user.getHomepage() %>"></td>
+        <td valign="bottom"><%= user.getHomepageError() %></td>
+       </tr>
+       <tr>
+        <td>Short description of the purpose for<br />
+                which you want to use JPlag<br />
+                (which course etc.):</td>
+        <td><textarea name="reason"><%= user.getReason() %></textarea></td>
+        <td><%= user.getReasonError() %></td>
+       </tr>
+       <tr>
+        <td>Additional notes (optional):</td>
+        <td><textarea name="notes"><%= user.getNotes() %></textarea></td>
+       </tr>
+<tr><td colspan="3" style="text-align: center;">
+      <input type="submit" value=" Send Request "/>
+</td></tr>
+      </table>
+     </form>
+<%@include file="footer.jsp" %>

+ 13 - 0
jplag.homepage/src/main/webapp/WEB-INF/web.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+  <display-name>JPlag web service page</display-name>
+  <description>
+     JPlag web service homepage
+  </description>
+  <url-pattern>/index.html</url-pattern>
+</web-app>

+ 58 - 0
jplag.homepage/src/main/webapp/develop.jsp

@@ -0,0 +1,58 @@
+<%@ page contentType="text/html;charset=UTF-8"%>
+<% request.setCharacterEncoding("UTF-8"); %>
+<jsp:useBean id="devuser" class="jplagHomepage.JSPDeveloperData" scope="session"/>
+<jsp:setProperty name="devuser" property="reset" value=""/>
+<jsp:setProperty name="devuser" property="*"/>
+
+ <%@include file="header.jsp" %>
+
+<h1>Developer Registration</h1>
+
+<p>Below, you can sign up yourself for developer mails concerning
+changes of the compatibility level and related needed changes to your client
+as described in the last chapter of the tutorial. As mentioned there it is
+not our intention to make such changes in the near future, but we want to make
+sure you get the ability to know about changes before your client becomes
+unusable.</p>
+
+<form method="post" action="develop.jsp">
+ <input type="hidden" name="initial" value="false" />
+ <table>
+  <tr>
+   <td>Username:</td>
+   <td><input type="text" name="username" style="width: 20em"
+		value="<%= devuser.getUsername() %>" /></td>
+  </tr>
+  <tr>
+   <td>Password:</td>
+   <td><input type="password" name="password" style="width: 20em"
+		value="<%= devuser.getPassword() %>" /></td>
+  </tr>
+  <tr>
+   <td align="right"><input type="radio" name="signwhat" value="signup" 
+   	<% if(devuser.getSignwhat().equals("signup")) out.print("checked"); %>
+   	/></td>
+   <td>Sign up as developer</td>
+  </tr>
+  <tr>
+   <td align="right"><input type="radio" name="signwhat" value="signoff"
+   	<% if(devuser.getSignwhat().equals("signoff")) out.print("checked"); %>
+   	/></td>
+   <td>Remove developer status</td>
+  </tr>
+  <tr>
+   <td colspan="2">
+    <br />
+    <%= devuser.setDeveloperState() %>
+   </td>
+  </tr>
+  <tr>
+  <td colspan="2"><input type="submit" value=" Update Developer Status "/></td>
+  </tr>
+ </table>
+</form>
+ 
+ <%@include file="footer.jsp" %>
+
+</body>
+</html>

+ 2 - 0
jplag.homepage/src/main/webapp/footer.jsp

@@ -0,0 +1,2 @@
+</body>
+</html>

+ 123 - 0
jplag.homepage/src/main/webapp/header.jsp

@@ -0,0 +1,123 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title>Request a JPlag account</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+
+<style type="text/css">
+<!--
+* {
+/*    border:0; */
+    font-family:Verdana, Arial, Helvetica, sans-serif;
+    margin:0;
+    padding:0;
+}
+
+img {
+    border:0;
+}
+
+input, textarea {
+    border:1px solid #b3b3b3;
+    margin:1px;
+    width: 250px;
+}
+
+/* Farben der allgemeinen Links */
+a:link,a:active,a:visited {
+    color:#009682;
+    text-decoration:none;
+}
+a:hover {
+    text-decoration:underline;
+}
+
+/* Überschriften */
+h1 {
+    border-bottom:1px solid #ccc;
+    color:#000000;
+    font-size:1.27em;
+    margin:-1px 0 14px;
+    padding-bottom:10px;
+    padding-top:10px; /* neu */
+    line-height:16px;
+}
+h2 {
+    color:#000000;
+    font-size:1.0909em;
+    font-weight:700;
+    line-height:16px;
+    margin:0;
+    padding-top:8px;
+    padding-bottom:8px;
+}
+h3 {
+    color:#808080;
+    font-size:1.0909em;
+    font-weight:700;
+    line-height:16px;
+    margin:0;
+    padding-bottom:8px;
+}
+h4 {
+    background:url(headline_bg.gif) center left repeat-x;
+    font-size:1em;
+    height:1.45em;
+    margin-bottom:5px;
+}
+html>/**/body h4:first-line {
+    background-color:#ffffff;
+}
+/* Formatierungen für Content */
+div#content img {
+/*    border:1px #b3b3b3 solid; */
+}
+div.text {
+    color:#000000;
+    line-height:1.45em;
+    margin:-3px 0 19px;
+    overflow:hidden;
+}
+div.rubriktext {
+    color:#000000;
+    line-height:1.45em;
+    margin:-3px 0 12px;
+}
+div.formular {
+    color:#000000;
+    line-height:1.45em;
+}
+div.text a:link,div.text a:active,div.text a:visited {
+    text-decoration:underline;
+}
+div.text a:hover {
+    text-decoration:none;
+}
+div.text ul {
+    margin-left: 2em;
+    margin-bottom: 0.5em;
+}
+div.text ul li {
+    list-style-image: url(dynimg.gif);
+}
+div.text ol {
+    margin-left: 3em;
+}
+div.text pre, div.text pre * {
+    font-family: monospace;
+    font-size: 11px;
+    color: #000000;
+}
+div.text code, div.text code * {
+    font-family: monospace;
+    font-size: 11px;
+    color: #000000;
+}
+table td {
+vertical-align: top;
+}
+
+-->
+</style>
+</head>
+<body>

+ 19 - 0
jplag.homepage/src/main/webapp/index.html

@@ -0,0 +1,19 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
+<html>
+<head>
+  <title>JPlag - Detecting Software Plagiarism</title>
+  <META http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta name="description" content="This Page is about JPlag, a plagiarism detection program for Java, C#, C, C++ and Scheme code." />
+  <meta name="keywords" content="JPlag, plagiarism, detect, education, c, c++, c#, java, scheme, programming, assignments" />
+</head>
+<body>
+<p>Lots of stuff here but no index...<br />
+<ul>
+<li><a href="/">JPlag Home</a></li>
+<li><a href="RequestForm.jsp">Registration Form</a></li>
+<li><a href="develop.jsp">Developer Registration Form</a></li>
+<li><a href="ActivateRequest.jsp">ActivateRequest</a></li>
+<li><a href="ExtendAccount.jsp">ExtendAccount</a></li>
+</p>
+</body>
+</html>

二进制
jplag.homepage/src/main/webapp/pics/background.png


二进制
jplag.homepage/src/main/webapp/pics/client.gif


二进制
jplag.homepage/src/main/webapp/pics/client_lit.gif


二进制
jplag.homepage/src/main/webapp/pics/contentforeground.gif


二进制
jplag.homepage/src/main/webapp/pics/credits.gif


二进制
jplag.homepage/src/main/webapp/pics/credits_lit.gif


二进制
jplag.homepage/src/main/webapp/pics/develop.gif


二进制
jplag.homepage/src/main/webapp/pics/develop_lit.gif


二进制
jplag.homepage/src/main/webapp/pics/example.gif


二进制
jplag.homepage/src/main/webapp/pics/example_lit.gif


二进制
jplag.homepage/src/main/webapp/pics/help.gif


二进制
jplag.homepage/src/main/webapp/pics/help_lit.gif


二进制
jplag.homepage/src/main/webapp/pics/home.gif


二进制
jplag.homepage/src/main/webapp/pics/home_lit.gif


二进制
jplag.homepage/src/main/webapp/pics/navbar.png


二进制
jplag.homepage/src/main/webapp/pics/navbarback.png


二进制
jplag.homepage/src/main/webapp/pics/register.gif


二进制
jplag.homepage/src/main/webapp/pics/register_lit.gif


二进制
jplag.homepage/src/main/webapp/pics/top.png


二进制
jplag.homepage/src/main/webapp/pics/topback.png