public final class DatabaseService extends Object
Modifier and Type | Method and Description |
---|---|
void |
changeUserPasswordAndNotify(String strBaseURL,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
Locale locale)
Change all user's password and notify them with an email.
|
boolean |
checkPassword(String strUserGuid,
String strPassword,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check the password
|
void |
doAutoLoginDatabaseUser(javax.servlet.http.HttpServletRequest request,
DatabaseUser databaseUser,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Login automatically the database user
|
DatabaseUser |
doCreateUser(DatabaseUser user,
String strPassword,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Do create a new database user
|
void |
doInsertNewPasswordInHistory(String strPassword,
int nUserId,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Log a password change in the password history
|
void |
doModifyPassword(DatabaseUser user,
String strPassword,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Do modify the password
|
void |
doModifyResetPassword(DatabaseUser user,
boolean bNewValue,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Do modify the reset password attribute
|
void |
doUpdateUser(DatabaseUser user,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the info of the user
|
List<DatabaseUser> |
getAuthorizedUsers(fr.paris.lutece.portal.business.user.AdminUser adminUser,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get authorized users list
|
List<DatabaseUser> |
getFilteredUsersInterface(DatabaseUserFilter duFilter,
boolean bIsSearch,
List<DatabaseUser> listUsers,
javax.servlet.http.HttpServletRequest request,
Map<String,Object> model,
fr.paris.lutece.util.url.UrlItem url)
Get the filtered list of database users
|
List<DatabaseUser> |
getListFilteredUsers(javax.servlet.http.HttpServletRequest request,
DatabaseUserFilter duFilter,
List<DatabaseUser> listUsers)
Get th list of filteredUsers
|
Map<String,Object> |
getManageAdvancedParameters(fr.paris.lutece.portal.business.user.AdminUser user)
Build the advanced parameters management
|
static DatabaseService |
getService()
Returns the instance of the singleton
|
String |
getXmlFromUser(DatabaseUser user,
boolean bExportRoles,
boolean bExportGroups,
boolean bExportAttributes,
List<fr.paris.lutece.plugins.mylutece.business.attribute.IAttribute> listAttributes,
Locale locale)
Get a XML string describing a given user
|
void |
init()
Initialize the Database service
|
boolean |
isAuthorized(DatabaseUser user,
fr.paris.lutece.portal.business.user.AdminUser adminUser,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check if an Lutece user should be visible to the user according its
workgroup
|
boolean |
isPluginJcaptchaEnable()
Check if the plugin jcaptcha is activated or not
|
boolean |
isUserActive(String strUserName,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check if the user is active or not
|
boolean |
mustUserChangePassword(fr.paris.lutece.portal.service.security.LuteceUser databaseUser,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check whether a user must change his password
|
void |
setDatabaseUserParameterService(DatabaseUserParameterService userParamService)
Set the database user parameter service
|
void |
setPasswordFactory(fr.paris.lutece.util.password.IPasswordFactory passwordFactory)
Set the password factory
|
void |
updateUserExpirationDate(int nIdUser,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the user expiration date with new values, and notify him with an
email.
|
void |
updateUserLastLoginDate(String strLogin,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update a user last login date.
|
public void setDatabaseUserParameterService(DatabaseUserParameterService userParamService)
userParamService
- the user parameter servicepublic void setPasswordFactory(fr.paris.lutece.util.password.IPasswordFactory passwordFactory)
passwordFactory
- the password factorypublic void init()
public static DatabaseService getService()
public Map<String,Object> getManageAdvancedParameters(fr.paris.lutece.portal.business.user.AdminUser user)
user
- the admin userpublic boolean isAuthorized(DatabaseUser user, fr.paris.lutece.portal.business.user.AdminUser adminUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
user
- the Lutece useradminUser
- the admin userplugin
- the pluginpublic List<DatabaseUser> getAuthorizedUsers(fr.paris.lutece.portal.business.user.AdminUser adminUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
adminUser
- the admin userplugin
- the pluginpublic List<DatabaseUser> getFilteredUsersInterface(DatabaseUserFilter duFilter, boolean bIsSearch, List<DatabaseUser> listUsers, javax.servlet.http.HttpServletRequest request, Map<String,Object> model, fr.paris.lutece.util.url.UrlItem url)
duFilter
- The filterbIsSearch
- True if the user used search filters, false otherwiselistUsers
- the initial list to filterrequest
- HttpServletRequestmodel
- Mapurl
- UrlItempublic List<DatabaseUser> getListFilteredUsers(javax.servlet.http.HttpServletRequest request, DatabaseUserFilter duFilter, List<DatabaseUser> listUsers)
request
- the HTTP requestduFilter
- the filterlistUsers
- the list of usersDatabaseUser
public DatabaseUser doCreateUser(DatabaseUser user, String strPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
user
- the userstrPassword
- the passwordplugin
- the pluginpublic void doModifyPassword(DatabaseUser user, String strPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
user
- the DatabaseUserstrPassword
- the new password not encryptedplugin
- the pluginpublic void doModifyResetPassword(DatabaseUser user, boolean bNewValue, fr.paris.lutece.portal.service.plugin.Plugin plugin)
user
- the DatabaseUserbNewValue
- the new valueplugin
- the pluginpublic void doUpdateUser(DatabaseUser user, fr.paris.lutece.portal.service.plugin.Plugin plugin)
user
- the userplugin
- the pluginpublic boolean checkPassword(String strUserGuid, String strPassword, fr.paris.lutece.portal.service.plugin.Plugin plugin)
strUserGuid
- the user guidstrPassword
- the passwordplugin
- the pluginpublic boolean isUserActive(String strUserName, fr.paris.lutece.portal.service.plugin.Plugin plugin)
strUserName
- the user nameplugin
- the pluginpublic boolean isPluginJcaptchaEnable()
public void changeUserPasswordAndNotify(String strBaseURL, fr.paris.lutece.portal.service.plugin.Plugin plugin, Locale locale)
strBaseURL
- The base url of the applicationplugin
- The pluginlocale
- The locale to usepublic boolean mustUserChangePassword(fr.paris.lutece.portal.service.security.LuteceUser databaseUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
databaseUser
- The user to checkplugin
- The pluginpublic void doInsertNewPasswordInHistory(String strPassword, int nUserId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
strPassword
- New password of the usernUserId
- Id of the userplugin
- The pluginpublic void updateUserExpirationDate(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
nIdUser
- Id of the user to updateplugin
- The pluginpublic void updateUserLastLoginDate(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin)
strLogin
- Login of the user to updateplugin
- The pluginpublic String getXmlFromUser(DatabaseUser user, boolean bExportRoles, boolean bExportGroups, boolean bExportAttributes, List<fr.paris.lutece.plugins.mylutece.business.attribute.IAttribute> listAttributes, Locale locale)
user
- The user to get the XML of.bExportRoles
- True to export roles of the user, false otherwise.bExportGroups
- True to export groups of the user, false otherwise.bExportAttributes
- True to export attributes of the user, false
otherwise.listAttributes
- The list of attributes to export.locale
- The localepublic void doAutoLoginDatabaseUser(javax.servlet.http.HttpServletRequest request, DatabaseUser databaseUser, fr.paris.lutece.portal.service.plugin.Plugin plugin)
request
- the HTTP requestDatabaseUser
- databaseUserplugin
- the pluginCopyright © 2018 City of Paris. All rights reserved.