From c52fd7d13c019745b3c32adbe3fe089ab993ebf0 Mon Sep 17 00:00:00 2001 From: BeenaShetty Date: Thu, 14 Jun 2012 09:44:27 +0530 Subject: [PATCH 1/3] Changed the name of user parameter to "cpanel_jsonapi_user" because it creates a problem for the function related to cpanel which contain user as parameter --- lib/panelbeater/whm/commands.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/panelbeater/whm/commands.rb b/lib/panelbeater/whm/commands.rb index 804bcf3..525b12c 100644 --- a/lib/panelbeater/whm/commands.rb +++ b/lib/panelbeater/whm/commands.rb @@ -76,7 +76,7 @@ def changepackage(user, package) def cpanel(user, options={}) default_options = { :apiversion => 2 } - all_options = default_options.merge!(options).merge!(:user => user) + all_options = default_options.merge!(options).merge!(:cpanel_jsonapi_user => user) do_request 'cpanel', all_options end From 1bf0a450f7bd8848c5cf758f3606d590b92b1f2d Mon Sep 17 00:00:00 2001 From: BeenaShetty Date: Wed, 3 Oct 2012 17:42:27 +0530 Subject: [PATCH 2/3] Update Readme.markdown --- Readme.markdown | 74 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/Readme.markdown b/Readme.markdown index 64bd23a..67659e1 100644 --- a/Readme.markdown +++ b/Readme.markdown @@ -1 +1,73 @@ -#cPanel gem \ No newline at end of file + WHM + WebHost Manager (WHM) is a web-based tool used by server administrators and resellers to manage hosting accounts on a web server. + WHM listens on ports 2086 and 2087 by default. + + cPanel + cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, resellers, and end-user website owners to control the various aspects of website and server administration through a standard web browser. + cPanel is commonly accessed on port 2082, with an SSL-secured server operating on port 2083. + + Use cpanel and Whm API's in Rails + Panelbeater gem is used for communicating with the cPanel and WHM API's. + Ruby library for the WHM & cPanel API. + Github path https://github.com/BeenaShetty/panelbeater + + Install + require 'panelbeater' + In the model where you want to use. + + + Usage +Create a server object and connect to WHM using your host and hash: + + server = Panelbeater::Whm::Commands.new( + :url => url, + :api_key => secure_hash, + :port => port, + :user => username + ) + +Now,you can access the modules of WHM by calling server. + + +Account Example + 1. Creating a new account + It requires only a username, domain + + result = server.createacct( + :username => 'newuser', + :domain => 'newuser.com' + ) + +Output + +createaact => {result => { :status => boolean, :statusmsg => "" }} + +status (boolean) — Status of the operation. + + 1 — success. + 0 — failure. + +statusmsg (string) — Status or error message. + + + + Reference : - http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/CreateAccount + +2. Delete account + It requires only user + + result = server.removeacct(:user => 'newuser') + +Output + + removeacct => {result => { :status => boolean, :statusmsg => "" }} + +status (boolean) — Status of the operation. + + 1 — success. + 0 — failure. + +statusmsg (string) — Message about the status of the operation. + + +Reference :- http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/TerminateAccount \ No newline at end of file From 6c28fc389999898df0e80a2b95047375af71dcdd Mon Sep 17 00:00:00 2001 From: BeenaShetty Date: Wed, 3 Oct 2012 17:42:57 +0530 Subject: [PATCH 3/3] Update Readme.markdown --- Readme.markdown | 1 - 1 file changed, 1 deletion(-) diff --git a/Readme.markdown b/Readme.markdown index 67659e1..1623c05 100644 --- a/Readme.markdown +++ b/Readme.markdown @@ -9,7 +9,6 @@ Use cpanel and Whm API's in Rails Panelbeater gem is used for communicating with the cPanel and WHM API's. Ruby library for the WHM & cPanel API. - Github path https://github.com/BeenaShetty/panelbeater Install require 'panelbeater'