Package mc.core.domain.cc.dobj
Class UserDO
java.lang.Object
mc.core.system.base.BaseBean
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classNested classes/interfaces inherited from class mc.core.domain.base.dobj.AbstractBaseDO
AbstractBaseDO.Initializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNOTE: when overriding this method and you delete any other objects you need to call validateNotUsed before in case flag force is false!voiddeleteSync(User user) Final delete of user.getAllActive(mc.core.system.search.SearchFilter sf) get all principals (User and UserGroup) according to given SearchFilter and active, not deleted and with isSystem-Flag false.getFromLoginAndPassword(String login, String password) get user from login and password: main method used for authenticating usergetSystemUser(UserCredentials systemUserCredentials) getTerritoriesForUser(User user, boolean fallbackToAllActive) <T extends Serializable>
TgetUserProfileValue(User user, UserProfile.UserProfileKey key, Class<T> valueClass) booleanbooleanisLDAPUser(User user) voidpasswordChange(User user, String oldPassword, String newPassword, String newPasswordRepeat) compare old password, prepare and set new if password is validpasswordGenerateNew(String login, String userIP) generate new password for user with given login and send it an user email if any in profile, else send email to admin, the pw must be changed manual.booleanpasswordMustBeChanged(User user) voidpasswordSet(User user, String pw) verify and encrypt password, and set in user object if validpasswordValidateLink(String changePasswordToken) map data to entity if any, validate and savevoidsetUserProfileValue(User user, UserProfile.UserProfileKey key, Object value) voidunlockAccount(String uid) Check validity of link and unlock the user accountvalidateLink(String tokenToCheck, String msgKey) Methods inherited from class mc.core.domain.cc.dobj.AbstractPrincipalDO
getAllActiveMethods inherited from class mc.core.domain.base.dobj.AbstractComplexEntityDO
addDefaultSearchCriteria, assertPermission, assertPermission, attributes, copy, copyDataSync, copyToCollection, doRecursiveActionAsync, entityProfileApply, entityProfileApply, filter, getCollectionHierarchies, getCollectionsAll, getFromExternalKey, getFromKeySearchFilter, getUserRole, lifecycle, newComplexEntityEvent, onChange, parameter, permissions, prepareSearchFilter, relations, secondaryCollectionAdd, secondaryCollectionCopy, secondaryCollectionMove, secondaryCollectionRemove, setRightInheritanceDisabled, states, translate, versions, watchesMethods inherited from class mc.core.domain.base.dobj.AbstractEntityBaseDO
getFromInternalDescription, sendEvent, sendEventMethods inherited from class mc.core.domain.base.dobj.AbstractBaseDO
delete, getAll, getEntityDisplay, getFromId, getFromKey, getOne, map, map, save, validator
-
Constructor Details
-
UserDO
public UserDO()
-
-
Method Details
-
getAllActive
Description copied from class:AbstractPrincipalDOget all principals (User and UserGroup) according to given SearchFilter and active, not deleted and with isSystem-Flag false.- Overrides:
getAllActivein classAbstractPrincipalDO<User>
-
insert
- Overrides:
insertin classAbstractComplexEntityDO<User>- Throws:
ApplicationException
-
insert
public User insert(User user, Locale defaultLocale, UserGroup defaultUserGroup) throws ApplicationException - Throws:
ApplicationException
-
edit
- Overrides:
editin classAbstractComplexEntityDO<User>- Throws:
ApplicationException
-
save
Description copied from interface:IBaseDOmap data to entity if any, validate and save- Specified by:
savein interfaceIBaseDO<User>- Overrides:
savein classAbstractEntityBaseDO<User>- Parameters:
user- mandatorydataMap- optional- Returns:
- mapped entity
- Throws:
ApplicationException
-
save
public User save(User user, String newPw, String newPwRepeat, DataMap dataMap) throws ApplicationException - Throws:
ApplicationException
-
passwordChange
public void passwordChange(User user, String oldPassword, String newPassword, String newPasswordRepeat) throws UserException compare old password, prepare and set new if password is valid- Parameters:
user-oldPassword- can be encoded if case forgot pwnewPassword-newPasswordRepeat-- Throws:
UserException- if oldPassword is the wrong password, if passwordRepeat is not same as newPassword, if oldPassword is same as newPassword or if newPassword is too short or if new password is in history (the 3 last passwords)
-
passwordSet
verify and encrypt password, and set in user object if valid- Throws:
UserException- if password is not valid, to short or trivial
-
passwordValidateLink
- Throws:
UserException
-
validateLink
- Throws:
UserException
-
passwordMustBeChanged
-
passwordGenerateNew
generate new password for user with given login and send it an user email if any in profile, else send email to admin, the pw must be changed manual. change key UserProfileKey.PASSWORD_MUST_CHANGE in user profile to true.- Parameters:
login- mandatory- Returns:
- message to user
- Throws:
UserException
-
delete
Description copied from class:AbstractBaseDONOTE: when overriding this method and you delete any other objects you need to call validateNotUsed before in case flag force is false!- Overrides:
deletein classAbstractPrincipalDO<User>- Parameters:
user- mandatoryforce- if true delete without usage check, which can result in db constraints error unless references are taken care of- Throws:
ApplicationException
-
deleteSync
Final delete of user. Make sure that delete-deny constraints don't exist or are removed beforehand otherwise we get an exception from DB.- Throws:
ApplicationException
-
getTerritoriesForUser
-
getUserProfileValue
public <T extends Serializable> T getUserProfileValue(User user, UserProfile.UserProfileKey key, Class<T> valueClass) -
getUserProfileValueBoolean
-
getUserProfileValueString
-
setUserProfileValue
-
getFromLoginAndPassword
get user from login and password: main method used for authenticating user- Parameters:
login- mandatorypassword- mandatory- Returns:
- user
- Throws:
UserException- with appropriate message key if user does not exist or password does not match
-
unlockAccount
Check validity of link and unlock the user account- Parameters:
uid- mandatory- Throws:
UserException- the link be expiredUserExceptionApplicationException
-
getSystemUser
- Throws:
ApplicationException
-
isLDAPUser
- Parameters:
user- Any persistent mediacockpit user.- Returns:
trueif user is from LDAP. Otherwisefalse.
-
newEvent
-