diff --git a/WebContent/adminLogin.jsp b/WebContent/adminLogin.jsp index e33796f..df36b10 100644 --- a/WebContent/adminLogin.jsp +++ b/WebContent/adminLogin.jsp @@ -1,88 +1,221 @@ <%@ page import = "database.*" %> -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import = "java.sql.*" %> <%@ page import = "java.security.MessageDigest" %> <%@ page import = "java.security.NoSuchAlgorithmException" %> -<% -int ssoNum; -String pass; -Cookie adminCookie; +<%@ page import = "java.util.Random" %> + + +
+ + + + + + -ssoNum = Integer.parseInt(request.getParameter("username")); -pass = request.getParameter("pass"); -String generatedPass = null; +Thanks for approving a ticket!
@@ -36,7 +40,7 @@You shouldn't be seeing this page :)
+ +<% +/* + We follow into this "if" statement if the password change form was submitted. +*/ +if(request.getParameter("password") != null){ + /* + Gathering form information that the user submitted. + */ + String old = request.getParameter("old"); + String newpass = request.getParameter("new"); + String confirm = request.getParameter("confirm"); + String generatedOldPass = null; + + /* + This uses MD5 to hash the old password the user entered in, so it can be compared against what is in the DB. + */ + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(old.getBytes()); + byte[] bytes = md.digest(); + StringBuilder sb = new StringBuilder(); + for(int i = 0; iOr choose an option to the left to begin requesting!
Thanks for returning some devices!
-You can ship the devices to the following address:
-Thanks for returning some devices!
+You can ship the devices to the following address:
+