Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation



integrationblogcta.jpg

SourceIPCheck Module Documentation

This module allows you to access a 2-step source IP authentication system.

The functions within this module may or may not be governed by a feature list. The required feature list may vary from function to function, to review a total list of the available features sets on a cPanel server, please see "Feature Manager" in WHM.

SourceIPCheck::addip

API Version: 2 - Click here for documentation
Description: Add an IP address to your list of trusted IP's.
Parameters:  
  ip (string)
  The full IPv4 address you wish to add to the white list. (e.g. 192.168.0.1).
Returns:  
 
<data>
  <status> A boolean value that indicates success or failure. '1' indicates that the IP address was added successfully. '0' indicates that the IP address was not added.</status>
  <ip> The IP address you attempted to add. (e.g. 192.168.0.1)</ip>
  <error> A string value that contains 'UNDEF' if the function completes successfully. If the function fails, this value contains a relevant error message.</error>
</data>

SourceIPCheck::resetsecquestions

API Version: 2 - Click here for documentation
Description: Remove security questions and answers for a specific cPanel or webmail user. After this function is run, cPanel prompts the user to redefine security questions on the next login attempt.
Parameters:  
  account (string (optional))
  The account for which you wish to reset security questions. If this parameter is not provided, your cPanel account is used.
Returns:  
 
<data>
  <status> A string value that is blank if the function completes successfully. If the function fails, this value contains a relevant error message.</status>
</data>

SourceIPCheck::savesecquestions

API Version: 2 - Click here for documentation
Description: Save a set of security questions and answers. These questions are used when users attempt to log into cPanel or webmail from an untrusted IP address. Trusted IP addresses are added via SourceIPCheck::addip.
Parameters:  
  account (string)
  The account name for which you wish to add the question and answer. You must be logged in as a cPanel user. Root and Reseller accounts will not work.
  q*answer (string)
  The answer that will correspond to the question. Each answer you wish to add will correspond to the question of the same increment. Increments must begin with 1 and will replace the asterisk (*) in the parameter. (e.g. 'q1answer', 'q2answer', 'q3answer', etc.) You must specify 4 questions and 4 answers. This string value must be greater than 2 bytes and less than 128 bytes.
  q*ques (string)
  The question that will correspond to the answer. Each question you wish to add will correspond to the answer of the same increment. Increments must begin with 1 and will replace the asterisk (*) in the parameter. (e.g. 'q1ques', 'q2ques', 'q3ques', etc.) You must specify 4 questions and 4 answers. This string value must be greater than 2 bytes and less than 128 bytes.
Returns:  
 
<data>
  <status> A boolean value that indicates success or failure. '1' indicates that the questions and answers were added successfully. '0' indicates that there was an error. Check the cPanel error log for possible error messages.</status>
</data>

SourceIPCheck::loadsecquestions

API Version: 2 - Click here for documentation
Description: Load security questions posed to cPanel users when they attempt to log in from an untrusted IP address. You can add trusted IP addresses using SourceIPCheck::addip.
Parameters:  
  account (string)
  The name of the cPanel account or webmail user whose questions you wish to retrieve. You must be authenticated as the user contained in this parameter. Root or reseller will not work.
  q* (string)
  The number of the question you wish to retrieve. Replace the asterisk (*) in this parameter with the desired number. (e.g. 'q1' or 'q4').
  q*answer (string (optional))
  The answer that corresponds to the question you wish to retrieve. Replace the asterisk (*) in this parameter with the desired answer number. (e.g. 'q1answer' or 'q4answer').
Returns:  
 
<data>
  <question> A string value that contains the security question.</question>
  <answer> An undefined value if 'q*answer' is not specified. If 'q*answer' is specified, this string value will contain the answer you specified.</answer>
  <options> Returns a list of hashes, 1 for each possible question. (currently always 7)
    <selectedtxt> An undefined value unless this output variable was designated by the value of 'q*'.</selectedtxt>
    <questionnum> An integer value that contains the question number.</questionnum>
  </options>
  <questionnum> An integer value that contains the question number.</questionnum>
</data>

SourceIPCheck::delip

API Version: 2 - Click here for documentation
Description: Remove an IP address from your list of trusted IP addresses.
Parameters:  
  ip (string)
  The IPv4 address to remove from the white list. (e.g. 192.168.0.1).
Returns:  
 
<data>
  <error> A string value that contains 'UNDEF' if the function completes successfully. If the function fails, this value contains a relevant error message.</error>
  <ip> The IP address you attempted to remove.</ip>
  <status> A boolean value that indicates success or failure. '1' indicates that the IP address was removed successfully. '0' indicates that the IP address was not removed.</status>
</data>

SourceIPCheck::listips

API Version: 2 - Click here for documentation
Description: List trusted IP addresses created with SourceIPCheck::addip. Connections from the resulting IP addresses and IP address blocks only require normal password authentication. Connections from other IP addresses require security questions that were configured with SourceIPCheck::savesecquestions.
Parameters:  
  account (string)
  The account name corresponding to the IP addresses you wish to retrieve. This parameter can also accept an email account.
Returns:  
 
<data>
  <ip> A string value that contains a trusted IP address. (e.g. 192.168.0.2)</ip>
</data>

Topic revision: r2 - 27 Mar 2012 - 16:36:48 - Main.JenniferDoubrava