Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session8 User Issue Fix #39

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
dea3522
Completed Command Line
RyanGaudion Sep 29, 2021
016f29b
checking in my first maven & netbeans example
RyanGaudion Sep 29, 2021
bb3e405
started revisionCOM405
RyanGaudion Sep 29, 2021
a680a49
Fixed bridge tests
RyanGaudion Sep 29, 2021
1be9fa2
finished tests
RyanGaudion Sep 29, 2021
ef81387
Merge remote-tracking branch 'upstream/master'
RyanGaudion Sep 29, 2021
b290deb
Merge remote-tracking branch 'upstream/master'
RyanGaudion Oct 6, 2021
dce623c
session 2 - first commit
RyanGaudion Oct 6, 2021
14ae760
Session 2 Complete
RyanGaudion Oct 6, 2021
62aec3c
added Bootstrap
RyanGaudion Oct 6, 2021
9f4736f
Merge remote-tracking branch 'upstream/master'
RyanGaudion Oct 13, 2021
d268230
finished task 1 of session 3
RyanGaudion Oct 13, 2021
9fbbf45
rest not working
RyanGaudion Oct 13, 2021
68bc7af
fixed tests to run without errors
RyanGaudion Oct 13, 2021
deb08a2
Merge remote-tracking branch 'upstream/master'
RyanGaudion Oct 20, 2021
c32eead
finished week 4 work
RyanGaudion Oct 20, 2021
2c7986c
fixed header
RyanGaudion Oct 20, 2021
f528b58
Merge remote-tracking branch 'upstream/master'
RyanGaudion Oct 27, 2021
319f6f8
Completed Excerise 1 & 2
RyanGaudion Oct 27, 2021
8fa3a82
Merge remote-tracking branch 'upstream/master'
RyanGaudion Oct 27, 2021
5b3d91a
Merge remote-tracking branch 'upstream/master'
RyanGaudion Nov 3, 2021
68f47a8
start week 6
RyanGaudion Nov 3, 2021
13f0145
part 1 complete
RyanGaudion Nov 3, 2021
696b937
part 2 complete
RyanGaudion Nov 3, 2021
a07217e
ready exercise 2 part 1
RyanGaudion Nov 3, 2021
0185e52
Exercise 2.1 complete
RyanGaudion Nov 3, 2021
349f085
Completed Excersice 2 Part 2
RyanGaudion Nov 3, 2021
621c182
Completed Excersice 2 Part 2 fix
RyanGaudion Nov 3, 2021
91f4802
Merge remote-tracking branch 'upstream/master'
RyanGaudion Nov 10, 2021
a685b66
Exercise 1.1
RyanGaudion Nov 10, 2021
2ebc70e
Exercise 1.2
RyanGaudion Nov 10, 2021
7da45c0
Excersise1.4 Complete
RyanGaudion Nov 10, 2021
0aa1c05
Exercise 3 complete
RyanGaudion Nov 10, 2021
d3935a4
Finished webfacadeexample2
RyanGaudion Nov 11, 2021
4602294
Merge remote-tracking branch 'upstream/master'
RyanGaudion Nov 17, 2021
5ed7851
bug fix
RyanGaudion Nov 17, 2021
9c079de
removed uneeded change
RyanGaudion Nov 17, 2021
472c363
gitignore undo
RyanGaudion Nov 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ public String users(Model model,

List<User> userList = userRepository.findAll();

model.addAttribute("user", sessionUser);
model.addAttribute("userListSize", userList.size());
model.addAttribute("userList", userList);
model.addAttribute("selectedPage", "users");
Expand Down Expand Up @@ -259,8 +260,9 @@ public String modifyuser(
return ("home");
}
}
User user = userList.get(0);
model.addAttribute("user", user);
User modifyUser = userList.get(0);
model.addAttribute("user", sessionUser);
model.addAttribute("modifyUser", modifyUser);
model.addAttribute("message", message);
model.addAttribute("errorMessage", errorMessage);
return "viewModifyUser";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,55 +27,55 @@
<tbody>
<tr>
<td>User ID</td>
<td>${user.id}</td>
<td>${modifyUser.id}</td>
</tr>
<tr>
<td>username</td>
<td>${user.username}</td>
<td>${modifyUser.username}</td>
</tr>
<tr>
<td>First Name</td>
<td><input type="text" name="firstName" value="${user.firstName}" /></td>
<td><input type="text" name="firstName" value="${modifyUser.firstName}" /></td>
</tr>
<tr>
<td>Second Name</td>
<td><input type="text" name="secondName" value="${user.secondName}" /></td>
<td><input type="text" name="secondName" value="${modifyUser.secondName}" /></td>
</tr>
<tr>
<td>House Number</td>
<td><input type="text" name="houseNumber" value="${user.address.houseNumber}" /></td>
<td><input type="text" name="houseNumber" value="${modifyUser.address.houseNumber}" /></td>
</tr>
<tr>
<td>Address Line 1</td>
<td><input type="text" name="addressLine1" value="${user.address.addressLine1}" /></td>
<td><input type="text" name="addressLine1" value="${modifyUser.address.addressLine1}" /></td>
</tr>
<tr>
<td>Address Line 2</td>
<td><input type="text" name="addressLine2" value="${user.address.addressLine2}" /></td>
<td><input type="text" name="addressLine2" value="${modifyUser.address.addressLine2}" /></td>
</tr>
<tr>
<td>city</td>
<td><input type="text" name="county" value="${user.address.city}" /></td>
<td><input type="text" name="county" value="${modifyUser.address.city}" /></td>
</tr>
<tr>
<td>county</td>
<td><input type="text" name="county" value="${user.address.county}" /></td>
<td><input type="text" name="county" value="${modifyUser.address.county}" /></td>
</tr>
<tr>
<td>country</td>
<td><input type="text" name="country" value="${user.address.country}" /></td>
<td><input type="text" name="country" value="${modifyUser.address.country}" /></td>
</tr>
<tr>
<td>postcode</td>
<td><input type="text" name="postcode" value="${user.address.postcode}" /></td>
<td><input type="text" name="postcode" value="${modifyUser.address.postcode}" /></td>
</tr>
<tr>
<td>telephone</td>
<td><input type="text" name="telephone" value="${user.address.telephone}" /></td>
<td><input type="text" name="telephone" value="${modifyUser.address.telephone}" /></td>
</tr>
<tr>
<td>mobile</td>
<td><input type="text" name="mobile" value="${user.address.mobile}" /></td>
<td><input type="text" name="mobile" value="${modifyUser.address.mobile}" /></td>
</tr>

</tbody>
Expand All @@ -90,11 +90,11 @@
<tbody>
<tr>
<td>Role</td>
<td>${user.userRole}</td>
<td>${modifyUser.userRole}</td>
</tr>
<tr>
<td>enabled</td>
<td><c:if test="${user.enabled}">ENABLED</c:if><c:if test="${!user.enabled}">DISABLED</c:if></td>
<td><c:if test="${modifyUser.enabled}">ENABLED</c:if><c:if test="${!modifyUser.enabled}">DISABLED</c:if></td>
</tr>
</tbody>
</table>
Expand All @@ -111,7 +111,7 @@
<td>
<select class="form-control" name="userRole" >
<c:forEach var="value" items="${UserRole.values()}">
<option value="${value}" <c:if test="${user.userRole == value}"> selected </c:if>>${value}</option>
<option value="${value}" <c:if test="${modifyUser.userRole == value}"> selected </c:if>>${value}</option>
</c:forEach>
</select>
</td>
Expand All @@ -120,25 +120,25 @@
<td>enabled</td>
<td>
<select class="form-control" name="userEnabled" >
<option value="true" <c:if test="${user.enabled}"> selected </c:if> >ENABLED</option>
<option value="false" <c:if test="${!user.enabled}"> selected </c:if> >DISABLED</option>
<option value="true" <c:if test="${modifyUser.enabled}"> selected </c:if> >ENABLED</option>
<option value="false" <c:if test="${!modifyUser.enabled}"> selected </c:if> >DISABLED</option>
</select>
</td>
</tr>
</tbody>
</table>
</c:if>

<input type="hidden" name="username" value="${user.username}"/>
<button class="btn" type="submit" >Update User ${user.username}</button>
<input type="hidden" name="username" value="${modifyUser.username}"/>
<button class="btn" type="submit" >Update User ${modifyUser.username}</button>
</form>
<p>Update Password</p>
<form action="./viewModifyUser" method="post">
<input type="hidden" name="username" value="${user.username}"/>
<input type="hidden" name="username" value="${modifyUser.username}"/>
<input type="hidden" name="action" value="updatePassword"/>
<p>Password <input type="password" name="password" ></input></p>
<p>Re Enter Password <input type="password" name="password2" ></input></p>
<button class="btn" type="submit" >Update ${user.username} Password</button>
<button class="btn" type="submit" >Update ${modifyUser.username} Password</button>
</form>
<c:if test="${user.userRole =='ADMINISTRATOR'}">
<BR>
Expand Down