Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.33 KB | None | 0 0
  1. ?php
  2. /**
  3. * Debian local configuration file
  4. *
  5. * This file overrides the settings made by phpMyAdmin interactive setup
  6. * utility.
  7. *
  8. * For example configuration see
  9. * /usr/share/doc/phpmyadmin/examples/config.sample.inc.php
  10. * or
  11. * /usr/share/doc/phpmyadmin/examples/config.manyhosts.inc.php
  12. *
  13. * NOTE: do not add security sensitive data to this file (like passwords)
  14. * unless you really know what you're doing. If you do, any user that can
  15. * run PHP or CGI on your webserver will be able to read them. If you still
  16. * want to do this, make sure to properly secure the access to this file
  17. * (also on the filesystem level).
  18. */
  19.  
  20. if (!function_exists('check_file_access')) {
  21. function check_file_access($path)
  22. {
  23. if (is_readable($path)) {
  24. return true;
  25. } else {
  26. error_log(
  27. 'phpmyadmin: Failed to load ' . $path
  28. . ' Check group www-data has read access and open_basedir restrictions.'
  29. );
  30. return false;
  31. }
  32. }
  33. }
  34.  
  35. // Load secret generated on postinst
  36. if (check_file_access('/var/lib/phpmyadmin/blowfish_secret.inc.php')) {
  37. require('/var/lib/phpmyadmin/blowfish_secret.inc.php');
  38. }
  39.  
  40. // Load autoconf local config
  41. if (check_file_access('/var/lib/phpmyadmin/config.inc.php')) {
  42. require('/var/lib/phpmyadmin/config.inc.php');
  43. }
  44.  
  45. /**
  46. * Server(s) configuration
  47. */
  48. $i = 0;
  49. // The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
  50. // You can disable a server config entry by setting host to ''.
  51. $i++;
  52.  
  53. /**
  54. * Read configuration from dbconfig-common
  55. * You can regenerate it using: dpkg-reconfigure -plow phpmyadmin
  56. */
  57. if (check_file_access('/etc/phpmyadmin/config-db.php')) {
  58. require('/etc/phpmyadmin/config-db.php');
  59. }
  60.  
  61. /* Configure according to dbconfig-common if enabled */
  62. if (!empty($dbname)) {
  63. /* Authentication type */
  64. $cfg['Servers'][$i]['auth_type'] = 'cookie';
  65. /* Server parameters */
  66. if (empty($dbserver)) $dbserver = 'localhost';
  67. $cfg['Servers'][$i]['host'] = $dbserver;
  68.  
  69. if (!empty($dbport) || $dbserver != 'localhost') {
  70. $cfg['Servers'][$i]['connect_type'] = 'tcp';
  71. $cfg['Servers'][$i]['port'] = $dbport;
  72. }
  73. //$cfg['Servers'][$i]['compress'] = false;
  74. /* Select mysqli if your server has it */
  75. $cfg['Servers'][$i]['extension'] = 'mysqli';
  76. /* Optional: User for advanced features */
  77. $cfg['Servers'][$i]['controluser'] = $dbuser;
  78. $cfg['Servers'][$i]['controlpass'] = $dbpass;
  79. /* Optional: Advanced phpMyAdmin features */
  80. $cfg['Servers'][$i]['pmadb'] = $dbname;
  81. $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
  82. $cfg['Servers'][$i]['relation'] = 'pma__relation';
  83. $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
  84. $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
  85. $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
  86. $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
  87. $cfg['Servers'][$i]['history'] = 'pma__history';
  88. $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
  89. $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
  90. $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
  91. $cfg['Servers'][$i]['recent'] = 'pma__recent';
  92. $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
  93. $cfg['Servers'][$i]['users'] = 'pma__users';
  94. $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
  95. $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
  96. $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
  97. $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
  98. $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
  99. $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
  100.  
  101. /* Uncomment the following to enable logging in to passwordless accounts,
  102. * after taking note of the associated security risks. */
  103. // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
  104.  
  105. /* Advance to next server for rest of config */
  106. $i++;
  107. }
  108.  
  109. /* Authentication type */
  110. //$cfg['Servers'][$i]['auth_type'] = 'cookie';
  111. /* Server parameters */
  112. //$cfg['Servers'][$i]['host'] = 'localhost';
  113. //$cfg['Servers'][$i]['connect_type'] = 'tcp';
  114. //$cfg['Servers'][$i]['compress'] = false;
  115. /* Uncomment the following to enable logging in to passwordless accounts,
  116. * after taking note of the associated security risks. */
  117. // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
  118.  
  119. /**
  120. * phpMyAdmin configuration storage settings.
  121. */
  122.  
  123. /* User used to manipulate with storage */
  124. // $cfg['Servers'][$i]['controlhost'] = '';
  125. // $cfg['Servers'][$i]['controlport'] = '';
  126. // $cfg['Servers'][$i]['controluser'] = 'pma';
  127. // $cfg['Servers'][$i]['controlpass'] = 'pmapass';
  128.  
  129. /* Storage database and tables */
  130. // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
  131. // $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
  132. // $cfg['Servers'][$i]['relation'] = 'pma__relation';
  133. // $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
  134. // $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
  135. // $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
  136. // $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
  137. // $cfg['Servers'][$i]['history'] = 'pma__history';
  138. // $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
  139. // $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
  140. // $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
  141. // $cfg['Servers'][$i]['recent'] = 'pma__recent';
  142. // $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
  143. // $cfg['Servers'][$i]['users'] = 'pma__users';
  144. // $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
  145. // $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
  146. // $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
  147. // $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
  148. // $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
  149. // $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
  150. /* Contrib / Swekey authentication */
  151. // $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';
  152.  
  153. /*
  154. * End of servers configuration
  155. */
  156.  
  157. /*
  158. * Directories for saving/loading files from server
  159. */
  160. $cfg['UploadDir'] = '';
  161. $cfg['SaveDir'] = '';
  162.  
  163. /* Support additional configurations */
  164. foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename)
  165. {
  166. include($filename);
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement