PHP examples use the PHP Client Library with SimpleXML
Description
object check_customer_login
( string $username, string $password, int $channel )
Parameters
$username
Username, perhaps entered by the customer in a login form
$password
Password, perhaps entered by the customer in a login form
$channel
ID number for the channel the customer belongs to
Example
// Set the channel ID
$channel = 3;
// Username, perhaps entered by the customer in a login form
$username = "jbloggs123"
// Password, perhaps entered by the customer in a login form
$password = "password"
// Query the TourCMS API
$result = $tourcms->check_customer_login($username, $password, $channel);
// Check the result, will be "OK" if login details are correct
if($result->error = "OK") {
// Correct details, we can now get the customer ID from the XML
$customer_id = $result->customer_id;
// Print a success message
print "Login details are correct, the customer ID is ".$customer_id;
} else {
// There has been a problem
print "Sorry, unable to log you in";
}
Login details are correct, the customer ID is 12345
C# examples use the .Net Client Library
Overload list
XmlDocument CheckCustomerLogin
( string username, string password, int channelId )
Parameters
username
Username, perhaps entered by the customer in a login form
password
Password, perhaps entered by the customer in a login form
channelId
ID number for the channel the customer belongs to
Example
// Set the channel ID
int channelId = 3;
// Username, perhaps entered by the customer in a login form
string username = "jbloggs123"
// Password, perhaps entered by the customer in a login form
string pass = "password"
// Query the TourCMS API
XmlDocument doc = myTourCMS.CheckCustomerLogin(username, pass, channelId);
// Check the status
string status = doc.SelectSingleNode("//error").InnerText;
if ( status == "OK" )
{
// Get the customer_id
string cId = doc.SelectSingleNode("//customer/customer_id").InnerText;
Console.WriteLine("Login details are correct, the customer ID is " + cId);
} else {
// There has been a problem
Console.WriteLine("Sorry, unable to log you in");
}
Login details are correct, the customer ID is 12345
VB examples use the .Net Client Library
Overload list
XmlDocument CheckCustomerLogin
( String username, String password, Integer channelId )
Parameters
username
Username, perhaps entered by the customer in a login form
password
Password, perhaps entered by the customer in a login form
channelId
ID number for the channel the customer belongs to
Example
' Set the channel ID
Dim channelId As Integer = 3
' Username, perhaps entered by the customer in a login form
Dim username As String = "jbloggs123"
' Password, perhaps entered by the customer in a login form
Dim pass As String = "password"
' Query the TourCMS API
Dim doc As XmlDocument = myTourCMS.CheckCustomerLogin(username, pass, channelId)
' Check the status
Dim status As String = doc.SelectSingleNode("//error").InnerText
If status = "OK" Then
' Get the customer_id
Dim cId As String = doc.SelectSingleNode("//customer/customer_id").InnerText
Console.WriteLine("Login details are correct, the customer ID is " + cId)
Else
' There has been a problem
Console.WriteLine("Sorry, unable to log you in")
End If
Login details are correct, the customer ID is 12345