# HG changeset patch # User peter # Date 1209413412 0 # Node ID 0756319df2d05fbe987d75552470f483b240241e # Parent 6190c9a5f48b1f84569a56ce8f4d8591377268e2 [feladat @ 252] Added the possibility to select whether MySQL or PostgreSQL should be used. Depending on the choice, a different instruction is displayed in step 3. Also fixed a minor typo. diff -r 6190c9a5f48b -r 0756319df2d0 install/index.php --- a/install/index.php Mon Apr 28 19:12:51 2008 +0000 +++ b/install/index.php Mon Apr 28 20:10:12 2008 +0000 @@ -41,6 +41,7 @@ echo "PasswordThe password for this username.\n"; echo "HostnameThe hostname on which the PowerDNS database resides. Frequently, this will be \"localhost\".\n"; echo "DatabaseThe name of the PowerDNS database.\n"; + echo "Database type"; echo ""; @@ -56,7 +57,7 @@ $db_pass = $_POST['pass']; $db_host = $_POST['host']; $db_name = $_POST['name']; - $db_type = "mysql"; + $db_type = $_POST['type']; require_once("../inc/database.inc.php"); $db = dbConnect(); $db->loadModule('Manager'); @@ -79,10 +80,14 @@ echo "done!

"; - echo "

We have now updated the PowerDNS database to work with Poweradmin. You now want to give limited rights to Poweraadmin so it can update the data in the tables. To do this, you should create a new user and give it rights to select, delete, insert and update records in the PowerDNS database. In MySQL should now perform the following command:

"; - echo "

GRANT SELECT, INSERT, UPDATE, DELETE
ON powerdns-database.*
TO 'poweradmin-user'@'localhost'
IDENTIFIED BY 'poweradmin-password';

"; - echo "

On PgSQL you would use:

"; - echo "

$ createuser poweradmin-user
Shall the new role be a superuser? (y/n) n
Shall the new user be allowed to create databases? (y/n) n
Shall the new user be allowed to create more new users? (y/n) n
CREATE USER
$ psql powerdns-database
psql> GRANT SELECT, INSERT, DELETE, UPDATE
ON powerdns-database
TO poweradmin-user;

"; + echo "

We have now updated the PowerDNS database to work with Poweradmin. You now want to give limited rights to Poweradmin so it can update the data in the tables. To do this, you should create a new user and give it rights to select, delete, insert and update records in the PowerDNS database. "; + if ($db_type=='mysql') { + echo "In MySQL should now perform the following command:

"; + echo "

GRANT SELECT, INSERT, UPDATE, DELETE
ON powerdns-database.*
TO 'poweradmin-user'@'localhost'
IDENTIFIED BY 'poweradmin-password';

"; + } elseif ($db_type == 'pgsql') { + echo "

On PgSQL you would use:

"; + echo "

$ createuser poweradmin-user
Shall the new role be a superuser? (y/n) n
Shall the new user be allowed to create databases? (y/n) n
Shall the new user be allowed to create more new users? (y/n) n
CREATE USER
$ psql powerdns-database
psql> GRANT SELECT, INSERT, DELETE, UPDATE
ON powerdns-database
TO poweradmin-user;

"; + } echo "

After you have added the new user, proceed with this installation procedure.

\n"; echo "
"; echo "";