Package cu.ftpd.user

Examples of cu.ftpd.user.User.removeGroup()


    public void execute(String[] parameterList, Connection connection, User user, FileSystem fs) {
        if (user.hasPermission(UserPermission.GROUPS)) { // gadmins can't remove users from their group
            try {
                User u = ServiceManager.getServices().getUserbase().getUser(parameterList[1]);
                u.removeGroup(parameterList[2]);
                // remove leech and allotments for the user in this group
                ServiceManager.getServices().getUserbase().setAllotmentForUser(0, u.getUsername(), parameterList[2], false);
                ServiceManager.getServices().getUserbase().setLeechForUser(false, u.getUsername(), parameterList[2], false);
                connection.respond("200 sucessfully removed user " + parameterList[1] + " from group " + parameterList[2] + '.');
            } catch (NoSuchUserException e) {
View Full Code Here


                user.delPermission(Integer.parseInt(value));
            } else if ("autg".equals(property)) {
                // we check that the group exists in the site-command
                user.addGroup(value);
            } else if ("rufg".equals(property)) {
                user.removeGroup(value);
            } else {
                throw new IllegalArgumentException("Tried to find property that does not exist: [" + username + ':' + property + ':' + value + ']');
            }
        // NOTE: we can be guaranteed to not get any NumberFormatExceptions here, since the caller of this method does a conversion FROM the appropriate formate before sending it over the wire
        } catch (NoSuchUserException e) {
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.