function CSAuth($username, $password) { $wsdl = 'https://internal.auth.com/Service.asmx?wsdl'; $dest = 'https://interal.auth.com/Service.asmx'; $single_md5_pass = md5($password); try { $client = new SoapClient($wsdl, array('trace' => 1)); $client->__setLocation($dest); $loginparams = array('username' => $username, 'password' => $password); $result = $client->AuthCS($loginparams); switch ($result->AuthCSResult) { case 'SUCCESS': $this->cleanConvertData($single_md5_pass); $this->return_code = $result->AuthCSResult; return TRUE; case 'WRONG_AUTH': $this->return_code = $result->AuthCSResult; return FALSE; default: $this->return_code = 'FAIL'; return FALSE; } } catch (Exception $ex) { //handle error $this->return_code = 'FAIL'; return FALSE; } }