function RegisterController(server, markup, $updateView) {
  var self = this;
  this.data = {
    firstname : "",
    email : "",
    password: "",
    password2: ""
  };
  this.readTouAndPp = false;
  this.markup = markup;
  this.responseMsg = "";
  this.waitingForServer = false;
  this.pwError = false;
  this.needTou = false;
  this.success = false;
  this.submit = function() {
    self.pwError = false;
    self.needTou = false;
    if (self.data.password != self.data.password2) {
      self.pwError = true;
      return;
    }
    if (!self.readTouAndPp) {
      self.needTou = true;
      return;
    }
    self.waitingForServer = true;
    /*server('/cgi-bin/register.py',
      { firstname : self.data.firstname, email: self.data.email, password: Sha1.hash(self.data.password, true) }, 
      function(ret) {
        self.responseMsg = "Registration successful. Click on the link in your email to activate your account.";
        self.waitingForServer = false;
        self.success = true;
        $updateView();
      }, function(ret) {
        self.responseMsg = ret;
        self.waitingForServer = false;
        self.success = true;
        $updateView();
      });*/
    alert("Registration currently disabled");
  };
}
RegisterController.$inject = ["DefaultAjax", "MarkupUtils", "$updateView"];

