Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master' into John's…
Browse files Browse the repository at this point in the history
…-Branch

# Conflicts:
#	WebContent/html/javascript/request.jsp
#	WebContent/html/webpages/statisticsPage.jsp
  • Loading branch information
clj13001 committed Apr 25, 2017
2 parents 7299dbf + 0c54b56 commit eb035b1
Show file tree
Hide file tree
Showing 65 changed files with 4,746 additions and 1,266 deletions.
7 changes: 4 additions & 3 deletions README.md
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 added Senior Design.war
Binary file not shown.
202 changes: 148 additions & 54 deletions WebContent/adminLogin.jsp
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 removed WebContent/html/imgs/cat.png
Binary file not shown.
Binary file removed WebContent/html/imgs/cat_admin.png
Binary file not shown.
Binary file added WebContent/html/imgs/loader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed WebContent/html/imgs/potato.png
Binary file not shown.
Binary file added WebContent/html/imgs/synchrony logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed WebContent/html/imgs/user_icon.png
Binary file not shown.
3 changes: 3 additions & 0 deletions WebContent/html/javascript/request.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Device[] mydevices = DeviceQueries.getAvailableDevices();
//string representation of array.
String deviceString = Device.arrayToString(mydevices);
deviceString = deviceString.replace("'","\\'");
//out.println(description);
//out.println(hardware);
%>
Expand All @@ -32,6 +33,8 @@ showAll();
// searchbar listener
var searchbar = document.getElementsByName('searchBar');
searchbar[0].onkeyup = refresh;
// populate page with all devices by default
show(devices);
function refresh() {
show(fuzzyFilter(filter(devices)));
}
Expand Down
8 changes: 3 additions & 5 deletions WebContent/html/webpages/administration/admin.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="description" content="">
<meta name="author" content="">

<title>Synchrony Financial</title>
<title>Innovation Hub</title>

<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
Expand Down Expand Up @@ -74,12 +74,10 @@ div.approveConfirm {
<%@ include file="../components/adminsidebar.jsp" %>
</div>
<div class="displayDevice">
<h2>Welcome to the admin page</h2>
<h2>Welcome to The Admin Hub!</h2>
<h3>Select from any option in the sidebar to exert your administrative power!</h3>
<div id="admin"></div>
</div>


<script src="../../javascript/admin.js"></script>
<script src="../../javascript/nhpup_1.1.js"></script>
</body>
</html>
Loading

0 comments on commit eb035b1

Please sign in to comment.