Esempio n. 1
0
 public PluginResult(Status status1, String s) {
   keepCallback = false;
   status = status1.ordinal();
   int i;
   if (s == null) {
     i = 5;
   } else {
     i = 1;
   }
   messageType = i;
   strMessage = s;
 }
Esempio n. 2
0
  @Override
  public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {

    String user = request.getParameter("user");
    String pass = request.getParameter("pass");

    Status status = dbhandler.authenticateUser(user, pass);
    dbhandler.updateLastLoginTime(user);

    try {
      if (status == Status.OK) {
        // should eventually change this to something more secure
        response.addCookie(new Cookie("login", "true"));
        response.addCookie(new Cookie("name", user));
        response.sendRedirect(response.encodeRedirectURL("/"));
      } else {
        response.addCookie(new Cookie("login", "false"));
        response.addCookie(new Cookie("name", ""));
        response.sendRedirect(response.encodeRedirectURL("/login?error=" + status.ordinal()));
      }
    } catch (Exception ex) {
      log.error("Unable to process login form.", ex);
    }
  }
 public PluginResult(Status status, boolean b) {
   this.status = status.ordinal();
   this.message = "" + b;
 }
 public PluginResult(Status status, float f) {
   this.status = status.ordinal();
   this.message = "" + f;
 }
 public PluginResult(Status status, int i) {
   this.status = status.ordinal();
   this.message = "" + i;
 }
 public PluginResult(Status status, JSONObject message) {
   this.status = status.ordinal();
   this.message = message.toString();
 }
 public PluginResult(Status status, String message) {
   this.status = status.ordinal();
   this.message = JSONObject.quote(message);
 }
 public PluginResult(Status status) {
   this.status = status.ordinal();
   this.message = "\"" + PluginResult.StatusMessages[this.status] + "\"";
 }
Esempio n. 9
0
 public PluginResult(Status status1, int i) {
   keepCallback = false;
   status = status1.ordinal();
   messageType = 3;
   encodedMessage = (new StringBuilder()).append("").append(i).toString();
 }
Esempio n. 10
0
 public PluginResult(Status status1) {
   this(status1, StatusMessages[status1.ordinal()]);
 }
Esempio n. 11
0
 public PluginResult(Status status1, boolean flag) {
   keepCallback = false;
   status = status1.ordinal();
   messageType = 4;
   encodedMessage = Boolean.toString(flag);
 }
Esempio n. 12
0
 public PluginResult(Status status1, JSONObject jsonobject) {
   keepCallback = false;
   status = status1.ordinal();
   messageType = 2;
   encodedMessage = jsonobject.toString();
 }
Esempio n. 13
0
 public PluginResult(Status status1, JSONArray jsonarray) {
   keepCallback = false;
   status = status1.ordinal();
   messageType = 2;
   encodedMessage = jsonarray.toString();
 }
Esempio n. 14
0
 public void setStatus(Status s) {
   status = s;
   statusDB = s.ordinal();
   //        Log.v("TodoItem-Status = ", String.valueOf(statusDB));
 }