Permalink
Browse files

fix edit current user form to required post mehtod

introduced with cde237b
  • Loading branch information...
reger24 committed Apr 8, 2017
1 parent 46a4aaf commit a4498e17c0738c6ec65a38e31a5372741eb7fc8c
Showing with 23 additions and 6 deletions.
  1. +2 −2 htroot/ConfigAccounts_p.html
  2. +21 −4 htroot/ConfigAccounts_p.java
@@ -75,7 +75,7 @@ <h2>User Administration</h2>
</fieldset>
<fieldset><legend>User Accounts</legend>
<form action="ConfigAccounts_p.html" accept-charset="UTF-8">
<form action="ConfigAccounts_p.html" method="post" accept-charset="UTF-8">
<input type="hidden" name="transactionToken" value="#[transactionToken]#"/>
<fieldset><legend>Select user</legend>
<dl>
@@ -128,7 +128,7 @@ <h2>User Administration</h2>
</dl>
</fieldset>
</form>
</fieldset>
</fieldset>
#%env/templates/footer.template%#
</body>
@@ -156,8 +156,8 @@ public static serverObjects respond(final RequestHeader header, final serverObje
//user != current_user
//user=from userlist
//current_user = edited user
} else if (post.containsKey("user") && !"newuser".equals(post.get("user"))){
TransactionManager.checkPostTransaction(header, post);
} else if (post.containsKey("user") && !"newuser".equals(post.get("user"))) {
TransactionManager.checkPostTransaction(header, post);
if (post.containsKey("change_user")) {
//defaults for newuser are set above
entry = sb.userDB.getEntry(post.get("user"));
@@ -183,7 +183,7 @@ public static serverObjects respond(final RequestHeader header, final serverObje
sb.userDB.removeEntry(post.get("user"));
}
} else if (post.containsKey("change")) { //New User / edit User
TransactionManager.checkPostTransaction(header, post);
TransactionManager.checkPostTransaction(header, post);
prop.put("text", "0");
prop.put("error", "0");
@@ -270,7 +270,24 @@ public static serverObjects respond(final RequestHeader header, final serverObje
prop.putHTML("text_username", username);
prop.put("text", "2");
}//edit user
prop.putHTML("username", username);
if (entry != null) {
//TODO: set username read-only in html
prop.putHTML("current_user", entry.getUserName());
prop.putHTML("username", entry.getUserName());
prop.putHTML("firstname", entry.getFirstName());
prop.putHTML("lastname", entry.getLastName());
prop.putHTML("address", entry.getAddress());
prop.put("timelimit", entry.getTimeLimit());
prop.put("timeused", entry.getTimeUsed());
int count = 0;
for (final AccessRight right : rights) {
prop.put("rights_" + count + "_set", entry.hasRight(right) ? "1" : "0");
count++;
}
prop.put("rights", count);
}
}
//Generate Userlist
@@ -289,4 +306,4 @@ public static serverObjects respond(final RequestHeader header, final serverObje
// return rewrite properties
return prop;
}
}
}

0 comments on commit a4498e1

Please sign in to comment.