Child pages
  • cPanel API 2 Functions - Logaholic::adduser

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt

This function adds a user to the Logaholic statistics program.

Include Page
LIB:_cPanelAPI2NoEquivalent
LIB:_cPanelAPI2NoEquivalent

Include Page
LIB:_LogaholicRemovedWarning
LIB:_LogaholicRemovedWarning

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleWHM API (JSON)
Code Block
languagetext
https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Logaholic&cpanel_jsonapi_func=adduser&username=user&password=12345luggage

Include Page
LIB:_CallFromWHMAPILink
LIB:_CallFromWHMAPILink

Expand
titleLiveAPI PHP Class
Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Add Logaholic user "example" with password "12345luggage"
$add_logaholicuser = $cpanel->api2(
    'Logaholic', 'adduser', 
    array(
        'username'       => 'example', 
        'newdomain'      => '12345luggage', 
    ) 
);

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

 

Expand
titleLiveAPI Perl Module
Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Add Logaholic user "example" with password "12345luggage"
my $add_logaholicuser = $cpliveapi->api2(
    'Logaholic', 'adduser',
    { 
        'username'      => 'example', 
        'password'      => '12345luggage', 
    }
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 

Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelAPI2cPanelTagsWarning
LIB:_cPanelAPI2cPanelTagsWarning

Expand
titleCommand Line
Warning
titleImportant:

Because we removed this function before we introduced this functionality, you cannot call this function via the command line. 

Expand
titleOutput (JSON)
Code Block
linenumberstrue
{
  "cpanelresult": {
    "apiversion": 2,
    "func": "adduser",
    "data": [
      {
        "reason": "The Logaholic user "example" was successfully created.",
        "result": 1
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Logaholic"
  }
}

Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote

   

Parameters

ReturnTypeDescriptionPossible valuesExample
usernamestring

Required

The Logaholic username.

A valid string.example
passwordstringRequired

The Logaholic password.

A valid string.12345luggage

Returns

ReturnTypeDescriptionPossible valuesExample
reason string

The status message from the function.

  • The Logaholic user "example" was successfully created.
  • “example” does not own the user “user”.
The Logaholic user "example" was successfully created.
resultBoolean Whether the function succeeded.
  • 1 — The function succeeded.
  • 0 — The function failed.
 1
reasonstring

A reason for failure.

Note
titleNote:

This function only returns a reason value if it failed.

A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1