|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.plugins.mylutece.util.SecurityUtils
public class SecurityUtils
Util for security parameters
Constructor Summary | |
---|---|
SecurityUtils()
|
Method Summary | |
---|---|
static java.lang.String |
buildPassword(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.lang.String strUserPassword)
Build the password depending of the encryption. |
static java.lang.String |
checkPasswordForBackOffice(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.lang.String strPassword,
javax.servlet.http.HttpServletRequest request)
Test a password validity |
static java.lang.String |
checkPasswordForFrontOffice(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.lang.String strPassword,
int nUserId)
Test a password validity |
protected static boolean |
checkPasswordFormat(java.lang.String strPassword,
IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check the format of the password from the entered parameters. |
static java.util.Map<java.lang.String,java.lang.Object> |
checkSecurityParameters(IUserParameterService parameterService,
java.util.Map<java.lang.String,java.lang.Object> model,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Loads a model with base security parameters |
protected static boolean |
checkUserPasswordMinimumLength(java.lang.String strPassword,
IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check whether a password is long enough. |
static java.sql.Timestamp |
getAccountMaxValidDate(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Compute the maximum valid date of an account with the current time and the parameters in the database. |
static boolean |
getBooleanSecurityParameter(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.lang.String strParameterkey)
Get the boolean value of a security parameter |
static int |
getIntegerSecurityParameter(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.lang.String strParameterkey)
Get the integer value of a security parameter |
static int |
getMaximumNumberPasswordChange(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the maximum number of time a user can change his password in a given period |
protected static java.lang.String |
getMessagePasswordFormat(javax.servlet.http.HttpServletRequest request,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Gets the admin message saying that the password does not match the required format |
protected static java.lang.String |
getMessagePasswordMinimumLength(javax.servlet.http.HttpServletRequest request,
IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the admin message telling the password length is too short. |
static int |
getPasswordDuration(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the password duration |
static int |
getPasswordHistorySize(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the password history size |
static java.sql.Timestamp |
getPasswordMaxValidDate(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the current maximum valid date of a password from the parameter service. |
static int |
getTSWSizePasswordChange(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the size of the time sliding window of passwor change |
static boolean |
isAdvancedSecurityParametersUsed(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the parameter indicating that a password must contain numbers. |
protected static boolean |
isPasswordFormatUsed(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the parameter indicating that a password must contain numbers. |
static void |
removeAdvancedSecurityParameters(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove the advanced security parameters |
static void |
updateParameterValue(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin,
java.lang.String strKey,
java.lang.String strValue)
Updates a parameter from its key with a new value. |
static void |
updateSecurityParameters(IUserParameterService parameterService,
javax.servlet.http.HttpServletRequest request,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update security parameters from request parameters |
static void |
useAdvancedSecurityParameters(IUserParameterService parameterService,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Enable advanced security parameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SecurityUtils()
Method Detail |
---|
public static java.util.Map<java.lang.String,java.lang.Object> checkSecurityParameters(IUserParameterService parameterService, java.util.Map<java.lang.String,java.lang.Object> model, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- The parameter service to usemodel
- The base model to loadplugin
- The plugin
public static void updateSecurityParameters(IUserParameterService parameterService, javax.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- Parameter servicerequest
- Request to get the parameter fromplugin
- The pluginprotected static boolean checkUserPasswordMinimumLength(java.lang.String strPassword, IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
strPassword
- Password to checkparameterService
- Parameter service to get parameters from.plugin
- The plugin
protected static java.lang.String getMessagePasswordMinimumLength(javax.servlet.http.HttpServletRequest request, IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
request
- The requestparameterService
- Parameter service to get parameters from.plugin
- The plugin
protected static boolean isPasswordFormatUsed(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- Parameter service to get parameters from.plugin
- The plugin
public static int getPasswordDuration(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- Parameter service to get parameters from.plugin
- The plugin
public static int getPasswordHistorySize(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- Parameter service to get parameters from.plugin
- The plugin
public static int getTSWSizePasswordChange(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- Parameter service to get parameters from.plugin
- The plugin
public static boolean isAdvancedSecurityParametersUsed(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- Parameter service to get parameters from.plugin
- The plugin
public static int getMaximumNumberPasswordChange(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- Parameter service to get parameters from.plugin
- The plugin
public static int getIntegerSecurityParameter(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.String strParameterkey)
parameterService
- Parameter service to useplugin
- The pluginstrParameterkey
- Key of the security parameter to get
public static boolean getBooleanSecurityParameter(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.String strParameterkey)
parameterService
- Parameter service to useplugin
- The pluginstrParameterkey
- Key of the security parameter to get
protected static boolean checkPasswordFormat(java.lang.String strPassword, IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
strPassword
- The password to checkparameterService
- Parameter service to get parameters from.plugin
- The plugin
protected static java.lang.String getMessagePasswordFormat(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.service.plugin.Plugin plugin)
request
- The requestplugin
- The plugin
public static void updateParameterValue(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.String strKey, java.lang.String strValue)
parameterService
- Parameter service to useplugin
- The pluginstrKey
- The key of the parameter to updatestrValue
- The new value of the parameterpublic static void useAdvancedSecurityParameters(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- Parameter service to useplugin
- The pluginpublic static void removeAdvancedSecurityParameters(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- Parameter service to useplugin
- The pluginpublic static java.sql.Timestamp getPasswordMaxValidDate(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- Parameter service to useplugin
- The plugin
public static java.sql.Timestamp getAccountMaxValidDate(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin)
parameterService
- Parameter service to useplugin
- The plugin
public static java.lang.String checkPasswordForFrontOffice(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.String strPassword, int nUserId)
parameterService
- Paramter service to useplugin
- The pluginstrPassword
- The password to test validitynUserId
- The id of the user
public static java.lang.String checkPasswordForBackOffice(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.String strPassword, javax.servlet.http.HttpServletRequest request)
parameterService
- Parameter service to useplugin
- The pluginstrPassword
- Password to checkrequest
- The request
public static java.lang.String buildPassword(IUserParameterService parameterService, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.String strUserPassword)
parameterService
- The parameter service to useplugin
- The pluginstrUserPassword
- the password
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |