Skip to content

Commit 533c0db

Browse files
author
Istiak Ferdous
authored
Few fixes related pma sso (#3315)
* few fixes related pma sso * Update 1.7.0.sh
1 parent a1f62ba commit 533c0db

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

docs/docs/server-administration/databases.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Automated can sometimes cause issues. Login via SSH and open `/var/log/{webserve
8383
1. Check if the api has been enabled.
8484
2. Add the public IP of your server to the allowed IPs in the **Server settings**.
8585
- `Access denied: There is a security token mismatch`
86-
1. Enable and then disable the API. This will refresh both keys.
86+
1. Disable and then enable the phpMyAdmin SSO. This will refresh both keys.
8787
2. If you are behind a firewall or proxy, you may want to disable it and try again.
8888
- `Link has expired`
8989
1. Refresh the database page and try again.

install/deb/phpmyadmin/hestia-sso.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ function session_invalid() {
132132
header("Location: " . dirname($_SERVER["PHP_SELF"]) . "/index.php");
133133
die();
134134
}
135+
135136
$api = new Hestia_API();
136137
if (!empty($_GET)) {
137138
if (isset($_GET["logout"])) {
@@ -141,10 +142,8 @@ function session_invalid() {
141142
$_SESSION["PMA_single_signon_user"],
142143
$_SESSION["HESTIA_sso_host"],
143144
);
144-
//remove sessin
145+
//remove session
145146
session_invalid();
146-
header("Location: " . dirname($_SERVER["PHP_SELF"]) . "/index.php");
147-
die();
148147
} else {
149148
if (isset($_GET["user"]) && isset($_GET["hestia_token"])) {
150149
$database = $_GET["database"];
@@ -166,8 +165,6 @@ function session_invalid() {
166165
E_USER_WARNING,
167166
);
168167
session_invalid();
169-
die();
170-
session_invalid();
171168
} else {
172169
$id = session_id();
173170
//create a new temp user
@@ -184,10 +181,10 @@ function session_invalid() {
184181
@session_write_close();
185182
setcookie($session_name, $id, 0, "/");
186183
header("Location: " . dirname($_SERVER["PHP_SELF"]) . "/index.php");
184+
die();
187185
} else {
188186
session_invalid();
189187
}
190-
die();
191188
}
192189
} else {
193190
trigger_error(
@@ -198,11 +195,9 @@ function session_invalid() {
198195
E_USER_WARNING,
199196
);
200197
session_invalid();
201-
die();
202198
}
203199
}
204200
}
205201
} else {
206202
session_invalid();
207-
die();
208203
}

install/upgrade/versions/1.7.0.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,9 @@ if echo "$BACKUP_SYSTEM" | grep "google" > /dev/null; then
9999
echo "[ ! ] Deprecation notice: Backup via Google Cloud has been removed setup backup again via Rclone to reinstate the backup and restore capebilities!"
100100
add_upgrade_message "Deprecation notice: Backup via Google Cloud has been removed setup backup again via Rclone to reinstate the backup and restore capebilities!"
101101
fi
102+
103+
if [ "$PHPMYADMIN_KEY" != "" ]; then
104+
echo "[ * ] Refresh hestia-sso for PMA..."
105+
$BIN/v-delete-sys-pma-sso quiet
106+
$BIN/v-add-sys-pma-sso quiet
107+
fi

0 commit comments

Comments
 (0)