-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/master' into John's…
…-Branch # Conflicts: # WebContent/html/javascript/request.jsp # WebContent/html/webpages/statisticsPage.jsp
- Loading branch information
Showing
65 changed files
with
4,746 additions
and
1,266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
# [Synchrony Financial Mobile Device Tracking System](https://seniordesign.cfapps.io/html/webpages/) | ||
# [Innovation Hub](https://seniordesign.cfapps.io/html/webpages/) | ||
In the Innovation Station at Synchrony Financial, applications are used by over 60 million cardholders across the US, and those customers use a huge variety of devices to access them. To make sure applications work on all devices they house hundreds of smart phones, tablets, and other connected devices to test with. The devices are lent to employees across the country for their individual testing needs. | ||
|
||
The goal of this project is to build and design an application that allows employees to view a list of available devices, allow employees to request one of those devices, and for it to be shipped for their testing needs. The current goal of this project is to design this as a Java web application that will work proficiently on phones and desktops. | ||
|
||
Team member on this project include: | ||
* Brianna Boyce | ||
* Connor Jackson | ||
* Adam Claxton | ||
* Brianna Boyce | ||
* John Costa | ||
* Maegan Dyakiw | ||
* Connor Jackson | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,161 @@ | ||
<%@ 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" %> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
|
||
ssoNum = Integer.parseInt(request.getParameter("ssoNum2")); | ||
pass = request.getParameter("pass"); | ||
String generatedPass = null; | ||
<title>Innovation Hub</title> | ||
|
||
try { | ||
MessageDigest md = MessageDigest.getInstance("MD5"); | ||
md.update(pass.getBytes()); | ||
byte[] bytes = md.digest(); | ||
StringBuilder sb = new StringBuilder(); | ||
for(int i = 0; i<bytes.length; i++) | ||
sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1)); | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | ||
<link rel = "stylesheet" type = "text/css" href = "html/css/stylesheet.css"> | ||
<link rel = "shortcut icon" href = "html/imgs/synchrony-financial-logo-dlpx_1.ico"> | ||
</head> | ||
<body> | ||
<nav class="navbar navbar-inverse navbar-fixed-top" id = "navbaruniversal" style = "visibility: hidden;"> | ||
<div class="container-fluid"><div class="navbar-header"><button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="index.jsp"><img src="html/imgs/synchrony-financial-logo-dlpx_1.png" style = "height: 100%;"></a></div><div id="navbar" class="navbar-collapse collapse" aria-expanded="false"><ul class="nav navbar-nav navbar-right"><li><a href="index.jsp">Synchrony Device Request System</a></li></ul></div></div> | ||
</nav> | ||
<div id = "info" style = "margin-left: 10px; visibility: hidden;"> | ||
<h2>Password Reset</h2> | ||
<h3>Please enter your SSO number and Email below.</h3> | ||
<form action = "passwordreset.jsp" method="post"> | ||
<div class="form-group"> | ||
<label = for="username">SSO Number *</label> | ||
<input id = "username" class = "form-control" type="text" pattern="[0-9]{9}" name="username" placeholder="9 digit SSO Number"> | ||
</div> | ||
<div class="form-group"> | ||
<label = for="email">Email *</label> | ||
<input id = "email" class = "form-control" type="email" name="email" placeholder="email@email.com"> | ||
</div> | ||
<button name = "reset" type="submit" class="btn btn-primary" id = "submit">Reset Password</button> | ||
</form> | ||
</div> | ||
</body> | ||
<% | ||
/* | ||
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; | ||
generatedPass = sb.toString(); | ||
} | ||
catch (NoSuchAlgorithmException e){ | ||
/* | ||
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<bytes.length; i++) | ||
sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1)); | ||
generatedPass = sb.toString(); | ||
} | ||
catch (NoSuchAlgorithmException e){ | ||
} | ||
} | ||
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 = DriverManager.getConnection(database, user, password); | ||
Statement stmt = connection.createStatement(); | ||
ResultSet result; | ||
result = stmt.executeQuery("select * FROM admin where Admin_ID='" + ssoNum + "' AND Password='" + generatedPass + "'"); | ||
if (result.next()){ | ||
request.getSession(); | ||
session.setAttribute("ssoNum", ssoNum); | ||
adminCookie = new Cookie("ssoNum", Integer.toString(ssoNum)); | ||
adminCookie.setMaxAge(30*60); | ||
adminCookie.setPath("/"); | ||
response.addCookie(adminCookie); | ||
Cookie adminCookie2 = new Cookie("admin", Integer.toString(ssoNum)); | ||
adminCookie2.setPath("/"); | ||
response.addCookie(adminCookie2); | ||
if(result.getInt("Password_Flag") == 1){ | ||
stmt.close(); | ||
connection.close(); | ||
response.sendRedirect("html/webpages/administration/admin.jsp"); | ||
return; | ||
/* | ||
Make database connection to get the corresponding user that's logging in. | ||
*/ | ||
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; | ||
} | ||
catch(SQLException e){ | ||
Thread.sleep(1); | ||
} | ||
} | ||
else{ | ||
for(;;){ | ||
try{ | ||
stmt = connection.createStatement(); | ||
break; | ||
} | ||
catch(SQLException e){ | ||
Thread.sleep(1); | ||
} | ||
} | ||
ResultSet result = stmt.executeQuery("select admin.*,employee.Name FROM admin INNER JOIN employee ON admin.Admin_ID = employee.Employee_ID WHERE Admin_ID='" + ssoNum + "' AND Password='" + generatedPass + "'"); | ||
/* | ||
If the user exists, we'll log them in. | ||
*/ | ||
if (result.next()){ | ||
/* | ||
Generating multiple cookies to be used during te user's session | ||
*/ | ||
request.getSession(); | ||
session.setAttribute("ssoNum", ssoNum); | ||
adminCookie = new Cookie("ssoNum", Integer.toString(ssoNum)); | ||
adminCookie.setMaxAge(30*60); | ||
adminCookie.setPath("/"); | ||
response.addCookie(adminCookie); | ||
Cookie adminCookie2 = new Cookie("admin", Integer.toString(ssoNum)); | ||
adminCookie2.setPath("/"); | ||
response.addCookie(adminCookie2); | ||
Cookie newCookie = new Cookie("name",result.getString("Name")); | ||
newCookie.setMaxAge(30*60); | ||
newCookie.setPath("/"); | ||
response.addCookie(newCookie); | ||
/* | ||
If the admin's password flag is 1, then we will allow them to be logged in no problem. | ||
*/ | ||
if(result.getInt("Password_Flag") == 1){ | ||
stmt.close(); | ||
connection.close(); | ||
response.sendRedirect("html/webpages/administration/admin.jsp"); | ||
return; | ||
} | ||
/* | ||
Otherwise, their password flag is 0, indicating they NEED to update their password and pincode. | ||
*/ | ||
else{ | ||
stmt.close(); | ||
connection.close(); | ||
response.sendRedirect("html/webpages/administration/adminpassword.jsp"); | ||
return; | ||
} | ||
/* | ||
If the user doesn't exist, they won't be logged in. | ||
*/ | ||
} else { | ||
stmt.close(); | ||
connection.close(); | ||
response.sendRedirect("html/webpages/administration/adminpassword.jsp"); | ||
return; | ||
response.sendRedirect("index.jsp"); | ||
} | ||
} else { | ||
stmt.close(); | ||
connection.close(); | ||
response.sendRedirect("index.jsp"); | ||
} | ||
%> | ||
/* | ||
If the user wants to reset their password, we will keep them on this page. | ||
*/ | ||
%> | ||
<script> | ||
/* | ||
If we get to this point in the page, the user is resetting their password and we want to display everything on the page now. | ||
*/ | ||
document.getElementById("info").style.visibility = 'visible'; | ||
document.getElementById("navbaruniversal").style.visibility = 'visible'; | ||
</script> | ||
</html> |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.