Skip to content

Commit

Permalink
Merge pull request #74 from WPI-CS3733-C17-Gamma/fix-admin-login
Browse files Browse the repository at this point in the history
Force use of username/password, simplify login process
  • Loading branch information
ad1217 authored Feb 17, 2017
2 parents d739e0b + 9f9257f commit d2120b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/main/java/Login.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Login {
Login(){
System.out.println("login made");
passwordAuthentication = new PasswordAuthentication(uname, charPassword);
requiredSignin = false; //change to true after development and when testing
requiredSignin = true; //change to true after development and when testing
isSignedIn = false;
}

Expand Down
38 changes: 8 additions & 30 deletions src/main/java/LoginController.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public class LoginController {
@FXML private Label labelWrongCreds;
@FXML private AnchorPane loginPage;
@FXML private Button loginButton;
@FXML private AnchorPane adminPane;


private String inputPassword = "";

Expand All @@ -36,41 +34,21 @@ private boolean getCredentials(){
return login.signIn(textboxUsername.getText(), passwordBox.getText());
}

public void signInMap(){
stage.setHeight(650);
stage.setWidth(600);
if (getCredentials()) {
stage.hide();
applicationController.createMapAdminDisplay(login);
} else {
passwordBox.clear();
labelWrongCreds.setVisible(true);
}
public void isSelected(){ //for auto-disapearing
labelWrongCreds.setVisible(false);
}

public void signInDirectory(){
if (getCredentials()){
/**
* Displays options for map and directory admin
*/
public void showAdminMenu(){
if (getCredentials()) {
loginPage.setVisible(false);
stage.hide();
applicationController.createDirectoryAdminDisplay(login);
} else {
passwordBox.clear();
labelWrongCreds.setVisible(true);
}
}


public void isSelected(){ //for auto-disapearing
labelWrongCreds.setVisible(false);
}

/**
* Displays options for map and directory admin
*/
public void showAdminMenu(){
loginPage.setVisible(false);
adminPane.setVisible(true);
stage.setHeight(500);
stage.setWidth(900);
stage.centerOnScreen();
}
}
7 changes: 0 additions & 7 deletions src/main/resources/LoginDisplay.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@
</font>
</Label>
</children>
</AnchorPane>
<AnchorPane fx:id="adminPane" prefHeight="200.0" prefWidth="200.0" styleClass="background" stylesheets="@design.css" visible="false">
<children>
<Button fx:id="buttonSubmitDirectory" layoutX="300.0" layoutY="150.0" mnemonicParsing="false" onAction="#signInDirectory" prefHeight="80.0" prefWidth="400.0" styleClass="directoryAdminButton" stylesheets="@design.css" text="Manage List of Entries" />
<Button fx:id="buttonSubmitMap" layoutX="300.0" layoutY="300.0" mnemonicParsing="false" onAction="#signInMap" prefHeight="80.0" prefWidth="400.0" styleClass="mapAdminButton" stylesheets="@design.css" text="Modify Maps" />
<!--<Button fx:id="patientDisplayButton" layoutX="915.0" layoutY="14.0" mnemonicParsing="false" onAction="#toggleAdminWindow" prefHeight="50.0" prefWidth="50.0" styleClass="adminMenuButton" stylesheets="@design.css" />-->
</children>
</AnchorPane>
</children>
</StackPane>

0 comments on commit d2120b8

Please sign in to comment.