Skip to content

Commit

Permalink
Added edit profile
Browse files Browse the repository at this point in the history
  • Loading branch information
pfreitag committed Nov 16, 2016
1 parent 1fc4064 commit 1db585a
Show file tree
Hide file tree
Showing 35 changed files with 35 additions and 3 deletions.
Binary file modified db/boi/db.lck
Binary file not shown.
Binary file modified db/boi/log/log.ctrl
Binary file not shown.
Binary file modified db/boi/log/log1.dat
Binary file not shown.
Binary file modified db/boi/log/logmirror.ctrl
Binary file not shown.
Binary file modified db/boi/seg0/c10.dat
Binary file not shown.
Binary file modified db/boi/seg0/c20.dat
Binary file not shown.
Binary file modified db/boi/seg0/c230.dat
Binary file not shown.
Binary file modified db/boi/seg0/c241.dat
Binary file not shown.
Binary file modified db/boi/seg0/c251.dat
Binary file not shown.
Binary file modified db/boi/seg0/c60.dat
Binary file not shown.
Binary file removed db/boi/seg0/c690.dat
Binary file not shown.
Binary file renamed db/boi/seg0/c680.dat → db/boi/seg0/c770.dat
Binary file not shown.
Binary file renamed db/boi/seg0/c6a0.dat → db/boi/seg0/c780.dat
Binary file not shown.
Binary file added db/boi/seg0/c790.dat
Binary file not shown.
Binary file added db/boi/seg0/c7a1.dat
Binary file not shown.
Binary file added db/boi/seg0/d680.dat
Binary file not shown.
Binary file added db/boi/seg0/d690.dat
Binary file not shown.
Binary file added db/boi/seg0/d6a0.dat
Binary file not shown.
Binary file added db/boi/seg0/d6b0.dat
Binary file not shown.
Binary file added db/boi/seg0/d6c0.dat
Binary file not shown.
Binary file added db/boi/seg0/d6d0.dat
Binary file not shown.
Binary file added db/boi/seg0/d6e1.dat
Binary file not shown.
Binary file added db/boi/seg0/d6f0.dat
Binary file not shown.
Binary file added db/boi/seg0/d700.dat
Binary file not shown.
Binary file added db/boi/seg0/d710.dat
Binary file not shown.
Binary file added db/boi/seg0/d721.dat
Binary file not shown.
Binary file added db/boi/seg0/d730.dat
Binary file not shown.
Binary file added db/boi/seg0/d740.dat
Binary file not shown.
Binary file added db/boi/seg0/d750.dat
Binary file not shown.
Binary file added db/boi/seg0/d761.dat
Binary file not shown.
9 changes: 8 additions & 1 deletion wwwroot/index.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@
SELECT username FROM users
</cfquery>
<div class="alert alert-success">
<strong><span class="glyphicon glyphicon-ok"></span> Database setup successfully.</strong>
<div class="row">
<div class="col-sm-8">
<strong><span class="glyphicon glyphicon-ok"></span> Database setup successfully.</strong>
</div>
<div class="col-sm-4 text-right">
<a href="tools/reset-database.cfm" class="btn btn-default btn-sm">Rebuild Database</a>
</div>
</div>
</div>
<cfcatch>
<div class="alert alert-danger">
Expand Down
3 changes: 2 additions & 1 deletion wwwroot/my-account/account.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<cfif session.isAdmin>
<a href="admin/" class="btn btn-danger btn-large">Bank Admin</a>
</cfif>
<a href="logout.cfm" class="btn btn-priary btn-large">Logout</a>
<a href="profile.cfm" class="btn btn-default btn-large">Profile</a>
<a href="logout.cfm" class="btn btn-default btn-large">Logout</a>
</div>
<h1>Hi <cfoutput>#session.username# <small>(Member ID: #session.userID#)</small></cfoutput></h1>
<cfquery name="user">
Expand Down
19 changes: 19 additions & 0 deletions wwwroot/my-account/profile.cfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<h2><a href="account.cfm">My Account</a> &raquo; My User Profile</h2>

<cfif structKeyExists(form, "username")>
<!--- using the cfupdate tag makes my job almost too easy! --->
<cfupdate datasource="#application.dsn#" tablename="USERS">
<cfset session.username = form.username>
<div class="alert alert-success">Your user account has been updated.</div>
</cfif>
<hr>
<form action="profile.cfm" method="post">
<cfoutput>
<input type="hidden" name="id" value="#session.userID#">
<div class="form-group">
<label for="username">Username:</label>
<input type="text" class="form-control" id="username" name="username" value="#encodeForHTMLAttribute(session.username)#" placeholder="Username">
</div>
</cfoutput>
<input type="submit" class="btn btn-primary" value="Update Profile">
</form>
5 changes: 5 additions & 0 deletions wwwroot/tools/dbinfo.cfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<cfset dbinfo = structNew()>
<cfdbinfo name="dbinfo.dbs" type="DBNames" datasource="#application.dsn#">
<cfdbinfo name="dbinfo.tables" type="Tables" datasource="#application.dsn#">

<cfdump var="#dbinfo#">
2 changes: 1 addition & 1 deletion wwwroot/tools/reset-database.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<cfelseif request.dbType IS "derby">
<cfquery>
CREATE TABLE users (
id INT NOT NULL GENERATED ALWAYS AS IDENTITY,
id INT NOT NULL GENERATED ALWAYS AS IDENTITY CONSTRAINT boi_users_pk PRIMARY KEY,
username varchar(100),
password varchar(250),
is_admin int DEFAULT 0,
Expand Down

0 comments on commit 1db585a

Please sign in to comment.