Package org.opencustomer.db.dao.system

Examples of org.opencustomer.db.dao.system.LdapGroupDAO


    //            while (enm.hasMore())
    //            {
    //                Binding b = enm.next();
    //                LdapUtil.getInstance().createGroupFromLdap(b.getName());
    //            }
                List<LdapGroupVO> ldapGroups = new LdapGroupDAO().getAll();
                for(LdapGroupVO group : ldapGroups) {
                    try {
                        ctx.lookup(group.getName()+ "," + SystemConfiguration.getInstance().getStringValue(SystemConfiguration.Key.LDAP_GROUP_PREFIX));
                    } catch(NamingException e) {
                        if(!group.getProfile().isLocked()) {
                            if(log.isDebugEnabled())
                                log.debug("locked profile [" + group.getProfile()+"]");
                            group.getProfile().setLocked(true);
                            new LdapGroupDAO().insertOrUpdate(group);
                        }
                    }
                }
   
                if(log.isDebugEnabled())
View Full Code Here


        LdapGroupVO ldapGroup = null;
       
        if(attrs.get("cn") != null)
        {
            String name = (String)attrs.get("cn").get(0); // TODO: what is this name for
            ldapGroup = new LdapGroupDAO().getByName(name);
            if(ldapGroup == null)
            {
                if(log.isDebugEnabled())
                    log.debug("creating new ldapGroup: " + name);
                ldapGroup = new LdapGroupVO();
                ldapGroup.setName(groupDN);
                ldapGroup.setOwnerGroup(adminUser.getProfile().getDefaultUsergroup().getId());
                ldapGroup.setOwnerUser(adminUser.getId());
                ldapGroup.setPriority(new LdapGroupDAO().getAll().size());
                ldapGroup.setAccessUser(Access.WRITE_SYSTEM);
                ldapGroup.setAccessGroup(Access.NONE);
                ldapGroup.setAccessGlobal(Access.NONE);
                ProfileVO profile = new ProfileVO();
                profile.setAccessGlobal(Access.READ);
                profile.setAccessGroup(Access.READ);
                profile.setAccessUser(Access.WRITE_SYSTEM);
                profile.setIpPattern("*");
                profile.setTimeLock(30);
                profile.setRole(new RoleDAO().getByName("User"));
                profile.setDefaultUsergroup(profile.getRole().getDefaultUsergroup());
                profile.setOwnerUser(adminUser.getId());
                profile.setOwnerGroup(adminUser.getProfile().getDefaultUsergroup().getId());
                ldapGroup.setProfile(profile);
                new LdapGroupDAO().insert(ldapGroup,adminUser);
            }
            else
            {
                if(log.isDebugEnabled())
                    log.debug("ldapGroup already exists: " + name);
View Full Code Here

        while(enm.hasMore())
        {
            NamingEnumeration<SearchResult> enm2 = ctx.search(SystemConfiguration.getInstance().getStringValue(SystemConfiguration.Key.LDAP_GROUP_PREFIX),filter_groups,new String[]{enm.next().getNameInNamespace()},null);
            while(enm2.hasMore())
            {
                LdapGroupVO tmpGroup = new LdapGroupDAO().getByDN(enm2.next().getName());
                ldapGroups.add(tmpGroup);
                if(log.isDebugEnabled())
                    log.debug("found ldap group " + tmpGroup.getName() + " for user " + username);
            }
        }
View Full Code Here

TOP

Related Classes of org.opencustomer.db.dao.system.LdapGroupDAO

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.