Login with FLASH Interface

BrycoPC

Verified User
Joined
Jun 16, 2004
Messages
7
Location
Alabama, USA
I am trying to login using flash actionscript in my interface. The code im using is as follows:

Code:
TextField.prototype.onKeyDown = function () {
  if (Key.getCode() == Key.ENTER
      && this.pressedOnce == undefined
      && this.isFocused()) {
    this.onSubmit();
    this.pressedOnce = true;
  }
};

TextField.prototype.onKeyUp = function () {
  if (Key.getCode() == Key.ENTER) {
    this.pressedOnce = undefined;
  }
}

TextField.prototype.isFocused = function () {
  if (Selection.getFocus() == targetPath(this))  {
    return true;
  }
  return false;
};

// ===============================================
// Implement Form
// ===============================================
// Prepare the data transfer object.
var sender = new LoadVars();

// Activate Enter key for text fields.
username.onSubmit = login;
Key.addListener(username);
password.onSubmit = login;
Key.addListener(password);

// Set submit button handler.
submit.setClickHandler("login");

// Provide custom form submission function.
function login () {
  sender.username = username.txt;
  sender.password = password.txt;
  sender.send("https://www.brycopc.com:2222/CMD_LOGIN", "_self", "POST");
}

the code appears to work, goes through checks the SSL Cert then it takes me back to a DA login page. Can anyone tellme whats up with this? and, if someoen can tell me how to fix it to make it work, how can i add FAIL_URL and LOGOUT_URL into the code to make those parse.
 
What's with the text files for username and passwords? I'm not familiar with flash (programming)

All I can suggest is using this as an example if you haven't found it yet: http://help.directadmin.com/item.php?id=61

My guess would have to do something the submition box names. DirectAdmin is probably looking for a box with a certain name, but thats not set in your script?

Just some guesses that may or may not help.
 
Back
Top