您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

header.inc.php 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. /* Poweradmin, a friendly web-based admin tool for PowerDNS.
  3. * See <http://www.poweradmin.org> for more details.
  4. *
  5. * Copyright 2007-2009 Rejo Zenger <rejo@zenger.nl>
  6. * Copyright 2010-2017 Poweradmin Development Team
  7. * <http://www.poweradmin.org/credits.html>
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. */
  22. /**
  23. * Web interface header
  24. *
  25. * @package Poweradmin
  26. * @copyright 2007-2010 Rejo Zenger <rejo@zenger.nl>
  27. * @copyright 2010-2017 Poweradmin Development Team
  28. * @license http://opensource.org/licenses/GPL-3.0 GPL
  29. */
  30. global $iface_style;
  31. global $iface_title;
  32. global $ignore_install_dir;
  33. global $session_key;
  34. header('Content-type: text/html; charset=utf-8');
  35. echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
  36. echo "<html>\n";
  37. echo " <head>\n";
  38. echo " <title>" . $iface_title . "</title>\n";
  39. echo " <link rel=stylesheet href=\"style/" . $iface_style . ".css\" type=\"text/css\">\n";
  40. echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n";
  41. echo " </head>\n";
  42. echo " <body>\n";
  43. if (file_exists('inc/custom_header.inc.php')) {
  44. include('inc/custom_header.inc.php');
  45. } else {
  46. echo " <h1>" . $iface_title . "</h1>\n";
  47. }
  48. // this config variable is used only for development, do not use it in production
  49. //if (($ignore_install_dir == NULL || $ignore_install_dir == false) && file_exists ( 'install' )) {
  50. if (file_exists('install')) {
  51. echo "<div>\n";
  52. error(ERR_INSTALL_DIR_EXISTS);
  53. include ('inc/footer.inc.php');
  54. exit();
  55. } elseif (isset($_SESSION ["userid"])) {
  56. do_hook('verify_permission', 'search') ? $perm_search = "1" : $perm_search = "0";
  57. do_hook('verify_permission', 'zone_content_view_own') ? $perm_view_zone_own = "1" : $perm_view_zone_own = "0";
  58. do_hook('verify_permission', 'zone_content_view_others') ? $perm_view_zone_other = "1" : $perm_view_zone_other = "0";
  59. do_hook('verify_permission', 'supermaster_view') ? $perm_supermaster_view = "1" : $perm_supermaster_view = "0";
  60. do_hook('verify_permission', 'zone_master_add') ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0";
  61. do_hook('verify_permission', 'zone_slave_add') ? $perm_zone_slave_add = "1" : $perm_zone_slave_add = "0";
  62. do_hook('verify_permission', 'supermaster_add') ? $perm_supermaster_add = "1" : $perm_supermaster_add = "0";
  63. do_hook('verify_permission', 'user_is_ueberuser') ? $perm_is_godlike = "1" : $perm_is_godlike = "0";
  64. if ($perm_is_godlike == 1 && $session_key == 'p0w3r4dm1n') {
  65. error(ERR_DEFAULT_CRYPTOKEY_USED);
  66. echo "<br>";
  67. }
  68. echo " <div class=\"menu\">\n";
  69. echo " <span class=\"menuitem\"><a href=\"index.php\">" . _('Index') . "</a></span>\n";
  70. if ($perm_search == "1") {
  71. echo " <span class=\"menuitem\"><a href=\"search.php\">" . _('Search zones and records') . "</a></span>\n";
  72. }
  73. if ($perm_view_zone_own == "1" || $perm_view_zone_other == "1") {
  74. echo " <span class=\"menuitem\"><a href=\"list_zones.php\">" . _('List zones') . "</a></span>\n";
  75. }
  76. if ($perm_zone_master_add) {
  77. echo " <span class=\"menuitem\"><a href=\"list_zone_templ.php\">" . _('List zone templates') . "</a></span>\n";
  78. }
  79. if ($perm_supermaster_view) {
  80. echo " <span class=\"menuitem\"><a href=\"list_supermasters.php\">" . _('List supermasters') . "</a></span>\n";
  81. }
  82. if ($perm_zone_master_add) {
  83. echo " <span class=\"menuitem\"><a href=\"add_zone_master.php\">" . _('Add master zone') . "</a></span>\n";
  84. }
  85. if ($perm_zone_slave_add) {
  86. echo " <span class=\"menuitem\"><a href=\"add_zone_slave.php\">" . _('Add slave zone') . "</a></span>\n";
  87. }
  88. if ($perm_supermaster_add) {
  89. echo " <span class=\"menuitem\"><a href=\"add_supermaster.php\">" . _('Add supermaster') . "</a></span>\n";
  90. }
  91. if ($perm_zone_master_add) {
  92. echo " <span class=\"menuitem\"><a href=\"bulk_registration.php\">" . _('Bulk registration') . "</a></span>\n";
  93. }
  94. if ($_SESSION ["auth_used"] != "ldap") {
  95. echo " <span class=\"menuitem\"><a href=\"change_password.php\">" . _('Change password') . "</a></span>\n";
  96. }
  97. echo " <span class=\"menuitem\"><a href=\"users.php\">" . _('User administration') . "</a></span>\n";
  98. echo " <span class=\"menuitem\"><a href=\"index.php?logout\">" . _('Logout') . "</a></span>\n";
  99. echo " </div> <!-- /menu -->\n";
  100. }
  101. echo " <div class=\"content\">\n";