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
  #11  
Old 15th October 2012, 12:06
abdi abdi is offline
Senior Member
 
Join Date: Sep 2012
Posts: 117
Thanks: 0
Thanked 10 Times in 6 Posts
Default

Thanks alot Till.
Now, I have realized some inconsistencies with database creation (sites_database_add). My understanding is that you can NOT have the same database name on the same server.

However, the API allows me to create same DB name on the same server_id several times without it complaining. It actually creates it in the database though on the real server it does not ...(I think you need this check in API)
Reply With Quote
Sponsored Links
  #12  
Old 15th October 2012, 12:11
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

Quote:
Originally Posted by abdi View Post
Thanks alot Till.
Now, I have realized some inconsistencies with database creation (sites_database_add). My understanding is that you can NOT have the same database name on the same server.

However, the API allows me to create same DB name on the same server_id several times without it complaining. It actually creates it in the database though on the real server it does not ...(I think you need this check in API)
Please add this as bugreport to the bugtracker. the database creation api is changed in 3.0.5 anyway as database users and databases are separated in this release to allow one user to access multiple databases.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #13  
Old 15th October 2012, 12:38
abdi abdi is offline
Senior Member
 
Join Date: Sep 2012
Posts: 117
Thanks: 0
Thanked 10 Times in 6 Posts
Default

Till, more challenges:
Much as I pass all these variables as seen below:

$params = array(
'server_id' => $_SESSION['db_server_id'],
'type' => "$type",
'database_name' => "$newdb_name",
'database_user' => "$newdb_user",
'database_password' => "$database_password",
'database_charset' => "$database_charset",
'remote_access' => "$remote_access",
'remote_ips' => "$remote_ips",
'active' => "$active");

ONLY the database is created, but not the database user. I don't see any commands for creating database users, I just thought they would be created in the above but aint working ...Please advice what am doing wrong or what I missed out.

Thanks, Joseph
Reply With Quote
  #14  
Old 15th October 2012, 12:42
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

The functions are not implemented yet as its a alpha version, they get implemented for the 3.0.5 final. The current api functions for the database creation are for 3.0.4.6.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #15  
Old 15th October 2012, 12:49
abdi abdi is offline
Senior Member
 
Join Date: Sep 2012
Posts: 117
Thanks: 0
Thanked 10 Times in 6 Posts
Default

Alright, so with the current set-up is there away I can create db users without necessary using the admin interface ...?

If the above is not possible, do you mind pointing me to the API database creation file I see if I can add to it that feature or function.. as I wait for 3.0.5
Reply With Quote
  #16  
Old 15th October 2012, 13:19
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
Default

Quote:
Alright, so with the current set-up is there away I can create db users without necessary using the admin interface ...?
No.

Quote:
If the above is not possible, do you mind pointing me to the API database creation file I see if I can add to it that feature or function.. as I wait for 3.0.5
All remote api functions are in the same file. The file is /usr/local/ispconfig/interface/lib/classes/remoting.inc.php
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #17  
Old 15th October 2012, 15:33
abdi abdi is offline
Senior Member
 
Join Date: Sep 2012
Posts: 117
Thanks: 0
Thanked 10 Times in 6 Posts
Default

Thanks Till for your help and advice. do much appreciate it. I have looked at /usr/local/ispconfig/interface/lib/classes/remoting.inc.php and boy its too complicated, I cant understand anything

I will just wait for 3.0.5 (any hopes when it will be out?)
Reply With Quote
  #18  
Old 15th October 2012, 17:35
abdi abdi is offline
Senior Member
 
Join Date: Sep 2012
Posts: 117
Thanks: 0
Thanked 10 Times in 6 Posts
Default MySQL Users with API

Till,
I have managed to work around that mysql user problem ...How?

I first created the user on the database server with mysql_query("GRANT ALL ON ".$newdb_name.".* to ".$newdb_user." identified by '".$database_password."'"

Then secondly, I saved the record above in `web_database_user` (for `sys_perm_user` and `sys_perm_group` am using riud though I dont know what it means..)

Then thirdly I use the API to create the database and then using the return ID from API I use it to update the database table with database_user_id from 2 above.

ALL is fine and working perfectly...HOWEVER

1. Your database_password ( in web_database_user) is encrypted and is the mysql password. I want users to be able to AUTO login to there database just like plesk by clicking the DB Icon (ofcourse I just have to pass to phpmyadmin username, password and the host) but passing an encrypted password does not work ..I need the row password ..

Did you have plans in future for auto-login? What is the approach you plan to use given you are storing encrypted password?
Reply With Quote
  #19  
Old 15th October 2012, 17:37
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
 
Default

This will not work for a multiserver system as your changes are no valid configuration transaction.

Passwords are always stored encrypted, storing them in plaintext would be a big security risk as users tend to use the same password for many things.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Tags
new interface

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
Change vmail Path in ISPConfig Control Panel from /var/vmail/... to /home/vmail/... uhp85 Installation/Configuration 1 24th July 2012 09:29
disable security constrain in ispconfig 3 control panel to enable the multisites qiubosu Installation/Configuration 3 10th December 2010 23:04
Loads of mysql connections to dbispconfig StrikerNL General 2 5th March 2009 14:31
Unable to log into ISPConfig control panel bobplank Installation/Configuration 1 13th July 2006 14:17
ISPConfig Control Panel dranieri Installation/Configuration 7 1st October 2005 01:22


All times are GMT +2. The time now is 13:26.


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