Skip to content

Commit 982ca62

Browse files
authored
[Bugs] Issue in PMA feature (hestiacp#1590)
* Added correct install to uninstall Fixed issue with pma unable to select database * Spell check
1 parent a2ce6ca commit 982ca62

File tree

5 files changed

+66
-57
lines changed

5 files changed

+66
-57
lines changed

bin/v-add-sys-pma-sso

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if [ "x$(id -u)" != 'x0' ]; then
3434
fi
3535

3636
if [ ! -z "$PHPMYADMIN_KEY" ] && [ "$PHPMYADMIN_KEY" != "" ] ; then
37-
echo "Error: SSO has been installed before to reenable it please run v-delete-pma-sso first"
37+
echo "Error: SSO has been installed before to reenable it please run v-delete-sys-pma-sso first"
3838
exit 1;
3939
fi
4040

install/deb/phpmyadmin/config.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
* You can find more configuration options in the documentation
2626
* in the doc/ folder or at <https://docs.phpmyadmin.net/>.
2727
*/
28-
$i = 0;
28+
29+
//start with 1 other wise it doesn't work
30+
$i = 1;
2931
foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename)
3032
{
3133
include($filename);

install/deb/phpmyadmin/hestia-sso.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ function session_invalid(){
145145
$data = $api -> create_temp_user($database,$user, $host);
146146
$_SESSION['PMA_single_signon_user'] = $data -> login -> user;
147147
$_SESSION['PMA_single_signon_password'] = $data -> login -> password ;
148+
$_SESSION['PMA_single_signon_host'] = $host;
148149
//save database / username to be used for sending logout notification.
149150
$_SESSION['HESTIA_sso_user'] = $user;
150151
$_SESSION['HESTIA_sso_database'] = $database;

install/deb/phpmyadmin/pma.sh

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,34 @@
1313
PASS=$(gen_pass)
1414

1515
#ubuntu phpmyadmin path
16-
pmapath1="/etc/phpmyadmin/conf.d/01-localhost.php"
17-
18-
echo "\$cfg['Servers'][\$i]['favorite'] = 'pma__favorite';" >> $pmapath1
19-
echo "\$cfg['Servers'][\$i]['usergroups'] = 'pma__usergroups';" >> $pmapath1
20-
echo "\$cfg['Servers'][\$i]['central_columns'] = 'pma__central_columns';" >> $pmapath1
21-
echo "\$cfg['Servers'][\$i]['designer_settings'] = 'pma__designer_settings';" >> $pmapath1
22-
echo "\$cfg['Servers'][\$i]['export_templates'] = 'pma__export_templates';" >> $pmapath1
23-
echo "\$cfg['Servers'][\$i]['savedsearches'] = 'pma__savedsearches';" >> $pmapath1
24-
echo "\$cfg['Servers'][\$i]['navigationhiding'] = 'pma__navigationhiding';" >> $pmapath1
25-
echo "\$cfg['Servers'][\$i]['users'] = 'pma__users';" >> $pmapath1
26-
echo "\$cfg['Servers'][\$i]['usergroups'] = 'pma__usergroups';" >> $pmapath1
27-
echo "\$cfg['Servers'][\$i]['pmadb'] = 'phpmyadmin';" >> $pmapath1
28-
echo "\$cfg['Servers'][\$i]['controluser'] = 'pma';" >> $pmapath1
29-
echo "\$cfg['Servers'][\$i]['controlpass'] = '$PASS';" >> $pmapath1
30-
echo "\$cfg['Servers'][\$i]['bookmarktable'] = 'pma__bookmark';" >> $pmapath1
31-
echo "\$cfg['Servers'][\$i]['relation'] = 'pma__relation';" >> $pmapath1
32-
echo "\$cfg['Servers'][\$i]['userconfig'] = 'pma__userconfig';" >> $pmapath1
33-
echo "\$cfg['Servers'][\$i]['table_info'] = 'pma__table_info';" >> $pmapath1
34-
echo "\$cfg['Servers'][\$i]['column_info'] = 'pma__column_info';" >> $pmapath1
35-
echo "\$cfg['Servers'][\$i]['history'] = 'pma__history';" >> $pmapath1
36-
echo "\$cfg['Servers'][\$i]['recent'] = 'pma__recent';" >> $pmapath1
37-
echo "\$cfg['Servers'][\$i]['table_uiprefs'] = 'pma__table_uiprefs';" >> $pmapath1
38-
echo "\$cfg['Servers'][\$i]['tracking'] = 'pma__tracking';" >> $pmapath1
39-
echo "\$cfg['Servers'][\$i]['table_coords'] = 'pma__table_coords';" >> $pmapath1
40-
echo "\$cfg['Servers'][\$i]['pdf_pages'] = 'pma__pdf_pages';" >> $pmapath1
41-
echo "\$cfg['Servers'][\$i]['designer_coords'] = 'pma__designer_coords';" >> $pmapath1
16+
pmapath="/etc/phpmyadmin/conf.d/01-localhost.php"
17+
echo "<?php " >> $pmapath
18+
echo "\$cfg['Servers'][\$i]['host'] = 'localhost';" >> $pmapath
19+
echo "\$cfg['Servers'][\$i]['port'] = '3306';" >> $pmapath
20+
echo "\$cfg['Servers'][\$i]['favorite'] = 'pma__favorite';" >> $pmapath
21+
echo "\$cfg['Servers'][\$i]['usergroups'] = 'pma__usergroups';" >> $pmapath
22+
echo "\$cfg['Servers'][\$i]['central_columns'] = 'pma__central_columns';" >> $pmapath
23+
echo "\$cfg['Servers'][\$i]['designer_settings'] = 'pma__designer_settings';" >> $pmapath
24+
echo "\$cfg['Servers'][\$i]['export_templates'] = 'pma__export_templates';" >> $pmapath
25+
echo "\$cfg['Servers'][\$i]['savedsearches'] = 'pma__savedsearches';" >> $pmapath
26+
echo "\$cfg['Servers'][\$i]['navigationhiding'] = 'pma__navigationhiding';" >> $pmapath
27+
echo "\$cfg['Servers'][\$i]['users'] = 'pma__users';" >> $pmapath
28+
echo "\$cfg['Servers'][\$i]['usergroups'] = 'pma__usergroups';" >> $pmapath
29+
echo "\$cfg['Servers'][\$i]['pmadb'] = 'phpmyadmin';" >> $pmapath
30+
echo "\$cfg['Servers'][\$i]['controluser'] = 'pma';" >> $pmapath
31+
echo "\$cfg['Servers'][\$i]['controlpass'] = '$PASS';" >> $pmapath
32+
echo "\$cfg['Servers'][\$i]['bookmarktable'] = 'pma__bookmark';" >> $pmapath
33+
echo "\$cfg['Servers'][\$i]['relation'] = 'pma__relation';" >> $pmapath
34+
echo "\$cfg['Servers'][\$i]['userconfig'] = 'pma__userconfig';" >> $pmapath
35+
echo "\$cfg['Servers'][\$i]['table_info'] = 'pma__table_info';" >> $pmapath
36+
echo "\$cfg['Servers'][\$i]['column_info'] = 'pma__column_info';" >> $pmapath
37+
echo "\$cfg['Servers'][\$i]['history'] = 'pma__history';" >> $pmapath
38+
echo "\$cfg['Servers'][\$i]['recent'] = 'pma__recent';" >> $pmapath
39+
echo "\$cfg['Servers'][\$i]['table_uiprefs'] = 'pma__table_uiprefs';" >> $pmapath
40+
echo "\$cfg['Servers'][\$i]['tracking'] = 'pma__tracking';" >> $pmapath
41+
echo "\$cfg['Servers'][\$i]['table_coords'] = 'pma__table_coords';" >> $pmapath
42+
echo "\$cfg['Servers'][\$i]['pdf_pages'] = 'pma__pdf_pages';" >> $pmapath
43+
echo "\$cfg['Servers'][\$i]['designer_coords'] = 'pma__designer_coords';" >> $pmapath
4244

4345
#SOME WORK with DATABASE (table / user)
4446
PMADB=phpmyadmin

install/upgrade/manual/migrate_phpmyadmin.sh

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ source $HESTIA/conf/hestia.conf
1818
#----------------------------------------------------------#
1919

2020
echo "For deleting PHPmyAdmin you will need confirm the removal with root password. Password can be found in /usr/local/hestia/conf/mysql.conf"
21-
read -p "Please enter Y to continue" -n 1 -r
21+
read -p 'Would you like to continue? [y/n]'
2222
echo # (optional) move to a new line
2323
if [[ $REPLY =~ ^[Yy]$ ]]
2424
then
@@ -69,7 +69,7 @@ then
6969
# Create copy of config file
7070
cp -f $HESTIA_INSTALL_DIR/phpmyadmin/config.inc.php /etc/phpmyadmin/
7171
mkdir -p /var/lib/phpmyadmin/tmp
72-
chmod 777 /var/lib/phpmyadmin/tmp
72+
chmod 777 -R /var/lib/phpmyadmin/tmp
7373

7474
# Set config and log directory
7575
sed -i "s|define('CONFIG_DIR', ROOT_PATH);|define('CONFIG_DIR', '/etc/phpmyadmin/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
@@ -83,40 +83,44 @@ then
8383
rm -fr phpMyAdmin-$pma_v-all-languages
8484
rm -f phpMyAdmin-$pma_v-all-languages.tar.gz
8585

86-
echo "DB_PMA_ALIAS='phpmyadmin'" >> $HESTIA/conf/hestia.conf
86+
if [ -z '$DB_PMA_ALIAS' ]; then
87+
echo "DB_PMA_ALIAS='phpmyadmin'" >> $HESTIA/conf/hestia.conf
88+
fi
8789
$HESTIA/bin/v-change-sys-db-alias 'pma' "phpmyadmin"
8890

8991
# Special thanks to Pavel Galkin (https://skurudo.ru)
9092
# https://github.com/skurudo/phpmyadmin-fixer
9193

9294
echo "[ * ] Createing localhost config"
9395
#ubuntu phpmyadmin path
94-
pmapath1="/etc/phpmyadmin/conf.d/01-localhost.php"
95-
96-
echo "\$cfg['Servers'][\$i]['favorite'] = 'pma__favorite';" >> $pmapath1
97-
echo "\$cfg['Servers'][\$i]['usergroups'] = 'pma__usergroups';" >> $pmapath1
98-
echo "\$cfg['Servers'][\$i]['central_columns'] = 'pma__central_columns';" >> $pmapath1
99-
echo "\$cfg['Servers'][\$i]['designer_settings'] = 'pma__designer_settings';" >> $pmapath1
100-
echo "\$cfg['Servers'][\$i]['export_templates'] = 'pma__export_templates';" >> $pmapath1
101-
echo "\$cfg['Servers'][\$i]['savedsearches'] = 'pma__savedsearches';" >> $pmapath1
102-
echo "\$cfg['Servers'][\$i]['navigationhiding'] = 'pma__navigationhiding';" >> $pmapath1
103-
echo "\$cfg['Servers'][\$i]['users'] = 'pma__users';" >> $pmapath1
104-
echo "\$cfg['Servers'][\$i]['usergroups'] = 'pma__usergroups';" >> $pmapath1
105-
echo "\$cfg['Servers'][\$i]['pmadb'] = 'phpmyadmin';" >> $pmapath1
106-
echo "\$cfg['Servers'][\$i]['controluser'] = 'pma';" >> $pmapath1
107-
echo "\$cfg['Servers'][\$i]['controlpass'] = '$PASS';" >> $pmapath1
108-
echo "\$cfg['Servers'][\$i]['bookmarktable'] = 'pma__bookmark';" >> $pmapath1
109-
echo "\$cfg['Servers'][\$i]['relation'] = 'pma__relation';" >> $pmapath1
110-
echo "\$cfg['Servers'][\$i]['userconfig'] = 'pma__userconfig';" >> $pmapath1
111-
echo "\$cfg['Servers'][\$i]['table_info'] = 'pma__table_info';" >> $pmapath1
112-
echo "\$cfg['Servers'][\$i]['column_info'] = 'pma__column_info';" >> $pmapath1
113-
echo "\$cfg['Servers'][\$i]['history'] = 'pma__history';" >> $pmapath1
114-
echo "\$cfg['Servers'][\$i]['recent'] = 'pma__recent';" >> $pmapath1
115-
echo "\$cfg['Servers'][\$i]['table_uiprefs'] = 'pma__table_uiprefs';" >> $pmapath1
116-
echo "\$cfg['Servers'][\$i]['tracking'] = 'pma__tracking';" >> $pmapath1
117-
echo "\$cfg['Servers'][\$i]['table_coords'] = 'pma__table_coords';" >> $pmapath1
118-
echo "\$cfg['Servers'][\$i]['pdf_pages'] = 'pma__pdf_pages';" >> $pmapath1
119-
echo "\$cfg['Servers'][\$i]['designer_coords'] = 'pma__designer_coords';" >> $pmapath1
96+
pmapath="/etc/phpmyadmin/conf.d/01-localhost.php"
97+
echo "<?php " >> $pmapath
98+
echo "\$cfg['Servers'][\$i]['host'] = 'localhost';" >> $pmapath
99+
echo "\$cfg['Servers'][\$i]['port'] = '3306';" >> $pmapath
100+
echo "\$cfg['Servers'][\$i]['favorite'] = 'pma__favorite';" >> $pmapath
101+
echo "\$cfg['Servers'][\$i]['usergroups'] = 'pma__usergroups';" >> $pmapath
102+
echo "\$cfg['Servers'][\$i]['central_columns'] = 'pma__central_columns';" >> $pmapath
103+
echo "\$cfg['Servers'][\$i]['designer_settings'] = 'pma__designer_settings';" >> $pmapath
104+
echo "\$cfg['Servers'][\$i]['export_templates'] = 'pma__export_templates';" >> $pmapath
105+
echo "\$cfg['Servers'][\$i]['savedsearches'] = 'pma__savedsearches';" >> $pmapath
106+
echo "\$cfg['Servers'][\$i]['navigationhiding'] = 'pma__navigationhiding';" >> $pmapath
107+
echo "\$cfg['Servers'][\$i]['users'] = 'pma__users';" >> $pmapath
108+
echo "\$cfg['Servers'][\$i]['usergroups'] = 'pma__usergroups';" >> $pmapath
109+
echo "\$cfg['Servers'][\$i]['pmadb'] = 'phpmyadmin';" >> $pmapath
110+
echo "\$cfg['Servers'][\$i]['controluser'] = 'pma';" >> $pmapath
111+
echo "\$cfg['Servers'][\$i]['controlpass'] = '$PASS';" >> $pmapath
112+
echo "\$cfg['Servers'][\$i]['bookmarktable'] = 'pma__bookmark';" >> $pmapath
113+
echo "\$cfg['Servers'][\$i]['relation'] = 'pma__relation';" >> $pmapath
114+
echo "\$cfg['Servers'][\$i]['userconfig'] = 'pma__userconfig';" >> $pmapath
115+
echo "\$cfg['Servers'][\$i]['table_info'] = 'pma__table_info';" >> $pmapath
116+
echo "\$cfg['Servers'][\$i]['column_info'] = 'pma__column_info';" >> $pmapath
117+
echo "\$cfg['Servers'][\$i]['history'] = 'pma__history';" >> $pmapath
118+
echo "\$cfg['Servers'][\$i]['recent'] = 'pma__recent';" >> $pmapath
119+
echo "\$cfg['Servers'][\$i]['table_uiprefs'] = 'pma__table_uiprefs';" >> $pmapath
120+
echo "\$cfg['Servers'][\$i]['tracking'] = 'pma__tracking';" >> $pmapath
121+
echo "\$cfg['Servers'][\$i]['table_coords'] = 'pma__table_coords';" >> $pmapath
122+
echo "\$cfg['Servers'][\$i]['pdf_pages'] = 'pma__pdf_pages';" >> $pmapath
123+
echo "\$cfg['Servers'][\$i]['designer_coords'] = 'pma__designer_coords';" >> $pmapath
120124

121125
#SOME WORK with DATABASE (table / user)
122126
PMADB=phpmyadmin

0 commit comments

Comments
 (0)