Package com.alibaba.dubbo.registry.common.domain

Examples of com.alibaba.dubbo.registry.common.domain.User


    @Autowired
    RegistryServerSync registryServerSync;

    public void execute(HttpSession session, Context context, CookieParser parser) {
       
        User user = (User) session.getAttribute(WebConstants.CURRENT_USER_KEY);
        if (user != null) context.put("operator", user.getUsername());
       
        RootContextPath rootContextPath = new RootContextPath(request.getContextPath());
        context.put("rootContextPath", rootContextPath);
        if (! context.containsKey("bucLogoutAddress")) {
          context.put("bucLogoutAddress", rootContextPath.getURI("logout"));
View Full Code Here


        Result result = new Result();
        if(request.getParameter("url")!=null){
            url = URL.valueOf(URL.decode(request.getParameter("url")));
        }
        if (context.get(WebConstants.CURRENT_USER_KEY) != null) {
            User user = (User) context.get(WebConstants.CURRENT_USER_KEY);
            currentUser = user;
            operator = user.getUsername();
            role = user.getRole();
            context.put(WebConstants.CURRENT_USER_KEY, user);
        }
        operatorAddress = (String) context.get("clientid");
        if(operatorAddress==null || operatorAddress.isEmpty()){
            operatorAddress = (String) context.get("request.remoteHost");
View Full Code Here

    protected User currentUser = null;
    protected String operatorAddress = null;

  public void execute(Map<String,Object> context) throws Exception {
      if(context.get(WebConstants.CURRENT_USER_KEY)!=null){
            User user = (User) context.get(WebConstants.CURRENT_USER_KEY);
            currentUser = user;
            operator = user.getUsername();
            role = user.getRole();
            context.put(WebConstants.CURRENT_USER_KEY, user);
        }
        operatorAddress = (String)context.get("request.remoteHost");
        context.put("operator", operator);
        context.put("operatorAddress", operatorAddress);
View Full Code Here

  protected String operatorAddress = null;
  protected String currentRegistry = null;
   
    public void execute(Map<String, Object> context) throws Throwable {
        if(context.get(WebConstants.CURRENT_USER_KEY)!=null){
          User user = (User) context.get(WebConstants.CURRENT_USER_KEY);
          currentUser = user;
          operator = user.getUsername();
          role = user.getRole();
          context.put(WebConstants.CURRENT_USER_KEY, user);
        }
        operatorAddress = (String)context.get("request.remoteHost");
        context.put("operator", operator);
      context.put("operatorAddress", operatorAddress);
View Full Code Here

        }
            return;
    }
        //FIXME
        if(! uri.startsWith("/status/")){
          User user = null;
            String authType = null;
            String authorization = request.getHeader("Authorization");
            if (authorization != null && authorization.length() > 0) {
                int i = authorization.indexOf(' ');
                if (i >= 0) {
                    authType = authorization.substring(0, i);
                    String authPrincipal = authorization.substring(i + 1);
                    if (BASIC_CHALLENGE.equalsIgnoreCase(authType)) {
                        user = loginByBase(authPrincipal);
                    } else if (DIGEST_CHALLENGE.equalsIgnoreCase(authType)) {
                        user = loginByDigest(authPrincipal);
                    }
                }
            }
            if (user == null || user.getUsername() == null || user.getUsername().length() == 0) {
                showLoginForm();
                pipelineContext.breakPipeline(1);
            }
            if (user != null && StringUtils.isNotEmpty(user.getUsername())) {
                request.getSession().setAttribute(WebConstants.CURRENT_USER_KEY, user);
                pipelineContext.invokeNext();
            }
        }else{
            pipelineContext.invokeNext();
View Full Code Here

        String username = authorization.substring(0, i);
        if (username != null && username.length() > 0) {
            String password = authorization.substring(i + 1);
            if (password != null && password.length() > 0) {
                String passwordDigest = Coder.encodeMd5(username + ":" + REALM + ":" + password);
                User user = getUser(username);
                if (user != null) {
                    String pwd = user.getPassword();
                    if (pwd != null && pwd.length() > 0) {
                        if (passwordDigest.equals(pwd)) {
                            return user;
                        }
                    }
View Full Code Here

        Map<String, String> params = parseParameters(value);
        String username = params.get("username");
        if (username != null && username.length() > 0) {
            String passwordDigest = params.get("response");
            if (passwordDigest != null && passwordDigest.length() > 0) {
                User user = getUser(username);
                if (user != null) {
                    String pwd = user.getPassword();
                    // 本地User,密码本地
                    if (pwd != null && pwd.length() > 0) {
                        String uri = params.get("uri");
                        String nonce = params.get("nonce");
                        String nc = params.get("nc");
View Full Code Here

    this.guestPassword = (password == null ? "" : password);
  }

    public User findUser(String username) {
      if ("guest".equals(username)) {
        User user = new User();
            user.setUsername(username);
            user.setPassword(Coder.encodeMd5(username + ":" + User.REALM + ":" + guestPassword));
            user.setName(username);
            user.setRole(User.GUEST);
            user.setEnabled(true);
            user.setLocale("zh");
            user.setServicePrivilege("");
            return user;
      } else if ("root".equals(username)) {
        User user = new User();
            user.setUsername(username);
            user.setPassword(Coder.encodeMd5(username + ":" + User.REALM + ":" + rootPassword));
            user.setName(username);
            user.setRole(User.ROOT);
            user.setEnabled(true);
            user.setLocale("zh");
            user.setServicePrivilege("*");
            return user;
      }
      return null;
    }
View Full Code Here

public class Infos extends Restful {
    @Autowired
    private UserService userDAO;

    public void index(Map<String, Object> context) {
        User user = userDAO.findById(currentUser.getId());
        context.put("user", user);
    }
View Full Code Here

        User user = userDAO.findById(currentUser.getId());
        context.put("user", user);
    }
   
    public boolean update(Map<String, Object> context) {
        User user = new User();
        user.setId(currentUser.getId());
        user.setUsername(currentUser.getUsername());
        user.setOperatorAddress(operatorAddress);
        user.setName((String) context.get("name"));
        user.setDepartment((String) context.get("department"));
        user.setEmail((String) context.get("email"));
        user.setPhone((String) context.get("phone"));
        user.setAlitalk((String) context.get("alitalk"));
        user.setLocale((String) context.get("locale"));
        userDAO.modifyUser(user);
        context.put("redirect", "../" + getClass().getSimpleName().toLowerCase());
        return true;
    }
View Full Code Here

TOP

Related Classes of com.alibaba.dubbo.registry.common.domain.User

Copyright © 2018 www.massapicom. 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.