Examples of Citizen


Examples of anvil.server.Citizen

  }
 
 
  public Citizen getCitizen(String username)
  {
    Citizen c = null;
   
    if (!_users.containsKey(username)) {
      try {
        c = new LDAPCitizen(this, username);
        _users.put(username, c);
View Full Code Here

Examples of anvil.server.Citizen

  }
 
 
  public Citizen getCitizen(String username)
  {
    Citizen c = null;
   
    if (!_users.containsKey(username)) {
      try {
        c = new LDAPCitizen(this, username);
        _users.put(username, c);
View Full Code Here

Examples of anvil.server.Citizen

        String decoded = new String(new sun.misc.BASE64Decoder().decodeBuffer(authCode));
        i = decoded.indexOf(':');
        if (i > -1) {
          String username = decoded.substring(0, i);
          String password = decoded.substring(i + 1);
          Citizen citizen = context.getCitizen();
          if (citizen != null) {
            if (!citizen.getRealm().equals(realm)) {
              citizen = null;
            } else if (!citizen.getName().equals(username)) {
              citizen = null;
            }
          }
          if (citizen == null) {
            context.log().info("basic: login="+username);
            citizen = realm.getCitizen(username);
          }
          if (citizen != null) {
            if (citizen.verifyCredentials(password)) {
              context.setCitizen(citizen);
              context.log().info("basic: authentication ok");
              authenticated = true;
            } else {
              context.log().info("basic: authentication failed");
View Full Code Here

Examples of anvil.server.Citizen

                if (id >= _nextid) {
                  _nextid = id+1;
                }
                String name = Conversions.URLDecode(args[1]);
                String crendentials = Conversions.URLDecode(args[2]);
                Citizen citizen = createCitizen(id, name, crendentials);
                _entities.put(new Integer(id), citizen);
                _citizens.put(name, citizen);
              }
            }
            break;
View Full Code Here

Examples of anvil.server.Citizen

 

  public synchronized Citizen createCitizen(String name, String credentials)
  {
    load();
    Citizen citizen = createCitizen(getNextId(), name, credentials);
    save(false);
    return citizen;
  }
View Full Code Here

Examples of anvil.server.Citizen

 

  public synchronized Citizen createCitizen(String name, String credentials, String[][] params)
  {
    load();
    Citizen citizen = createCitizen(getNextId(), name, credentials);
    if (params != null) {
      for (int i=0,l=params.length; i<l; i++) {
        citizen.setVariable(params[i][0], Any.create(params[i][1]));
      }
    }
    save(false);
    return citizen;
 
View Full Code Here

Examples of anvil.server.Citizen

                if (id >= _nextid) {
                  _nextid = id+1;
                }
                String name = Conversions.URLDecode(args[1]);
                String crendentials = Conversions.URLDecode(args[2]);
                Citizen citizen = createCitizen(id, name, crendentials);
                _entities.put(new Integer(id), citizen);
                _citizens.put(name, citizen);
              }
            }
            break;
View Full Code Here

Examples of anvil.server.Citizen

 

  public synchronized Citizen createCitizen(String name, String credentials)
  {
    load();
    Citizen citizen = createCitizen(getNextId(), name, credentials);
    save(false);
    return citizen;
  }
View Full Code Here

Examples of anvil.server.Citizen

 

  public synchronized Citizen createCitizen(String name, String credentials, String[][] params)
  {
    load();
    Citizen citizen = createCitizen(getNextId(), name, credentials);
    if (params != null) {
      for (int i=0,l=params.length; i<l; i++) {
        citizen.setVariable(params[i][0], Any.create(params[i][1]));
      }
    }
    save(false);
    return citizen;
 
View Full Code Here

Examples of anvil.server.Citizen

                if (id >= _nextid) {
                  _nextid = id+1;
                }
                String name = Conversions.URLDecode(args[1]);
                String crendentials = Conversions.URLDecode(args[2]);
                Citizen citizen = createCitizen(id, name, crendentials);
                _entities.put(new Integer(id), citizen);
                _citizens.put(name, citizen);
              }
            }
            break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.