Package org.olat.basesecurity

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


  protected void formOK(UserRequest ureq) {
    //list with property-key-name and value for the MailTemplate in the next step
    List<String[]> propsAndValues = new ArrayList<String[]>(userPropertyHandlers.size());
    //
    Manager im = ManagerFactory.getManager();
    Identity identity = im.findIdentityByName(getIdentity().getName());
    for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) {
      String propertyName = userPropertyHandler.getName();
      FormItem fi = this.flc.getFormComponent(propertyName);
      String propertyValue = userPropertyHandler.getStringValue(fi);
      //(propertyname, propertyvalue) for mailtemplate
View Full Code Here


          val = val.trim();
          String assessment = (String) feedbackDataModel.getValueAt(i, colForBulk);
          Identity identity = null;

          if (selectedOlatKey == 0){ // username
              identity = secMgr.findIdentityByName(val);
          }else if (selectedOlatKey == 1) { // email
            identity = um.findIdentityByEmail(val);
          }
          identitiesAndTheirAssessments.add(new Object[]{identity,assessment});
        }
View Full Code Here

            // see also in BulkAssessmentWizardController
            if (identitiesFoundByInst.size() == 1){
              identity = (Identity) identitiesFoundByInst.get(0);
            }
          }else if (selectedOlatKey == 1){ // username
              identity = secMgr.findIdentityByName(val);
          }else if (selectedOlatKey == 2) { // email
            identity = um.findIdentityByEmail(val);
          }
          identities.add(identity);
        }
View Full Code Here

    int c = 0;
   
    if (userName.getValue().length()>0) {
      c++;
      Manager secMgr = ManagerFactory.getManager();
      identity = secMgr.findIdentityByName(userName.getValue());
       if (identity == null){
             userName.setErrorKey ("error.search.form.nousername", null);
             return false;
       }
    }
View Full Code Here

    Manager securityManager = ManagerFactory.getManager();
    String uid = LDAPHelper.getAttributeValue(userAttributes.get(LDAPHelper
        .mapOlatPropertyToLdapAttribute(LDAPConstants.LDAP_USER_IDENTIFYER)));
    String email = LDAPHelper.getAttributeValue(userAttributes.get(LDAPHelper.mapOlatPropertyToLdapAttribute(UserConstants.EMAIL)));
    // Lookup user
    if (securityManager.findIdentityByName(uid) != null) {
      log.error("Can't create user with username='" + uid + "', does already exist in OLAT database");
      return;
    }
    // Create User (first and lastname is added in next step)
    User user = UserManager.getInstance().createUser(null, null, email);
View Full Code Here

   *         otherwise (if user exists but not managed by LDAP, error Object is
   *         modified)
   */
  public Identity findIdentyByLdapAuthentication(String uid, LDAPError errors) {
    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) {
View Full Code Here

      String[] oldGuestUserNames = new String[] { "gast", "guest", "ospite", "invité", "invitado", "episkeptis", "gost", "gosc", "kerencn",
          "kerentw", "gaest", "host", "svecas", "mehman", "convidadopt", "convidadobr", "misafir", "vend&#233;g", "mysafir", "tamu",
          "dhaif", "giast", "gas", "oreah", "khachmoi", "zochin" };
      Manager secMgr = ManagerFactory.getManager();
      for (String guestUserName : oldGuestUserNames) {
        Identity oldGuest = secMgr.findIdentityByName(guestUserName);
        if (oldGuest == null) {
          // skip this one, seems already to be deleted
          continue;
        }
        UserDeletionManager.getInstance().deleteIdentity(oldGuest);
View Full Code Here

    SecurityGroup ownerGroup = securityManager.createAndPersistSecurityGroup();
    // member of this group may modify member's membership
    securityManager.createAndPersistPolicy(ownerGroup, Constants.PERMISSION_ACCESS, ownerGroup);
    // members of this group are always authors also
    securityManager.createAndPersistPolicy(ownerGroup, Constants.PERMISSION_HASROLE, Constants.ORESOURCE_AUTHOR);
    securityManager.addIdentityToSecurityGroup(securityManager.findIdentityByName("administrator"), ownerGroup);
    re.setOwnerGroup(ownerGroup);
    // save the repository entry
    rm.saveRepositoryEntry(re);
    // Create course admin policy for owner group of repository entry
    // -> All owners of repository entries are course admins
View Full Code Here

          if (!UserDeletionManager.isKeepUserLoginAfterDeletion () ){
            // deleted username are like <TIMESTAMP>_bks_<USRENAME>
            // check if username is already in use again
            String orginalUserName = extractOrginalUserName(identity.getName());
            if (log.isDebug()) log.debug("cleanUpDeletedUserData: process orginalUserName=" + orginalUserName);
            Identity foundIdentity = secMgr.findIdentityByName(orginalUserName);
            if (foundIdentity == null) {
              MigrationIdentity migrationIdentity = new MigrationIdentity(orginalUserName);
              UserFileDeletionManager.getInstance().deleteUserData(migrationIdentity, migrationIdentity.getName())
              log.audit("Cleanup userdata of deleted user '" + identity.getName() + "' orginalUserName=" + orginalUserName);
              counter++;
View Full Code Here

        log.info("Found 1 of " + i + ":\t " + querytime + "ms;\tAND Power Search;\tAfter query time: " + afterquerytime + "ms\tused mem: " + StringHelper.formatMemory(r.totalMemory() - r.freeMemory()));

        // find one specific user via a dedicated search via login name. No
        // joining is done (automatic by hibernate)
        querystart = System.currentTimeMillis();
        ident = sm.findIdentityByName(i/2 + "test");
        querytime = System.currentTimeMillis() - querystart;
        assertNotNull(ident);
        DBFactory.getInstance().closeSession();
        // check that all data is loaded and not stale
        assertNotNull(ident.getUser());
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.