Examples of findSecurityGroupByName()


Examples of org.olat.basesecurity.Manager.findSecurityGroupByName()

        result.append("\n0\n0\n");
      }
      result.append(instanceId);
    } else if (command.equals("usercount")) { // get number of useraccounts counter
      Manager secMgr = ManagerFactory.getManager();
      SecurityGroup olatuserGroup = secMgr.findSecurityGroupByName(Constants.GROUP_OLATUSERS);
      int users = secMgr.countIdentitiesOfSecurityGroup(olatuserGroup);
      int disabled = secMgr.getIdentitiesByPowerSearch(null, null, true, null, null, null, null, null, Identity.STATUS_LOGIN_DENIED).size();     
      result.append(users-disabled).append("\n"); // number of active users
      result.append(disabled).append("\n"); // number of disabled users
      result.append("0\n");
View Full Code Here

Examples of org.olat.basesecurity.Manager.findSecurityGroupByName()

    }
    // Create LDAP Security Group if not existing. Used to identify users that
    // have to be synced with LDAP
    Manager scrManager = ManagerFactory.getManager();
    LDAPLoginManager ldapManager = LDAPLoginManager.getInstance();
    SecurityGroup ldapGroup = scrManager.findSecurityGroupByName(LDAPConstants.SECURITY_GROUP_LDAP);
    if (ldapGroup == null) {
      ldapGroup = scrManager.createAndPersistNamedSecurityGroup(LDAPConstants.SECURITY_GROUP_LDAP);
    }
    // check for valid configuration
    if (!checkConfigParameterIsNotEmpty(ldapUrl)) return;
View Full Code Here

Examples of org.olat.basesecurity.Manager.findSecurityGroupByName()

   */
  public void deletIdentities(List<Identity> identityList) {
    Manager securityManager = ManagerFactory.getManager();
    Identity identity;
    UserDeletionManager deletionManager = UserDeletionManager.getInstance();
    SecurityGroup secGroup = securityManager.findSecurityGroupByName(LDAPConstants.SECURITY_GROUP_LDAP);
    for (Iterator<Identity> itr = identityList.iterator(); itr.hasNext();) {
      identity = itr.next();
      securityManager.removeIdentityFromSecurityGroup(identity, secGroup);
      deletionManager.deleteIdentity(identity);
    }
View Full Code Here

Examples of org.olat.basesecurity.Manager.findSecurityGroupByName()

    }

    // Create Identity
    Identity identity = securityManager.createAndPersistIdentityAndUser(uid, user, LDAPAuthenticationController.PROVIDER_LDAP, uid, null);
    // Add to SecurityGroup LDAP
    SecurityGroup secGroup = securityManager.findSecurityGroupByName(LDAPConstants.SECURITY_GROUP_LDAP);
    securityManager.addIdentityToSecurityGroup(identity, secGroup);
    // Add to SecurityGroup OLATUSERS
    secGroup = securityManager.findSecurityGroupByName(Constants.GROUP_OLATUSERS);
    securityManager.addIdentityToSecurityGroup(identity, secGroup);
    log.info("Created LDAP user username::" + uid);
View Full Code Here

Examples of org.olat.basesecurity.Manager.findSecurityGroupByName()

    Identity identity = securityManager.createAndPersistIdentityAndUser(uid, user, LDAPAuthenticationController.PROVIDER_LDAP, uid, null);
    // Add to SecurityGroup LDAP
    SecurityGroup secGroup = securityManager.findSecurityGroupByName(LDAPConstants.SECURITY_GROUP_LDAP);
    securityManager.addIdentityToSecurityGroup(identity, secGroup);
    // Add to SecurityGroup OLATUSERS
    secGroup = securityManager.findSecurityGroupByName(Constants.GROUP_OLATUSERS);
    securityManager.addIdentityToSecurityGroup(identity, secGroup);
    log.info("Created LDAP user username::" + uid);

  }
View Full Code Here

Examples of org.olat.basesecurity.Manager.findSecurityGroupByName()

    Manager securityManager = ManagerFactory.getManager();
    Identity identity = securityManager.findIdentityByName(uid);
    if (identity == null) {
      return null;
    } else {
      SecurityGroup ldapGroup = securityManager.findSecurityGroupByName(LDAPConstants.SECURITY_GROUP_LDAP);
      if (ldapGroup == null) {
        log.error("Error getting user from OLAT security group '" + LDAPConstants.SECURITY_GROUP_LDAP + "' : group does not exist");
        return null;
      }
      if (securityManager.isIdentityInSecurityGroup(identity, ldapGroup)) {
View Full Code Here

Examples of org.olat.basesecurity.Manager.findSecurityGroupByName()

      return null;
    }

    // Find all User in OLAT, members of LDAPSecurityGroup
    Manager securityManager = ManagerFactory.getManager();
    SecurityGroup ldapGroup = securityManager.findSecurityGroupByName(LDAPConstants.SECURITY_GROUP_LDAP);
    if (ldapGroup == null) {
      log.error("Error getting users from OLAT security group '" + LDAPConstants.SECURITY_GROUP_LDAP + "' : group does not exist");
      return null;
    }
    List<Identity> olatListIdentity = securityManager.getIdentitiesOfSecurityGroup(ldapGroup);
View Full Code Here

Examples of org.olat.basesecurity.Manager.findSecurityGroupByName()

          // check if more not more than the defined percentages of
          // users managed in LDAP should be deleted
          // if they are over the percentage, they will not be deleted
          // by the sync job
          Manager securityManager = ManagerFactory.getManager();
          SecurityGroup ldapGroup = securityManager
              .findSecurityGroupByName(LDAPConstants.SECURITY_GROUP_LDAP);
          List<Identity> olatListIdentity = securityManager
              .getIdentitiesOfSecurityGroup(ldapGroup);
          if (olatListIdentity.size() == 0)
            log
View Full Code Here

Examples of org.olat.basesecurity.Manager.findSecurityGroupByName()

        return;
      }
     
      Manager secMgr = ManagerFactory.getManager();
      //filter all admins
      SecurityGroup adminGroup = secMgr.findSecurityGroupByName(Constants.GROUP_ADMIN);
      //get all identities
     
      int count = 0;
      List<Identity> identitiesList = secMgr.getIdentitiesByPowerSearch(null, null, true, null, null, null, null, null, null);
      DBFactory.getInstance().intermediateCommit();
View Full Code Here

Examples of org.olat.basesecurity.Manager.findSecurityGroupByName()

      /*
       * copy a snapshot of olatAdmins into catalogAdmins do not put
       * secMgr.findSecurityGroupByName(Constants.GROUP_ADMIN) directly into a
       * CatalogEntry!!
       */
      SecurityGroup olatAdmins = secMgr.findSecurityGroupByName(Constants.GROUP_ADMIN);
      List olatAdminIdents = secMgr.getIdentitiesOfSecurityGroup(olatAdmins);
      SecurityGroup catalogAdmins = secMgr.createAndPersistSecurityGroup();
      for (int i = 0; i < olatAdminIdents.size(); i++) {
        secMgr.addIdentityToSecurityGroup((Identity) olatAdminIdents.get(i), catalogAdmins);
      }
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.