From ead2472bb6b16995637e83e44aceed16af910a55 Mon Sep 17 00:00:00 2001
From: Andrew Hoffmann <andrew.hoffmann@wisc.edu>
Date: Tue, 28 Apr 2015 14:39:49 -0500
Subject: [PATCH] Updated the changePassword documentation to indicate that it
 does not check for complexity requirements. Added a check for the 400 return
 value, even though it is not documented in the WSDL. (I encountered it in the
 past.)

---
 src/main/edu/wisc/doit/RpcNetidClient.php     | 8 ++++++--
 src/main/edu/wisc/doit/RpcNetidClientSoap.php | 4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/main/edu/wisc/doit/RpcNetidClient.php b/src/main/edu/wisc/doit/RpcNetidClient.php
index dd93326..5eb63a4 100644
--- a/src/main/edu/wisc/doit/RpcNetidClient.php
+++ b/src/main/edu/wisc/doit/RpcNetidClient.php
@@ -41,10 +41,14 @@ interface RpcNetidClient {
 	function credentialCheck ( $uid, \DateTime $birthdate, $wiscard = null  );
 
 	/**
-	 * Checks that the password meets require criteria and then changes password if it meets criteria
+	 * Changes the password for a given NetID
+	 * 
+	 * <p><b>WARNING READ THIS IMPORTANT DO NOT SKIP:</b> This method DOES NOT check if the password
+	 * meets complexity requirements. You MUST check the complexity using {@link RpcNetidClient::passwordChoicePolicyCheck}</p>
+	 * 
 	 * @param string $uid  the uid of the user to search for (typically the NetID)
 	 * @param string $password  the password to be checked for policy adherence and replace current password
-	 * @return bool  True if password was changed successfully, false if password did not meet password criteria
+	 * @return bool  true if password was changed successfully, false otherwise
 	 * @throws edu\wisc\doit\RpcNetidClientSoapException if unexpected response code from SOAP service
 	 */
 	function changePassword ( $uid, $password );
diff --git a/src/main/edu/wisc/doit/RpcNetidClientSoap.php b/src/main/edu/wisc/doit/RpcNetidClientSoap.php
index 1b4708e..f8de806 100644
--- a/src/main/edu/wisc/doit/RpcNetidClientSoap.php
+++ b/src/main/edu/wisc/doit/RpcNetidClientSoap.php
@@ -208,12 +208,12 @@ class RpcNetidClientSoap implements RpcNetidClient {
 			return true;
 		}
 		
-		if( $result->result === 401 ){
+		if( $result->result === 400 or $result->result === 401 ){
 			return false;
 		}
 			
 		throw new RpcNetidClientSoapException("Unexpected status code: {$result->result}",
-		RpcNetidClientSoapException::UNEXPECTED_STATUS_CODE );
+			RpcNetidClientSoapException::UNEXPECTED_STATUS_CODE );
 
 	}
 			
-- 
GitLab