Update config.inc.php

This commit is contained in:
Stefan Pejcic 2024-09-13 12:36:26 +02:00 committed by GitHub
parent 4c5912ce22
commit 447df59ecf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,10 +25,21 @@ if (check_file_access('/etc/phpmyadmin/config-db.php')) {
} }
if (!empty($dbname)) { if (!empty($dbname)) {
/* Authentication type */ $serverPort = $_SERVER['SERVER_PORT'];
$cfg['Servers'][$i]['auth_type'] = 'signon'; // AUTOLOGIN FROM OPENPANEL UI
$cfg['Servers'][$i]['SignonSession'] = 'OPENPANEL_PHPMYADMIN'; if ($serverPort != 80 && $serverPort != 443) {
$cfg['Servers'][$i]['SignonURL'] = 'pma.php'; error_log("Using Single Sign-On (SSO) for connections from OpenPanel: $clientIp");
$cfg['Servers'][$i]['auth_type'] = 'signon';
$cfg['Servers'][$i]['SignonSession'] = 'OPENPANEL_PHPMYADMIN';
$cfg['Servers'][$i]['SignonURL'] = 'pma.php';
// LOGIN FORM ON DOMAIN/phpmyadmin
} else {
error_log("Using cookie authentication for connection via domain name");
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
}
/* Server parameters */ /* Server parameters */
if (empty($dbserver)) $dbserver = 'localhost'; if (empty($dbserver)) $dbserver = 'localhost';
$cfg['Servers'][$i]['host'] = $dbserver; $cfg['Servers'][$i]['host'] = $dbserver;
@ -68,15 +79,13 @@ $cfg['ShowChgPassword'] = false;
$cfg['ShowCreateDb'] = false; $cfg['ShowCreateDb'] = false;
$cfg['SuggestDBName'] = false; $cfg['SuggestDBName'] = false;
$cfg['AllowUserDropDatabase'] = false; $cfg['AllowUserDropDatabase'] = false;
$cfg['AllowUserDropUser'] = false;
$cfg['PmaNoRelation_DisableWarning'] = true; $cfg['PmaNoRelation_DisableWarning'] = true;
$cfg['UploadDir'] = ''; $cfg['UploadDir'] = '';
$cfg['SaveDir'] = ''; $cfg['SaveDir'] = '';
$cfg['ShowDatabasesNavigationAsTree'] = false; $cfg['ShowDatabasesNavigationAsTree'] = false;
/* Support additional configurations */ /* Support additional configurations */
foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename) foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename) {
{
include($filename); include($filename);
} }