- Timestamp:
- 2023-04-13T21:49:38+12:00 (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/ModifyUsersDB.java
r35333 r37660 183 183 } 184 184 185 public static void modifyUser(DerbyWrapper dw, UserTermInfo user, String username, String password, String groups, String addgroups, String accountstatus, String comment, String email) { 186 185 private static void modifyUser(DerbyWrapper dw, UserTermInfo user, String username, String password, String groups, String addgroups, String accountstatus, String comment, String email) { 186 187 // Copied code back from svn rev=35298 into this function, as without it, modifying users/admin pwd 188 // wiped out rest of its details from userdb. Notably groups, as groups below now needs to be null 189 // for code to read groups' values back in from db 190 if (groups.equals("")) 191 { 192 // groups should be expandedGroups because we no longer store the groups in userDB 193 // as user-entered or compacted, but as programmatically expanded. 194 // This allows HttpServletRequest.isUserInRole() to now automatically retrieve the 195 // expandedGroups list of a user to check collectionConfig.xml security elements against. 196 197 groups = user.getExpandedGroups(); // get from database 198 } //else { 199 //groups = UserTermInfo.expandGroups(groups); // ensure groups are stored expanded in userDB 200 //} // Covered: groups var comes in expanded when called from ModifyUsersDB.java::main() 201 // Only should be done if anyone else can call this modifyUser() function and if they don't ensure 202 // groups expanded first 203 // in case any of fields other than username are not specified, get fallbacks from the database 204 205 206 // groups can never be null at this point if called by ModifyUsersDB.java::main() above, 207 // as main() does groups=expandGroups() which never returns null, only "" at minimum. 187 208 if (groups == null && addgroups != null) { 188 209 groups = user.getExpandedGroups(); // get the groups from db, as we want to add on to what is already there 189 210 } 211 212 if (password.equals("")) 213 { 214 password = user.getPassword(); // already stored hashed-and-hexed in DB 215 } 216 217 if (accountstatus.equals("")) 218 { 219 accountstatus = user.getAccountStatus().equals("") ? "true" : user.getAccountStatus(); 220 } 221 if (comment.equals("")) 222 { 223 comment = user.getComment(); 224 } 225 if (email.equals("")) 226 { 227 email = user.getEmail(); 228 } 229 190 230 if (addgroups != null) { 191 231 if (!groups.equals("")) {
Note:
See TracChangeset
for help on using the changeset viewer.