diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-22 01:59:54 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-22 01:59:54 -0700 |
commit | e3b642ae979493c3cd48b4702e8d06f3448f8d7a (patch) | |
tree | d6b6786e0ae66801b27009dc60c2596e094cdc9a /system/admin/admin.go | |
parent | 34ea2f841e5b227b7aa8e2e35f605a2a942849a9 (diff) |
adding initial support to edit and add admin users
Diffstat (limited to 'system/admin/admin.go')
-rw-r--r-- | system/admin/admin.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/system/admin/admin.go b/system/admin/admin.go index 472d4df..f3ab3ac 100644 --- a/system/admin/admin.go +++ b/system/admin/admin.go @@ -250,20 +250,20 @@ func UsersList(req *http.Request) ([]byte, error) { <div class="card user-management"> <form class="row" enctype="multipart/form-data" action="/admin/configure/users/edit" method="post"> <div>Edit your account:</div> - <div class="input-feild col s12"> + <div class="input-feild col s9"> <label class="active">Email Address</label> <input type="email" name="email" value="{{ .User.Email }}"/> </div> <div>To approve changes, enter your password:</div> - <div class="input-feild col s12"> + <div class="input-feild col s9"> <label class="active">Current Password</label> <input type="password" name="password"/> </div> - <div class="input-feild col s12"> + <div class="input-feild col s9"> <label class="active">New Password: (leave blank if no password change needed)</label> - <input type="email" name="new_password" type="password"/> + <input name="new_password" type="password"/> </div> <button class="btn waves-effect waves-light green right" type="submit">Save</button> @@ -271,12 +271,12 @@ func UsersList(req *http.Request) ([]byte, error) { <form class="row" enctype="multipart/form-data" action="/admin/configure/users" method="post"> <div>Add a new user:</div> - <div class="input-feild col s12"> + <div class="input-feild col s9"> <label class="active">Email Address</label> <input type="email" name="email" value=""/> </div> - <div class="input-feild col s12"> + <div class="input-feild col s9"> <label class="active">Password</label> <input type="password" name="password"/> </div> @@ -327,14 +327,17 @@ func UsersList(req *http.Request) ([]byte, error) { if err != nil { return nil, err } - usrs := make([]user.User, len(jj), len(jj)) + + var usrs []user.User for i := range jj { var u user.User err = json.Unmarshal(jj[i], &u) if err != nil { return nil, err } - usrs = append(usrs, u) + if u.Email != usr.Email { + usrs = append(usrs, u) + } } // make buffer to execute html into then pass buffer's bytes to Admin |