Class DatabaseHome
- java.lang.Object
-
- fr.paris.lutece.plugins.mylutece.modules.database.authentication.business.DatabaseHome
-
public final class DatabaseHome extends java.lang.ObjectThis class provides instances management methods (create, find, ...) for databaseUser objects
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddGroupForUser(int nIdUser, java.lang.String strGroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Assign a group to userstatic voidaddRoleForUser(int nIdUser, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Assign a role to userstatic java.util.Collection<BaseUser>findDatabaseUsersList(fr.paris.lutece.portal.service.plugin.Plugin plugin, fr.paris.lutece.portal.service.security.LuteceAuthentication authenticationService)Load the list ofBaseUserstatic java.util.Collection<java.lang.String>findDatabaseUsersListForRoleKey(java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Returns a collection of DatabaseUser objects for a Lutece rolestatic java.util.List<DatabaseUser>findGroupUsersFromGroupKey(java.lang.String strGroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Find assigned users to the given groupstatic BaseUserfindLuteceUserByLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin, fr.paris.lutece.portal.service.security.LuteceAuthentication authenticationService)Find users by loginstatic java.sql.TimestampfindPasswordMaxValideDateFromLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)Gets the expiration date of the user's passwordstatic booleanfindResetPasswordFromLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)Gets the reset password attribute of the user from his loginstatic java.util.List<java.lang.String>findUserGroupsFromLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)Find user's groups by loginstatic intfindUserIdFromLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the id of a user from his loginstatic java.util.List<java.lang.String>findUserRolesFromLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)Find user's roles by loginstatic voidremoveGroupsForUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Delete groups for a userstatic voidremoveRolesForUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)Delete roles for a userstatic voidupdateResetPasswordFromLogin(java.lang.String strUserName, boolean bNewValue, fr.paris.lutece.portal.service.plugin.Plugin plugin)Update the reset password attribut of a user from his login
-
-
-
Method Detail
-
findLuteceUserByLogin
public static BaseUser findLuteceUserByLogin(java.lang.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 loginplugin- The Plugin using this data access serviceauthenticationService- the LuteceAuthentication object- Returns:
- DatabaseUser the user corresponding to the login
-
findResetPasswordFromLogin
public static boolean findResetPasswordFromLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)Gets the reset password attribute of the user from his login- Parameters:
strLogin- the loginplugin- The Plugin using this data access service- Returns:
- True if the password has to be changed, false otherwise
-
findPasswordMaxValideDateFromLogin
public static java.sql.Timestamp findPasswordMaxValideDateFromLogin(java.lang.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 userplugin- The plugin- Returns:
- The expiration date of the user's password
-
findDatabaseUsersList
public static java.util.Collection<BaseUser> findDatabaseUsersList(fr.paris.lutece.portal.service.plugin.Plugin plugin, fr.paris.lutece.portal.service.security.LuteceAuthentication authenticationService)
Load the list ofBaseUser- Parameters:
plugin- The Plugin using this data access serviceauthenticationService- the authentication service- Returns:
- The Collection of the
BaseUser
-
findUserRolesFromLogin
public static java.util.List<java.lang.String> findUserRolesFromLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)Find user's roles by login- Parameters:
strLogin- the loginplugin- 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 userplugin- The Plugin using this data access service
-
addRoleForUser
public static void addRoleForUser(int nIdUser, java.lang.String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Assign a role to user- Parameters:
nIdUser- The id of the userstrRoleKey- The key of the roleplugin- The Plugin using this data access service
-
findUserGroupsFromLogin
public static java.util.List<java.lang.String> findUserGroupsFromLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)Find user's groups by login- Parameters:
strLogin- the loginplugin- 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 userplugin- The Plugin using this data access service
-
addGroupForUser
public static void addGroupForUser(int nIdUser, java.lang.String strGroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)Assign a group to user- Parameters:
nIdUser- The id of the userstrGroupKey- The key of the groupplugin- The Plugin using this data access service
-
findDatabaseUsersListForRoleKey
public static java.util.Collection<java.lang.String> findDatabaseUsersListForRoleKey(java.lang.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 databseUserplugin- The current plugin using this method- Returns:
- A collection of logins
-
findGroupUsersFromGroupKey
public static java.util.List<DatabaseUser> findGroupUsersFromGroupKey(java.lang.String strGroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Find assigned users to the given group- Parameters:
strGroupKey- The group keyplugin- Plugin- Returns:
- a list of DatabaseUser
-
updateResetPasswordFromLogin
public static void updateResetPasswordFromLogin(java.lang.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 updatebNewValue- New valueplugin- the plugin
-
findUserIdFromLogin
public static int findUserIdFromLogin(java.lang.String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the id of a user from his login- Parameters:
strLogin- Login of the userplugin- The plugin- Returns:
- The id of the user
-
-