Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
89876509
Commit
89876509
authored
Nov 05, 2018
by
Nilu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow special characters in password
parent
875cd680
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
PerformaPasswordValidator.java
cmsWebApp/src/performa/utils/PerformaPasswordValidator.java
+31
-0
GeneralConfigOverrides.xml
config/GeneralConfigOverrides.xml
+1
-2
No files found.
cmsWebApp/src/performa/utils/PerformaPasswordValidator.java
0 → 100644
View file @
89876509
package
performa
.
utils
;
import
java.util.Map
;
import
java.util.regex.*
;
import
oneit.objstore.*
;
import
oneit.objstore.parser.BusinessObjectParser
;
import
oneit.objstore.validator.*
;
import
oneit.security.SecUser
;
public
class
PerformaPasswordValidator
extends
AttributeValidator
{
@Override
public
boolean
validate
(
Map
attribMetadata
,
BaseBusinessClass
obj
,
String
fieldName
,
Object
newValue
)
throws
Exception
{
String
newPwd
=
(
String
)
newValue
;
Pattern
pattern
=
Pattern
.
compile
(
"([a-zA-Z.@_]+\\d+[a-zA-Z0-9.@_]*)"
);
Matcher
matcher
=
pattern
.
matcher
(
newPwd
);
BusinessObjectParser
.
assertFieldCondition
(
matcher
.
matches
(),
obj
,
SecUser
.
FIELD_Password
,
"PasswordPatternNotMatched"
);
// Password must at least 8 characters
BusinessObjectParser
.
assertFieldCondition
(
newPwd
.
length
()
>=
8
,
obj
,
SecUser
.
FIELD_Password
,
"PasswordLengthTooShort"
);
// Password must be less than or equal 16 characters
BusinessObjectParser
.
assertFieldCondition
(
newPwd
.
length
()
<=
16
,
obj
,
SecUser
.
FIELD_Password
,
"PasswordLengthTooLong"
);
return
true
;
}
}
config/GeneralConfigOverrides.xml
View file @
89876509
...
...
@@ -17,11 +17,10 @@
<PARAM
name=
"DBEnumStaticOverride:oneit.business.content.ArticleTemplate"
factory=
"Named"
nodename=
"DBEnumStaticOverride:ArticleTemplates"
/>
</NODE>
<NODE
name=
"CONFIG.ORMVALIDATOR"
factory=
"SystemConfiguration"
>
<PARENT
factory=
"Named"
nodename=
"CONFIG.ORMVALIDATOR:parent"
/>
<PARAM
name=
"PasswordValidator"
factory=
"Participant"
class=
"performa.utils.PerformaPasswordValidator"
errorType=
"invalidPassword"
/>
<!-- Validator for InvoiceStatus
<PARAM name="InvoiceStatusValidator" factory="Participant" class="oneit.cashflow.orm.InvoiceStatusValidator" errorType="illegalStatus"/>
-->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment