From fc200b494e1efbc687dc8058b89b935bf3df7aa3 Mon Sep 17 00:00:00 2001 From: Connor L Jackson Date: Fri, 21 Apr 2017 13:32:11 -0400 Subject: [PATCH] Password Reset Functionality --- WebContent/adminLogin.jsp | 277 ++++++--- .../administration/adminpasswordsetting.jsp | 62 ++ .../adminpasswordsettingtryagain.jsp | 63 ++ .../webpages/administration/ticketApprove.jsp | 6 +- .../html/webpages/components/adminnavbar.jsp | 3 +- .../html/webpages/components/adminsidebar.jsp | 1 + .../html/webpages/components/navbar.jsp | 3 +- WebContent/html/webpages/error.jsp | 2 +- WebContent/html/webpages/index.jsp | 2 +- WebContent/html/webpages/listingPage.jsp | 14 +- WebContent/html/webpages/profileSettings.jsp | 33 +- .../webpages/redirect/adminpasswordchange.jsp | 22 +- .../webpages/redirect/adminpasswordupdate.jsp | 205 +++++++ WebContent/html/webpages/requestPage.jsp | 12 +- WebContent/html/webpages/returnComplete.jsp | 32 +- WebContent/html/webpages/returnPage.jsp | 92 +-- WebContent/html/webpages/shoppingCart.jsp | 576 +++++++++--------- WebContent/html/webpages/somethingwrong.jsp | 2 +- WebContent/html/webpages/statisticsPage.jsp | 104 ++-- WebContent/html/webpages/userLogin.jsp | 76 +-- WebContent/index.jsp | 73 +-- 21 files changed, 1077 insertions(+), 583 deletions(-) create mode 100644 WebContent/html/webpages/administration/adminpasswordsetting.jsp create mode 100644 WebContent/html/webpages/administration/adminpasswordsettingtryagain.jsp create mode 100644 WebContent/html/webpages/redirect/adminpasswordupdate.jsp 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; + Innovation Hub -try { - MessageDigest md = MessageDigest.getInstance("MD5"); - md.update(pass.getBytes()); - byte[] bytes = md.digest(); - StringBuilder sb = new StringBuilder(); - for(int i = 0; i + + + + + + + + + +<% +/* + If admin chose to login, we work on this form. +*/ +if(request.getParameter("login") != null){ + /* + Get form information from last page. + */ + int ssoNum = Integer.parseInt(request.getParameter("username")); + String pass = request.getParameter("pass"); + Cookie adminCookie; + String generatedPass = null; -} - -String database = "jdbc:mysql://us-cdbr-iron-east-04.cleardb.net/ad_15a989204c2ff8a?user=b372dfe7409692&password=74f6e317"; -String user = "b372dfe7409692"; -String password = "74f6e317"; -Class.forName("com.mysql.jdbc.Driver"); -Connection connection; -Statement stmt; -for(;;){ - try{ - connection = DriverManager.getConnection(database, user, password); - break; + /* + Hash what the user put in, so we can see if the passwords match up. + */ + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(pass.getBytes()); + byte[] bytes = md.digest(); + StringBuilder sb = new StringBuilder(); + for(int i = 0; i \ No newline at end of file +/* + Goes back to the previous page. +*/ +function goBack(){ + window.history.back(); +} + + \ No newline at end of file diff --git a/WebContent/html/webpages/administration/adminpasswordsetting.jsp b/WebContent/html/webpages/administration/adminpasswordsetting.jsp new file mode 100644 index 0000000..0359bc0 --- /dev/null +++ b/WebContent/html/webpages/administration/adminpasswordsetting.jsp @@ -0,0 +1,62 @@ + + + + + + + + + + Innovation Hub + + + + + + + + + + + + + + + +
+ +
+

Change Your Password

+
+ + +
+
+ + +
+
+ + +
+ +
+
+

Change Pincode

+
+ + +
+ +
+
+ + \ No newline at end of file diff --git a/WebContent/html/webpages/administration/adminpasswordsettingtryagain.jsp b/WebContent/html/webpages/administration/adminpasswordsettingtryagain.jsp new file mode 100644 index 0000000..f006479 --- /dev/null +++ b/WebContent/html/webpages/administration/adminpasswordsettingtryagain.jsp @@ -0,0 +1,63 @@ + + + + + + + + + + Innovation Hub + + + + + + + + + + + + + + + +
+ +
+

Something went wrong. Try again!

+

Change Your Password

+
+ + +
+
+ + +
+
+ + +
+ +
+
+

Change Pincode

+
+ + +
+ +
+
+ + \ No newline at end of file diff --git a/WebContent/html/webpages/administration/ticketApprove.jsp b/WebContent/html/webpages/administration/ticketApprove.jsp index 7b35f4c..7116095 100644 --- a/WebContent/html/webpages/administration/ticketApprove.jsp +++ b/WebContent/html/webpages/administration/ticketApprove.jsp @@ -29,6 +29,10 @@ + +

Approving Tickets

Thanks for approving a ticket!

@@ -36,7 +40,7 @@
Synchrony Financial

-
+
diff --git a/WebContent/html/webpages/components/adminnavbar.jsp b/WebContent/html/webpages/components/adminnavbar.jsp index 160a20a..e3cde2c 100644 --- a/WebContent/html/webpages/components/adminnavbar.jsp +++ b/WebContent/html/webpages/components/adminnavbar.jsp @@ -24,6 +24,7 @@
  • Device Hub
  • Location Hub
  • +
  • Update Password/Pincode
  • \ No newline at end of file diff --git a/WebContent/html/webpages/components/navbar.jsp b/WebContent/html/webpages/components/navbar.jsp index 0f32c01..ac1ec25 100644 --- a/WebContent/html/webpages/components/navbar.jsp +++ b/WebContent/html/webpages/components/navbar.jsp @@ -24,6 +24,7 @@