Executes the filter with given request and response objects.
Implements Filterable. Definition at line 57 of file class_PasswordChangeFilter.php. References BaseFrameworkSystem.$userInstance, Responseable.addFatalMessage(), Registry.getRegistry(), Requestable.getRequestElement(), BaseFrameworkSystem.partialStub(), and Requestable.requestIsValid(). 00057 { 00058 // Get both passwords 00059 $pass1 = $requestInstance->getRequestElement('pass1'); 00060 $pass2 = $requestInstance->getRequestElement('pass2'); 00061 00062 // Is only first email set? 00063 if ((!empty($pass1)) && (empty($pass2))) { 00064 // Request is invalid! 00065 $requestInstance->requestIsValid(false); 00066 00067 // Email 2 is empty 00068 $responseInstance->addFatalMessage('pass2_empty'); 00069 00070 // Stop processing here 00071 return false; 00072 } // END - if 00073 00074 // Is only second pass set? 00075 if ((empty($pass1)) && (!empty($pass2))) { 00076 // Request is invalid! 00077 $requestInstance->requestIsValid(false); 00078 00079 // Email 1 is empty 00080 $responseInstance->addFatalMessage('pass1_empty'); 00081 00082 // Stop processing here 00083 return false; 00084 } // END - if 00085 00086 // Are password and confirmation empty? 00087 if ((empty($pass1)) && (empty($pass2))) { 00088 // Don't change password here 00089 return true; 00090 } // END - if 00091 00092 // Do both match? 00093 if ($pass1 != $pass2) { 00094 // Request is invalid! 00095 $requestInstance->requestIsValid(false); 00096 00097 // Emails are mismatching 00098 $responseInstance->addFatalMessage('pass_mismatch'); 00099 00100 // Stop processing here 00101 return false; 00102 } // END - if 00103 00104 // Now, get a user instance for comparison 00105 $userInstance = Registry::getRegistry()->getInstance('user'); 00106 00107 // Update the "password" field 00108 $this->partialStub("Unfinished part."); 00109 }
Here is the call graph for this function:
![]()
|
1.5.6