Просмотр исходного кода

Fix #1825 PMA Support not working (#1901)

* Fix bug preventing upgrade pma when postgesql is enabeled

* Fix #1825 Make /phpmyadmin/ url in pma script

* Update upgrade script

* Update changelog

Co-authored-by: Raphael Schneeberger <rs@scit.ch>
Jaap Marcus 4 лет назад
Родитель
Сommit
b7f9032ceb

+ 2 - 0
CHANGELOG.md

@@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
 ### Features
 
 - Include DMARC record in DNS record list #1836
+- Enabled phpMyAdmin Single Sign On support
 - Add command to add / delete from API_ALLOWED_IP list (#1904)
 
 ### Bugfixes
@@ -19,6 +20,7 @@ All notable changes to this project will be documented in this file.
 - Increased minimal memory requirements for ClamD / ClamAV.  #1840
 - Restore of backup did not rebuild the "Forced SSL" and "HSTS" config on new account #1862
 - Keep changes made by /install/upgrade/manual/install_awstats_geopip.sh on update HestiaCP (via Discord)
+- Fixed an issue where phpmyadmin did not update when Postgresql was availble.
 
 ## [1.4.2] - Service release
 

+ 1 - 1
func/upgrade.sh

@@ -474,7 +474,7 @@ upgrade_start_routine() {
 upgrade_phpmyadmin() {
     if [ "$UPGRADE_UPDATE_PHPMYADMIN" = "true" ]; then
         # Check if MariaDB/MySQL is installed on the server before attempting to install or upgrade phpMyAdmin
-        if [ "$DB_SYSTEM" = "mysql" ]; then
+        if [ ! -z "$(echo $DB_SYSTEM | grep -w 'mysql')" ]; then
             # Define version check function
             function version_ge(){ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o ! -z "$1" -a "$1" = "$2"; }
 

+ 8 - 2
install/deb/phpmyadmin/hestia-sso.php

@@ -118,7 +118,7 @@ function session_invalid(){
     //delete all current sessions
     session_destroy();
     setcookie($session_name, null, -1, '/');
-    header('Location: /phpmyadmin/index.php');
+    header("Location: " . dirname($_SERVER['PHP_SELF']) . "/index.php");
     die();
 }
     $api = new Hestia_API();
@@ -127,6 +127,8 @@ function session_invalid(){
             $api -> delete_temp_user($_SESSION['HESTIA_sso_database'], $_SESSION['HESTIA_sso_user'],  $_SESSION['PMA_single_signon_user'], $_SESSION['HESTIA_sso_host']);
             //remove sessin
             session_invalid();
+            header("Location: " . dirname($_SERVER['PHP_SELF']) . "/index.php");
+            die();
         }else{ 
             if(isset($_GET['user']) && isset($_GET['hestia_token'])){
                 $database = $_GET['database'];
@@ -153,15 +155,19 @@ function session_invalid(){
                         
                         @session_write_close();
                         setcookie($session_name, $id , 0, "/");
-                        header('Location: /phpmyadmin/index.php');
+                        header("Location: " . dirname($_SERVER['PHP_SELF']) . "/index.php");
                         die();
                     }
                 }else{
                     session_invalid();
+                    header("Location: " . dirname($_SERVER['PHP_SELF']) . "/index.php");
+                    die();
                 }
             }
         }
     }else{
         session_invalid();
+        header("Location: " . dirname($_SERVER['PHP_SELF']) . "/index.php");
+        die();
     }
 ?>

+ 7 - 0
install/upgrade/versions/1.4.3.sh

@@ -11,3 +11,10 @@ if [ "$FIREWALL_SYSTEM" = "iptables" ]; then
     echo "[ * ] Fix the issue of generate firewall rules..."
     $BIN/v-update-firewall
 fi
+
+# Reset PMA SSO
+if [ "$PHPMYADMIN_KEY" != "" ]; then
+    echo "[ * ] Refressh hestia-sso for PMA..."
+    $BIN/v-delete-sys-pma-sso 
+    $BIN/v-add-sys-pma-sso 
+fi

+ 1 - 2
web/templates/pages/edit_server.html

@@ -502,8 +502,7 @@
 												<br><br>
 											</td>
 										</tr>
-										<?php if ($_SESSION['POLICY_SYSTEM_ENABLE_BACON'] === 'true' && 1 != 1) {
-                                        //disable for 1.4.0 release due some bugs
+										<?php if ($_SESSION['POLICY_SYSTEM_ENABLE_BACON'] === 'true') {
                                         ?>
 											<tr>
 												<td class="vst-text">

+ 0 - 2
web/templates/pages/list_server_preview.html

@@ -24,7 +24,6 @@
 		</div>
 	</div>
 	<!-- Start of item element-->
-    <!--
 	<div class="l-unit header animated fadeIn">
 		<div class="l-unit__col l-unit__col--right">
 			<div class="clearfix l-unit__stat-col--left super-compact text-center">
@@ -35,7 +34,6 @@
 			<div class="clearfix l-unit__stat-col--left wide-2">In final development stages.</div>
 		</div>
 	</div>
-    -->
 	<!-- End of item element-->
 	<!-- Start of item element-->
 	<div class="l-unit header animated fadeIn">