Refs #476 Enable autologin for phpPgAdmin

This commit is contained in:
cytopia 2019-01-30 15:05:48 +01:00
parent 5c492f3089
commit f20e8205d8
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
4 changed files with 45 additions and 6 deletions

View File

@ -20,6 +20,19 @@
// Database port on server (5432 is the PostgreSQL default) // Database port on server (5432 is the PostgreSQL default)
$conf['servers'][0]['port'] = 5432; $conf['servers'][0]['port'] = 5432;
// ---- Auto-login
if (getenv('DEVILBOX_VENDOR_PHPPGADMIN_AUTOLOGIN') == 1) {
$_REQUEST['server']= 'pgsql:5432:allow';
if(session_id() == ''){
//session has not started
session_name('PPA_ID');
session_start();
}
$_SESSION['sharedUsername'] = getenv('PGSQL_ROOT_USER');
$_SESSION['sharedPassword'] = getenv('PGSQL_ROOT_PASSWORD');
}
// ---- end of Auto-login
// Database SSL mode // Database SSL mode
// Possible options: disable, allow, prefer, require // Possible options: disable, allow, prefer, require
// To require SSL on older servers use option: legacy // To require SSL on older servers use option: legacy

View File

@ -55,8 +55,10 @@
// Start session (if not auto-started) // Start session (if not auto-started)
if (!ini_get('session.auto_start')) { if (!ini_get('session.auto_start')) {
session_name('PPA_ID'); if (session_id() == '') {
session_start(); session_name('PPA_ID');
session_start();
}
} }
// Do basic PHP configuration checks // Do basic PHP configuration checks

View File

@ -7,8 +7,10 @@
*/ */
if (!ini_get('session.auto_start')) { if (!ini_get('session.auto_start')) {
session_name('PPA_ID'); if (session_id() == '') {
session_start(); session_name('PPA_ID');
session_start();
}
} }
unset($_SESSION); unset($_SESSION);
session_destroy(); session_destroy();

View File

@ -6,10 +6,22 @@
### All the following settings are applied during ### All the following settings are applied during
### $ docker-compose up ### $ docker-compose up
### ###
### No need to rebuild any dockers! ### No need to rebuild any docker images!
### ###
### For custom variables, scroll to the bottom ### IMPORTANT:
### ----------
### When changing any values ensure to stop, rm and restart:
### $ docker-compose stop
### $ docker-compose rm -f
### $ docker-compose up
### ###
### NOTE:
### -----
### For you own custom variables, scroll to the bottom
###
# The following line will disable any shellcheck warnings throughout this file
# shellcheck disable=SC2034,SC2125
### ###
@ -212,6 +224,16 @@ DEVILBOX_UI_ENABLE=1
DEVILBOX_VENDOR_PHPMYADMIN_AUTOLOGIN=1 DEVILBOX_VENDOR_PHPMYADMIN_AUTOLOGIN=1
###
### Automatically be logged in into phpPgAdmin
###
### Example:
### DEVILBOX_VENDOR_PHPPGADMIN_AUTOLOGIN=1
### DEVILBOX_VENDOR_PHPPGADMIN_AUTOLOGIN=0
###
DEVILBOX_VENDOR_PHPPGADMIN_AUTOLOGIN=1
################################################################################ ################################################################################
### ###