-
Notifications
You must be signed in to change notification settings - Fork 5
ValidateLogin()
Through this explanation we assume that you have using WHMCS_API;
on the begining of the file
And the API()
class initialized as _api
If needed check the Getting Started page
Prototype: public ValidateLogin.ValidateLogin ValidateLogin(string Email, string Password)
Input:
- Email: The email of the user to validate (required)
- Password: The password of the user to validate in plaintext (required)
Output: ValidateLogin
Model
Exception: "An API Error has Ocurred" witch contains an inner exception with further explanation of the error
To call it just use ValidateLogin.ValidateLogin login = _api.ValidateLogin("useremail@example.com", "plaintextpassword");
The GetClientDetails model is inside it's own namespace (more info)
You can store the UserID and PasswordHash in the Session Session["uid"]
and Session["upw"]
View all details about ValidateLogin Model
WHMCS API Reference: https://developers.whmcs.com/api-reference/validatelogin/
using WHMCS_API;
namespace YourApp
{
class YourClass
{
public void YourFunction()
{
API _api = new API("username", "password", "accesskey", "url");
ValidateLogin.ValidateLogin login = _api.ValidateLogin("useremail@example.com", "plaintextpassword");
//Let's keep the user logged in
Session["uid"] = login.UserID;
Session["upw"] = login.PasswordHash;
Console.WriteLine("UserID: {0}", login.UserID);
}
}
}
PCDev Open Source Development Team 2017