Git Product home page Git Product logo

cpanel-whm-api's Introduction

cPanel/WHM API PHP

Manage your WHM/cPanel server with this PHP library. Simple to use. With this PHP library, you can manage your cPanel/WHM server.

License Build Status Code Coverage Code Quality Code Quality

Installation

You can install this library with composer.

composer require previewtechs/cpanel-whm-api:dev-master

Usage

<?php
require "vendor/autoload.php";

//Build WHM Client
use PreviewTechs\cPanelWHM\WHM\Accounts;
use PreviewTechs\cPanelWHM\WHMClient;

require "vendor/autoload.php";
$whmClient = new WHMClient("WHM_USERNAME","API_TOKEN", "yourwhmserver.com", 2087);
$accounts = new Accounts($whmClient);

var_dump($accounts->searchAccounts());

WHM Client

To access and use WHM related functionality you must need to build WHM client with configuration and credentials.

To configure your WHM client, you must provide your WHM username (you use to login into your WHM panel) and API Token.

If you have an API token you can use that if proper permissions are configured, otherwise you can create a new API token from your WHM.

Create API token from https://your-whm-server:2087/cpsessxxxxxx/scripts7/apitokens/home

Learn more about WHM API Token from https://documentation.cpanel.net/display/64Docs/Manage+API+Tokens

<?php
use PreviewTechs\cPanelWHM\WHMClient;
$whmClient = new WHMClient("WHM_USERNAME","API_TOKEN", "yourwhmserver.com", 2087);

Available Functionality

  • WHM
    • Accounts
      • searchAccounts (List of all accounts)
      • getDetails (Details of a specific account)
      • create (Create a new account)
      • availableFunctions (List of API functions available for current authenticated user)
      • userDomainDetails (Get a hosted domain details)
      • changeDiskSpaceQuota (Modify an user's disk space quota)
      • forcePasswordChange (Force user to change their password at their next login)
      • getDomains (List of domains exists in the server)
      • hasDigestAuth (Digest auth is enabled or disabled)
      • hasMyCnfInHomeDirectory (.my.cnf file exists in user's home directory or not)
      • limitBandwidth (Modify bandwidth limit)
      • getUsers (List of all users in server)
      • getLockedAccounts (List of all locked accounts)
      • getSuspendedAccounts (List of all suspended accounts)
      • createUserSession()
      • changePlan()

Contibutions

You are always welcome to contribute in this library.

See our list of contributors

Issues/Bug Reports

Please create an issue or report a bug in this GitHub repository and we will be happy to look into that.

License

The MIT License (MIT)

Copyright (c) 2014 Domain Reseller API

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

cpanel-whm-api's People

Contributors

shahariaazam avatar lukehebb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.