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

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 9th April 2007, 10:53
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 12 Times in 10 Posts
Default Tools access to DB functions

Can someone guide me to how to automatically add a database to a website? I am writing a new Tools interface which needs to auto create a database on behalf of the "client" and the only a function I could find to do it properly was in the isp_datenbank class, calling the datenbank_insert function.

function datenbank_insert($doc_id, $doctype_id, $die_on_error = '1')

Is this the right way to actually do it as I don't see it used anywhere weirdly enough...????

I have the client sites $web_doc_id and just need a little help here and this is where i'm currently stuck at.
__________________
www.emperor-it.com for ISPConfig mods/hacks

Last edited by djtremors; 9th April 2007 at 22:36.
Reply With Quote
Sponsored Links
  #2  
Old 10th April 2007, 10:32
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,198 Times in 3,213 Posts
Default

Quote:
Is this the right way to actually do it as I don't see it used anywhere weirdly enough...????
This function does not insert the records in the DB. ISPConfig is event based and this function is just a event handler that does some additional steps after a database has been inserted into the database. The insertion of the records itself is done by the form processing scrpts and these scripts are calling also the event handlers.

I think you will have to add the records in the tables isp_isp_datenbank, isp_nodes and isp_dep manually. I guess the best way to see what has to be added is to add a database trough ISPConfig and see what is changed in these three tables.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 11th April 2007, 13:46
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 12 Times in 10 Posts
Default

Well, i thought of doing this the easy way and use the remote framework only to fail when ispconfig php isnt compiled with xml2 functions otherwise I would've been sweet and plugins could just use the remote framework to do the dirty work... oh well.

so i'm back to doing it the SQL direct way. I added a simple database and 2 tables changed, isp_isp_dep and isp_isp_datenbank.

I can't see where some of the fields are related to anything. Some things are obvious ie. doc_id = autoincrement, datenbankname , datenbankuser , etc but what are the relationships with the other fields so i know where the values come from?

:isp_isp_dep:
dep_id
userid
groupid
parent_doc_id
parent_doctype_id
parent_tree_id
child_doc_id
child_doctype_id
child_tree_id
status

:isp_isp_datenbank:
doc_id
doctype_id
datenbankname
datenbankuser
db_passwort
web_id
status
remote_access
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #4  
Old 20th April 2007, 12:59
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 12 Times in 10 Posts
Default

Unfortunately I can't figure out how the table fields work or relate to anything so I resorted to remote framework but then hit a wall again when the php that compiles with ispconfig doesn't have XML support in it so I can't use the remote framework "client" inside the http:81 of ispconfig... *sigh*.

can anyone help?
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #5  
Old 21st April 2007, 12:40
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,594 Times in 2,445 Posts
Default

You can change the PHP configure string in install_ispconfig/compile_aps/compile and then install ISPConfig again. But make sure that libxml2-dev is installed. And back up your ISPConfig installation before you try this!
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #6  
Old 22nd April 2007, 03:03
djtremors djtremors is offline
Senior Member
 
Join Date: Apr 2006
Location: Sydney
Posts: 278
Thanks: 0
Thanked 12 Times in 10 Posts
Default

yeah I did go down this path already but considering that this was to be a package to use in ispconfig, there's no point telling users that they must reinstall their ispconfig and make changes to the compile script to use my module all because i can't work out how to add a database to a site...
If this was done on future releases then at least it would make it easier for me and possibly others wanting to make changes easily.

The remote-framework is encrypted as well othewise I'd look into that on how it adds a new database to a site.... but no go there either.

Is this telling me that no body knows the structure of the ISPC database?
__________________
www.emperor-it.com for ISPConfig mods/hacks
Reply With Quote
  #7  
Old 22nd April 2007, 15:45
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,198 Times in 3,213 Posts
 
Default

Quote:
yeah I did go down this path already but considering that this was to be a package to use in ispconfig, there's no point telling users that they must reinstall their ispconfig and make changes to the compile script to use my module all because i can't work out how to add a database to a site...
The ISPConfig Development versions contain all PHP with XML compiled in, so every version > ISPConfig 2.3.x will have xml support and the remoting framework by default.

Quote:
The remote-framework is encrypted as well othewise I'd look into that on how it adds a new database to a site.... but no go there either.
No. The remoting framework is already part of the dev branch as source for several weeks.

Quote:
Is this telling me that no body knows the structure of the ISPC database?
Not at all. I've written the structure, so I know it. And Falko and some other developers know them too.
__________________
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig on a RaQ2 mattm Installation/Configuration 12 23rd January 2008 18:17
directories in /home/admispconfig/ispconfig renamed? Spudchat General 10 12th April 2007 19:37
Questions in regards to ISP-Server Setup - Ubuntu 5.10 "Breezy Badger" rbrantley HOWTO-Related Questions 16 10th April 2006 18:26
setup fails on debian 3.1 dtrumbower Installation/Configuration 7 7th March 2006 13:42
Update to 2.2.0 question brianetilley Installation/Configuration 10 4th March 2006 17:02


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


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