Package org.olat.core.id

Examples of org.olat.core.id.Identity


    setTranslator(UserManager.getInstance().getPropertyHandlerTranslator(getTranslator()));
    VelocityContainer myContent = createVelocityContainer("homepagedisplay");
   
    String userName = hpc.getUserName();
    UserManager um = UserManager.getInstance();
    Identity identity = ManagerFactory.getManager().findIdentityByName(userName);
    User u = identity.getUser();
   
    myContent.contextPut("userName", identity.getName());
    myContent.contextPut("deleted", identity.getStatus().equals(Identity.STATUS_DELETED));
    myContent.contextPut("user", u);
    myContent.contextPut("locale", getLocale());
   
    // add configured property handlers and the homepage config
    // do the looping in the velocity context
View Full Code Here


   */
  public User findUserByEmail(String email) {
    if (Tracing.isDebugEnabled(UserManager.class)){
      Tracing.logDebug("Trying to find user with email '" + email + "'", UserManager.class);
    }
    Identity ident = findIdentityByEmail(email);
    // if no user found return null
    if (ident == null) {
      if (Tracing.isDebugEnabled(UserManager.class)){
        Tracing.logDebug("Could not find user '" + email + "'", UserManager.class);
      }
      return null;
    }
    return ident.getUser();
  }
View Full Code Here

   * @see org.olat.core.id.context.ContextEntryControllerCreator#createController(org.olat.core.id.context.ContextEntry,
   *      org.olat.core.gui.UserRequest,
   *      org.olat.core.gui.control.WindowControl)
   */
  public Controller createController(ContextEntry ce, UserRequest ureq, WindowControl wControl) {
    Identity identity = extractIdentity(ce);
    if (identity == null) return null;
    UserInfoMainController uimc = new UserInfoMainController(ureq, wControl, identity);
    return uimc;
  }
View Full Code Here

  /**
   * @see org.olat.core.id.context.ContextEntryControllerCreator#getTabName(org.olat.core.id.context.ContextEntry)
   */
  public String getTabName(ContextEntry ce) {
    Identity identity = extractIdentity(ce);
    if (identity == null) return null;
    return identity.getName();
  }
View Full Code Here

    Long key = resource.getResourceableId();
    if (key == null || key.equals(0)) {
      log.error("Can not load identity with key::" + key);
      return null;
    }
    Identity identity = ManagerFactory.getManager().loadIdentityByKey(key);
    if (identity == null) {
      log.error("Can not load identity with key::" + key);
      return null;
    }
    return identity;
View Full Code Here

    simCourseEnv = new PreviewCourseEnvironment(title, runStructure, psf.getDate(), course.getCourseFolderContainer(), course
        .getCourseBaseContainer(),course.getResourceableId(), cpm, cgm, auditman, am);
    simIdentEnv = new IdentityEnvironment();
    simIdentEnv.setRoles(new Roles(false, false, false, isGlobalAuthor, isGuestOnly, false));
    final Identity ident = new PreviewIdentity();
    simIdentEnv.setIdentity(ident);
    //identity must be set before attributes OLAT-4811
    simIdentEnv.setAttributes(psf.getAttributesMap());
  }
View Full Code Here

    if (source == chPwdForm) {
      if (event == Form.EVNT_VALIDATION_OK) { // form validation was ok
        // Form data is ok
        // verify old password
        String oldPwd = chPwdForm.getOldPasswordValue();
        Identity provenIdent = null;
        if(ManagerFactory.getManager().findAuthentication(ureq.getIdentity(), LDAPAuthenticationController.PROVIDER_LDAP) != null) {
          LDAPError ldapError = new LDAPError();
          //fallback to OLAT if enabled happen automatically in LDAPAuthenticationController
          provenIdent = LDAPAuthenticationController.authenticate(ureq.getIdentity().getName(), oldPwd, ldapError);
        }
        else if(ManagerFactory.getManager().findAuthentication(ureq.getIdentity(), OLATAuthenticationController.PROVIDER_OLAT) != null) {
          provenIdent = OLATAuthenticationController.authenticate(ureq.getIdentity().getName(), oldPwd);
        }
       
        if (provenIdent == null) {
          getWindowControl().setError(translate("error.password.noauth"))
        }
        else {
          String newPwd = chPwdForm.getNewPasswordValue();
          if(OLATAuthManager.changePassword(ureq.getIdentity(), provenIdent, newPwd)) {
            //TODO: verify that we are NOT in a transaction (changepwd should be commited immediately)
            log.audit("Changed password for identity."+provenIdent.getName());
            getWindowControl().setInfo(translate("password.successful"));
          } else {
            getWindowControl().setInfo(translate("password.failed"));
          }
        }
View Full Code Here

    if (cev != null) {
      // return emtyp string to continue with condition evaluation test
      return defaultValue();
    }

    Identity ident = getUserCourseEnv().getIdentityEnvironment().getIdentity();
    User user = ident.getUser();
    String propertyName = (String) inStack[0];

    return user.getProperty(propertyName, null); // always use default locale
  }
View Full Code Here

    int contcnt = DefaultController.getControllerCount();
    sb.append("total usersessions (auth and non auth): "+ucCnt+"<br />auth usersessions: "+usesss.size()+"<br />Total Controllers (active, not disposed) of all users:"+contcnt+"<br /><br />");
    Formatter f = Formatter.getInstance(ureq.getLocale());
    for (Iterator iter = usesss.iterator(); iter.hasNext();) {
      UserSession usess = (UserSession) iter.next();
      Identity iden = usess.getIdentity();
      sb.append("authusersession (").append(usess.hashCode()).append(") of ");
      if (iden != null) {
        sb.append(iden.getName()).append(" ").append(iden.getKey());
      }
      else {
        sb.append(" - ");
      }
      sb.append("<br />");
View Full Code Here

    RepositoryEntryImportExport rie = new RepositoryEntryImportExport(importSubdir);
    if (!rie.anyExportedPropertiesAvailable()) return null;

    // do import referenced repository entries
    if (unattendedImport) {
      Identity admin = ManagerFactory.getManager().findIdentityByName("administrator");
      ImportReferencesController.doImport(rie, this, ImportReferencesController.IMPORT_WIKI ,true, admin);
      return null;
    } else {
      return new ImportReferencesController(this, ImportReferencesController.IMPORT_WIKI,rie, ureq, wControl);
    }
View Full Code Here

TOP

Related Classes of org.olat.core.id.Identity

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.