Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 4th November 2009, 14:37
osmoza osmoza is offline
Junior Member
 
Join Date: Nov 2009
Posts: 5
Thanks: 0
Thanked 4 Times in 3 Posts
Default CLI and web_domain "save" action

Hello,

I've got several CLI scripts that inserts data into ISPConfig's database

Something like that:
Code:
$ user_add client_name username password other_stuff && web_domain_add client_name domain.name.tld
Now, I'd like to force ISPConfigs to generate all the needed system (web_domain related to) files and inserts (vhosts, passwd, shadow etc.) for database inserts made with this scripts ("call the save action" in the web_domain form, but via CLI).

Is it possible? Is there a function/method/script that does the trick? If so - where can I find it?

Cheers,
Osmoza
Reply With Quote
The Following User Says Thank You to osmoza For This Useful Post:
adamassasda291 (24th June 2013)
Sponsored Links
  #2  
Old 4th November 2009, 14:40
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,458
Thanks: 813
Thanked 5,240 Times in 4,108 Posts
Default

Not sure how your cli scripts work as ispconfig does not provide any cli scripts. If they use the remoting framework to connect to ispconfig, then there is no further action needed. if they try to insert sql records manually, then this is the source of your problem. You should rewrite them to use the remoting API as the APi ensures that the records were inserted correctly incl. correct permission settings and thet the config files are written based on these records.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 4th November 2009, 15:26
osmoza osmoza is offline
Junior Member
 
Join Date: Nov 2009
Posts: 5
Thanks: 0
Thanked 4 Times in 3 Posts
Default

Hello Till,

The scripts inserts sql manually - I know that's cousing my problem.
The question is: how can I get to methods/functions/scripts (as you mentioned - the last one doesn't exist) that parses db records and saves them in the system.

I've found processDatalog() method in modules class and server.sh script - I guess, I'm in need of saving sys_datalog and running server.sh to do "if( changes found ) { generate stuff }"....

Remote API? I'll give it a try BUT I've made some simple changes in ISPConfig's source (changes in web_domain db schema - added field, vhost template changed.....) and I'm affraid that it's not gonna work without messing with API's source too (maybe I'm wrong).

Thanks,
Osmoza
Reply With Quote
The Following User Says Thank You to osmoza For This Useful Post:
adamassasda291 (28th June 2013)
  #4  
Old 4th November 2009, 15:32
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,458
Thanks: 813
Thanked 5,240 Times in 4,108 Posts
Default

Looks as you mix up here several things. This thread here is about ispconfig 2 (its in the ispconfig 2 forum) and ispconfig 2 does not has a function processDatalog. ISPConfig 3 has this function, but thats a completely different software that works differently.

So which ispconfig version do you use?

Quote:
I've made some simple changes in ISPConfig's source (changes in web_domain db schema - added field, vhost template changed.....) and I'm affraid that it's not gonna work without messing with API's source too (maybe I'm wrong).
I hope you are aware that you are not able to install any ptches or updates for ispconfig anymore as the updater will remove your complete databse on the next update if your databae scheme is different to the one from ispconfig. So adding any fields is a bad idea if you want to benefit from new features in future ispconfig versions.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
adamassasda291 (29th June 2013)
  #5  
Old 4th November 2009, 15:53
osmoza osmoza is offline
Junior Member
 
Join Date: Nov 2009
Posts: 5
Thanks: 0
Thanked 4 Times in 3 Posts
Default

Oh sh**!
You are right - I'm using ISPConfig3 - didn't notice "ISPConfig 2" in breadcrumbs...
Could you please move thread to proper room/category (whatever it's called)?

Updates and stuff - I know, but don't need them as much, as I need extra functionality I get with these changes (long story).

Thanks,
O
Reply With Quote
  #6  
Old 4th November 2009, 16:14
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,458
Thanks: 813
Thanked 5,240 Times in 4,108 Posts
Default

Take a look at the file /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php

Hou have to use the dalaogInsert, datalogUpdate and datalogDelete functions from there to do any kind of data manipulation in the ispconfig database. Everything that you uppate with sql queries without using these functions will be ignored by the server script and not be used to write any config files.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:46.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.