Post Reply 
[HOWTO] Using the CLI to manage ispcp via command line (scripts)
Author Message
aseques Offline
Development Team (junior)
*****
Dev Team

Posts: 247
Joined: May 2008
Reputation: 2
Post: #41
RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts)
(03-17-2010 09:40 AM)rethus Wrote:  I have found a little bug into your scripts. Not an prgramming-bug... its an logical BUG.
I have installed ispCP and configured it to only set hosting-plans on Admin - not on Reseller.
Why would you want this? If you company grows up, then you will have some non-technical person to be your resseller to do burocracy stuff, while you are the admin user for the technical stuff.
Also this is the way it worked in plesk one the days I was using it (8.2.smtng)
Quote:If i use your Script, i have to add --created_by and --hosting_plan. And its only works, if the Hosting_Plan was created by the user who is named on --created_by.

But this is no logical assignment. Cause if i add all my plesk-customers i had to add them to the admin (cause reseller don't have own hosting_plans.

But ispCP don't can assign users from (or to) admin. This is also a logical misstake of ispCP, cause a user have to be also assignable from reseller back to admin... or from admin to reseller....

I solve my Problem with changing your domain.php...

Change this line:
Code:
$result = $mysqli->query("SELECT `props` FROM `hosting_plans` WHERE `name`='$hosting_plan' AND `reseller_id`='$created_by'");

into:

Code:
$result = $mysqli->query("SELECT `props` FROM `hosting_plans` WHERE `name`='$hosting_plan'");

Quote:So my next Question is... how did you set all the User-Details (adress, name and so on)?
I see some variables into your script, but seems they doesn't accessaible from outside?
These are not mandatory, so I just left them empty so I had a more general script. If you want to add them It's ok fine for me, I'll gladly accept the patches.

A couple of important things:
.- I forgot to add the getopts.php (it's just a code snippet so you can use longopts in php-cli) taken from the php example codes. Please redownload the code and check again. (there's also some new stuff like htaccess creation)
.- You CAN add hosting plans to the reseller, I am doing it normally with a SQL query like this:
INSERT INTO `hosting_plans` VALUES ('',RESELLER_ID,'Personal','_no_;_no_;0;-1;5;1;-1;-1;2048;200;_no_;_no_','Hosting plan','0.00','0.00','','',0);
where RESELLER_ID is the reseller id. Also you can switch to the reseller and create the plans from there.


NOTE: I'd like to know what is the layout of your users, everyone has it's own reseller?
I just updated the page on http://www.isp-control.net/documentation...mmands_cli with the latest updates of the CLI scripts.
Now there's also a complete example to create a working domain.

Mods:
Dovecot, RoundCube, ControlPanel on SSL only, CLI management Quota modification(thread 8483)
(This post was last modified: 03-17-2010 07:44 PM by aseques.)
03-17-2010 06:56 PM
Find all posts by this user Quote this message in a reply
rethus Offline
Junior Member
*

Posts: 145
Joined: May 2009
Reputation: 2
Post: #42
RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts)
(03-17-2010 06:56 PM)aseques Wrote:  
(03-17-2010 09:40 AM)rethus Wrote:  I have found a little bug into your scripts. Not an prgramming-bug... its an logical BUG.
I have installed ispCP and configured it to only set hosting-plans on Admin - not on Reseller.
Why would you want this? If you company grows up, then you will have some non-technical person to be your resseller to do burocracy stuff, while you are the admin user for the technical stuff.
Also this is the way it worked in plesk one the days I was using it (8.2.smtng)

In my case i not have Real Webhosting-Resellers. I have only webdeveloper which are using my hosting-packages [means they pipe the customers to me, but administrate thair custommer accounts themself]. So there is no needing for me to give them permissions to create own hosting-plans.

Very great would be this solution:
  1. Administrator create hosting-plan
  2. Reseller can use this, but can - if admin set the permission-flag - additionaly add own hosting plans.

This would make ispcp able to work for every kind of needing with hosting-plans.

(03-17-2010 06:56 PM)aseques Wrote:  
Quote:So my next Question is... how did you set all the User-Details (adress, name and so on)?
I see some variables into your script, but seems they doesn't accessaible from outside?
These are not mandatory, so I just left them empty so I had a more general script. If you want to add them It's ok fine for me, I'll gladly accept the patches.
Yes, i add them, cause i'll try to create a nearly full automatet plesk migration.

(03-17-2010 06:56 PM)aseques Wrote:  A couple of important things:
.- I forgot to add the getopts.php (it's just a code snippet so you can use longopts in php-cli) taken from the php example codes. Please redownload the code and check again. (there's also some new stuff like htaccess creation)
[quote]
Would be great if u put a changelog-file into your script to see which functions (or Codelines) has changed)

[quote='aseques' pid='77252' dateline='1268816213']
.- You CAN add hosting plans to the reseller, I am doing it normally with a SQL query like this:
INSERT INTO `hosting_plans` VALUES ('',RESELLER_ID,'Personal','_no_;_no_;0;-1;5;1;-1;-1;2048;200;_no_;_no_','Hosting plan','0.00','0.00','','',0);
where RESELLER_ID is the reseller id. Also you can switch to the reseller and create the plans from there.
Thanks for this hint. This solution i found too, but i better use the optimatzion in your script which i've done, thats pretty fast and less work for many domains.

(03-17-2010 06:56 PM)aseques Wrote:  NOTE: I'd like to know what is the layout of your users, everyone has it's own reseller?
I just updated the page on http://www.isp-control.net/documentation...mmands_cli with the latest updates of the CLI scripts.
Now there's also a complete example to create a working domain.

No, not every user has own reseller, but some useres has own resellers. Like i say it above. I have some Partner whcih are developers and fully support thair customers themself. Thair customer pay me for hosting, but all the hosting-stuff support is createt by the resellers.
Ok, its a very special kind of cooperation, but not such special at all.

Rate me!
Online-Chat: #ispcp
xstable.de - Hosting, Onlienshops und mehr...
03-26-2010 04:48 PM
Find all posts by this user Quote this message in a reply
aseques Offline
Development Team (junior)
*****
Dev Team

Posts: 247
Joined: May 2008
Reputation: 2
Post: #43
RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts)
There's a new release of the scripts:
.- Until now you could only use the hosting plans from the reseller, and some people complained because they where setting the plans as admin.
Now there's the variable plan_owner (defaults to reseller) that can be changed to admin, and that will allow you to use the admin plans.

//Are the hosting plans owned by admin or reseller?
$plan_owner = "reseller";

Mods:
Dovecot, RoundCube, ControlPanel on SSL only, CLI management Quota modification(thread 8483)
03-31-2010 06:08 PM
Find all posts by this user Quote this message in a reply
aseques Offline
Development Team (junior)
*****
Dev Team

Posts: 247
Joined: May 2008
Reputation: 2
Post: #44
RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts)
Just uploaded a new version of the scripts, the changes:
.- Ftp creation should work fine with 1.0.4 (at some point it had broke)
.- You can specify the username for ftp with --user

Mods:
Dovecot, RoundCube, ControlPanel on SSL only, CLI management Quota modification(thread 8483)
04-13-2010 06:51 PM
Find all posts by this user Quote this message in a reply
rethus Offline
Junior Member
*

Posts: 145
Joined: May 2009
Reputation: 2
Post: #45
RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts)
Hi aseques,

now my bash-script which automigrate from plesk to ispCP is nearly finished.
On My Plesk i have a qmail (imap-account with subfolders). I have rsync it to ispCp and run the Webmailer. but the Webmailer show only the Inbox, not all the other subfolders.

I fix it, by clicking on "Folders" (on upper navigationbar) and choose all Folders to subscribe.

But my question: Did u know a CLI-Command to subscribe all Folders by default?

Rate me!
Online-Chat: #ispcp
xstable.de - Hosting, Onlienshops und mehr...
05-14-2010 11:08 PM
Find all posts by this user Quote this message in a reply
aseques Offline
Development Team (junior)
*****
Dev Team

Posts: 247
Joined: May 2008
Reputation: 2
Post: #46
RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts)
(05-14-2010 11:08 PM)rethus Wrote:  Hi aseques,

now my bash-script which automigrate from plesk to ispCP is nearly finished.
On My Plesk i have a qmail (imap-account with subfolders). I have rsync it to ispCp and run the Webmailer. but the Webmailer show only the Inbox, not all the other subfolders.

I fix it, by clicking on "Folders" (on upper navigationbar) and choose all Folders to subscribe.

But my question: Did u know a CLI-Command to subscribe all Folders by default?

I thing that plesk is using courier, also the default ispcp package, so If you are migrating the subscribe file, it should be seamless.
If you are using dovecot, then there's the courier_migrate tool tha will keep the important information for you (seen flags and subscription)

Mods:
Dovecot, RoundCube, ControlPanel on SSL only, CLI management Quota modification(thread 8483)
05-14-2010 11:22 PM
Find all posts by this user Quote this message in a reply
aseques Offline
Development Team (junior)
*****
Dev Team

Posts: 247
Joined: May 2008
Reputation: 2
Post: #47
RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts)
After testing the scripts with 1.0.5, I've released the last version. This are the main changes:

.- More checks to avoid errors and better presentation
.- Fixed the subodmain creation for domain alias
.- Dropped the enable_mail/disable_mail, it was a ugly hack and it has to be solved differently

Mods:
Dovecot, RoundCube, ControlPanel on SSL only, CLI management Quota modification(thread 8483)
05-15-2010 12:37 AM
Find all posts by this user Quote this message in a reply
dcreation Offline
Junior Member
*

Posts: 78
Joined: Apr 2009
Reputation: 0
Post: #48
RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts)
Thanks alot for your work so far. I think it can be very useful.
05-18-2010 05:40 PM
Find all posts by this user Quote this message in a reply
help40 Offline
Junior Member
*

Posts: 12
Joined: Mar 2010
Reputation: 0
Post: #49
RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts)
what about "disable user" and "enable user" for changing the "Status" of the users ?
07-31-2010 09:41 AM
Visit this user's website Find all posts by this user Quote this message in a reply
aseques Offline
Development Team (junior)
*****
Dev Team

Posts: 247
Joined: May 2008
Reputation: 2
Post: #50
RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts)
Hi,

I just released another version, I cannot update the wiki page currently as there seem to be some problems on the wiki, but these are the major changes to scripts.

Two new functions:
.- change_domain_pass: The name is clear enough, give a domain, and the new password you want for that particular domain.
.- set_mail_limit: This allows us to set the mail limit (it could be extended to other variables) to any value we need.
For example, to disable mail for example.com, you can do:
Code:
php domain.php --domain example.com --action set_mail_limit --limit --1 #Note the doble hyphen

(07-31-2010 09:41 AM)help40 Wrote:  what about "disable user" and "enable user" for changing the "Status" of the users ?
I'll have a look to this, it could be interesting too.
I'm thinking on putting the code somewhere where the people can branch the code to make improvements...

Mods:
Dovecot, RoundCube, ControlPanel on SSL only, CLI management Quota modification(thread 8483)
(This post was last modified: 08-03-2010 11:54 PM by aseques.)
08-03-2010 11:52 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


| All rights reserved : isp-control.net |