
15th October 2012, 12:06
|
|
Senior Member
|
|
Join Date: Sep 2012
Posts: 107
Thanks: 0
Thanked 9 Times in 5 Posts
|
|
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)
|

15th October 2012, 12:11
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 32,071
Thanks: 697
Thanked 4,249 Times in 3,261 Posts
|
|
Quote:
Originally Posted by abdi
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.
|

15th October 2012, 12:38
|
|
Senior Member
|
|
Join Date: Sep 2012
Posts: 107
Thanks: 0
Thanked 9 Times in 5 Posts
|
|
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
|

15th October 2012, 12:42
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 32,071
Thanks: 697
Thanked 4,249 Times in 3,261 Posts
|
|
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.
|

15th October 2012, 12:49
|
|
Senior Member
|
|
Join Date: Sep 2012
Posts: 107
Thanks: 0
Thanked 9 Times in 5 Posts
|
|
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
|

15th October 2012, 13:19
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 32,071
Thanks: 697
Thanked 4,249 Times in 3,261 Posts
|
|
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
|

15th October 2012, 15:33
|
|
Senior Member
|
|
Join Date: Sep 2012
Posts: 107
Thanks: 0
Thanked 9 Times in 5 Posts
|
|
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?)
|

15th October 2012, 17:35
|
|
Senior Member
|
|
Join Date: Sep 2012
Posts: 107
Thanks: 0
Thanked 9 Times in 5 Posts
|
|
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?
|

15th October 2012, 17:37
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 32,071
Thanks: 697
Thanked 4,249 Times in 3,261 Posts
|
|
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.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 00:55.
|
Recent comments
8 hours 29 min ago
9 hours 29 min ago
13 hours 16 min ago
14 hours 30 min ago
18 hours 6 min ago
1 day 1 hour ago
1 day 10 hours ago
1 day 11 hours ago
2 days 2 hours ago
2 days 5 hours ago