Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

error.inc.php 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. /* PERMISSIONS */
  23. define("ERR_PERM_SEARCH", _("You do not have the permission to perform searches."));
  24. define("ERR_PERM_ADD_RECORD", _("You do not have the permission to add a record to this zone."));
  25. define("ERR_PERM_EDIT_RECORD", _("You do not have the permission to edit this record."));
  26. define("ERR_PERM_EDIT_RECORD_SOA", _("You do not have the permission to edit this SOA record."));
  27. define("ERR_PERM_EDIT_RECORD_NS", _("You do not have the permission to edit this NS record."));
  28. define("ERR_PERM_VIEW_RECORD", _("You do not have the permission to view this record."));
  29. define("ERR_PERM_DEL_RECORD", _("You do not have the permission to delete this record."));
  30. define("ERR_PERM_ADD_ZONE_MASTER", _("You do not have the permission to add a master zone."));
  31. define("ERR_PERM_ADD_ZONE_SLAVE", _("You do not have the permission to add a slave zone."));
  32. define("ERR_PERM_DEL_ZONE", _("You do not have the permission to delete a zone."));
  33. define("ERR_PERM_VIEW_COMMENT", _("You do not have the permission to view this comment."));
  34. define("ERR_PERM_EDIT_COMMENT", _("You do not have the permission to edit this comment."));
  35. define("ERR_PERM_DEL_SM", _("You do not have the permission to delete a supermaster."));
  36. define("ERR_PERM_VIEW_ZONE", _("You do not have the permission to view this zone."));
  37. define("ERR_PERM_EDIT_USER", _("You do not have the permission to edit this user."));
  38. define("ERR_PERM_EDIT_PERM_TEMPL", _("You do not have the permission to edit permission templates."));
  39. define("ERR_PERM_DEL_PERM_TEMPL", _("You do not have the permission to delete permission templates."));
  40. define("ERR_PERM_ADD_USER", _("You do not have the permission to add a new user."));
  41. define("ERR_PERM_DEL_USER", _("You do not have the permission to delete this user."));
  42. define("ERR_PERM_EDIT_ZONE_TEMPL", _("You do not have the permission to edit zone templates."));
  43. define("ERR_PERM_DEL_ZONE_TEMPL", _("You do not have the permission to delete zone templates."));
  44. define("ERR_PERM_ADD_ZONE_TEMPL", _("You do not have the permission to add a zone template."));
  45. /* DOMAIN STUFF */
  46. define("ERR_DOMAIN_INVALID", _('This is an invalid zone name.'));
  47. define("ERR_SM_EXISTS", _('There is already a supermaster with this IP address and hostname.'));
  48. define("ERR_DOMAIN_EXISTS", _('There is already a zone with this name.'));
  49. /* USER STUFF */
  50. define("ERR_USER_EXIST", _('Username exist already, please choose another one.'));
  51. define("ERR_USER_NOT_EXIST", _('User does not exist.'));
  52. define("ERR_USER_WRONG_CURRENT_PASS", _('You did not enter the correct current password.'));
  53. define("ERR_USER_MATCH_NEW_PASS", _('The two new password fields do not match.'));
  54. define("ERR_PERM_TEMPL_ASSIGNED", _('This template is assigned to at least one user.'));
  55. /* OTHER */
  56. define("ERR_INV_INPUT", _('Invalid or unexpected input given.'));
  57. define("ERR_INV_ARG", _('Invalid argument(s) given to function %s'));
  58. define("ERR_INV_ARGC", _('Invalid argument(s) given to function %s %s'));
  59. define("ERR_UNKNOWN", _('Unknown error.'));
  60. define("ERR_INV_EMAIL", _('Enter a valid email address.'));
  61. define("ERR_ZONE_NOT_EXIST", _('There is no zone with this ID.'));
  62. define("ERR_REVERS_ZONE_NOT_EXIST", _('There is no matching reverse-zone for: %s.'));
  63. define("ERR_ZONE_TEMPL_NOT_EXIST", _('There is no zone template with this ID.'));
  64. define("ERR_INSTALL_DIR_EXISTS", _('The <a href="install/">install/</a> directory exists, you must remove it first before proceeding.'));
  65. define("ERR_ZONE_TEMPL_EXIST", _('Zone template with this name already exists, please choose another one.'));
  66. define("ERR_ZONE_TEMPL_IS_EMPTY", _('Template name can\'t be an empty string.'));
  67. define("ERR_DEFAULT_CRYPTOKEY_USED", _('Default session encryption key is used, please set it in your configuration file.'));
  68. define("ERR_LOCALE_FAILURE", _('Failed to set locale. Selected locale may be unsupported on this system. Please contact your administrator.'));
  69. define("ERR_ZONE_UPD", _('Zone has not been updated successfully.'));
  70. define("ERR_EXEC_NOT_ALLOWED", _('Failed to call function exec. Make sure that exec is not listed in disable_functions at php.ini'));
  71. /* DATABASE */
  72. define("ERR_DB_NO_DB_NAME", _('No database name has been set in config.inc.php.'));
  73. define("ERR_DB_NO_DB_HOST", _('No database host has been set in config.inc.php.'));
  74. define("ERR_DB_NO_DB_USER", _('No database username has been set in config.inc.php.'));
  75. define("ERR_DB_NO_DB_PASS", _('No database password has been set in config.inc.php.'));
  76. define("ERR_DB_NO_DB_TYPE", _('No or unknown database type has been set in config.inc.php.'));
  77. define("ERR_DB_NO_DB_FILE", _('No database file has been set in config.inc.php.'));
  78. define("ERR_DB_NO_DB_UPDATE", _('It seems that you forgot to update the database after Poweradmin upgrade to new version.'));
  79. define("ERR_DB_UNK_TYPE", _('Unknown database type.'));
  80. /* DNS */
  81. define("ERR_DNS_CONTENT", _('Your content field doesnt have a legit value.'));
  82. define("ERR_DNS_HOSTNAME", _('Invalid hostname.'));
  83. define("ERR_DNS_HN_INV_CHARS", _('You have invalid characters in your hostname.'));
  84. define("ERR_DNS_HN_DASH", _('A hostname can not start or end with a dash.'));
  85. define("ERR_DNS_HN_LENGTH", _('Given hostname or one of the labels is too short or too long.'));
  86. define("ERR_DNS_HN_SLASH", _('Given hostname has too many slashes.'));
  87. define("ERR_DNS_RR_TYPE", _('Unknown record type.'));
  88. define("ERR_DNS_IP", _('This is not a valid IPv4 or IPv6 address.'));
  89. define("ERR_DNS_IPV6", _('This is not a valid IPv6 address.'));
  90. define("ERR_DNS_IPV4", _('This is not a valid IPv4 address.'));
  91. define("ERR_DNS_CNAME", _('This is not a valid CNAME. Did you assign an MX or NS record to the record?'));
  92. define("ERR_DNS_CNAME_EXISTS", _('This is not a valid record. There is already exists a CNAME with this name.'));
  93. define("ERR_DNS_CNAME_UNIQUE", _('This is not a valid CNAME. There is already exists an A, AAAA or CNAME with this name.'));
  94. define("ERR_DNS_CNAME_EMPTY", _('Empty CNAME records are not allowed.'));
  95. define("ERR_DNS_NON_ALIAS_TARGET", _('You can not point a NS or MX record to a CNAME record. Remove or rame the CNAME record first, or take another name.'));
  96. define("ERR_DNS_NS_HNAME", _('NS records must be a hostnames.'));
  97. define("ERR_DNS_MX_PRIO", _('A prio field should be numeric.'));
  98. define("ERR_DNS_SOA_NAME", _('Invalid value for name field of SOA record. It should be the name of the zone.'));
  99. define("ERR_DNS_SOA_MNAME", _('You have an error in the MNAME field of the SOA record.'));
  100. define("ERR_DNS_HINFO_INV_CONTENT", _('Invalid value for content field of HINFO record.'));
  101. define("ERR_DNS_HN_TOO_LONG", _('The hostname is too long.'));
  102. define("ERR_DNS_INV_TLD", _('You are using an invalid top level domain.'));
  103. define("ERR_DNS_INV_TTL", _('Invalid value for TTL field. It should be numeric.'));
  104. define("ERR_DNS_INV_PRIO", _('Invalid value for prio field. It should be numeric.'));
  105. define("ERR_DNS_SRV_NAME_SERVICE", _('Invalid service value in name field of SRV record.'));
  106. define("ERR_DNS_SRV_NAME_PROTO", _('Invalid protocol value in name field of SRV record.'));
  107. define("ERR_DNS_SRV_NAME", _('Invalid FQDN value in name field of SRV record.'));
  108. define("ERR_DNS_SRV_WGHT", _('Invalid value for the priority field of the SRV record.'));
  109. define("ERR_DNS_SRV_PORT", _('Invalid value for the weight field of the SRV record.'));
  110. define("ERR_DNS_SRV_TRGT", _('Invalid SRV target.'));
  111. define("ERR_DNS_PRINTABLE", _('Invalid characters have been used in this record.'));
  112. /* DNSSEC */
  113. define('ERR_EXEC_PDNSSEC', _('Failed to call pdnssec utility.'));
  114. define('ERR_EXEC_PDNSSEC_ADD_ZONE_KEY', _('Failed to add new DNSSEC key.'));
  115. define('ERR_EXEC_PDNSSEC_DISABLE_ZONE', _('Failed to deactivate DNSSEC keys.'));
  116. define('ERR_EXEC_PDNSSEC_SECURE_ZONE', _('Failed to secure zone.'));
  117. define('ERR_EXEC_PDNSSEC_SHOW_ZONE', _('Failed to get DNSSEC key details.'));
  118. define('ERR_EXEC_PDNSSEC_RECTIFY_ZONE', _('Failed to rectify zone.'));
  119. define('ERR_EXEC_PDNSSEC_PRESIGNED_ZONE', _('Failed to change presigned mode'));
  120. define('ERR_PDNSSEC_DEL_ZONE_KEY', _('Failed to delete DNSSEC key.'));
  121. /* GOOD! */
  122. define("SUC_ZONE_ADD", _('Zone has been added successfully.'));
  123. define("SUC_ZONE_DEL", _('Zone has been deleted successfully.'));
  124. define("SUC_ZONES_DEL", _('Zones have been deleted successfully.'));
  125. define("SUC_ZONE_UPD", _('Zone has been updated successfully.'));
  126. define("SUC_ZONE_NOCHANGE", _('Zone did not have any record changes.'));
  127. define("SUC_ZONES_UPD", _('Zones have been updated successfully.'));
  128. define("SUC_USER_UPD", _('The user has been updated successfully.'));
  129. define("SUC_USER_ADD", _('The user has been created successfully.'));
  130. define("SUC_USER_DEL", _('The user has been deleted successfully.'));
  131. define("SUC_RECORD_UPD", _('The record has been updated successfully.'));
  132. define("SUC_RECORD_DEL", _('The record has been deleted successfully.'));
  133. define("SUC_COMMENT_UPD", _('The comment has been updated successfully.'));
  134. define("SUC_SM_DEL", _('The supermaster has been deleted successfully.'));
  135. define("SUC_SM_ADD", _('The supermaster has been added successfully.'));
  136. define("SUC_PERM_TEMPL_ADD", _('The permission template has been added successfully.'));
  137. define("SUC_PERM_TEMPL_UPD", _('The permission template has been updated successfully.'));
  138. define("SUC_PERM_TEMPL_DEL", _('The permission template has been deleted successfully.'));
  139. define("SUC_ZONE_TEMPL_ADD", _('Zone template has been added successfully.'));
  140. define("SUC_ZONE_TEMPL_UPD", _('Zone template has been updated successfully.'));
  141. define("SUC_ZONE_TEMPL_DEL", _('Zone template has been deleted successfully.'));
  142. define("SUC_EXEC_PDNSSEC_RECTIFY_ZONE", _('Zone has been rectified successfully.'));
  143. define("SUC_EXEC_PDNSSEC_ADD_ZONE_KEY", _('Zone key has been added successfully.'));
  144. define("SUC_EXEC_PDNSSEC_REMOVE_ZONE_KEY", _('Zone key has been deleted successfully.'));
  145. define("SUC_EXEC_PDNSSEC_ACTIVATE_ZONE_KEY", _('Zone key has been successfully activated.'));
  146. define("SUC_EXEC_PDNSSEC_DEACTIVATE_ZONE_KEY", _('Zone key has been successfully deactivated.'));
  147. /** Print error message (toolkit.inc)
  148. *
  149. * @param string $msg Error message
  150. * @param string $name Offending DNS record name
  151. *
  152. * @return null
  153. */
  154. function error($msg, $name = null) {
  155. if ($name == null) {
  156. echo " <div class=\"error\">Error: " . $msg . "</div>\n";
  157. } else {
  158. echo " <div class=\"error\">Error: " . $msg . " (Record: " . $name . ")</b></div>\n";
  159. }
  160. }