• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Using the GetAccountByName method

E

eric4gh

Guest
Hi. I am building an API between WHMcs and Sitebuilder. I have automatic user/site creation working. Now I wish to delete a certain account. However, I am receiving this error when using the GetAccountByName method.

Listed below this error message is the code where I am using that method.:

Type: SoapFault
Message: Generic error. Internal Sitebuilder error. Base_SyntaxException: PHP Notice : Undefined property: stdClass::$username file: /usr/local/sitebuilder/include/SB/Actions/Admin/User/GetAccount.php line: 60 code: 8
Fault code: ERROR_GENERIC
Details: Internal Sitebuilder error. Base_SyntaxException: PHP Notice : Undefined property: stdClass::$username file: /usr/local/sitebuilder/include/SB/Actions/Admin/User/GetAccount.php line: 60 code: 8
File: /home/goodhost/public_html/billing3/includes/actionhooks.php
Line: 340
Code: 0

Code the generates this error:

$struct->username = $vars["username"]; // retrieves user name from WHMcs system

print $vars["username"];
print "<p>";
print_r($struct->username);

$accountService = $this->_getWebService('/AccountWebService.asmx?WSDL');

// first we must search to see if the username exists as a site in sitebuilder.

$result = $accountService->GetAccountByName($struct->username);

// then if there is a match, delete that site

$result2 = $accountService->DeleteAccount(new SoapVar($result, SOAP_ENC_OBJECT));

~~~

I have also tried using the method by supplying a variable and the hardcoded string "sitetest1" for example, and the same error message above is generated.

I have also passed in an account object

$struct->username = $vars["username"];

$result = $accountService->GetAccountByName(new SoapVar($struct, SOAP_ENC_OBJECT));

but the same error is generated.

Can anyone tell me how I should be using the GetAccountByName API method to process correctly?

Thank you.
 

Similar threads

N
Replies
3
Views
3K
NicolasR
N
J
Replies
5
Views
4K
holykim66
H
N
Replies
0
Views
2K
Nate Custer
N
Back
Top