Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/epic 12881 self reset password #13096

Open
wants to merge 123 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
8a8eba6
set the descriptions for the captions and strings#12881
Anthony4m Feb 22, 2022
8b0c7ed
current password, new password, confirm password and password strengt…
Anthony4m Feb 22, 2022
7b2a25a
#21-Added methods to
Anthony4m Feb 22, 2022
a679d47
current password, new password, confirm password and password strengt…
Anthony4m Feb 22, 2022
f9e5afb
Added plugin to check password strength#12881
Anthony4m Feb 22, 2022
056ec34
Added activity for changePasswordActivity#12881
Anthony4m Feb 22, 2022
68916e5
#21-Added function to setNewPassword locally to android
Anthony4m Feb 22, 2022
f0634c4
#21-Added saveNewPassword and generatePassword calls to the server
Anthony4m Feb 22, 2022
9709c86
#21-override the setHint method in the password controlField
Anthony4m Feb 22, 2022
1810d6c
#21- created a ChangePassword activity
Anthony4m Feb 22, 2022
cb98944
#21-Added a post request to save password and a get request to genera…
Anthony4m Feb 22, 2022
e884e2a
#21-Added getters and setters for password strength
Anthony4m Feb 22, 2022
1c5b453
#21-Added change password button that leads to changePasswordActivity
Anthony4m Feb 22, 2022
1839224
#21-Added curved edges to button
Anthony4m Feb 22, 2022
ab14391
#21-created a check icon
Anthony4m Feb 22, 2022
c8a9021
#21-Added change password button
Anthony4m Feb 22, 2022
02e91b2
#21-Edited the textInputfield to change hint
Anthony4m Feb 22, 2022
5036d4f
#21-Created a validator for the password field
Anthony4m Feb 22, 2022
0ee7ee2
#21-Added a change password layout
Anthony4m Feb 22, 2022
a5f44ff
Added a pop up component that contains update password form for chang…
Anthony4m Feb 22, 2022
c1079ad
Added descriptions to captions of strings#12880
Anthony4m Feb 22, 2022
5c8caf5
#21-Created a form for changing password
Anthony4m Feb 22, 2022
be22664
Added generated password and update Password to user service#12880
Anthony4m Feb 22, 2022
a9da21b
#21-Added styling to the generate button
Anthony4m Feb 22, 2022
6bbae90
#21- Added create new password to user settings menu
Anthony4m Feb 22, 2022
330c333
#21-Added plugin to check passwors strength
Anthony4m Feb 22, 2022
c474f8d
#21-Added http request to rest to receive requests sent from android
Anthony4m Feb 22, 2022
e501765
Added a method to generate password
Anthony4m Feb 22, 2022
826a0d2
#21-Added a default screen magin to position change password layout a…
Anthony4m Feb 22, 2022
792355d
#21
Anthony4m Feb 22, 2022
6372d68
#21-removed duplicate entries
Anthony4m Feb 22, 2022
d55f94c
Rephrased the error message
Anthony4m May 16, 2022
5d7b532
Changed the name of the method makeUpdatePassword to showUpdatePassword
Anthony4m May 16, 2022
3a018a7
Removed redundant code#12881
Anthony4m May 16, 2022
9c61bd6
Removed redundant code
Anthony4m May 16, 2022
88ecf92
added sormas linces info on top of new classes and enhanced password …
daveotengo Feb 6, 2024
3eb3a39
upating camera permission and progress dialog#12881
daveotengo Feb 7, 2024
08a5b6b
removed user edit from validate password to enable all users to be ab…
daveotengo Feb 7, 2024
9bbb51a
Merge pull request #12947 from ePareto-Information-System/feature/EPI…
daveotengo Feb 7, 2024
47b3dc9
Added @Audited Annotations to classes that require them and rearrange…
daveotengo Feb 12, 2024
5152dac
Merge pull request #12960 from ePareto-Information-System/feature/EPI…
daveotengo Feb 12, 2024
32cb5da
Merge branch 'development' into feature/EPIC-12881-Self_reset_password
daveotengo Feb 13, 2024
4117122
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Feb 13, 2024
a8d7889
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Feb 14, 2024
ba27681
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Feb 15, 2024
c24c987
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Feb 15, 2024
1d9ba9a
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Feb 17, 2024
9da71bc
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Feb 17, 2024
340eb6f
fix methods to pass testcases#12881
daveotengo Feb 18, 2024
a0b6547
Merge branch 'feature/EPIC-12881-Self_reset_password' into feature/EP…
daveotengo Feb 18, 2024
50f83d9
Merge pull request #12978 from ePareto-Information-System/feature/EPI…
daveotengo Feb 18, 2024
d2d955d
user facade update to fix double methods#12881
daveotengo Feb 18, 2024
2d320b8
user facade update to fix double methods#12881
daveotengo Feb 18, 2024
6aa6a3d
Merge pull request #12979 from ePareto-Information-System/feature/EPI…
daveotengo Feb 18, 2024
2729b1c
special characters, notification, password generation logic and disca…
daveotengo Mar 16, 2024
47dc514
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Mar 19, 2024
e001af2
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Mar 19, 2024
36636f0
Merge branch 'feature/EPIC-12881-Self_reset_password' into feature/EP…
daveotengo Mar 19, 2024
99bfd39
Merge pull request #13048 from ePareto-Information-System/feature/EPI…
daveotengo Mar 19, 2024
6bef4e5
Adding special character validation to password policy#12881
daveotengo Mar 19, 2024
597ffea
Merge branch 'feature/EPIC-142-Self_reset_password' of https://github…
daveotengo Mar 19, 2024
9f29d98
Merge pull request #13050 from ePareto-Information-System/feature/EPI…
daveotengo Mar 19, 2024
851aa45
updated notification
daveotengo Mar 21, 2024
d5b9952
Merge branch 'feature/EPIC-12881-Self_reset_password' of https://gith…
daveotengo Mar 21, 2024
9ea3165
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo May 3, 2024
7c89ae7
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo May 29, 2024
99f7597
fix for sonarqube errors
daveotengo May 29, 2024
971f573
two sonarqube errors fixed
daveotengo May 29, 2024
3c824f5
cleared unnecessay comment
daveotengo May 29, 2024
3de56b1
security error sonarqube
daveotengo May 29, 2024
a25a037
Merge branch 'feature/EPIC-12881-Self_reset_password' of https://gith…
daveotengo May 29, 2024
1765ca4
fix for sonar qube tests coverage and duplicates
daveotengo Jun 4, 2024
6248f6f
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Jun 24, 2024
9aa2e5b
review issues identified fixed
daveotengo Jun 27, 2024
17c2c48
update after review
daveotengo Jul 22, 2024
003c8e1
add permitAll to isPasswordStrong to pass text case
daveotengo Jul 23, 2024
afb411a
validation update on change password form
daveotengo Jul 23, 2024
484bde5
update with copy password from alert functionality
daveotengo Jul 23, 2024
8ff346d
update of generate password with number check
daveotengo Jul 23, 2024
4c26528
clean up on build.gradle
daveotengo Jul 23, 2024
3c71a90
clean up after review
daveotengo Aug 20, 2024
5bcb629
clean up after review
daveotengo Aug 20, 2024
39f066e
taking of @Audited from UserRoleDto
daveotengo Aug 20, 2024
752fd92
Replacing genereatepassword with create pass
daveotengo Aug 20, 2024
a18eec4
clean up after review
daveotengo Aug 20, 2024
fc1fcb7
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Aug 20, 2024
b90d09e
fix lowercase error on password validator
daveotengo Aug 20, 2024
8100344
clean up after review
daveotengo Aug 20, 2024
a1c76ae
clean up after review
daveotengo Sep 19, 2024
0f9bda0
clean up after review
daveotengo Sep 19, 2024
8ddbb26
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Oct 23, 2024
836968e
update with upstream development branch
daveotengo Oct 23, 2024
6e93bc4
white spaces removed from existing code
daveotengo Oct 23, 2024
7dd5372
removing white spaces and redundant changes
daveotengo Oct 23, 2024
8a02305
removing white spaces and redundant changes on existing classes
daveotengo Oct 23, 2024
20e51a2
clear white spaces and redundant code after review
daveotengo Oct 23, 2024
0028314
trimming spaces after review
daveotengo Oct 23, 2024
57541fc
cleaning white space
daveotengo Oct 23, 2024
f176e59
trimming white spaces after review
daveotengo Oct 23, 2024
c47d032
trimmed spaces after review
daveotengo Oct 23, 2024
58c2a0f
trimmed white spaces
daveotengo Oct 23, 2024
3768d09
making feature configurable on both android and web
daveotengo Oct 24, 2024
7fa7d6b
reordering imports
daveotengo Oct 24, 2024
d63163b
reordering imports
daveotengo Oct 24, 2024
db570ed
handled keycloak use case with password reset on web
daveotengo Oct 25, 2024
9e0d17c
redirect to reset password update to occur on the same page
daveotengo Oct 26, 2024
359378d
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Oct 26, 2024
efef942
cleanup whitespace
daveotengo Oct 28, 2024
d350825
cleaned white space
daveotengo Oct 30, 2024
a2e5b05
feature property FeatureTypeProperty.AUTHENTICATION_PROVIDER added to…
daveotengo Oct 30, 2024
f46d5ac
updated with moble reset password using keycloak
daveotengo Nov 1, 2024
e393aad
taken off KeycloakClientConfig class
daveotengo Nov 1, 2024
a58443b
final clean up after update
daveotengo Nov 1, 2024
45dfae4
final clean up
daveotengo Nov 1, 2024
e3c456e
organizing imports
daveotengo Nov 1, 2024
ed2ce98
caption updated on mobile
daveotengo Nov 2, 2024
3da2860
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Nov 4, 2024
fb03f99
applying method guidlines
daveotengo Nov 6, 2024
6e629b5
added license headers to new classes
daveotengo Nov 11, 2024
76c6e6e
Merge branch 'development' of https://github.com/SORMAS-Foundation/SO…
daveotengo Nov 11, 2024
9f832ce
organizing imports
daveotengo Nov 11, 2024
01d8072
update of FeatureType import
daveotengo Nov 11, 2024
21f1125
spacing out lincence header
daveotengo Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ public enum FeatureType {
CASE_SURVEILANCE,
CONTACT_TRACING },
null,
ImmutableMap.of(FeatureTypeProperty.S2S_SHARING, Boolean.FALSE));
ImmutableMap.of(FeatureTypeProperty.S2S_SHARING, Boolean.FALSE)),
SELF_PASSWORD_RESET(true, false, null, null,null);

public static final FeatureType[] SURVEILLANCE_FEATURE_TYPES = {
FeatureType.CASE_SURVEILANCE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ public interface Captions {
String Configuration_LineListing = "Configuration.LineListing";
String Configuration_Outbreaks = "Configuration.Outbreaks";
String Configuration_PointsOfEntry = "Configuration.PointsOfEntry";
String confirmPassword = "confirmPassword";
String Contact = "Contact";
String Contact_additionalDetails = "Contact.additionalDetails";
String Contact_ageAndBirthDate = "Contact.ageAndBirthDate";
Expand Down Expand Up @@ -1170,6 +1171,7 @@ public interface Captions {
String countryArchivedCountries = "countryArchivedCountries";
String createSymptomJournalAccountButton = "createSymptomJournalAccountButton";
String creationDate = "creationDate";
String currentPassword = "currentPassword";
String CustomizableEnum_hasDetails = "CustomizableEnum.hasDetails";
String CustomizableEnum_hasDetails_short = "CustomizableEnum.hasDetails.short";
String CustomizableEnumValue_active = "CustomizableEnumValue.active";
Expand Down Expand Up @@ -2132,6 +2134,7 @@ public interface Captions {
String outbreakNormal = "outbreakNormal";
String outbreakOutbreak = "outbreakOutbreak";
String passportNumber = "passportNumber";
String passwordStrength = "passwordStrength";
String PathogenTest = "PathogenTest";
String PathogenTest_cqValue = "PathogenTest.cqValue";
String PathogenTest_ctValueE = "PathogenTest.ctValueE";
Expand Down Expand Up @@ -3050,6 +3053,7 @@ public interface Captions {
String treatmentOpenPrescription = "treatmentOpenPrescription";
String unassigned = "unassigned";
String unknown = "unknown";
String updatePassword = "updatePassword";
String User = "User";
String User_active = "User.active";
String User_address = "User.address";
Expand All @@ -3068,6 +3072,7 @@ public interface Captions {
String User_userName = "User.userName";
String User_userRoles = "User.userRoles";
String User_uuid = "User.uuid";
String userGeneratePassword = "userGeneratePassword";
String userMyUserId = "userMyUserId";
String userNewUser = "userNewUser";
String userResetPassword = "userResetPassword";
Expand Down
11 changes: 11 additions & 0 deletions sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ public interface Strings {
String confirmationVaccinationStatusUpdate = "confirmationVaccinationStatusUpdate";
String confirmExternalMessageCorrectionThrough = "confirmExternalMessageCorrectionThrough";
String confirmNetworkDiagramTooManyContacts = "confirmNetworkDiagramTooManyContacts";
String confirmPassword = "confirmPassword";
String currentPassword = "currentPassword";
String date = "date";
String day = "day";
String DefaultPassword_newPassword = "DefaultPassword.newPassword";
Expand Down Expand Up @@ -487,6 +489,7 @@ public interface Strings {
String headingcasesWithReferenceDefinitionFulfilled = "headingcasesWithReferenceDefinitionFulfilled";
String headingCaution = "headingCaution";
String headingChangeCaseDisease = "headingChangeCaseDisease";
String headingChangePassword = "headingChangePassword";
String headingChangePathogenTestResult = "headingChangePathogenTestResult";
String headingClinicalMeasurements = "headingClinicalMeasurements";
String headingClinicalVisitsDeleted = "headingClinicalVisitsDeleted";
Expand Down Expand Up @@ -873,6 +876,7 @@ public interface Strings {
String headingUpdatedPersonInformation = "headingUpdatedPersonInformation";
String headingUpdatedSampleInformation = "headingUpdatedSampleInformation";
String headingUpdatePassword = "headingUpdatePassword";
String headingUpdatePasswordFailed = "headingUpdatePasswordFailed";
String headingUpdatePersonContactDetails = "headingUpdatePersonContactDetails";
String headingUploadSuccess = "headingUploadSuccess";
String headingUserData = "headingUserData";
Expand Down Expand Up @@ -1433,6 +1437,8 @@ public interface Strings {
String messageMissingDateFilter = "messageMissingDateFilter";
String messageMissingEpiWeekFilter = "messageMissingEpiWeekFilter";
String messageMultipleSampleReports = "messageMultipleSampleReports";
String messageNewPasswordDoesNotMatchFailed = "messageNewPasswordDoesNotMatchFailed";
String messageNewPasswordFailed = "messageNewPasswordFailed";
String messageNoCaseFound = "messageNoCaseFound";
String messageNoCaseFoundToLinkImmunization = "messageNoCaseFoundToLinkImmunization";
String messageNoCasesSelected = "messageNoCasesSelected";
Expand Down Expand Up @@ -1470,6 +1476,8 @@ public interface Strings {
String messageNoVisitsSelected = "messageNoVisitsSelected";
String messageOtherDeleteReasonNotFilled = "messageOtherDeleteReasonNotFilled";
String messageOutbreakSaved = "messageOutbreakSaved";
String messagePasswordChange = "messagePasswordChange";
String messagePasswordFailed = "messagePasswordFailed";
String messagePasswordReset = "messagePasswordReset";
String messagePasswordResetEmailLink = "messagePasswordResetEmailLink";
String messagePathogenTestSaved = "messagePathogenTestSaved";
Expand Down Expand Up @@ -1581,6 +1589,7 @@ public interface Strings {
String messageVisitsDeleted = "messageVisitsDeleted";
String messageVisitsWithWrongStatusNotCancelled = "messageVisitsWithWrongStatusNotCancelled";
String messageVisitsWithWrongStatusNotSetToLost = "messageVisitsWithWrongStatusNotSetToLost";
String messageWrongCurrentPassword = "messageWrongCurrentPassword";
String messageWrongFileType = "messageWrongFileType";
String messageWrongTemplateFileType = "messageWrongTemplateFileType";
String min = "min";
Expand Down Expand Up @@ -1646,6 +1655,7 @@ public interface Strings {
String of = "of";
String on = "on";
String or = "or";
String passwordStrength = "passwordStrength";
String pathogenTestDeletedDuringLabMessageConversion = "pathogenTestDeletedDuringLabMessageConversion";
String pleaseSpecify = "pleaseSpecify";
String populationDataByArea = "populationDataByArea";
Expand Down Expand Up @@ -1813,6 +1823,7 @@ public interface Strings {
String unsavedChanges_warningMessage = "unsavedChanges.warningMessage";
String unsavedChanges_warningTitle = "unsavedChanges.warningTitle";
String until = "until";
String updatePassword = "updatePassword";
String uuidOf = "uuidOf";
String warningDashboardMapTooManyMarkers = "warningDashboardMapTooManyMarkers";
String warningNetworkDiagramTooManyContacts = "warningNetworkDiagramTooManyContacts";
Expand Down
41 changes: 41 additions & 0 deletions sormas-api/src/main/java/de/symeda/sormas/api/user/UserDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,17 @@ public class UserDto extends EntityDto {
public static final String HAS_CONSENTED_TO_GDPR = "hasConsentedToGdpr";
public static final String EXTERNAL_ID = "externalId";
public static final String JURISDICTION_LEVEL = "jurisdictionLevel";
public static final String PASSWORD = "currentPassword";
public static final String NEW_PASSWORD = "newPassword";
public static final String CONFIRM_PASSWORD = "confirmPassword";

private boolean active = true;

private String currentPassword;
private String newPassword;
private String confirmPassword;
private String passwordStrength;

@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
@AuditIncludeProperty
private String userName;
Expand Down Expand Up @@ -296,4 +304,37 @@ public JurisdictionLevel getJurisdictionLevel() {
public void setJurisdictionLevel(JurisdictionLevel jurisdictionLevel) {
this.jurisdictionLevel = jurisdictionLevel;
}

public void setCurrentPassword(String currentPassword) {
this.currentPassword = currentPassword;
}

public String getCurrentPassword() {
return currentPassword;
}

public void setNewPassword(String newPassword) {
this.newPassword = newPassword;
}

public String getNewPassword() {
return newPassword;
}

public void setConfirmPassword(String confirmPassword) {
this.confirmPassword = confirmPassword;
}

public String getConfirmPassword() {
return confirmPassword;
}

public void setPasswordStrength(String passwordStrength) {
this.passwordStrength = passwordStrength;
}

public String getPasswordStrength() {
return passwordStrength;
}

}
18 changes: 14 additions & 4 deletions sormas-api/src/main/java/de/symeda/sormas/api/user/UserFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,22 @@ public interface UserFacade {

String resetPassword(String uuid);

String updateUserPassword(String uuid, String newPassword);

boolean validateCurrentPassword(String password);

String checkPasswordStrength(String password);

boolean isPasswordWeak(String password);

String generatePassword();

List<UserDto> getAllAfter(Date date);

UserDto getByUserName(String userName);

/**
*
*
* @param regionRef
* reference of the region to be filtered for. When this region is null, it is not filtered in this regard.
* NOTE: some users don't have a region (often users with NATIONAL_USER role, for example). They will
Expand All @@ -79,7 +89,7 @@ public interface UserFacade {
long count(UserCriteria userCriteria);

/**
*
*
* @param district
* reference of the district to be filtered for. When this district is null, it is not filtered in this regard.
* NOTE: some users don't have a district (often users with NATIONAL_USER role, for example). They will
Expand All @@ -93,7 +103,7 @@ public interface UserFacade {
List<UserReferenceDto> getUserRefsByDistrict(DistrictReferenceDto district, Disease limitedDisease, UserRight... userRights);

/**
*
*
* @param district
* reference of the district to be filtered for. When this district is null, it is not filtered in this regard.
* NOTE: some users don't have a district (often users with NATIONAL_USER role, for example). They will
Expand Down Expand Up @@ -160,7 +170,7 @@ List<UserReferenceDto> getUserRefsByInfrastructure(
/**
* Retrieves the user rights of the user specified by the passed UUID, or those of the current user if no UUID is specified.
* Requesting the user rights of another user without the rights to view users and user roles results in an AccessDeniedException.
*
*
* @param userUuid
* The UUID of the user to request the user rights for
* @return A set containing the user rights associated to all user roles assigned to the user
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
* Copyright © 2016-2023 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package de.symeda.sormas.api.user;

import java.io.Serializable;

public class UserPasswordChangeDto implements Serializable {

private static final long serialVersionUID = 6269655187128160377L;

private String uuid;
private String newPassword;

public String getUuid() {
return uuid;
}

public void setUuid(String uuid) {
this.uuid = uuid;
}

public String getNewPassword() {
return newPassword;
}

public void setNewPassword(String newPassword) {
this.newPassword = newPassword;
}

public UserPasswordChangeDto(String uuid, String newPassword) {
this.uuid = uuid;
this.newPassword = newPassword;
}

public UserPasswordChangeDto() {
}
}
6 changes: 6 additions & 0 deletions sormas-api/src/main/resources/captions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2975,6 +2975,7 @@ TreatmentExport.caseName=Case name
userNewUser=New user
userMyUserId=My user ID
userResetPassword=Create new password
userGeneratePassword=Generate new password
userUpdatePasswordConfirmation=Really update password?
sync=Sync
syncUsers=Sync Users
Expand All @@ -3000,6 +3001,11 @@ User.district=District
User.community=Community
User.externalId=External ID
userRestrictDiseases=Restrict access to specific diseases
currentPassword=Enter Current Password
updatePassword=Enter new Password
confirmPassword=Confirm new Password
passwordStrength=Password strength

# Vaccination
vaccinationNewVaccination=New vaccination
vaccinationNoVaccinationsForPerson=There are no vaccinations for this person
Expand Down
11 changes: 11 additions & 0 deletions sormas-api/src/main/resources/strings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ headingLineListing = Line listing
headingLineListingImport = Line listing import
headingLocation = Location
headingLoginFailed = Login failed
headingUpdatePasswordFailed = Update password failed
headingMaternalHistory = Maternal history
headingMedicalInformation = Additional medical information
headingMissingDateFilter = Missing date filter
Expand Down Expand Up @@ -660,6 +661,10 @@ headingOutbreakIn = Outbreak in
headingPathogenTestsDeleted = Pathogen tests deleted
headingPaperFormDates = Reception dates of paper form
headingPersonData = Person data
currentPassword=Enter Current Password
updatePassword=Enter new Password
confirmPassword=Confirm new Password
passwordStrength=Password strength
headingPersonInformation = Person information
headingPersonOccupation = Occupation & education
headingPickEventGroup = Pick event group
Expand Down Expand Up @@ -711,6 +716,7 @@ headingReferCaseFromPointOfEntry = Refer case from point of entry
headingTreatments = Executed treatments
headingTreatmentsDeleted = Treatments deleted
headingUpdatePassword = Update password
headingChangePassword = Change password
headingUploadSuccess = Upload Successful
headingUserData = User data
headingVaccination = Vaccination
Expand Down Expand Up @@ -1315,6 +1321,9 @@ messageUploadSuccessful = Upload successful! You can now close this window.
messageIncompleteGpsCoordinates = GPS coordinates are incomplete
messageExternalMessagesAssigned = The assignee has been changed for all selected messages
messageLoginFailed = Please check your username and password and try again
messageNewPasswordDoesNotMatchFailed = New password and Confirm password does not match
messagePasswordFailed = Incorrect Password Please check your Password and try again
messageNewPasswordFailed = Password should contain some text, \n some numbers \n and should be more than 8 characters
messageMissingCases = Please generate some cases before generating contacts
messageMissingDateFilter = Please fill in both date filter fields
messageMissingEpiWeekFilter = Please fill in both epi week filter fields
Expand Down Expand Up @@ -1344,6 +1353,7 @@ messageNoUsersSelected = You have not selected any users
messageNoUserSelected = No user has been selected
messageOutbreakSaved = Outbreak information saved
messagePasswordReset = User's password was reset
messagePasswordChange = User's password was changed successfully
messagePasswordResetEmailLink = A link to reset the password was sent to the user's email
messagePathogenTestSaved = Pathogen test saved. The classification of its associated case was automatically changed to %s.
messagePathogenTestSavedShort = Pathogen test saved
Expand Down Expand Up @@ -1392,6 +1402,7 @@ messageVaccinationOutsideJurisdictionDeletionDenied = The vaccination outside us
messageVisitsDeleted = All selected eligible visits have been deleted
messageVisitsWithWrongStatusNotCancelled = Follow-up visits with CANCELLED or NO FOLLOW-UP status can not be cancelled
messageVisitsWithWrongStatusNotSetToLost = Follow-up visits with NO FOLLOW-UP status can not be set to lost
messageWrongCurrentPassword = Wrong Current Password
messageWrongFileType = Please provide a .csv file containing the data you want to import. It's recommended to use the import template file as a starting point.
messageWrongTemplateFileType=For %s, please provide a .%s file.
messageLineListingDisabled = Line listing has been disabled
Expand Down
8 changes: 8 additions & 0 deletions sormas-app/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<uses-feature android:name="android.hardware.location.gps" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:name=".SormasApplication"
Expand Down Expand Up @@ -490,6 +491,13 @@
<activity
android:name=".barcode.BarcodeActivity" />

<activity
android:name=".login.ChangePasswordActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@style/SormasTheme"
android:windowSoftInputMode="stateHidden" />

<receiver
android:name=".SormasBootstrap"
android:enabled="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,16 @@ public static void setUsernameAndPassword(String username, String password) {
}
}

public static void setNewPassword(String password) {

if (password == null)
throw new NullPointerException("password");
password = instance.encodeCredential(password, "Password");

instance.password = password;
DatabaseHelper.getConfigDao().createOrUpdate(new Config(KEY_PASSWORD, password));
}

public static void setPin(String pin) {
if (pin == null) {
throw new NullPointerException("pin");
Expand Down Expand Up @@ -621,7 +631,7 @@ public static void setAccessGranted(Boolean accessGranted) {
/**
* When no locale is set Locale.getDefault is set.
* (Actually not relevant, because the locale is always updated to the server's, so this is just a fallback).
*
*
* @return Will never be null.
*/
public static String getServerLocale() {
Expand Down
Loading
Loading