Class Customer ignores password policy

I've noticed password policy is ignored if you set it through the Customer class. 


Sett password policy to something like this: 

Save a customer with an 'invalid' password: 

Customer c;
c.setValue("password", "abc");;

This works, and i just assume the customer class doesnt really care what your policy is, it just saves it 'as is'. 

I've been scouring the SDK for a method/something that could validate the password before i input it but no luck..  am i barking up all the wrong trees or do i have to do this manually? 

I looked into the password_rules table and created a short script to check what is in there: 

#setLanguageLevel 3;

SearchEngine se;
se.addFields("password_rules", "id,flags,min_characters,min_numbers,min_lowercase,min_uppercase,min_special");
  printLine("id: " + se.getField(0) + ", flags: " + se.getField(1) + ", minChar: " + se.getField(2) + ", minNum: " + se.getField(3) + ", minLc: " + se.getField(4) + ", minUc: " + se.getField(5));

Looks like id = 2 is the policy for customer passwords: 

Before i start working on a function to validate the password according to these rules myself I want to make sure there is nothing standard I can use.. It only needs to return true/false so nothing fancy and it seems weird that CRMscripts ignores it. 


Noch keine Antworten!