Jump to content

AddClient API validation is not working correctly


Recommended Posts

Hey,

 

After upgrading our WHMCS from 5.0.5 to 5.3.3, we are getting new clients on our site without e-mails. This is also an issue after upgrading to 5.3.5

 

It looks like AddClient API doesn't validate user data on sign up anymore. We are also seeing invalid e-mails and e-mails already used by other clients on the site.

 

For API calls, we are using our custom API method on top of AddClient LocalAPI call:

 

try {
   $vars = get_defined_vars();

   // figure out the required parameters
   $action = array();
   $params = array();
   $adminuser = false;
   if (isset($vars['cmd'])) {
       //Local API mode
       $action = $vars['cmd'];
       $params = $vars['apivalues1'];
       $adminuser = $vars['adminuser'];
   } else {
       //Post CURL mode
       $action = $vars['_POST']['action'];
       $params = $vars['_POST'];

       // params not needed
       unset($params['username']);
       unset($params['password']);
       unset($params['action']);
   }

   // add new user
   $apiresults = $api_client_res = LocalAPI("addclient", $params, $adminuser);

} catch (Exception $e) {
   $apiresults = array(
       "result" => "error",
       "message" => $e->getMessage(),
   );
}  

 

Also, when adding client without e-mail address, I get response "Email or Password Invalid" (correct should be "You did not enter your email address"). The user is still added to the system with empty e-mail address.

Edited by Infopro
Link to duplicate thread removed
Link to comment
Share on other sites

I got response from very helpful WHMCS support, that this issue appears only on certain occasion:

 

When the Client Email address field is locked in Setup -> General Settings -> Other, this issue occurs. I've opened case #3497 with our developers in order to have this resolved for future releases.

 

Hopefully this will be fixed soon.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated