#622: UserService.java

projectforge-business/src/main/java/org/projectforge/business/user/service/UserService.java Role: user | Active Java source 541 lines · 353 code · 135 comments · 53 blank
User business logic
Path: projectforge-business/src/main/java/org/projectforge/business/user/service/UserService.java

Architecture Analysis

Resides in projectforge-business, the core module containing domain logic, services, and persistence. Serves as a Spring @Service encapsulating business logic, coordinating across domain objects and DAOs. Typically annotated with @Service or @Component, managed by the Spring IoC container with dependency injection.

Git History

CommitWhat changed
868d6abb752025 -> 2026
7893cea1edSelection of User/Employee improved (without autocompletion), see vacation editing... EmployeeService.selectAllActive returns now sorted list of employees.
63081666f6Source file headers: 2024-> 2025.
3c42485eb9Migration stuff in progress... (all tests of all packages: OK).
a33f8f203bMigration stuff in progress... (all tests of all packages: OK).
87dd5b87c3AuftragsCache refactored, migration stuff... (all tests OK)
1b50060c3aBaseDao: renamed: get -> find, save -> insert, getList -> select, load -> select
87aaf6a5a5Migration stuff in progress... BaseDao refactored (not yet finished) internal* methods renamed.
a72903e36a*.java, *.kt: StringBuffer -> StringBuilder.
3aeda5ef5aBig change: all save|update|...InTrans renamed (InTrans removed). PfPesistenceContext as param not needed anymore (ThreadLocal is used instead). (all tests of all packages: OK).
67805f2fc1ThreadLocalUserContext.user -> ThreadLocalUserContext.loggedInUser (renamed for avoiding mis-understandings in code).
1135ccbca9Persistence: functions renamed: *NewTrans -> *InTrans
b095e6f7d1!!!!! Big change of Transaction handling: Re-uses PfPersistenceContext as much as possible (not yet finished). Tests doesn't yet run.
4c04cfd652MAJOR-CHANGE! Migration of integer id's to Long id's (including fk's etc.)
e33c8b9c20Migration stuff in progress...
06828f4908Migration stuff in progress...
b6092df092Copyright 2023 -> 2024
22b8d9d6f1WIP: phone calls for Sipgate
612cd1dca7UserService: WLAN-PW change: fix of timestamp?
01dca29413UserService: WLAN-PW change: fix of timestamp?
2a8575c7f6Bugfix (to be tested): handle last wlan password change.
ab45d51fa4Copyright 2001-2022 -> 2001-2023.
73b0be50b2org.apache.commons.collections -> org.apache.commons.collections4
ca52498519Change of WLAN-Password fixed.
18a7481a5eFinalization of UserPagesRest (SetupPage)
3256dc0793(WLAN)-Password changing refactored (is now used for changing own passwords and other's passwords by admins).
6be8efa1baShow time of last password change (my account and user edit)
ea7ec2556fRefactored (due to security reasons): PFUserDO.password -> UserPasswordDO.passwordHash
c2128f0526GroupEditForm: Add list of e-mails of assigned users (e. g. for mailing).
d62d71d067ChangePassword modified: UserService, ChangePasswordPageRest
5f7ef41b8cCopyright 2021 -> 2022
8641d51bc5CookieService: refactored (format of stayLoggedInCookie changed, old format is supported). WIP: 2FA
6ab17aeea6DataTransferAreaDao searches now also for personal boxes by user name (if search string is given).
02128a8fb7Ldap works
87a1c4cfc2Passwords (char[]) will be cleared in most backend methods due to security reasons.
0050a24d94String password -> char[] password. Not yet tested: LDAP client/master and change of Wlan-Password.
c0f2b9de04Tenants functionality removed everywhere (untested).
ceb63e8a1bSource code header: (C) 2001-2021.
2b542af969wip: MyAccountPageRest
d8da31ee33UserService: changePassword fixed.
dcee9262d9NPE fix in UserService.onPasswordChange
6b26a60f68NumberHelper.getSecureRandomUrlSaveString and getSecureRandomBas64String -> getSecureRandomAlphanumeric
89324bedaaUser Authentication: encryption and UserAuthenticationsService added.
6d99ca8ed3WIP: UserTokenType's...
cf5c5fa662UserService: update passwort with salt and pepper in data base.
7c1c487822Replacing more instance of java.sql.Date with java.time.LocalDate Replacing instances of java sql.Timestamp with java.util.Date
dee69b7965Merge branch 'VacationMigration' into merlin-importer
7c79f1922cCopyright of source header -> 2020.
2d2a112101BaseDao: bulk update runs now in one transaction, HistoryAdapter ops are now part of update/insert transaction. DatevImportDao works now.
8f96c5a56dHeavy WIP: Remove @Transaction annotations....
3a2f340f48UserDao warning fixed regarding overriding hasSelect methods: BaseDao.hasSelectAccess(PFUserDO, boolean) -> hasUserSelectAccess, hasSelectAccess(PFUserDO, O, boolean) -> hasUserSelectAccess.
73a9755df7More code cleanup: - Collapsed catch blocks that did the exact same things - Replaced ArrayList with ArrayList<> - Replaced StringBuffer with StringBuilder - Removed a few usages of deprecated classes (mainly HSSFColors in Excel) - Replace Collections.sort with List.sort
000ca723d8Remove pointless boolean expressions (business)
bd38598cc3UserService: java doc.
2b5524e65fWicket needs default constructor in UserService for creating proxy object.
dd5ca38acdCopyRight of all java file-header updated or created.
10c2bed496!!!UserDao, UserService: More protection of PFUserDO's secret fields. Elements after loading must be evicted (otherwise the db is modified by ereasing the secret fields)
e772507cbf!!!UserDao, UserService: More protection of PFUserDO's secret fields.
c7ed4cdc24UserService: Don't copy secret fields for context user.
614328623ePFUserDO.java -> PFUserDO.kt
9a6362462aUserServiceImpl and UserPreferencesServiceImpl and their interface merged. Impl class will be added, if really needed. I don't like interfaces with only one impl class if no other implementations are planned.
1d135db42bPROJECTFORGE-3287 First draw
d590fdcb7cPROJECTFORGE-2967 fix bug with singleton in PasswordQualityService, refactorings
10286895a8PROJECTFORGE-2967 Set up set for I18n messages password change
8b5fd79ddcPROJECTFORGE-2967 check for same password in password change
8caa563148refactor Password Quality Check + setup multiple i18n as return messages
7ea3d59325PROJECTFORGE-3048 use configured min password length, fix findbugs issues
91eab214a1PROJECTFORGE-2579 create history entry for the last wlan password change, set the LDAP field “sambaPwdLastSet” only if the wlan password is changed
383ad7cd63PROJECTFORGE-2577 add button to change WLAN password on my account page
438b8e4644PROJECTFORGE-2304 Add user, if email match
9ebb885224Initial commit