<?php //header("Content-type: text/xml"); require_once '../include/common.inc.php'; require_once '../PHPMailer_5.2.4/class.phpmailer.php'; // decide what action to take depending on the client request $strResponseMessage = "Request Undefined"; $strResponseData = ""; $strNewPassword = ""; if (isset($_REQUEST['action'])) { switch ($_REQUEST['action']) { case "forgot-password": // handles the forgot password request if (isset($_REQUEST['email'])) { if (resetPasswordDB($_REQUEST['email'], $strNewPassword, $strResponseMessage, $strResponseData)) { sendEmailPasswordChanged($_REQUEST['email'], $strNewPassword, $strResponseMessage, $strResponseData); } if ($strResponseMessage != 'Success') { $strResponseData .= "<br>Please contact us to resolve this matter"; } } break; default: $strResponseMessage = "Unknown request"; } // switch } $strResponse = "<message>{$strResponseMessage}</message>"; $strResponse .= "<data><![CDATA[{$strResponseData}]]></data>"; $strPackage = "<package>{$strResponse}</package>"; echo $strPackage;
//header("Content-type: text/xml"); require_once '../include/lib/common.inc.php'; require_once '../PHPMailer_5.2.4/class.phpmailer.php'; // decide what action to take depending on the client request $strResponseStatus = "Failure"; $strResponseMessage = "Request Undefined"; $strResponseData = ""; $actionTaken = isset($_REQUEST['action']) ? $_REQUEST['action'] : ""; $email = isset($_REQUEST['email']) ? $_REQUEST['email'] : ""; $strNewPassword = ""; switch ($actionTaken) { case "forgot-password": // handles the forgot password request $isSuccessful = resetPasswordDB($email, $strNewPassword, $strResponseMessage); $isSuccessful = $isSuccessful ? sendEmailPasswordChanged($email, $strNewPassword, $strResponseMessage) : false; $strResponseStatus = $isSuccessful ? "Success" : "Failure"; break; default: $strResponseMessage = "Unknown request"; } // switch $strResponse = "<status>{$strResponseStatus}</status>"; $strResponse .= "<message><![CDATA[{$strResponseMessage}]]></message>"; $strResponse .= "<data><![CDATA[{$strResponseData}]]></data>"; $strPackage = "<package>{$strResponse}</package>"; echo $strPackage; // -------------------------------------------------------------------------------------------------------------- // getDBConnection // -------------------------------------------------------------------------------------------------------------- function getDBConnection(&$strResponseMessage)