Current time: 04-17-2024, 02:06 AM Hello There, Guest! (LoginRegister)


Thread Closed 
[HOWTO] Using the CLI to manage ispcp via command line (scripts)
Author Message
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
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.
(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
rethus Offline
Junior Member
*

Posts: 202
Joined: May 2009
Reputation: 3
Post: #42
RE: [HOWTO] Using the CLI to manage ispcp via command line (scripts)
03-26-2010 04:48 PM
Find all posts by this user
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
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";
03-31-2010 06:08 PM
Find all posts by this user
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
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
04-13-2010 06:51 PM
Find all posts by this user
rethus Offline
Junior Member
*

Posts: 202
Joined: May 2009
Reputation: 3
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?
05-14-2010 11:08 PM
Find all posts by this user
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
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)
05-14-2010 11:22 PM
Find all posts by this user
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
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
05-15-2010 12:37 AM
Find all posts by this user
dcreation Offline
Junior Member
*

Posts: 85
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
help40 Offline
Junior Member
*

Posts: 16
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
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
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...
(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
Thread Closed 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)