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

Hide information_scheme database on default (#2609)

* Hide information_scheme database on default

* Add update existing servers
Jaap Marcus 3 лет назад
Родитель
Сommit
e819202824
2 измененных файлов с 10 добавлено и 0 удалено
  1. 1 0
      install/deb/phpmyadmin/pma.sh
  2. 9 0
      install/upgrade/versions/1.6.0.sh

+ 1 - 0
install/deb/phpmyadmin/pma.sh

@@ -41,6 +41,7 @@ echo "\$cfg['Servers'][\$i]['tracking'] = 'pma__tracking';" >> $pmapath
 echo "\$cfg['Servers'][\$i]['table_coords'] = 'pma__table_coords';" >> $pmapath
 echo "\$cfg['Servers'][\$i]['table_coords'] = 'pma__table_coords';" >> $pmapath
 echo "\$cfg['Servers'][\$i]['pdf_pages'] = 'pma__pdf_pages';" >> $pmapath
 echo "\$cfg['Servers'][\$i]['pdf_pages'] = 'pma__pdf_pages';" >> $pmapath
 echo "\$cfg['Servers'][\$i]['designer_coords'] = 'pma__designer_coords';" >> $pmapath
 echo "\$cfg['Servers'][\$i]['designer_coords'] = 'pma__designer_coords';" >> $pmapath
+echo "\$cfg['Servers'][\$i]['hide_db'] = 'information_schema';" >> $pmapath
 
 
 #SOME WORK with DATABASE (table / user)
 #SOME WORK with DATABASE (table / user)
 PMADB=phpmyadmin
 PMADB=phpmyadmin

+ 9 - 0
install/upgrade/versions/1.6.0.sh

@@ -93,4 +93,13 @@ fi
 if [ -f "/etc/cron.d/hestia-sftp" ]; then
 if [ -f "/etc/cron.d/hestia-sftp" ]; then
     rm /etc/cron.d/hestia-sftp
     rm /etc/cron.d/hestia-sftp
     echo "@reboot root sleep 60 && /usr/local/hestia/bin/v-add-sys-sftp-jail > /dev/null" > /etc/cron.d/hestia-sftp
     echo "@reboot root sleep 60 && /usr/local/hestia/bin/v-add-sys-sftp-jail > /dev/null" > /etc/cron.d/hestia-sftp
+fi
+
+if [ -d /etc/phpmyadmin/conf.d ]; then
+    for file in /etc/phpmyadmin/conf.d/*; do
+        if [ -z $(cat $file | grep 'information_schema') ]; then
+            echo "[ * ] Update phpMyAdmin server configuration"
+            echo "\$cfg['Servers'][\$i]['hide_db'] = 'information_schema';" >> $file
+        fi
+    done
 fi
 fi