Package evolaris.framework.sys.business

Examples of evolaris.framework.sys.business.UserManagerBase


  /**
   * Test method for 'evolaris.um.business.UserManager.isUserInRole(Object,String)'
   *
   */
  public void testIsUserinRole(){
    UserManagerBase usrMng = new UserManager(Locale.GERMAN,session);
    User user = usrMng.getUserDetails("Administrator");
    assertTrue(UserManager.isUserInRole(user,UserManagerBase.ADMINISTRATOR));
  }
View Full Code Here


    User user = usrMng.getUserDetails("Administrator");
    assertTrue(UserManager.isUserInRole(user,UserManagerBase.ADMINISTRATOR));
  }

  public void testIsUserInSet(){
    UserManagerBase usrMng = new UserManager(Locale.GERMAN,session);
    User user = usrMng.getUserDetails("mysqltestuser");
    assertEquals(user.getUserSets().size(),1);
    Set<UserSet> userSets = user.getUserSets();
    assertEquals(userSets.iterator().next().getName(),"unit test");

  }
View Full Code Here

    setMgr.removeUserFromUserSet(user,set);
    userMgr.deleteUser(user);
  }

  public void testDoesUserShareMoreThanOneUserSetWithAnotherUser(){
    UserManagerBase userMgr = new UserManager(Locale.GERMAN,session);
    User user = userMgr.getUserDetails("tom");
    UserSetManager setMgr = new UserSetManager(Locale.GERMAN,session);
    UserSet userset = setMgr.getUserSet("test", user.getGroup());
    setMgr.add(userset, user);
    setMgr.doesUserShareMoreThanOneUserSetWithAnotherUser(user);
  }
View Full Code Here

   *
   * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {

    UserManagerBase userManager = new UserManager(locale,session);
    User user = userManager.getUserDetails(req.getUserPrincipal().getName().toLowerCase());
    SendTaskListForm sendTaskListForm = (SendTaskListForm) form;

    SendTaskManager sendTaskMgr = new SendTaskManager(locale, session);

    Group groupToDisplay = getCurrentGroup(req);
View Full Code Here

    try {
      Group group = null;
      String groupId = request.getParameter("group");
      if (groupId == null) {
        String webUsername = request.getUserPrincipal().getName().toLowerCase();
        UserManagerBase userManager = new UserManager(Locale.GERMAN, session)
        User webUser = userManager.getUserDetails(webUsername);
        group = webUser.getGroup();
      } else {
        GroupManager groupManager = new GroupManager(Locale.GERMAN, session);
        group = groupManager.getGroup(Long.parseLong(groupId));
      }
View Full Code Here

   */
  protected boolean initialize(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    boolean gohome = false;
    try {
      String webUsername = getWebUserName(req);
      UserManagerBase userManagerBase = new UserManagerBase(locale, session);
      webUser = userManagerBase.getUserDetails(webUsername);
    } catch (Exception e) {
      webUser = null/* anonymous user */
    }
    locale = validLocale(webUser, req);
    setLocale(req, locale);
View Full Code Here

   * @return whether to "go home" or not
   */ 
  protected boolean initialize(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    boolean gohome = false;
    String webUsername = req.getUserPrincipal().getName().toLowerCase();
    UserManagerBase userManagerBase = new UserManagerBase(DEFAULT_LOCALE,session)// use default locale to get user information; should not lead to localized messages anyhow
    webUser = userManagerBase.getUserDetails(webUsername);
    locale = validLocale(webUser, req);
    if (locale != DEFAULT_LOCALE){
      userManagerBase = new UserManagerBase(locale,session)// user manager with correct localization
    }
    setLocale(req, locale);
    /* create menu once and store it in session (required because otherwise no menu is created when struts validation re-displays a page)
     * menu is recreated if current locale differs from language in session (happens, when user switches language)
     */
View Full Code Here

   */
  public ActionForward list(ActionMapping mapping, ActionForm form,
      HttpServletRequest req, HttpServletResponse resp) {

    SendTaskDetailForm detailForm = (SendTaskDetailForm)form;
    UserManagerBase userManager = new UserManager(locale,session);
    User user = userManager.getUserDetails(req.getUserPrincipal().getName().toLowerCase());

    String idParam = req.getParameter("id");
    if (idParam == null) {
      throw new BugException("missing id parameter");
    }
View Full Code Here

TOP

Related Classes of evolaris.framework.sys.business.UserManagerBase

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.