Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    1
    cPanel/Enkompass Access Level

    Website Owner

    Default verifying cpanel is connectable via API

    i am just trying to run a check to make sure that the credentials used for cpanel work, however, my code is not working at all. it seems that i get the message "connected to cpanel" even if i am using credentials that i know are not working.

    heres the code

    Code:
        $cpCfg = array(
            'cpanel'=>array(
                'service'=>array(
                    'cpanel' => array(
                        'host' => $_POST['cpanel_host'],
                        'user' => $_POST['cpanel_username'],
                        'password' => $_POST['cpanel_password'],
                    )
                )
            )
        );
        
        if ($cp = Cpanel_PublicAPI::getInstance($cpCfg))
        {
            echo 'connected to cpanel';
        }
        else
        {
            echo 'failed to connect to cpanel';
        }
    like i said, no matter what i enter in the form, i get the same result - "connected to cpanel"

  2. #2
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    525

    Default Re: verifying cpanel is connectable via API

    Hi kevin77,

    No authentication attempt is performed until you make an API request. The return value from getInstance is simply an object that will allow you to make said queries.

    Regards,
    -DavidN
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Request

Similar Threads & Tags
Similar threads

  1. Verifying VPS
    By acer2k in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 03-24-2006, 11:17 AM
  2. verifying information about network tools
    By vodka in forum New User Questions
    Replies: 2
    Last Post: 01-23-2006, 12:29 PM
  3. Verifying RHEL 3 version
    By te2586 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-05-2005, 04:38 PM
  4. Verifying installation error
    By GetWiredNet in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 12-10-2004, 09:57 PM
  5. Verifying proper Tomcat 4.1.2 installation
    By RisingHost in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 02-12-2004, 06:20 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube