Package cu.ftpd.user

Examples of cu.ftpd.user.User


        }
    }

    protected boolean currentUserIsGadminForUser(String username, User user) {
        try {
            User u = ServiceManager.getServices().getUserbase().getUser(username);
            //current user is gadmin for any of the groups the specified user is a member of
            for (String gadminGroup : user.getGadminGroups()) { // this is generally a smaller set, so it makes sense to go over that first, since we abort early
                if (u.isMemberOfGroup(gadminGroup)) {
                    return true;
                }
            }
        } catch (NoSuchUserException e) {
            // you can't be the gadmin of a user that doesn't exist
View Full Code Here


        }
    }

    protected boolean currentUserIsGadminForUser(String username, User user) {
        try {
            User u = ServiceManager.getServices().getUserbase().getUser(username);
            //current user is gadmin for any of the groups the specified user is a member of
            for (String gadminGroup : user.getGadminGroups()) { // this is generally a smaller set, so it makes sense to go over that first, since we abort early
                if (u.isMemberOfGroup(gadminGroup)) {
                    return true;
                }
            }
        } catch (NoSuchUserException e) {
            // you can't be the gadmin of a user that doesn't exist
View Full Code Here

    // path, username, groupname, tagline
    private final MessageFormat deldir = new MessageFormat("DELDIR: \"{0}\" \"{1}\" \"{2}\" \"{3}\"");

    public void handleEvent(Event event) {
        String path = event.getProperty("file.path.real");
        User user = event.getUser();
        // we always log these events, so we don't need to check for permission
        if (event.getType() == Event.CREATE_DIRECTORY) {
            Logging.getEventLog().log(newdir.format(new Object[] {path, user.getUsername(), user.getPrimaryGroup(), user.getTagline()}));
        } else if (event.getType() == Event.REMOVE_DIRECTORY) {
            Logging.getEventLog().log(deldir.format(new Object[] {path, user.getUsername(), user.getPrimaryGroup(), user.getTagline()}));
        }
    }
View Full Code Here

            Iterator<Connection> i = connections.iterator();
            while (i.hasNext()) {
                Connection conn = i.next();
                if (conn.getConnectionId() == connectionId) {
                    i.remove();
                    User user = conn.getUser();
                    if (user != null) {
                        username = user.getUsername();
                    }
                    conn.respond("421 Your connection has been terminated by the server " + (reason == null ? "." : ". Reason: " + reason));
                    conn.shutdown();
                    break;
                }
View Full Code Here

        }
    }

    protected boolean currentUserIsGadminForUser(String username, User user) {
        try {
            User u = ServiceManager.getServices().getUserbase().getUser(username);
            //current user is gadmin for any of the groups the specified user is a member of
            for (String gadminGroup : user.getGadminGroups()) { // this is generally a smaller set, so it makes sense to go over that first, since we abort early
                if (u.isMemberOfGroup(gadminGroup)) {
                    return true;
                }
            }
        } catch (NoSuchUserException e) {
            // you can't be the gadmin of a user that doesn't exist
View Full Code Here

TOP

Related Classes of cu.ftpd.user.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.