java.lang.Object
fr.paris.lutece.plugins.mylutece.modules.database.authentication.business.DatabaseHome

public final class DatabaseHome extends Object
This class provides instances management methods (create, find, ...) for databaseUser objects
  • Method Details

    • findLuteceUserByLogin

      public static BaseUser findLuteceUserByLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin, fr.paris.lutece.portal.service.security.LuteceAuthentication authenticationService)
      Find users by login
      Parameters:
      strLogin - the login
      plugin - The Plugin using this data access service
      authenticationService - the LuteceAuthentication object
      Returns:
      DatabaseUser the user corresponding to the login
    • findResetPasswordFromLogin

      public static boolean findResetPasswordFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Gets the reset password attribute of the user from his login
      Parameters:
      strLogin - the login
      plugin - The Plugin using this data access service
      Returns:
      True if the password has to be changed, false otherwise
    • findPasswordMaxValideDateFromLogin

      public static Timestamp findPasswordMaxValideDateFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Gets the expiration date of the user's password
      Parameters:
      strLogin - The login of the user
      plugin - The plugin
      Returns:
      The expiration date of the user's password
    • findDatabaseUsersList

      public static Collection<BaseUser> findDatabaseUsersList(fr.paris.lutece.portal.service.plugin.Plugin plugin, fr.paris.lutece.portal.service.security.LuteceAuthentication authenticationService)
      Load the list of BaseUser
      Parameters:
      plugin - The Plugin using this data access service
      authenticationService - the authentication service
      Returns:
      The Collection of the BaseUser
    • findUserRolesFromLogin

      public static List<String> findUserRolesFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Find user's roles by login
      Parameters:
      strLogin - the login
      plugin - The Plugin using this data access service
      Returns:
      ArrayList the role key list corresponding to the login
    • removeRolesForUser

      public static void removeRolesForUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete roles for a user
      Parameters:
      nIdUser - The id of the user
      plugin - The Plugin using this data access service
    • addRoleForUser

      public static void addRoleForUser(int nIdUser, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Assign a role to user
      Parameters:
      nIdUser - The id of the user
      strRoleKey - The key of the role
      plugin - The Plugin using this data access service
    • findUserGroupsFromLogin

      public static List<String> findUserGroupsFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Find user's groups by login
      Parameters:
      strLogin - the login
      plugin - The Plugin using this data access service
      Returns:
      ArrayList the group key list corresponding to the login
    • removeGroupsForUser

      public static void removeGroupsForUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete groups for a user
      Parameters:
      nIdUser - The id of the user
      plugin - The Plugin using this data access service
    • addGroupForUser

      public static void addGroupForUser(int nIdUser, String strGroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Assign a group to user
      Parameters:
      nIdUser - The id of the user
      strGroupKey - The key of the group
      plugin - The Plugin using this data access service
    • findDatabaseUsersListForRoleKey

      public static Collection<String> findDatabaseUsersListForRoleKey(String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Returns a collection of DatabaseUser objects for a Lutece role
      Parameters:
      strRoleKey - The role of the databseUser
      plugin - The current plugin using this method
      Returns:
      A collection of logins
    • findGroupUsersFromGroupKey

      public static List<DatabaseUser> findGroupUsersFromGroupKey(String strGroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Find assigned users to the given group
      Parameters:
      strGroupKey - The group key
      plugin - Plugin
      Returns:
      a list of DatabaseUser
    • updateResetPasswordFromLogin

      public static void updateResetPasswordFromLogin(String strUserName, boolean bNewValue, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update the reset password attribut of a user from his login
      Parameters:
      strUserName - Login of the user to update
      bNewValue - New value
      plugin - the plugin
    • findUserIdFromLogin

      public static int findUserIdFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the id of a user from his login
      Parameters:
      strLogin - Login of the user
      plugin - The plugin
      Returns:
      The id of the user