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


            int downloaders = 0;
            Set<Connection> conns = Server.getInstance().getConnections();
            synchronized(conns) {
               for (Connection c : conns) {
                   // hide user if user has the property hidden, or the directory in which the user operates is hidden
                   User u = c.getUser();
                   if ((u.isHidden() && !user.hasPermission(UserPermission.SEE_HIDDEN)) || !ServiceManager.getServices().getPermissions().canSee(user, u, c.getCurrentDir())) {
                       continue;
                   }
                   if (c.isDownloading()) {
                       downloaders++;
                       downloadSpeed += c.getCurrentSpeed();
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

                ServiceManager.getServices().getMetadataHandler().move(originalDir, nukedDir, null, null);
                long totalBytesNuked = calculateNukeSize(nukedDir, victims);
                String nukees = "{";
                for (Map.Entry<String, Long> victim : victims.entrySet()) {
                    try {
                        User user = ServiceManager.getServices().getUserbase().getUser(victim.getKey());
                        long credits = 0;
                        if (!user.hasLeech()) {
                            credits = victim.getValue() * multiplier;
                            user.takeCredits(credits);
                        }
                        nukees +=  user.getUsername() + '/' + user.getPrimaryGroup() + '/' + credits + '|';
                    } catch (NoSuchUserException e) {
                        // just skip this user if it doesn't exist anymore
                    }
                }
                nukees += "}";
View Full Code Here

                        nuke[7] = nuke[7].substring(1, nuke[7].length() - 1); // remove the leading and trailing '{' '}'
                        String[] nukees = nuke[7].split("\\|");
                        for (int i = 0; i < nukees.length; i++) {
                            String[] nukee = nukees[i].split("/");
                            try {
                                User user = ServiceManager.getServices().getUserbase().getUser(nukee[0]);
                                long credits = Long.parseLong(nukee[2]);
                                //System.out.println("giving back " + credits +" to user " + user.getUsername());
                                user.giveCredits(credits);
                            } catch (NoSuchUserException e) {
                                // this user doesn't exist anymore, skip it
                            }
                        }
                        logUnnukeToEventLog(releaseName, section, unnuker, reason);
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

    }

    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

        connection.respond(Formatter.createFooter(200));
    }

    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

        return nukeHandler.unnuke(fs.getRealParentWorkingDirectoryPath(), fs.getCurrentSection().getName(), parameterList[1], user.getUsername(), Formatter.join(parameterList, 2, parameterList.length, " "));
    }

    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

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.