PageRenderTime 30ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/xampp/phpMyAdmin/setup/frames/index.inc.php

https://github.com/edmondscommerce/XAMPP-Magento-Demo-Site
PHP | 243 lines | 186 code | 21 blank | 36 comment | 24 complexity | c9f3e0e7f6c457579b4f9f24de872def MD5 | raw file
  1. <?php
  2. /**
  3. * Overview (main page)
  4. *
  5. * @package phpMyAdmin-setup
  6. * @author Piotr Przybylski <piotrprz@gmail.com>
  7. * @license http://www.gnu.org/licenses/gpl.html GNU GPL 2.0
  8. * @version $Id: index.inc.php 11650 2008-10-14 10:31:07Z crackpl $
  9. */
  10. if (!defined('PHPMYADMIN')) {
  11. exit;
  12. }
  13. require_once './libraries/display_select_lang.lib.php';
  14. require_once './setup/lib/FormDisplay.class.php';
  15. require_once './setup/lib/index.lib.php';
  16. // prepare unfiltered language list
  17. $all_languages = PMA_langList();
  18. uasort($all_languages, 'PMA_language_cmp');
  19. $cf = ConfigFile::getInstance();
  20. $separator = PMA_get_arg_separator('html');
  21. // message handling
  22. messages_begin();
  23. //
  24. // Check phpMyAdmin version
  25. //
  26. if (isset($_GET['version_check'])) {
  27. PMA_version_check();
  28. }
  29. //
  30. // Perform various security, compatibility and consistency checks
  31. //
  32. perform_config_checks();
  33. //
  34. // Check whether we can read/write configuration
  35. //
  36. $config_readable = false;
  37. $config_writable = false;
  38. $config_exists = false;
  39. check_config_rw($config_readable, $config_writable, $config_exists);
  40. if (!$config_writable || !$config_readable) {
  41. messages_set('error', 'config_rw', 'CannotLoadConfig', PMA_lang('CannotLoadConfigMsg'));
  42. }
  43. //
  44. // Check https connection
  45. //
  46. $is_https = !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';
  47. if (!$is_https) {
  48. $text = $GLOBALS['strSetupInsecureConnectionMsg1'];
  49. if (!empty($_SERVER['REQUEST_URI']) && !empty($_SERVER['HTTP_HOST'])) {
  50. $text .= ' ' . PMA_lang('InsecureConnectionMsg2',
  51. 'https://' . htmlspecialchars($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
  52. }
  53. messages_set('warning', 'no_https', 'InsecureConnection', $text);
  54. }
  55. ?>
  56. <form id="select_lang" method="post" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>">
  57. <?php echo PMA_generate_common_hidden_inputs() ?>
  58. <bdo xml:lang="en" dir="ltr"><label for="lang">
  59. <?php echo $GLOBALS['strLanguage'] . ($GLOBALS['strLanguage'] != 'Language' ? ' - Language' : '') ?>
  60. </label></bdo><br />
  61. <select id="lang" name="lang" onchange="this.form.submit();" xml:lang="en" dir="ltr">
  62. <?php
  63. // create language list
  64. $lang_list = array();
  65. foreach ($all_languages as $each_lang_key => $each_lang) {
  66. if (!file_exists($GLOBALS['lang_path'] . $each_lang[1] . '.inc.php')) {
  67. continue;
  68. }
  69. $lang_name = ucfirst(substr(strrchr($each_lang[0], '|'), 1));
  70. // Include native name if non empty
  71. if (!empty($each_lang[3])) {
  72. $lang_name = $each_lang[3] . ' - ' . $lang_name;
  73. }
  74. //Is current one active?
  75. $selected = ($GLOBALS['lang'] == $each_lang_key) ? ' selected="selected"' : '';
  76. echo '<option value="' . $each_lang_key . '"' . $selected . '>' . $lang_name
  77. . '</option>' . "\n";
  78. }
  79. ?>
  80. </select>
  81. </form>
  82. <h2><?php echo $GLOBALS['strSetupOverview'] ?></h2>
  83. <?php
  84. // message handling
  85. messages_end();
  86. messages_show_html();
  87. ?>
  88. <a href="#" id="show_hidden_messages" style="display:none"><?php echo $GLOBALS['strSetupShowHiddenMessages'] ?></a>
  89. <h3><?php echo $GLOBALS['strServers'] ?></h3>
  90. <?php
  91. //
  92. // Display server list
  93. //
  94. display_form_top('index.php', 'get', array(
  95. 'page' => 'servers',
  96. 'mode' => 'add'
  97. ));
  98. ?>
  99. <div class="form">
  100. <?php if ($cf->getServerCount() > 0): ?>
  101. <table cellspacing="0" class="datatable" style="table-layout: fixed">
  102. <tr>
  103. <th>#</th>
  104. <th><?php echo $GLOBALS['strName'] ?></th>
  105. <th>Authentication type</th>
  106. <th colspan="2">DSN</th>
  107. </tr>
  108. <?php foreach ($_SESSION['ConfigFile']['Servers'] as $id => $server): ?>
  109. <tr>
  110. <td><?php echo $id ?></td>
  111. <td><?php echo $cf->getServerName($id) ?></td>
  112. <td><?php echo htmlspecialchars($cf->getValue("Servers/$id/auth_type")) ?></td>
  113. <td><?php echo htmlspecialchars($cf->getServerDSN($id)) ?></td>
  114. <td style="white-space: nowrap">
  115. <small>
  116. <a href="<?php echo "?page=servers{$separator}mode=edit{$separator}id=$id" ?>"><?php echo $GLOBALS['strEdit'] ?></a>
  117. | <a href="<?php echo "?page=servers{$separator}mode=remove{$separator}id=$id" ?>"><?php echo $GLOBALS['strDelete'] ?></a>
  118. </small>
  119. </td>
  120. </tr>
  121. <?php endforeach; ?>
  122. </table>
  123. <?php else: ?>
  124. <table width="100%">
  125. <tr>
  126. <td>
  127. <i><?php echo $GLOBALS['strSetupNoServers'] ?></i>
  128. </td>
  129. </tr>
  130. </table>
  131. <?php endif; ?>
  132. <table width="100%">
  133. <tr>
  134. <td class="lastrow" style="text-align: left">
  135. <input type="submit" name="submit" value="<?php echo $GLOBALS['strSetupNewServer'] ?>" />
  136. </td>
  137. </tr>
  138. </table>
  139. </div>
  140. <?php
  141. display_form_bottom();
  142. ?>
  143. <h3><?php echo $GLOBALS['strSetupConfigurationFile'] ?></h3>
  144. <?php
  145. //
  146. // Display config file settings and load/save form
  147. //
  148. $form_display = new FormDisplay();
  149. display_form_top('config.php');
  150. display_fieldset_top('', '', null, array('class' => 'simple'));
  151. // Display language list
  152. $opts = array(
  153. 'doc' => $form_display->getDocLink('DefaultLang'),
  154. 'wiki' => $form_display->getWikiLink('DefaultLang'),
  155. 'values' => array(),
  156. 'values_escaped' => true);
  157. foreach ($all_languages as $each_lang_key => $each_lang) {
  158. if (!file_exists($GLOBALS['lang_path'] . $each_lang[1] . '.inc.php')) {
  159. continue;
  160. }
  161. $lang_name = ucfirst(substr(strrchr($each_lang[0], '|'), 1));
  162. // Include native name if non empty
  163. if (!empty($each_lang[3])) {
  164. $lang_name = $each_lang[3] . ' - ' . $lang_name;
  165. }
  166. $opts['values'][$each_lang_key] = $lang_name;
  167. }
  168. display_input('DefaultLang', $GLOBALS['strSetupDefaultLanguage'], '', 'select',
  169. $cf->getValue('DefaultLang'), true, $opts);
  170. // Display server list
  171. $opts = array(
  172. 'doc' => $form_display->getDocLink('ServerDefault'),
  173. 'wiki' => $form_display->getWikiLink('ServerDefault'),
  174. 'values' => array(),
  175. 'values_disabled' => array());
  176. if ($cf->getServerCount() > 0) {
  177. $opts['values']['0'] = $GLOBALS['strSetupLetUserChoose'];
  178. $opts['values']['-'] = '------------------------------';
  179. if ($cf->getServerCount() == 1) {
  180. $opts['values_disabled'][] = '0';
  181. }
  182. $opts['values_disabled'][] = '-';
  183. foreach ($_SESSION['ConfigFile']['Servers'] as $id => $server) {
  184. $opts['values'][(string)$id] = $cf->getServerName($id) . " [$id]";
  185. }
  186. } else {
  187. $opts['values']['1'] = $GLOBALS['strSetupOptionNone'];
  188. $opts['values_escaped'] = true;
  189. }
  190. display_input('ServerDefault', $GLOBALS['strSetupDefaultServer'], '', 'select',
  191. $cf->getValue('ServerDefault'), true, $opts);
  192. // Display EOL list
  193. $opts = array(
  194. 'values' => array(
  195. 'unix' => 'UNIX / Linux (\n)',
  196. 'win' => 'Windows (\r\n)'),
  197. 'values_escaped' => true);
  198. $eol = PMA_ifSetOr($_SESSION['eol'], (PMA_IS_WINDOWS ? 'win' : 'unix'));
  199. display_input('eol', $GLOBALS['strSetupEndOfLine'], '', 'select',
  200. $eol, true, $opts);
  201. ?>
  202. <tr>
  203. <td colspan="2" class="lastrow" style="text-align: left">
  204. <input type="submit" name="submit_display" value="<?php echo $GLOBALS['strSetupDisplay'] ?>" />
  205. <input type="submit" name="submit_download" value="<?php echo $GLOBALS['strSetupDownload'] ?>" />
  206. &nbsp; &nbsp;
  207. <input type="submit" name="submit_save" value="<?php echo $GLOBALS['strSave'] ?>"<?php if (!$config_writable) echo ' disabled="disabled"' ?> />
  208. <input type="submit" name="submit_load" value="<?php echo $GLOBALS['strSetupLoad'] ?>"<?php if (!$config_exists) echo ' disabled="disabled"' ?> />
  209. <input type="submit" name="submit_delete" value="<?php echo $GLOBALS['strDelete'] ?>"<?php if (!$config_exists || !$config_writable) echo ' disabled="disabled"' ?> />
  210. &nbsp; &nbsp;
  211. <input type="submit" name="submit_clear" value="<?php echo $GLOBALS['strSetupClear'] ?>" class="red" />
  212. </td>
  213. </tr>
  214. <?php
  215. display_fieldset_bottom_simple();
  216. display_form_bottom();
  217. ?>
  218. <div id="footer">
  219. <a href="http://phpmyadmin.net"><?php echo $GLOBALS['strSetupHomepageLink'] ?></a>
  220. <a href="http://sourceforge.net/donate/index.php?group_id=23067"><?php echo $GLOBALS['strSetupDonateLink'] ?></a>
  221. <a href="?version_check=1<?php echo "{$separator}token=" . $_SESSION[' PMA_token '] ?>"><?php echo $GLOBALS['strSetupVersionCheckLink'] ?></a>
  222. </div>