Changeset 1492 for trunk


Ignore:
Timestamp:
12/05/19 11:54:59 (4 years ago)
Author:
bnemhaus
Message:

You cannot nominate yourself as one of your trusted colleagues for pw recovery.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/auth/Actions.java

    r1484 r1492  
    242242                        String colleagueOne = userData.get(AuthenticationTag.TrustedUserOne);
    243243                        String colleagueTwo = userData.get(AuthenticationTag.TrustedUserTwo);
    244                         AuthSubmitTrustedUsersPasswordRecovery(colleagueOne, colleagueTwo);
    245 //                      Path colleagueOnePath = Paths.get(FrameIO.CONTACTS_PATH).resolve(colleagueOne + "-credentials");
    246 //                      Path colleagueTwoPath = Paths.get(FrameIO.CONTACTS_PATH).resolve(colleagueTwo + "-credentials");
    247 //                      if (!colleagueOnePath.toFile().exists()) {
    248 //                              MessageBay.errorMessage("Your nominated trusted user: " + colleagueOne + " must exist in your contacts.");
    249 //                      } else if (!colleagueTwoPath.toFile().exists()) {
    250 //                              MessageBay.errorMessage("Your nominated trusted user: " + colleagueTwo + " must exist in your contacts.");
    251 //                      } else {
    252 //                              userData.put(AuthenticationTag.Username, UserSettings.UserName.get());
    253 //                              boolean success = submitTrustedUsersPasswordRecovery(userData);
    254 //                              if (success) {
    255 //                                      Collection<Item> toShow = getByData(currentFrame, "ShowOnProgress");
    256 //                                      for (Item i: toShow) {
    257 //                                              i.setVisible(true);
    258 //                                      }
    259 //                                      currentFrame.change();
    260 //                                      MessageBay.displayMessage("-------Messages sent-------");
    261 //                              }
    262 //                              FrameIO.SaveFrame(currentFrame);
    263 //                              DisplayController.requestRefresh(false);
    264 //                      }
     244                        String username = UserSettings.UserName.get().toLowerCase();
     245                        if (colleagueOne.toLowerCase().equals(username) || colleagueTwo.toLowerCase().equals(username)) {
     246                                MessageBay.displayMessage("You cannot nominate yourself as one of your trusted colleagues.");
     247                        } else {
     248                                AuthSubmitTrustedUsersPasswordRecovery(colleagueOne, colleagueTwo);
     249                        }
    265250                }
    266251        }
Note: See TracChangeset for help on using the changeset viewer.