Beispiel #1
0
  /** Called when the applet is created */
  public void init() {
    home = getCodeBase();

    // Creates a AuthorLogin object that request the user login and the password
    AuthorLogin alogin = new AuthorLogin(home);

    // Creates an WowAuthor object, that codifies the password of the user
    WowAuthor author = new WowAuthor();

    // If login or password are not correct, then a error message is showed
    // and deny access to the TestEditor tool
    if (!alogin.login()) {
      try {
        String codebase = home.toString();
        int index = codebase.lastIndexOf("/");
        index = codebase.substring(0, index).lastIndexOf("/");
        String base = codebase.substring(0, index + 1);
        getAppletContext().showDocument(new URL(base + "accessdenied.html"), "_top");
      } catch (Exception e) {
        e.printStackTrace();
      }
    } else {
      userLogin = alogin.getUserName();

      // Reads the password from the user
      userPassword = alogin.password;

      // Ciphers the password of the user
      userPassword = author.showHashString(userPassword);

      // Start TestEditor
      startEditor();
    }
  }
Beispiel #2
0
  public static void main(String[] args) {
    try {
      String userLogin = "******";
      String userPassword = "******";
      URL codebase = new URL("http://localhost:8085/wow/lib/");

      // Ciphers the password of the user
      WowAuthor author = new WowAuthor();
      userPassword = author.showHashString(userPassword);
      System.out.println("Arrancando TestEditor en modo local....");
      new TestEditorApplet(codebase, userLogin, userPassword);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }