1

TL;DR: how do I change the minimum password length requirement for customers created via the SOAP v2 API?

I need to change the minimum password length requirement for customers created via the SOAP V2 API but can't find which file(s) I need to edit. I've tried using grep to check for occurrences of the password length being checked but only found the front-end code for that. It seems like there is some mapping between the SOAP layer and the model layer I'm not aware of, any pointers would be appreciated.

EDIT: So I realised that I was using grep with the case sensitive mode, which was excluding everything, since all the soap files are named Soap.php. Still looking, though.

Marius
199k55 gold badges431 silver badges837 bronze badges
asked Nov 20, 2013 at 23:38

1 Answer 1

3

Customer creation

I assume you're using the standard customerCustomerCreate() SOAP v2 Method.

This method is referenced in app/code/core/Mage/Customer/etc/wsdl.xml (grep for: "customerCustomerCreate"). The method create is defined in Model/Customer/Api.php where you can see that the customer/customer Model is called:

class Mage_Customer_Model_Customer_Api extends Mage_Customer_Model_Api_Resource
{
 ....
/**
 * Create new customer
 *
 * @param array $customerData
 * @return int
 */
public function create($customerData)
{
 $customerData = $this->_prepareData($customerData);
 try {
 $customer = Mage::getModel('customer/customer')
 ->setData($customerData)
 ->save();
 } catch (Mage_Core_Exception $e) {
 $this->_fault('data_invalid', $e->getMessage());
 }
 return $customer->getId();
}
... 
}

The Mage_Customer_Model_Customer_Api_V2 class extends Mage_Customer_Model_Customer_Api. So you'll need a bit of effort just to change it for the created customers via SOAP.

The password length is hardcoded in Mage_Customer_Model_Customer_Attribute_Backend_Password (see: $len = Mage::helper('core/string')->strlen($password); and if ($len < 6) ).

answered Nov 27, 2013 at 19:44
1
  • 2
    As a note to any travellers showing up from google, we also needed to modify the frontend-code so that it matched the changes made where you suggested. Thanks! Commented Nov 28, 2013 at 4:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.