mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-06 08:55:08 +00:00
@@ -60,7 +60,7 @@ static const NSString *SPECIAL_SYMBOL_ALLOWED = @"%$&*(){}!?\\@#.,:;+=";
|
||||
return [NSArray arrayWithObjects: [NSString stringWithFormat:@"(.*[a-z].*){%i}", [count intValue]],
|
||||
[NSString stringWithFormat:@"(.*[A-Z].*){%i}", [count intValue]],
|
||||
[NSString stringWithFormat:@"(.*[0-9].*){%i}", [count intValue]],
|
||||
[NSString stringWithFormat:@"([%%%@].*){%i,}", SPECIAL_SYMBOL_ALLOWED, [count intValue]],
|
||||
[NSString stringWithFormat:@"([%@].*){%i,}", SPECIAL_SYMBOL_ALLOWED, [count intValue]],
|
||||
[NSString stringWithFormat:@".{%i,}", [count intValue]],
|
||||
nil];
|
||||
}
|
||||
@@ -99,25 +99,17 @@ static const NSString *SPECIAL_SYMBOL_ALLOWED = @"%$&*(){}!?\\@#.,:;+=";
|
||||
if ([[self policies] containsObject: label]) {
|
||||
NSNumber *value = [policy objectForKey:@"value"];
|
||||
if (0 < value) {
|
||||
if (![POLICY_MIN_SPECIAL_SYMBOLS isEqualToString: label]) {
|
||||
NSString *newLabel = [[translations objectForKey: label]
|
||||
stringByReplacingOccurrencesOfString: @"%{0}"
|
||||
withString: [value stringValue]];
|
||||
[userTranslatedPasswordPolicy addObject:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
newLabel, @"label",
|
||||
[policy objectForKey:@"regex"], @"regex",
|
||||
nil]];
|
||||
} else {
|
||||
NSString *newLabel = [[[[translations objectForKey: label]
|
||||
stringByReplacingOccurrencesOfString: @"%{0}"
|
||||
withString: [value stringValue]]
|
||||
stringByAppendingString: @" "]
|
||||
stringByAppendingString: SPECIAL_SYMBOL_ALLOWED];
|
||||
[userTranslatedPasswordPolicy addObject:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
newLabel, @"label",
|
||||
[policy objectForKey:@"regex"], @"regex",
|
||||
nil]];
|
||||
NSString *newLabel = [[translations objectForKey: label]
|
||||
stringByReplacingOccurrencesOfString: @"%{0}"
|
||||
withString: [value stringValue]];
|
||||
if ([POLICY_MIN_SPECIAL_SYMBOLS isEqualToString: label]) {
|
||||
newLabel = [[newLabel stringByAppendingString: @" "]
|
||||
stringByAppendingString: SPECIAL_SYMBOL_ALLOWED];
|
||||
}
|
||||
[userTranslatedPasswordPolicy addObject:[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
newLabel, @"label",
|
||||
[policy objectForKey:@"regex"], @"regex",
|
||||
nil]];
|
||||
} else {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user