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
  #51  
Old 12th January 2006, 02:36
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

You can have a look at the code in /root/ispconfig/scripts/lib/config.lib.php where new MySQL databases are created. Something like this should work:

PHP Code:
$link mysql_connect($db_server$db_user$db_password)
    or die(
"Could not connect");
mysql_select_db("<db_name>")
    or die(
"Could not select database");

$result mysql_query("UPDATE pn_users SET pn_uname = 'test' WHERE pn_uid = '2'"); 
__________________
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
Sponsored Links
  #52  
Old 12th January 2006, 12:37
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,022
Thanks: 840
Thanked 5,655 Times in 4,464 Posts
Default

Quote:
Originally Posted by danf.1979
Hi again.
I have been coding a lot lately, and I'm rewriting all the installers into one big administrative interface. I'm doing Ok, but now I have a big problem.
I ask the user for the admin username and password, for example, and then I want to write those values to the *user* database, in some any table (it depends on the cms). I cannot find anything that would let me change to the user database in the mysql class.
My idea was something like this, but I doesnt work ofcourse:
Code:
$go_api->db->query("use $db_database");
$go_api->db->query("UPDATE pn_users SET pn_uname='test_user' WHERE pn_uid='2'");
And I was looking to the "query" method, and it doesnt let me change to another database...
Any help?
thanks again.

You dont have to change the database at all. ISPConfig is logged in with a mySQL user who can access all databases. Simply prepend the database name before the table name with a dot. Example:

Code:
$go_api->db->query("UPDATE ".$database.".pn_users SET pn_uname='test_user' WHERE pn_uid='2'");
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #53  
Old 18th January 2006, 04:37
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
Default

Ok, I think its time to an update on my work.
I'm doing Ok. I have developed a program called CMS Manager. It runs from its own menu in the tools section, though I would like to move it to the "ISP Manager" section.
Till now I have installers for:
<b>Portals:</b>
Etomite: http://www.etomite.org/
Joomla!: http://www.joomla.org/
PHP-Nuke: http://www.phpnuke.org/
PostNuke: http://www.postnuke.org/
WebsiteBaker: http://www.websitebaker.org/2/home/

WebsiteBaker and Etomite are great, just very simple for anyone to use with little effort.

<b>Forums</b>
phpBB
-------------------------------

I'm working on MediaWiki now.

I rewrote all my previous installers into this big cms manager (its not that big though), but from here you can now install all this programs with only some clicks and providing some required info. I dont need any more the default installers that came with the cms's tar.gz. All is done from ispconfig.

Here you have some screenshots from the Main Window (Spanish). I will rewrite it though with a different template.

Step1, were you choose the website were to install the cms

Step2, were you enter basic info like the database name, password and directory were to install


Note that every window has explanations (in spanish till now), but its very easy to go through this steps and install any software.

Some of my problems:
- When I show the user the cms_done.htm template maybe the install process has not even started yet. So the client could press the final url link that I provide and get a 404. It's a matter of time anyway. The cms does get installed.
- Till now the user has to *remember* how his database is called. I would like to do a dropdown menu for him to choose.

Ideas:
- I want to integrate this a lot more with ispconfig. Maybe 1 CMS per MySQL its OK? I think so. Maybe 2, I dont know.

Last edited by danf.1979; 18th January 2006 at 05:20.
Reply With Quote
  #54  
Old 18th January 2006, 13:34
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,022
Thanks: 840
Thanked 5,655 Times in 4,464 Posts
Default

This looks really great!

Quote:
Originally Posted by danf.1979
Some of my problems:
- When I show the user the cms_done.htm template maybe the install process has not even started yet. So the client could press the final url link that I provide and get a 404. It's a matter of time anyway. The cms does get installed.
I think there is no real solution for this problem. the best way might be to provide some info text that it may take some minutes until the CMS is installed and the link to the CMS is valid.

Quote:
- Till now the user has to *remember* how his database is called. I would like to do a dropdown menu for him to choose.
This might be better, i guess many users wont remeber what they have done 10 seconds before

Quote:
Ideas:
- I want to integrate this a lot more with ispconfig. Maybe 1 CMS per MySQL its OK? I think so. Maybe 2, I dont know.
Better onyl one CMS per MySQL, otherwise you will get sooner or later conflicting table names. Maybe we should add limit the number of installable CMS in the Reseller limits an website settings?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #55  
Old 20th January 2006, 03:36
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
Default

We could add a 1 or 0 for the capabilities to install cms in the isp_isp_web_template. And from there on, 1 cms per MySQL. Maybe we should have an option too to override the 1-1 limitation too, for example if I wanted to install more than one cms (or any other ispconfig admin) for my own site (1 forum, 1 portal, 1 chat for example).
I'm going to start coding some uninstalling methods now. Do I just warn the user and erase all stuff?
Reply With Quote
  #56  
Old 20th January 2006, 03:39
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
Default

Uhm, I think it would be unjustified to limit the reseller to only #X cms to offer. Just limit all users to 1-1 and thats all, what do you think?
I was thinking alsa about the user passwords... You said about having clear passwords to be unsecure, and I agree with that, but anyway, you have the root password in clear text. Then why dont we store the users password encoded with base_64? And in that case, clients can forget about remembering passwords.
They choose the database in the dropbox, and thats all. What about that?

Last edited by danf.1979; 20th January 2006 at 03:50.
Reply With Quote
  #57  
Old 20th January 2006, 07:08
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Quote:
Originally Posted by danf.1979
Uhm, I think it would be unjustified to limit the reseller to only #X cms to offer. Just limit all users to 1-1 and thats all, what do you think?
I'm not quite sure, but I can imagine that sooner or later someone will request that feature. I'm not sure though if it's enough to say "this reseller is allowed to install CMS' in his web sites, and that one isn't" instead of specifiying a number...


Quote:
Originally Posted by danf.1979
You said about having clear passwords to be unsecure, and I agree with that, but anyway, you have the root password in clear text.
Where do we have the root password in clear text?
__________________
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
  #58  
Old 20th January 2006, 07:16
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,022
Thanks: 840
Thanked 5,655 Times in 4,464 Posts
Default

Quote:
Originally Posted by danf.1979
Uhm, I think it would be unjustified to limit the reseller to only #X cms to offer. Just limit all users to 1-1 and thats all, what do you think?
It will be better if the limit can be entered as a number of cms per website.

Quote:
I was thinking alsa about the user passwords... You said about having clear passwords to be unsecure, and I agree with that, but anyway, you have the root password in clear text.
The password of the root user is not used in ISPConfig at all. Maybe you mean another password that is identical with the root password in your installation.

Quote:
Then why dont we store the users password encoded with base_64? And in that case, clients can forget about remembering passwords.
They choose the database in the dropbox, and thats all. What about that?
No, for security reasons we shall not store passwords in the database.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #59  
Old 20th January 2006, 07:28
danf.1979 danf.1979 is offline
Senior Member
 
Join Date: Dec 2005
Location: Chile
Posts: 247
Thanks: 4
Thanked 3 Times in 2 Posts
Send a message via MSN to danf.1979
Default

field server_db_passwort has the root password for the mysql root user. I see it in clear text.
Reply With Quote
  #60  
Old 20th January 2006, 08:40
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,022
Thanks: 840
Thanked 5,655 Times in 4,464 Posts
 
Default

Hmm, Ive not programmed anything waht puts the cleartext password in the DB. I will check where it is used and how we can remove it.
__________________
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 03:58.


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