Page 1 of 1

if add a database server or postgresql database

Posted: Sat Jan 26, 2013 12:39 am
by Omar
Vesta support add remote database server, but in the panel if I use the "open phpMyAdmin" or "open phpPgAdmin" button, always redirect to localhost server.
To fix this, add $data[$key]['HOST'] value to $httpd var in php code (embedded in the html list_db.html), which gets the correct host database:

Code: Select all

<?php
          list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]);
          foreach ($data as $key => $value) {
          ++$i;
          if ($data[$key]['SUSPENDED'] == 'yes') {
                $status = 'suspended';
                $spnd_action = 'unsuspend' ;
          } else {
                $status = 'active';
                $spnd_action = 'suspend' ;
          }
          $http_host=$data[$key]['HOST'];              <=== THIS
          if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin";
          if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$http_host."/phpMyAdmin/";
          if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin";
          if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$http_host."/phpPgAdmin/";
?>
The other issue is referring to postgresql database, cant no add this type, this is because in vesta.conf only is added mysql type (DB_SYSTEM='mysql') this changes to DB_SYSTEM='mysql,pgsql' and the problem is solved.

regards

Re: if add a database server or postgresql database

Posted: Sat Jan 26, 2013 1:07 pm
by skid
Good point, Omar. I will add this in feature release. Thank you

Re: if add a database server or postgresql database

Posted: Fri Feb 08, 2013 9:09 am
by skid
Feature is implemented and will be available in the next update.