Browse Source

updated poweradmin to 2.1.8

tags/v2.0.0
Robin Thoni 6 years ago
parent
commit
0a7e027216
100 changed files with 24369 additions and 1 deletions
  1. 1
    1
      poweradmin/Dockerfile
  2. 9
    0
      poweradmin/poweradmin-2.1.8/.gitignore
  3. 622
    0
      poweradmin/poweradmin-2.1.8/LICENSE
  4. 3
    0
      poweradmin/poweradmin-2.1.8/README.md
  5. 86
    0
      poweradmin/poweradmin-2.1.8/add_perm_templ.php
  6. 236
    0
      poweradmin/poweradmin-2.1.8/add_record.php
  7. 120
    0
      poweradmin/poweradmin-2.1.8/add_supermaster.php
  8. 90
    0
      poweradmin/poweradmin-2.1.8/add_user.php
  9. 192
    0
      poweradmin/poweradmin-2.1.8/add_zone_master.php
  10. 129
    0
      poweradmin/poweradmin-2.1.8/add_zone_slave.php
  11. 66
    0
      poweradmin/poweradmin-2.1.8/add_zone_templ.php
  12. 165
    0
      poweradmin/poweradmin-2.1.8/add_zone_templ_record.php
  13. 9
    0
      poweradmin/poweradmin-2.1.8/addons/clientip.php
  14. 43
    0
      poweradmin/poweradmin-2.1.8/addons/dynamic_dns_client.pl
  15. 164
    0
      poweradmin/poweradmin-2.1.8/bulk_registration.php
  16. 64
    0
      poweradmin/poweradmin-2.1.8/change_password.php
  17. 23
    0
      poweradmin/poweradmin-2.1.8/composer.json
  18. 103
    0
      poweradmin/poweradmin-2.1.8/delete_domain.php
  19. 103
    0
      poweradmin/poweradmin-2.1.8/delete_domains.php
  20. 67
    0
      poweradmin/poweradmin-2.1.8/delete_perm_templ.php
  21. 136
    0
      poweradmin/poweradmin-2.1.8/delete_record.php
  22. 82
    0
      poweradmin/poweradmin-2.1.8/delete_supermaster.php
  23. 127
    0
      poweradmin/poweradmin-2.1.8/delete_user.php
  24. 66
    0
      poweradmin/poweradmin-2.1.8/delete_zone_templ.php
  25. 89
    0
      poweradmin/poweradmin-2.1.8/delete_zone_templ_record.php
  26. 113
    0
      poweradmin/poweradmin-2.1.8/dnssec.php
  27. 150
    0
      poweradmin/poweradmin-2.1.8/dnssec_add_key.php
  28. 98
    0
      poweradmin/poweradmin-2.1.8/dnssec_delete_key.php
  29. 95
    0
      poweradmin/poweradmin-2.1.8/dnssec_ds_dnskey.php
  30. 108
    0
      poweradmin/poweradmin-2.1.8/dnssec_edit_key.php
  31. 238
    0
      poweradmin/poweradmin-2.1.8/dynamic_update.php
  32. 521
    0
      poweradmin/poweradmin-2.1.8/edit.php
  33. 117
    0
      poweradmin/poweradmin-2.1.8/edit_comment.php
  34. 99
    0
      poweradmin/poweradmin-2.1.8/edit_perm_templ.php
  35. 157
    0
      poweradmin/poweradmin-2.1.8/edit_record.php
  36. 172
    0
      poweradmin/poweradmin-2.1.8/edit_user.php
  37. 193
    0
      poweradmin/poweradmin-2.1.8/edit_zone_templ.php
  38. 110
    0
      poweradmin/poweradmin-2.1.8/edit_zone_templ_record.php
  39. BIN
      poweradmin/poweradmin-2.1.8/favicon.ico
  40. BIN
      poweradmin/poweradmin-2.1.8/images/arrow.png
  41. BIN
      poweradmin/poweradmin-2.1.8/images/background.jpg
  42. BIN
      poweradmin/poweradmin-2.1.8/images/delete.gif
  43. BIN
      poweradmin/poweradmin-2.1.8/images/edit.gif
  44. BIN
      poweradmin/poweradmin-2.1.8/images/logo.png
  45. BIN
      poweradmin/poweradmin-2.1.8/images/switch_user.png
  46. 249
    0
      poweradmin/poweradmin-2.1.8/inc/PDOCommon.class.php
  47. 253
    0
      poweradmin/poweradmin-2.1.8/inc/PDOLayer.php
  48. 64
    0
      poweradmin/poweradmin-2.1.8/inc/RecordLog.class.php
  49. 36
    0
      poweradmin/poweradmin-2.1.8/inc/auth.inc.php
  50. 44
    0
      poweradmin/poweradmin-2.1.8/inc/benchmark.php
  51. 79
    0
      poweradmin/poweradmin-2.1.8/inc/config-me.inc.php
  52. 79
    0
      poweradmin/poweradmin-2.1.8/inc/config.inc.php
  53. 188
    0
      poweradmin/poweradmin-2.1.8/inc/countrycodes.inc.php
  54. 168
    0
      poweradmin/poweradmin-2.1.8/inc/database.inc.php
  55. 849
    0
      poweradmin/poweradmin-2.1.8/inc/dns.inc.php
  56. 617
    0
      poweradmin/poweradmin-2.1.8/inc/dnssec.inc.php
  57. 171
    0
      poweradmin/poweradmin-2.1.8/inc/error.inc.php
  58. 35
    0
      poweradmin/poweradmin-2.1.8/inc/file.inc.php
  59. 71
    0
      poweradmin/poweradmin-2.1.8/inc/footer.inc.php
  60. 108
    0
      poweradmin/poweradmin-2.1.8/inc/header.inc.php
  61. 148
    0
      poweradmin/poweradmin-2.1.8/inc/helper.js
  62. 50
    0
      poweradmin/poweradmin-2.1.8/inc/i18n.inc.php
  63. 80
    0
      poweradmin/poweradmin-2.1.8/inc/migrations.inc.php
  64. 105
    0
      poweradmin/poweradmin-2.1.8/inc/plugin.inc.php
  65. 2
    0
      poweradmin/poweradmin-2.1.8/inc/plugins/.gitignore
  66. 223
    0
      poweradmin/poweradmin-2.1.8/inc/plugins/auth_local/auth_local.plugin.php
  67. 884
    0
      poweradmin/poweradmin-2.1.8/inc/plugins/users_local/users_local.plugin.php
  68. 2143
    0
      poweradmin/poweradmin-2.1.8/inc/record.inc.php
  69. 635
    0
      poweradmin/poweradmin-2.1.8/inc/templates.inc.php
  70. 819
    0
      poweradmin/poweradmin-2.1.8/inc/toolkit.inc.php
  71. 251
    0
      poweradmin/poweradmin-2.1.8/inc/users.inc.php
  72. 75
    0
      poweradmin/poweradmin-2.1.8/index.php
  73. 74
    0
      poweradmin/poweradmin-2.1.8/list_perm_templ.php
  74. 72
    0
      poweradmin/poweradmin-2.1.8/list_supermasters.php
  75. 73
    0
      poweradmin/poweradmin-2.1.8/list_zone_templ.php
  76. 164
    0
      poweradmin/poweradmin-2.1.8/list_zones.php
  77. 1163
    0
      poweradmin/poweradmin-2.1.8/locale/cs_CZ/LC_MESSAGES/cs.po
  78. 88
    0
      poweradmin/poweradmin-2.1.8/locale/cs_CZ/LC_MESSAGES/cs_db.po
  79. BIN
      poweradmin/poweradmin-2.1.8/locale/cs_CZ/LC_MESSAGES/messages.mo
  80. 977
    0
      poweradmin/poweradmin-2.1.8/locale/de_DE/LC_MESSAGES/de.po
  81. BIN
      poweradmin/poweradmin-2.1.8/locale/de_DE/LC_MESSAGES/messages.mo
  82. 1237
    0
      poweradmin/poweradmin-2.1.8/locale/en_EN/LC_MESSAGES/en.po
  83. BIN
      poweradmin/poweradmin-2.1.8/locale/en_EN/LC_MESSAGES/messages.mo
  84. 887
    0
      poweradmin/poweradmin-2.1.8/locale/fr_FR/LC_MESSAGES/fr.po
  85. 79
    0
      poweradmin/poweradmin-2.1.8/locale/fr_FR/LC_MESSAGES/fr_db.po
  86. BIN
      poweradmin/poweradmin-2.1.8/locale/fr_FR/LC_MESSAGES/messages.mo
  87. 82
    0
      poweradmin/poweradmin-2.1.8/locale/i18n-template-db.pot
  88. 1081
    0
      poweradmin/poweradmin-2.1.8/locale/i18n-template-php.pot
  89. 1256
    0
      poweradmin/poweradmin-2.1.8/locale/ja_JP/LC_MESSAGES/ja.po
  90. BIN
      poweradmin/poweradmin-2.1.8/locale/ja_JP/LC_MESSAGES/messages.mo
  91. 1163
    0
      poweradmin/poweradmin-2.1.8/locale/lt_LT/LC_MESSAGES/lt.po
  92. 88
    0
      poweradmin/poweradmin-2.1.8/locale/lt_LT/LC_MESSAGES/lt_db.po
  93. BIN
      poweradmin/poweradmin-2.1.8/locale/lt_LT/LC_MESSAGES/messages.mo
  94. BIN
      poweradmin/poweradmin-2.1.8/locale/nb_NO/LC_MESSAGES/messages.mo
  95. 1162
    0
      poweradmin/poweradmin-2.1.8/locale/nb_NO/LC_MESSAGES/nb.po
  96. 85
    0
      poweradmin/poweradmin-2.1.8/locale/nb_NO/LC_MESSAGES/nb_db.po
  97. BIN
      poweradmin/poweradmin-2.1.8/locale/nl_NL/LC_MESSAGES/messages.mo
  98. 1161
    0
      poweradmin/poweradmin-2.1.8/locale/nl_NL/LC_MESSAGES/nl.po
  99. 85
    0
      poweradmin/poweradmin-2.1.8/locale/nl_NL/LC_MESSAGES/nl_db.po
  100. 0
    0
      poweradmin/poweradmin-2.1.8/locale/pl_PL/LC_MESSAGES/messages.mo

+ 1
- 1
poweradmin/Dockerfile View File

@@ -49,7 +49,7 @@ RUN rm -rf /etc/powerdns/*
49 49
 
50 50
 COPY apache2.conf /etc/apache2/apache2.conf
51 51
 
52
-COPY ./poweradmin-2.1.7/ /var/www/html/
52
+COPY ./poweradmin-2.1.8/ /var/www/html/
53 53
 
54 54
 COPY ./vars-vars /etc/vars-vars
55 55
 

+ 9
- 0
poweradmin/poweradmin-2.1.8/.gitignore View File

@@ -0,0 +1,9 @@
1
+.DS_Store
2
+/nbproject
3
+/scripts
4
+/tests
5
+/.idea
6
+/docs
7
+/.settings/
8
+/.buildpath
9
+/.project

+ 622
- 0
poweradmin/poweradmin-2.1.8/LICENSE View File

@@ -0,0 +1,622 @@
1
+                    GNU GENERAL PUBLIC LICENSE
2
+                       Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+                            Preamble
9
+
10
+  The GNU General Public License is a free, copyleft license for
11
+software and other kinds of works.
12
+
13
+  The licenses for most software and other practical works are designed
14
+to take away your freedom to share and change the works.  By contrast,
15
+the GNU General Public License is intended to guarantee your freedom to
16
+share and change all versions of a program--to make sure it remains free
17
+software for all its users.  We, the Free Software Foundation, use the
18
+GNU General Public License for most of our software; it applies also to
19
+any other work released this way by its authors.  You can apply it to
20
+your programs, too.
21
+
22
+  When we speak of free software, we are referring to freedom, not
23
+price.  Our General Public Licenses are designed to make sure that you
24
+have the freedom to distribute copies of free software (and charge for
25
+them if you wish), that you receive source code or can get it if you
26
+want it, that you can change the software or use pieces of it in new
27
+free programs, and that you know you can do these things.
28
+
29
+  To protect your rights, we need to prevent others from denying you
30
+these rights or asking you to surrender the rights.  Therefore, you have
31
+certain responsibilities if you distribute copies of the software, or if
32
+you modify it: responsibilities to respect the freedom of others.
33
+
34
+  For example, if you distribute copies of such a program, whether
35
+gratis or for a fee, you must pass on to the recipients the same
36
+freedoms that you received.  You must make sure that they, too, receive
37
+or can get the source code.  And you must show them these terms so they
38
+know their rights.
39
+
40
+  Developers that use the GNU GPL protect your rights with two steps:
41
+(1) assert copyright on the software, and (2) offer you this License
42
+giving you legal permission to copy, distribute and/or modify it.
43
+
44
+  For the developers' and authors' protection, the GPL clearly explains
45
+that there is no warranty for this free software.  For both users' and
46
+authors' sake, the GPL requires that modified versions be marked as
47
+changed, so that their problems will not be attributed erroneously to
48
+authors of previous versions.
49
+
50
+  Some devices are designed to deny users access to install or run
51
+modified versions of the software inside them, although the manufacturer
52
+can do so.  This is fundamentally incompatible with the aim of
53
+protecting users' freedom to change the software.  The systematic
54
+pattern of such abuse occurs in the area of products for individuals to
55
+use, which is precisely where it is most unacceptable.  Therefore, we
56
+have designed this version of the GPL to prohibit the practice for those
57
+products.  If such problems arise substantially in other domains, we
58
+stand ready to extend this provision to those domains in future versions
59
+of the GPL, as needed to protect the freedom of users.
60
+
61
+  Finally, every program is threatened constantly by software patents.
62
+States should not allow patents to restrict development and use of
63
+software on general-purpose computers, but in those that do, we wish to
64
+avoid the special danger that patents applied to a free program could
65
+make it effectively proprietary.  To prevent this, the GPL assures that
66
+patents cannot be used to render the program non-free.
67
+
68
+  The precise terms and conditions for copying, distribution and
69
+modification follow.
70
+
71
+                       TERMS AND CONDITIONS
72
+
73
+  0. Definitions.
74
+
75
+  "This License" refers to version 3 of the GNU General Public License.
76
+
77
+  "Copyright" also means copyright-like laws that apply to other kinds of
78
+works, such as semiconductor masks.
79
+
80
+  "The Program" refers to any copyrightable work licensed under this
81
+License.  Each licensee is addressed as "you".  "Licensees" and
82
+"recipients" may be individuals or organizations.
83
+
84
+  To "modify" a work means to copy from or adapt all or part of the work
85
+in a fashion requiring copyright permission, other than the making of an
86
+exact copy.  The resulting work is called a "modified version" of the
87
+earlier work or a work "based on" the earlier work.
88
+
89
+  A "covered work" means either the unmodified Program or a work based
90
+on the Program.
91
+
92
+  To "propagate" a work means to do anything with it that, without
93
+permission, would make you directly or secondarily liable for
94
+infringement under applicable copyright law, except executing it on a
95
+computer or modifying a private copy.  Propagation includes copying,
96
+distribution (with or without modification), making available to the
97
+public, and in some countries other activities as well.
98
+
99
+  To "convey" a work means any kind of propagation that enables other
100
+parties to make or receive copies.  Mere interaction with a user through
101
+a computer network, with no transfer of a copy, is not conveying.
102
+
103
+  An interactive user interface displays "Appropriate Legal Notices"
104
+to the extent that it includes a convenient and prominently visible
105
+feature that (1) displays an appropriate copyright notice, and (2)
106
+tells the user that there is no warranty for the work (except to the
107
+extent that warranties are provided), that licensees may convey the
108
+work under this License, and how to view a copy of this License.  If
109
+the interface presents a list of user commands or options, such as a
110
+menu, a prominent item in the list meets this criterion.
111
+
112
+  1. Source Code.
113
+
114
+  The "source code" for a work means the preferred form of the work
115
+for making modifications to it.  "Object code" means any non-source
116
+form of a work.
117
+
118
+  A "Standard Interface" means an interface that either is an official
119
+standard defined by a recognized standards body, or, in the case of
120
+interfaces specified for a particular programming language, one that
121
+is widely used among developers working in that language.
122
+
123
+  The "System Libraries" of an executable work include anything, other
124
+than the work as a whole, that (a) is included in the normal form of
125
+packaging a Major Component, but which is not part of that Major
126
+Component, and (b) serves only to enable use of the work with that
127
+Major Component, or to implement a Standard Interface for which an
128
+implementation is available to the public in source code form.  A
129
+"Major Component", in this context, means a major essential component
130
+(kernel, window system, and so on) of the specific operating system
131
+(if any) on which the executable work runs, or a compiler used to
132
+produce the work, or an object code interpreter used to run it.
133
+
134
+  The "Corresponding Source" for a work in object code form means all
135
+the source code needed to generate, install, and (for an executable
136
+work) run the object code and to modify the work, including scripts to
137
+control those activities.  However, it does not include the work's
138
+System Libraries, or general-purpose tools or generally available free
139
+programs which are used unmodified in performing those activities but
140
+which are not part of the work.  For example, Corresponding Source
141
+includes interface definition files associated with source files for
142
+the work, and the source code for shared libraries and dynamically
143
+linked subprograms that the work is specifically designed to require,
144
+such as by intimate data communication or control flow between those
145
+subprograms and other parts of the work.
146
+
147
+  The Corresponding Source need not include anything that users
148
+can regenerate automatically from other parts of the Corresponding
149
+Source.
150
+
151
+  The Corresponding Source for a work in source code form is that
152
+same work.
153
+
154
+  2. Basic Permissions.
155
+
156
+  All rights granted under this License are granted for the term of
157
+copyright on the Program, and are irrevocable provided the stated
158
+conditions are met.  This License explicitly affirms your unlimited
159
+permission to run the unmodified Program.  The output from running a
160
+covered work is covered by this License only if the output, given its
161
+content, constitutes a covered work.  This License acknowledges your
162
+rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+  You may make, run and propagate covered works that you do not
165
+convey, without conditions so long as your license otherwise remains
166
+in force.  You may convey covered works to others for the sole purpose
167
+of having them make modifications exclusively for you, or provide you
168
+with facilities for running those works, provided that you comply with
169
+the terms of this License in conveying all material for which you do
170
+not control copyright.  Those thus making or running the covered works
171
+for you must do so exclusively on your behalf, under your direction
172
+and control, on terms that prohibit them from making any copies of
173
+your copyrighted material outside their relationship with you.
174
+
175
+  Conveying under any other circumstances is permitted solely under
176
+the conditions stated below.  Sublicensing is not allowed; section 10
177
+makes it unnecessary.
178
+
179
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+  No covered work shall be deemed part of an effective technological
182
+measure under any applicable law fulfilling obligations under article
183
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+similar laws prohibiting or restricting circumvention of such
185
+measures.
186
+
187
+  When you convey a covered work, you waive any legal power to forbid
188
+circumvention of technological measures to the extent such circumvention
189
+is effected by exercising rights under this License with respect to
190
+the covered work, and you disclaim any intention to limit operation or
191
+modification of the work as a means of enforcing, against the work's
192
+users, your or third parties' legal rights to forbid circumvention of
193
+technological measures.
194
+
195
+  4. Conveying Verbatim Copies.
196
+
197
+  You may convey verbatim copies of the Program's source code as you
198
+receive it, in any medium, provided that you conspicuously and
199
+appropriately publish on each copy an appropriate copyright notice;
200
+keep intact all notices stating that this License and any
201
+non-permissive terms added in accord with section 7 apply to the code;
202
+keep intact all notices of the absence of any warranty; and give all
203
+recipients a copy of this License along with the Program.
204
+
205
+  You may charge any price or no price for each copy that you convey,
206
+and you may offer support or warranty protection for a fee.
207
+
208
+  5. Conveying Modified Source Versions.
209
+
210
+  You may convey a work based on the Program, or the modifications to
211
+produce it from the Program, in the form of source code under the
212
+terms of section 4, provided that you also meet all of these conditions:
213
+
214
+    a) The work must carry prominent notices stating that you modified
215
+    it, and giving a relevant date.
216
+
217
+    b) The work must carry prominent notices stating that it is
218
+    released under this License and any conditions added under section
219
+    7.  This requirement modifies the requirement in section 4 to
220
+    "keep intact all notices".
221
+
222
+    c) You must license the entire work, as a whole, under this
223
+    License to anyone who comes into possession of a copy.  This
224
+    License will therefore apply, along with any applicable section 7
225
+    additional terms, to the whole of the work, and all its parts,
226
+    regardless of how they are packaged.  This License gives no
227
+    permission to license the work in any other way, but it does not
228
+    invalidate such permission if you have separately received it.
229
+
230
+    d) If the work has interactive user interfaces, each must display
231
+    Appropriate Legal Notices; however, if the Program has interactive
232
+    interfaces that do not display Appropriate Legal Notices, your
233
+    work need not make them do so.
234
+
235
+  A compilation of a covered work with other separate and independent
236
+works, which are not by their nature extensions of the covered work,
237
+and which are not combined with it such as to form a larger program,
238
+in or on a volume of a storage or distribution medium, is called an
239
+"aggregate" if the compilation and its resulting copyright are not
240
+used to limit the access or legal rights of the compilation's users
241
+beyond what the individual works permit.  Inclusion of a covered work
242
+in an aggregate does not cause this License to apply to the other
243
+parts of the aggregate.
244
+
245
+  6. Conveying Non-Source Forms.
246
+
247
+  You may convey a covered work in object code form under the terms
248
+of sections 4 and 5, provided that you also convey the
249
+machine-readable Corresponding Source under the terms of this License,
250
+in one of these ways:
251
+
252
+    a) Convey the object code in, or embodied in, a physical product
253
+    (including a physical distribution medium), accompanied by the
254
+    Corresponding Source fixed on a durable physical medium
255
+    customarily used for software interchange.
256
+
257
+    b) Convey the object code in, or embodied in, a physical product
258
+    (including a physical distribution medium), accompanied by a
259
+    written offer, valid for at least three years and valid for as
260
+    long as you offer spare parts or customer support for that product
261
+    model, to give anyone who possesses the object code either (1) a
262
+    copy of the Corresponding Source for all the software in the
263
+    product that is covered by this License, on a durable physical
264
+    medium customarily used for software interchange, for a price no
265
+    more than your reasonable cost of physically performing this
266
+    conveying of source, or (2) access to copy the
267
+    Corresponding Source from a network server at no charge.
268
+
269
+    c) Convey individual copies of the object code with a copy of the
270
+    written offer to provide the Corresponding Source.  This
271
+    alternative is allowed only occasionally and noncommercially, and
272
+    only if you received the object code with such an offer, in accord
273
+    with subsection 6b.
274
+
275
+    d) Convey the object code by offering access from a designated
276
+    place (gratis or for a charge), and offer equivalent access to the
277
+    Corresponding Source in the same way through the same place at no
278
+    further charge.  You need not require recipients to copy the
279
+    Corresponding Source along with the object code.  If the place to
280
+    copy the object code is a network server, the Corresponding Source
281
+    may be on a different server (operated by you or a third party)
282
+    that supports equivalent copying facilities, provided you maintain
283
+    clear directions next to the object code saying where to find the
284
+    Corresponding Source.  Regardless of what server hosts the
285
+    Corresponding Source, you remain obligated to ensure that it is
286
+    available for as long as needed to satisfy these requirements.
287
+
288
+    e) Convey the object code using peer-to-peer transmission, provided
289
+    you inform other peers where the object code and Corresponding
290
+    Source of the work are being offered to the general public at no
291
+    charge under subsection 6d.
292
+
293
+  A separable portion of the object code, whose source code is excluded
294
+from the Corresponding Source as a System Library, need not be
295
+included in conveying the object code work.
296
+
297
+  A "User Product" is either (1) a "consumer product", which means any
298
+tangible personal property which is normally used for personal, family,
299
+or household purposes, or (2) anything designed or sold for incorporation
300
+into a dwelling.  In determining whether a product is a consumer product,
301
+doubtful cases shall be resolved in favor of coverage.  For a particular
302
+product received by a particular user, "normally used" refers to a
303
+typical or common use of that class of product, regardless of the status
304
+of the particular user or of the way in which the particular user
305
+actually uses, or expects or is expected to use, the product.  A product
306
+is a consumer product regardless of whether the product has substantial
307
+commercial, industrial or non-consumer uses, unless such uses represent
308
+the only significant mode of use of the product.
309
+
310
+  "Installation Information" for a User Product means any methods,
311
+procedures, authorization keys, or other information required to install
312
+and execute modified versions of a covered work in that User Product from
313
+a modified version of its Corresponding Source.  The information must
314
+suffice to ensure that the continued functioning of the modified object
315
+code is in no case prevented or interfered with solely because
316
+modification has been made.
317
+
318
+  If you convey an object code work under this section in, or with, or
319
+specifically for use in, a User Product, and the conveying occurs as
320
+part of a transaction in which the right of possession and use of the
321
+User Product is transferred to the recipient in perpetuity or for a
322
+fixed term (regardless of how the transaction is characterized), the
323
+Corresponding Source conveyed under this section must be accompanied
324
+by the Installation Information.  But this requirement does not apply
325
+if neither you nor any third party retains the ability to install
326
+modified object code on the User Product (for example, the work has
327
+been installed in ROM).
328
+
329
+  The requirement to provide Installation Information does not include a
330
+requirement to continue to provide support service, warranty, or updates
331
+for a work that has been modified or installed by the recipient, or for
332
+the User Product in which it has been modified or installed.  Access to a
333
+network may be denied when the modification itself materially and
334
+adversely affects the operation of the network or violates the rules and
335
+protocols for communication across the network.
336
+
337
+  Corresponding Source conveyed, and Installation Information provided,
338
+in accord with this section must be in a format that is publicly
339
+documented (and with an implementation available to the public in
340
+source code form), and must require no special password or key for
341
+unpacking, reading or copying.
342
+
343
+  7. Additional Terms.
344
+
345
+  "Additional permissions" are terms that supplement the terms of this
346
+License by making exceptions from one or more of its conditions.
347
+Additional permissions that are applicable to the entire Program shall
348
+be treated as though they were included in this License, to the extent
349
+that they are valid under applicable law.  If additional permissions
350
+apply only to part of the Program, that part may be used separately
351
+under those permissions, but the entire Program remains governed by
352
+this License without regard to the additional permissions.
353
+
354
+  When you convey a copy of a covered work, you may at your option
355
+remove any additional permissions from that copy, or from any part of
356
+it.  (Additional permissions may be written to require their own
357
+removal in certain cases when you modify the work.)  You may place
358
+additional permissions on material, added by you to a covered work,
359
+for which you have or can give appropriate copyright permission.
360
+
361
+  Notwithstanding any other provision of this License, for material you
362
+add to a covered work, you may (if authorized by the copyright holders of
363
+that material) supplement the terms of this License with terms:
364
+
365
+    a) Disclaiming warranty or limiting liability differently from the
366
+    terms of sections 15 and 16 of this License; or
367
+
368
+    b) Requiring preservation of specified reasonable legal notices or
369
+    author attributions in that material or in the Appropriate Legal
370
+    Notices displayed by works containing it; or
371
+
372
+    c) Prohibiting misrepresentation of the origin of that material, or
373
+    requiring that modified versions of such material be marked in
374
+    reasonable ways as different from the original version; or
375
+
376
+    d) Limiting the use for publicity purposes of names of licensors or
377
+    authors of the material; or
378
+
379
+    e) Declining to grant rights under trademark law for use of some
380
+    trade names, trademarks, or service marks; or
381
+
382
+    f) Requiring indemnification of licensors and authors of that
383
+    material by anyone who conveys the material (or modified versions of
384
+    it) with contractual assumptions of liability to the recipient, for
385
+    any liability that these contractual assumptions directly impose on
386
+    those licensors and authors.
387
+
388
+  All other non-permissive additional terms are considered "further
389
+restrictions" within the meaning of section 10.  If the Program as you
390
+received it, or any part of it, contains a notice stating that it is
391
+governed by this License along with a term that is a further
392
+restriction, you may remove that term.  If a license document contains
393
+a further restriction but permits relicensing or conveying under this
394
+License, you may add to a covered work material governed by the terms
395
+of that license document, provided that the further restriction does
396
+not survive such relicensing or conveying.
397
+
398
+  If you add terms to a covered work in accord with this section, you
399
+must place, in the relevant source files, a statement of the
400
+additional terms that apply to those files, or a notice indicating
401
+where to find the applicable terms.
402
+
403
+  Additional terms, permissive or non-permissive, may be stated in the
404
+form of a separately written license, or stated as exceptions;
405
+the above requirements apply either way.
406
+
407
+  8. Termination.
408
+
409
+  You may not propagate or modify a covered work except as expressly
410
+provided under this License.  Any attempt otherwise to propagate or
411
+modify it is void, and will automatically terminate your rights under
412
+this License (including any patent licenses granted under the third
413
+paragraph of section 11).
414
+
415
+  However, if you cease all violation of this License, then your
416
+license from a particular copyright holder is reinstated (a)
417
+provisionally, unless and until the copyright holder explicitly and
418
+finally terminates your license, and (b) permanently, if the copyright
419
+holder fails to notify you of the violation by some reasonable means
420
+prior to 60 days after the cessation.
421
+
422
+  Moreover, your license from a particular copyright holder is
423
+reinstated permanently if the copyright holder notifies you of the
424
+violation by some reasonable means, this is the first time you have
425
+received notice of violation of this License (for any work) from that
426
+copyright holder, and you cure the violation prior to 30 days after
427
+your receipt of the notice.
428
+
429
+  Termination of your rights under this section does not terminate the
430
+licenses of parties who have received copies or rights from you under
431
+this License.  If your rights have been terminated and not permanently
432
+reinstated, you do not qualify to receive new licenses for the same
433
+material under section 10.
434
+
435
+  9. Acceptance Not Required for Having Copies.
436
+
437
+  You are not required to accept this License in order to receive or
438
+run a copy of the Program.  Ancillary propagation of a covered work
439
+occurring solely as a consequence of using peer-to-peer transmission
440
+to receive a copy likewise does not require acceptance.  However,
441
+nothing other than this License grants you permission to propagate or
442
+modify any covered work.  These actions infringe copyright if you do
443
+not accept this License.  Therefore, by modifying or propagating a
444
+covered work, you indicate your acceptance of this License to do so.
445
+
446
+  10. Automatic Licensing of Downstream Recipients.
447
+
448
+  Each time you convey a covered work, the recipient automatically
449
+receives a license from the original licensors, to run, modify and
450
+propagate that work, subject to this License.  You are not responsible
451
+for enforcing compliance by third parties with this License.
452
+
453
+  An "entity transaction" is a transaction transferring control of an
454
+organization, or substantially all assets of one, or subdividing an
455
+organization, or merging organizations.  If propagation of a covered
456
+work results from an entity transaction, each party to that
457
+transaction who receives a copy of the work also receives whatever
458
+licenses to the work the party's predecessor in interest had or could
459
+give under the previous paragraph, plus a right to possession of the
460
+Corresponding Source of the work from the predecessor in interest, if
461
+the predecessor has it or can get it with reasonable efforts.
462
+
463
+  You may not impose any further restrictions on the exercise of the
464
+rights granted or affirmed under this License.  For example, you may
465
+not impose a license fee, royalty, or other charge for exercise of
466
+rights granted under this License, and you may not initiate litigation
467
+(including a cross-claim or counterclaim in a lawsuit) alleging that
468
+any patent claim is infringed by making, using, selling, offering for
469
+sale, or importing the Program or any portion of it.
470
+
471
+  11. Patents.
472
+
473
+  A "contributor" is a copyright holder who authorizes use under this
474
+License of the Program or a work on which the Program is based.  The
475
+work thus licensed is called the contributor's "contributor version".
476
+
477
+  A contributor's "essential patent claims" are all patent claims
478
+owned or controlled by the contributor, whether already acquired or
479
+hereafter acquired, that would be infringed by some manner, permitted
480
+by this License, of making, using, or selling its contributor version,
481
+but do not include claims that would be infringed only as a
482
+consequence of further modification of the contributor version.  For
483
+purposes of this definition, "control" includes the right to grant
484
+patent sublicenses in a manner consistent with the requirements of
485
+this License.
486
+
487
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+patent license under the contributor's essential patent claims, to
489
+make, use, sell, offer for sale, import and otherwise run, modify and
490
+propagate the contents of its contributor version.
491
+
492
+  In the following three paragraphs, a "patent license" is any express
493
+agreement or commitment, however denominated, not to enforce a patent
494
+(such as an express permission to practice a patent or covenant not to
495
+sue for patent infringement).  To "grant" such a patent license to a
496
+party means to make such an agreement or commitment not to enforce a
497
+patent against the party.
498
+
499
+  If you convey a covered work, knowingly relying on a patent license,
500
+and the Corresponding Source of the work is not available for anyone
501
+to copy, free of charge and under the terms of this License, through a
502
+publicly available network server or other readily accessible means,
503
+then you must either (1) cause the Corresponding Source to be so
504
+available, or (2) arrange to deprive yourself of the benefit of the
505
+patent license for this particular work, or (3) arrange, in a manner
506
+consistent with the requirements of this License, to extend the patent
507
+license to downstream recipients.  "Knowingly relying" means you have
508
+actual knowledge that, but for the patent license, your conveying the
509
+covered work in a country, or your recipient's use of the covered work
510
+in a country, would infringe one or more identifiable patents in that
511
+country that you have reason to believe are valid.
512
+
513
+  If, pursuant to or in connection with a single transaction or
514
+arrangement, you convey, or propagate by procuring conveyance of, a
515
+covered work, and grant a patent license to some of the parties
516
+receiving the covered work authorizing them to use, propagate, modify
517
+or convey a specific copy of the covered work, then the patent license
518
+you grant is automatically extended to all recipients of the covered
519
+work and works based on it.
520
+
521
+  A patent license is "discriminatory" if it does not include within
522
+the scope of its coverage, prohibits the exercise of, or is
523
+conditioned on the non-exercise of one or more of the rights that are
524
+specifically granted under this License.  You may not convey a covered
525
+work if you are a party to an arrangement with a third party that is
526
+in the business of distributing software, under which you make payment
527
+to the third party based on the extent of your activity of conveying
528
+the work, and under which the third party grants, to any of the
529
+parties who would receive the covered work from you, a discriminatory
530
+patent license (a) in connection with copies of the covered work
531
+conveyed by you (or copies made from those copies), or (b) primarily
532
+for and in connection with specific products or compilations that
533
+contain the covered work, unless you entered into that arrangement,
534
+or that patent license was granted, prior to 28 March 2007.
535
+
536
+  Nothing in this License shall be construed as excluding or limiting
537
+any implied license or other defenses to infringement that may
538
+otherwise be available to you under applicable patent law.
539
+
540
+  12. No Surrender of Others' Freedom.
541
+
542
+  If conditions are imposed on you (whether by court order, agreement or
543
+otherwise) that contradict the conditions of this License, they do not
544
+excuse you from the conditions of this License.  If you cannot convey a
545
+covered work so as to satisfy simultaneously your obligations under this
546
+License and any other pertinent obligations, then as a consequence you may
547
+not convey it at all.  For example, if you agree to terms that obligate you
548
+to collect a royalty for further conveying from those to whom you convey
549
+the Program, the only way you could satisfy both those terms and this
550
+License would be to refrain entirely from conveying the Program.
551
+
552
+  13. Use with the GNU Affero General Public License.
553
+
554
+  Notwithstanding any other provision of this License, you have
555
+permission to link or combine any covered work with a work licensed
556
+under version 3 of the GNU Affero General Public License into a single
557
+combined work, and to convey the resulting work.  The terms of this
558
+License will continue to apply to the part which is the covered work,
559
+but the special requirements of the GNU Affero General Public License,
560
+section 13, concerning interaction through a network will apply to the
561
+combination as such.
562
+
563
+  14. Revised Versions of this License.
564
+
565
+  The Free Software Foundation may publish revised and/or new versions of
566
+the GNU General Public License from time to time.  Such new versions will
567
+be similar in spirit to the present version, but may differ in detail to
568
+address new problems or concerns.
569
+
570
+  Each version is given a distinguishing version number.  If the
571
+Program specifies that a certain numbered version of the GNU General
572
+Public License "or any later version" applies to it, you have the
573
+option of following the terms and conditions either of that numbered
574
+version or of any later version published by the Free Software
575
+Foundation.  If the Program does not specify a version number of the
576
+GNU General Public License, you may choose any version ever published
577
+by the Free Software Foundation.
578
+
579
+  If the Program specifies that a proxy can decide which future
580
+versions of the GNU General Public License can be used, that proxy's
581
+public statement of acceptance of a version permanently authorizes you
582
+to choose that version for the Program.
583
+
584
+  Later license versions may give you additional or different
585
+permissions.  However, no additional obligations are imposed on any
586
+author or copyright holder as a result of your choosing to follow a
587
+later version.
588
+
589
+  15. Disclaimer of Warranty.
590
+
591
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+  16. Limitation of Liability.
601
+
602
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+SUCH DAMAGES.
611
+
612
+  17. Interpretation of Sections 15 and 16.
613
+
614
+  If the disclaimer of warranty and limitation of liability provided
615
+above cannot be given local legal effect according to their terms,
616
+reviewing courts shall apply local law that most closely approximates
617
+an absolute waiver of all civil liability in connection with the
618
+Program, unless a warranty or assumption of liability accompanies a
619
+copy of the Program in return for a fee.
620
+
621
+                     END OF TERMS AND CONDITIONS
622
+

+ 3
- 0
poweradmin/poweradmin-2.1.8/README.md View File

@@ -0,0 +1,3 @@
1
+# Poweradmin - a web-based control panel for PowerDNS.
2
+
3
+[Poweradmin](http://www.poweradmin.org/) is a friendly web-based DNS administration tool for Bert Hubert's PowerDNS server. The interface has full support for most of the features of PowerDNS. It has full support for all zone types (master,  native and  slave), for  supermasters for automatic provisioning of slave zones, full support for IPv6 and comes with multi-language support.

+ 86
- 0
poweradmin/poweradmin-2.1.8/add_perm_templ.php View File

@@ -0,0 +1,86 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles requests to add new permission template
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+if (!do_hook('verify_permission' , 'templ_perm_edit' )) {
36
+    error(ERR_PERM_EDIT_PERM_TEMPL);
37
+} else {
38
+
39
+    if (isset($_POST['commit'])) {
40
+        do_hook('add_perm_templ', $_POST );
41
+        success(SUC_PERM_TEMPL_ADD);
42
+    }
43
+
44
+    $perms_avail = do_hook('get_permissions_by_template_id');
45
+
46
+    /*
47
+      Display new permission form
48
+     */
49
+
50
+    echo "    <h2>" . _('Add permission template') . "</h2>\n";
51
+    echo "    <form method=\"post\" action=\"\">\n";
52
+    echo "     <table>\n";
53
+    echo "      <tr>\n";
54
+    echo "       <th>" . _('Name') . "</th>\n";
55
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"\"></td>\n";
56
+    echo "      </tr>\n";
57
+    echo "      <tr>\n";
58
+    echo "       <th>" . _('Description') . "</th>\n";
59
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"\"></td>\n";
60
+    echo "      </tr>\n";
61
+    echo "     </table>\n";
62
+    echo "     <table>\n";
63
+    echo "      <tr>\n";
64
+    echo "       <th>&nbsp;</th>\n";
65
+    echo "       <th>" . _('Name') . "</th>\n";
66
+    echo "       <th>" . _('Description') . "</th>\n";
67
+    echo "      </tr>\n";
68
+
69
+    /*
70
+      Display available permissions settings for inclusion
71
+      in the new permission
72
+     */
73
+    foreach ($perms_avail as $perm_a) {
74
+
75
+        echo "      <tr>\n";
76
+        echo "       <td><input type=\"checkbox\" name=\"perm_id[]\" value=\"" . $perm_a['id'] . "\"></td>\n";
77
+        echo "       <td>" . $perm_a['name'] . "</td>\n";
78
+        echo "       <td>" . _($perm_a['descr']) . "</td>\n";
79
+        echo "      </tr>\n";
80
+    }
81
+    echo "     </table>\n";
82
+    echo "     <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
83
+    echo "     </form>\n";
84
+}
85
+
86
+include_once("inc/footer.inc.php");

+ 236
- 0
poweradmin/poweradmin-2.1.8/add_record.php View File

@@ -0,0 +1,236 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles request to add new records to existing zone
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once('inc/toolkit.inc.php');
33
+include_once('inc/header.inc.php');
34
+
35
+global $pdnssec_use;
36
+
37
+/*
38
+  Get permissions
39
+ */
40
+if (do_hook('verify_permission', 'zone_content_view_others')) {
41
+    $perm_view = "all";
42
+} elseif (do_hook('verify_permission', 'zone_content_view_own')) {
43
+    $perm_view = 'own';
44
+} else {
45
+    $perm_view = 'none';
46
+}
47
+
48
+if (do_hook('verify_permission', 'zone_content_edit_others')) {
49
+    $perm_content_edit = 'all';
50
+} elseif (do_hook('verify_permission', 'zone_content_edit_own')) {
51
+    $perm_content_edit = 'own';
52
+} elseif (do_hook('verify_permission', 'zone_content_edit_own_as_client')) {
53
+    $perm_content_edit = 'own_as_client';
54
+} else {
55
+    $perm_content_edit = 'none';
56
+}
57
+
58
+if (do_hook('verify_permission', 'zone_meta_edit_others')) {
59
+    $perm_meta_edit = "all";
60
+} elseif (do_hook('verify_permission', 'zone_meta_edit_own')) {
61
+    $perm_meta_edit = "own";
62
+} else {
63
+    $perm_meta_edit = "none";
64
+}
65
+
66
+
67
+/*
68
+  Check and make sure all post values have made it through
69
+  if not set them.
70
+ */
71
+$zone_id = "-1";
72
+if ((isset($_GET['id'])) && (v_num($_GET['id']))) {
73
+    $zone_id = $_GET['id'];
74
+}
75
+
76
+$ttl = $dns_ttl;
77
+if ((isset($_POST['ttl'])) && (v_num($_POST['ttl']))) {
78
+    $ttl = $_POST['ttl'];
79
+}
80
+
81
+$prio = "10";
82
+if ((isset($_POST['prio'])) && (v_num($_POST['prio']))) {
83
+    $prio = $_POST['prio'];
84
+}
85
+
86
+if (isset($_POST['name'])) {
87
+    $name = $_POST['name'];
88
+} else {
89
+    $name = "";
90
+}
91
+
92
+if (isset($_POST['type'])) {
93
+    $type = $_POST['type'];
94
+} else {
95
+    $type = "";
96
+}
97
+
98
+if (isset($_POST['content'])) {
99
+    $content = $_POST['content'];
100
+} else {
101
+    $content = "";
102
+}
103
+
104
+if ($zone_id == "-1") {
105
+    error(ERR_INV_INPUT);
106
+    include_once("inc/footer.inc.php");
107
+    exit;
108
+}
109
+
110
+/*
111
+  Check and see if the user is the zone owner
112
+  Check the sone type and get the zone name
113
+ */
114
+$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid', $zone_id);
115
+$zone_type = get_domain_type($zone_id);
116
+$zone_name = get_zone_name_from_id($zone_id);
117
+
118
+/*
119
+  If the form as been submitted
120
+  process it!
121
+ */
122
+if (isset($_POST["commit"])) {
123
+    if ($zone_type == "SLAVE" || $perm_content_edit == "none" || ($perm_content_edit == "own" || $perm_content_edit == "own_as_client") && $user_is_zone_owner == "0") {
124
+        error(ERR_PERM_ADD_RECORD);
125
+    } else {
126
+        // a PTR-record is added if an A or an AAAA-record are created
127
+        // and checkbox is checked
128
+
129
+        if ((isset($_POST["reverse"])) && $iface_add_reverse_record ) {
130
+            if ($type === 'A') {
131
+                $content_array = preg_split("/\./", $content);
132
+                $content_rev = sprintf("%d.%d.%d.%d.in-addr.arpa", $content_array[3], $content_array[2], $content_array[1], $content_array[0]);
133
+                $zone_rev_id = get_best_matching_zone_id_from_name($content_rev);
134
+            } elseif ($type === 'AAAA') {
135
+                $content_rev = convert_ipv6addr_to_ptrrec($content);
136
+                $zone_rev_id = get_best_matching_zone_id_from_name($content_rev);
137
+            }
138
+            if (isset($zone_rev_id) && $zone_rev_id != -1) {
139
+                $zone_name = get_zone_name_from_id($zone_id);
140
+                $fqdn_name = sprintf("%s.%s", $name, $zone_name);
141
+                if (add_record($zone_rev_id, $content_rev, 'PTR', $fqdn_name, $ttl, $prio)) {
142
+                    success(" <a href=\"edit.php?id=" . $zone_rev_id . "\"> " . _('The PTR-record was successfully added.') . "</a>");
143
+                    log_info(sprintf('client_ip:%s user:%s operation:add_record record_type:PTR record:%s content:%s ttl:%s priority:%s',
144
+                                      $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
145
+                                      $content_rev, $fqdn_name, $ttl, $prio));
146
+		    if ($pdnssec_use) {
147
+			    if (dnssec_rectify_zone($zone_rev_id)) {
148
+				    success(SUC_EXEC_PDNSSEC_RECTIFY_ZONE);
149
+			    }
150
+		    }
151
+
152
+                }
153
+            } elseif (isset($content_rev)) {
154
+                error(sprintf(ERR_REVERS_ZONE_NOT_EXIST, $content_rev));
155
+            }
156
+        }
157
+        if (add_record($zone_id, $name, $type, $content, $ttl, $prio)) {
158
+            success(" <a href=\"edit.php?id=" . $zone_id . "\"> " . _('The record was successfully added.') . "</a>");
159
+            log_info(sprintf('client_ip:%s user:%s operation:add_record record_type:%s record:%s.%s content:%s ttl:%s priority:%s',
160
+                              $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
161
+                              $type, $name, $zone_name, $content, $ttl, $prio));
162
+	    if ($pdnssec_use) {
163
+		    if (dnssec_rectify_zone($zone_id)) {
164
+			    success(SUC_EXEC_PDNSSEC_RECTIFY_ZONE);
165
+		    }
166
+	    }
167
+
168
+            $name = $type = $content = $ttl = $prio = "";
169
+        }
170
+    }
171
+}
172
+
173
+/*
174
+  Display form to add a record
175
+ */
176
+echo "    <h2>" . _('Add record to zone') . " <a href=\"edit.php?id=" . $zone_id . "\"> " . $zone_name . "</a></h2>\n";
177
+
178
+if ($zone_type == "SLAVE" || $perm_content_edit == "none" || ($perm_content_edit == "own" || $perm_content_edit == "own_as_client") && $user_is_zone_owner == "0") {
179
+    error(ERR_PERM_ADD_RECORD);
180
+} else {
181
+    echo "     <form method=\"post\">\n";
182
+    echo "      <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
183
+    echo "      <table border=\"0\" cellspacing=\"4\">\n";
184
+    echo "       <tr>\n";
185
+    echo "        <td class=\"n\">" . _('Name') . "</td>\n";
186
+    echo "        <td class=\"n\">&nbsp;</td>\n";
187
+    echo "        <td class=\"n\">" . _('Type') . "</td>\n";
188
+    echo "        <td class=\"n\">" . _('Content') . "</td>\n";
189
+    echo "        <td class=\"n\">" . _('Priority') . "</td>\n";
190
+    echo "        <td class=\"n\">" . _('TTL') . "</td>\n";
191
+    echo "       </tr>\n";
192
+    echo "       <tr>\n";
193
+    echo "        <td class=\"n\"><input type=\"text\" name=\"name\" class=\"input\" value=\"" . htmlspecialchars($name) . "\">." . $zone_name . "</td>\n";
194
+    echo "        <td class=\"n\">IN</td>\n";
195
+    echo "        <td class=\"n\">\n";
196
+    echo "         <select name=\"type\">\n";
197
+    $found_selected_type = !(isset($type) && $type);
198
+    foreach (get_record_types() as $record_type) {
199
+        if (isset($type) && $type) {
200
+            if ($type == $record_type) {
201
+                $found_selected_type = true;
202
+                $add = " SELECTED";
203
+            } else {
204
+                $add = "";
205
+            }
206
+        } else {
207
+            if (preg_match('/i(p6|n-addr).arpa/i', $zone_name) && strtoupper($record_type) == 'PTR') {
208
+                $add = " SELECTED";
209
+                $rev = "";
210
+            } elseif ((strtoupper($record_type) == 'A') && $iface_add_reverse_record) {
211
+                $add = " SELECTED";
212
+                $rev = "<input type=\"checkbox\" name=\"reverse\"><span class=\"normaltext\">" . _('Add also reverse record') . "</span>\n";
213
+            } else {
214
+                $add = "";
215
+            }
216
+        }
217
+        echo "          <option" . $add . " value=\"" . htmlspecialchars($record_type) . "\">" . $record_type . "</option>\n";
218
+    }
219
+    if (!$found_selected_type)
220
+        echo "          <option SELECTED value=\"" . htmlspecialchars($type) . "\"><i>" . htmlspecialchars($type) . "</i></option>\n";
221
+    echo "         </select>\n";
222
+    echo "        </td>\n";
223
+    echo "        <td class=\"n\"><input type=\"text\" name=\"content\" class=\"input\" value=\"" . htmlspecialchars($content) . "\"></td>\n";
224
+    echo "        <td class=\"n\"><input type=\"text\" name=\"prio\" class=\"sinput\" value=\"" . htmlspecialchars($prio) . "\"></td>\n";
225
+    echo "        <td class=\"n\"><input type=\"text\" name=\"ttl\" class=\"sinput\" value=\"" . htmlspecialchars($ttl) . "\"</td>\n";
226
+    echo "       </tr>\n";
227
+    echo "      </table>\n";
228
+    echo "      <br>\n";
229
+    echo "      <input type=\"submit\" name=\"commit\" value=\"" . _('Add record') . "\" class=\"button\">\n";
230
+    if (isset($rev)) {
231
+        echo "      $rev";
232
+    }
233
+    echo "     </form>\n";
234
+}
235
+
236
+include_once("inc/footer.inc.php");

+ 120
- 0
poweradmin/poweradmin-2.1.8/add_supermaster.php View File

@@ -0,0 +1,120 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles requests to add new supermaster servers
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+$master_ip = "";
36
+if (isset($_POST["master_ip"])) {
37
+    $master_ip = $_POST["master_ip"];
38
+}
39
+
40
+$ns_name = "";
41
+if (isset($_POST["ns_name"])) {
42
+    $ns_name = $_POST["ns_name"];
43
+}
44
+
45
+$account = "";
46
+if (isset($_POST["account"])) {
47
+    $account = $_POST["account"];
48
+}
49
+
50
+(do_hook('verify_permission' , 'supermaster_add' )) ? $supermasters_add = "1" : $supermasters_add = "0";
51
+(do_hook('verify_permission' , 'user_view_others' )) ? $perm_view_others = "1" : $perm_view_others = "0";
52
+
53
+$error = 0;
54
+if (isset($_POST["submit"])) {
55
+    if (add_supermaster($master_ip, $ns_name, $account)) {
56
+        success(SUC_SM_ADD);
57
+    } else {
58
+        $error = "1";
59
+    }
60
+}
61
+
62
+echo "     <h2>" . _('Add supermaster') . "</h2>\n";
63
+
64
+if ($supermasters_add != "1") {
65
+    echo "     <p>" . _("You do not have the permission to add a new supermaster.") . "</p>\n";
66
+} else {
67
+    echo "     <form method=\"post\" action=\"add_supermaster.php\">\n";
68
+    echo "      <table>\n";
69
+    echo "       <tr>\n";
70
+    echo "        <td class=\"n\">" . _('IP address of supermaster') . "</td>\n";
71
+    echo "        <td class=\"n\">\n";
72
+    if ($error) {
73
+        echo "         <input type=\"text\" class=\"input\" name=\"master_ip\" value=\"" . $master_ip . "\">\n";
74
+    } else {
75
+        echo "         <input type=\"text\" class=\"input\" name=\"master_ip\" value=\"\">\n";
76
+    }
77
+    echo "        </td>\n";
78
+    echo "       </tr>\n";
79
+    echo "       <tr>\n";
80
+    echo "        <td class=\"n\">" . _('Hostname in NS record') . "</td>\n";
81
+    echo "        <td class=\"n\">\n";
82
+    if ($error) {
83
+        echo "         <input type=\"text\" class=\"input\" name=\"ns_name\" value=\"" . $ns_name . "\">\n";
84
+    } else {
85
+        echo "         <input type=\"text\" class=\"input\" name=\"ns_name\" value=\"\">\n";
86
+    }
87
+    echo "        </td>\n";
88
+    echo "       </tr>\n";
89
+    echo "       <tr>\n";
90
+    echo "        <td class=\"n\">" . _('Account') . "</td>\n";
91
+    echo "        <td class=\"n\">\n";
92
+
93
+    echo "         <select name=\"account\">\n";
94
+    /*
95
+      Display list of users to assign slave zone to if the
96
+      editing user has the permissions to, otherise just
97
+      display the adding users name
98
+     */
99
+    $users = do_hook('show_users');
100
+    foreach ($users as $user) {
101
+        if ($user['id'] === $_SESSION['userid']) {
102
+            echo "          <option value=\"" . $user['username'] . "\" selected>" . $user['fullname'] . "</option>\n";
103
+        } elseif ($perm_view_others == "1") {
104
+            echo "          <option value=\"" . $user['username'] . "\">" . $user['fullname'] . "</option>\n";
105
+        }
106
+    }
107
+    echo "         </select>\n";
108
+
109
+    echo "        </td>\n";
110
+    echo "       </tr>\n";
111
+    echo "       <tr>\n";
112
+    echo "        <td class=\"n\">&nbsp;</td>\n";
113
+    echo "        <td class=\"n\">\n";
114
+    echo "         <input type=\"submit\" class=\"button\" name=\"submit\" value=\"" . _('Add supermaster') . "\">\n";
115
+    echo "        </td>\n";
116
+    echo "       </tr>\n";
117
+    echo "      </table>\n";
118
+    echo "     </form>\n";
119
+}
120
+include_once("inc/footer.inc.php");

+ 90
- 0
poweradmin/poweradmin-2.1.8/add_user.php View File

@@ -0,0 +1,90 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles requests to add new users
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+if (!do_hook('verify_permission' , 'user_add_new' )) {
36
+    error(ERR_PERM_ADD_USER);
37
+} else {
38
+    if (isset($_POST["commit"])) {
39
+        if (do_hook('add_new_user' , $_POST )) {
40
+            success(SUC_USER_ADD);
41
+        }
42
+    }
43
+
44
+    echo "     <h2>" . _('Add user') . "</h2>\n";
45
+    echo "     <form method=\"post\" action=\"add_user.php\">\n";
46
+    echo "      <table>\n";
47
+    echo "       <tr>\n";
48
+    echo "        <td class=\"n\">" . _('Username') . "</td>\n";
49
+    echo "        <td class=\"n\"><input type=\"text\" class=\"input\" name=\"username\" value=\"\"></td>\n";
50
+    echo "       </tr>\n";
51
+    echo "       <tr>\n";
52
+    echo "        <td class=\"n\">" . _('Fullname') . "</td>\n";
53
+    echo "        <td class=\"n\"><input type=\"text\" class=\"input\" name=\"fullname\" value=\"\"></td>\n";
54
+    echo "       </tr>\n";
55
+    echo "       <tr>\n";
56
+    echo "        <td class=\"n\">" . _('Password') . "</td>\n";
57
+    echo "        <td class=\"n\"><input type=\"password\" class=\"input\" name=\"password\"></td>\n";
58
+    echo "       </tr>\n";
59
+    echo "       <tr>\n";
60
+    echo "        <td class=\"n\">" . _('Email address') . "</td>\n";
61
+    echo "        <td class=\"n\"><input type=\"text\" class=\"input\" name=\"email\" value=\"\"></td>\n";
62
+    echo "       </tr>\n";
63
+    if (do_hook('verify_permission' , 'user_edit_templ_perm' )) {
64
+        echo "       <tr>\n";
65
+        echo "        <td class=\"n\">" . _('Permission template') . "</td>\n";
66
+        echo "        <td class=\"n\">\n";
67
+        echo "         <select name=\"perm_templ\">\n";
68
+        foreach (do_hook('list_permission_templates' ) as $template) {
69
+            echo "          <option value=\"" . $template['id'] . "\">" . $template['name'] . "</option>\n";
70
+        }
71
+        echo "         </select>\n";
72
+        echo "       </td>\n";
73
+        echo "       </tr>\n";
74
+    }
75
+    echo "       <tr>\n";
76
+    echo "        <td class=\"n\">" . _('Description') . "</td>\n";
77
+    echo "        <td class=\"n\"><textarea rows=\"4\" cols=\"30\" class=\"inputarea\" name=\"descr\"></textarea></td>\n";
78
+    echo "       </tr>\n";
79
+    echo "       <tr>\n";
80
+    echo "        <td class=\"n\">" . _('Enabled') . "</td>\n";
81
+    echo "        <td class=\"n\"><input type=\"checkbox\" class=\"input\" name=\"active\" value=\"1\" CHECKED></td>\n";
82
+    echo "       </tr>\n";
83
+    echo "       <tr>\n";
84
+    echo "        <td class=\"n\">&nbsp;</td>\n";
85
+    echo "        <td class=\"n\"><input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\"></td>\n";
86
+    echo "      </table>\n";
87
+    echo "     </form>\n";
88
+}
89
+
90
+include_once("inc/footer.inc.php");

+ 192
- 0
poweradmin/poweradmin-2.1.8/add_zone_master.php View File

@@ -0,0 +1,192 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles requests to add new master zones
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+echo "  <script type=\"text/javascript\" src=\"inc/helper.js\"></script>";
36
+
37
+global $pdnssec_use;
38
+global $dns_third_level_check;
39
+
40
+$owner = "-1";
41
+if ((isset($_POST['owner'])) && (v_num($_POST['owner']))) {
42
+    $owner = $_POST['owner'];
43
+}
44
+
45
+$dom_type = "NATIVE";
46
+if (isset($_POST["dom_type"]) && (in_array($_POST['dom_type'], $server_types))) {
47
+    $dom_type = $_POST["dom_type"];
48
+}
49
+
50
+if (isset($_POST['domain'])) {
51
+    $temp = array();
52
+    foreach ($_POST['domain'] as $domain) {
53
+        if ($domain != "") {
54
+            $temp[] = trim($domain);
55
+        }
56
+    }
57
+    $domains = $temp;
58
+} else {
59
+    $domains = array();
60
+}
61
+
62
+if (isset($_POST['zone_template'])) {
63
+    $zone_template = $_POST['zone_template'];
64
+} else {
65
+    $zone_template = "none";
66
+}
67
+
68
+$enable_dnssec = false;
69
+if (isset($_POST['dnssec']) && $_POST['dnssec'] == '1') {
70
+    $enable_dnssec = true;
71
+}
72
+
73
+/*
74
+  Check user permissions
75
+ */
76
+(do_hook('verify_permission' , 'zone_master_add' )) ? $zone_master_add = "1" : $zone_master_add = "0";
77
+(do_hook('verify_permission' , 'user_view_others' )) ? $perm_view_others = "1" : $perm_view_others = "0";
78
+
79
+if (isset($_POST['submit']) && $zone_master_add == "1") {
80
+    $error = false;
81
+    foreach ($domains as $domain) {
82
+        if (!is_valid_hostname_fqdn($domain, 0)) {
83
+            error($domain . ' failed - ' . ERR_DNS_HOSTNAME);
84
+        } elseif ($dns_third_level_check && get_domain_level($domain) > 2 && domain_exists(get_second_level_domain($domain))) {
85
+            error($domain . ' failed - ' . ERR_DOMAIN_EXISTS);
86
+            $error = true;
87
+        } elseif (domain_exists($domain) || record_name_exists($domain)) {
88
+            error($domain . ' failed - ' . ERR_DOMAIN_EXISTS);
89
+            // TODO: repopulate domain name(s) to the form if there was an error occured
90
+            $error = true;
91
+        } elseif (add_domain($domain, $owner, $dom_type, '', $zone_template)) {
92
+            $domain_id = get_zone_id_from_name($domain);
93
+            success("<a href=\"edit.php?id=" . $domain_id . "\">" . $domain . " - " . SUC_ZONE_ADD . '</a>');
94
+            log_info(sprintf('client_ip:%s user:%s operation:add_zone zone:%s zone_type:%s zone_template:%s',
95
+                              $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
96
+                              $domain,$dom_type,$zone_template));
97
+
98
+            if ($pdnssec_use) {
99
+                if ($enable_dnssec) {
100
+                    dnssec_secure_zone($domain);
101
+                }
102
+
103
+                dnssec_rectify_zone($domain_id);
104
+            }
105
+        }
106
+    }
107
+
108
+    if (false === $error) {
109
+        unset($domains, $owner, $dom_type, $zone_template);
110
+    }
111
+}
112
+
113
+if ($zone_master_add != "1") {
114
+    error(ERR_PERM_ADD_ZONE_MASTER);
115
+} else {
116
+    echo "     <h2>" . _('Add master zone') . "</h2>\n";
117
+
118
+    $available_zone_types = array("MASTER", "NATIVE");
119
+    $users = do_hook('show_users');
120
+    $zone_templates = get_list_zone_templ($_SESSION['userid']);
121
+
122
+    echo "     <form method=\"post\" action=\"add_zone_master.php\">\n";
123
+    echo "      <table>\n";
124
+    echo "       <tr>\n";
125
+    echo "        <td class=\"n\">" . _('Zone name') . ":</td>\n";
126
+    echo "        <td class=\"n\">\n";
127
+    echo "         <ul id=\"domain_names\" style=\"list-style-type:none; padding:0 \">\n";
128
+    echo "          <li><input type=\"text\" class=\"input\" name=\"domain[]\" value=\"\" id=\"domain_1\"></li>\n";
129
+    echo "         </ol>\n";
130
+    echo "        </td>\n";
131
+    echo "        <td class=\"n\">\n";
132
+    echo "         <input class=\"button\" type=\"button\" value=\"Add another domain\" onclick=\"addField('domain_names','domain_',0);\" />\n";
133
+    echo "        </td>\n";
134
+    echo "       </tr>\n";
135
+    echo "       <tr>\n";
136
+    echo "        <td class=\"n\">" . _('Owner') . ":</td>\n";
137
+    echo "        <td class=\"n\">\n";
138
+    echo "         <select name=\"owner\">\n";
139
+    /*
140
+      Display list of users to assign zone to if creating
141
+      user has the proper permission to do so.
142
+     */
143
+    foreach ($users as $user) {
144
+        if ($user['id'] === $_SESSION['userid']) {
145
+            echo "          <option value=\"" . $user['id'] . "\" selected>" . $user['fullname'] . "</option>\n";
146
+        } elseif ($perm_view_others == "1") {
147
+            echo "          <option value=\"" . $user['id'] . "\">" . $user['fullname'] . "</option>\n";
148
+        }
149
+    }
150
+    echo "         </select>\n";
151
+    echo "        </td>\n";
152
+    echo "        <td class=\"n\">&nbsp;</td>\n";
153
+    echo "       </tr>\n";
154
+    echo "       <tr>\n";
155
+    echo "        <td class=\"n\">" . _('Type') . ":</td>\n";
156
+    echo "        <td class=\"n\">\n";
157
+    echo "         <select name=\"dom_type\">\n";
158
+    foreach ($available_zone_types as $type) {
159
+        echo "          <option value=\"" . $type . "\">" . strtolower($type) . "</option>\n";
160
+    }
161
+    echo "         </select>\n";
162
+    echo "        </td>\n";
163
+    echo "        <td>&nbsp;</td>\n";
164
+    echo "       </tr>\n";
165
+    echo "       <tr>\n";
166
+    echo "        <td class=\"n\">" . _('Template') . ":</td>\n";
167
+    echo "        <td class=\"n\">\n";
168
+    echo "         <select name=\"zone_template\">\n";
169
+    echo "          <option value=\"none\">none</option>\n";
170
+    foreach ($zone_templates as $zone_template) {
171
+        echo "          <option value=\"" . $zone_template['id'] . "\">" . $zone_template['name'] . "</option>\n";
172
+    }
173
+    echo "         </select>\n";
174
+    echo "        </td>\n";
175
+    echo "        <td>&nbsp;</td>\n";
176
+    echo "       </tr>\n";
177
+    echo "       <tr>\n";
178
+    echo "        <td class=\"n\">" . _('DNSSEC') . ":</td>\n";
179
+    echo "        <td class=\"n\"><input type=\"checkbox\" class=\"input\" name=\"dnssec\" value=\"1\"></td>\n";
180
+    echo "       </tr>\n";
181
+    echo "       <tr>\n";
182
+    echo "        <td class=\"n\">&nbsp;</td>\n";
183
+    echo "        <td class=\"n\">\n";
184
+    echo "         <input type=\"submit\" class=\"button\" name=\"submit\" value=\"" . _('Add zone') . "\" onclick=\"checkDomainFilled();return false;\">\n";
185
+    echo "        </td>\n";
186
+    echo "        <td class=\"n\">&nbsp;</td>\n";
187
+    echo "       </tr>\n";
188
+    echo "      </table>\n";
189
+    echo "     </form>\n";
190
+}
191
+
192
+include_once("inc/footer.inc.php");

+ 129
- 0
poweradmin/poweradmin-2.1.8/add_zone_slave.php View File

@@ -0,0 +1,129 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles requests to add new slave zone
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+global $dns_third_level_check;
36
+
37
+$owner = "-1";
38
+if ((isset($_POST['owner'])) && (v_num($_POST['owner']))) {
39
+    $owner = $_POST['owner'];
40
+}
41
+
42
+$zone = "";
43
+if (isset($_POST['domain'])) {
44
+    $zone = trim($_POST['domain']);
45
+}
46
+
47
+$master = "";
48
+if (isset($_POST['slave_master'])) {
49
+    $master = $_POST['slave_master'];
50
+}
51
+
52
+$type = "SLAVE";
53
+
54
+/*
55
+  Check permissions
56
+ */
57
+(do_hook('verify_permission' , 'zone_slave_add' )) ? $zone_slave_add = "1" : $zone_slave_add = "0";
58
+(do_hook('verify_permission' , 'user_view_others' )) ? $perm_view_others = "1" : $perm_view_others = "0";
59
+
60
+if (isset($_POST['submit']) && $zone_slave_add == "1") {
61
+    if (!is_valid_hostname_fqdn($zone, 0)) {
62
+        error(ERR_DNS_HOSTNAME);
63
+    } elseif ($dns_third_level_check && get_domain_level($zone) > 2 && domain_exists(get_second_level_domain($zone))) {
64
+        error(ERR_DOMAIN_EXISTS);
65
+    } elseif (domain_exists($zone) || record_name_exists($zone)) {
66
+        error(ERR_DOMAIN_EXISTS);
67
+    } elseif (!are_multipe_valid_ips($master)) {
68
+        error(ERR_DNS_IP);
69
+    } else {
70
+        if (add_domain($zone, $owner, $type, $master, 'none')) {
71
+            success("<a href=\"edit.php?id=" . get_zone_id_from_name($zone) . "\">" . SUC_ZONE_ADD . '</a>');
72
+            log_info(sprintf('client_ip:%s user:%s operation:add_zone zone:%s zone_type:SLAVE zone_master:%s',
73
+                              $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
74
+                              $zone, $master));
75
+            unset($zone, $owner, $webip, $mailip, $empty, $type, $master);
76
+        }
77
+    }
78
+}
79
+
80
+if ($zone_slave_add != "1") {
81
+    error(ERR_PERM_ADD_ZONE_SLAVE);
82
+} else {
83
+    echo "     <h2>" . _('Add slave zone') . "</h2>\n";
84
+
85
+    $users = do_hook('show_users');
86
+    echo "     <form method=\"post\" action=\"add_zone_slave.php\">\n";
87
+    echo "      <table>\n";
88
+    echo "       <tr>\n";
89
+    echo "        <td class=\"n\">" . _('Zone name') . "</td>\n";
90
+    echo "        <td class=\"n\">\n";
91
+    echo "         <input type=\"text\" class=\"input\" name=\"domain\" value=\"\">\n";
92
+    echo "        </td>\n";
93
+    echo "       </tr>\n";
94
+    echo "       <tr>\n";
95
+    echo "        <td class=\"n\">" . _('IP address of master NS') . ":</td>\n";
96
+    echo "        <td class=\"n\">\n";
97
+    echo "         <input type=\"text\" class=\"input\" name=\"slave_master\" value=\"\">\n";
98
+    echo "        </td>\n";
99
+    echo "       </tr>\n";
100
+    echo "       <tr>\n";
101
+    echo "        <td class=\"n\">" . _('Owner') . ":</td>\n";
102
+    echo "        <td class=\"n\">\n";
103
+    echo "         <select name=\"owner\">\n";
104
+    /*
105
+      Display list of users to assign slave zone to if the
106
+      editing user has the permissions to, otherise just
107
+      display the adding users name
108
+     */
109
+    foreach ($users as $user) {
110
+        if ($user['id'] === $_SESSION['userid']) {
111
+            echo "          <option value=\"" . $user['id'] . "\" selected>" . $user['fullname'] . "</option>\n";
112
+        } elseif ($perm_view_others == "1") {
113
+            echo "          <option value=\"" . $user['id'] . "\">" . $user['fullname'] . "</option>\n";
114
+        }
115
+    }
116
+    echo "         </select>\n";
117
+    echo "        </td>\n";
118
+    echo "       </tr>\n";
119
+    echo "       <tr>\n";
120
+    echo "        <td class=\"n\">&nbsp;</td>\n";
121
+    echo "        <td class=\"n\">\n";
122
+    echo "         <input type=\"submit\" class=\"button\" name=\"submit\" value=\"" . _('Add zone') . "\">\n";
123
+    echo "        </td>\n";
124
+    echo "       </tr>\n";
125
+    echo "      </table>\n";
126
+    echo "     </form>\n";
127
+}
128
+
129
+include_once("inc/footer.inc.php");

+ 66
- 0
poweradmin/poweradmin-2.1.8/add_zone_templ.php View File

@@ -0,0 +1,66 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles requests to add new zone templates
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+if (!do_hook('verify_permission' , 'zone_master_add' )) {
36
+    error(ERR_PERM_ADD_ZONE_TEMPL);
37
+} else {
38
+
39
+    if (isset($_POST['commit'])) {
40
+        if (add_zone_templ($_POST, $_SESSION['userid'])) {
41
+            success(SUC_ZONE_TEMPL_ADD);
42
+        } // TODO: otherwise repopulate values to form
43
+    }
44
+
45
+    /*
46
+      Display new zone template form
47
+     */
48
+
49
+    $username = do_hook('get_fullname_from_userid' , $_SESSION['userid'] );
50
+    echo "    <h2>" . _('Add zone template for') . " " . $username . "</h2>\n";
51
+    echo "    <form method=\"post\" action=\"add_zone_templ.php\">\n";
52
+    echo "     <table>\n";
53
+    echo "      <tr>\n";
54
+    echo "       <th>" . _('Name') . "</th>\n";
55
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"\"></td>\n";
56
+    echo "      </tr>\n";
57
+    echo "      <tr>\n";
58
+    echo "       <th>" . _('Description') . "</th>\n";
59
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"\"></td>\n";
60
+    echo "      </tr>\n";
61
+    echo "     </table>\n";
62
+    echo "     <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Add zone template') . "\">\n";
63
+    echo "     </form>\n";
64
+}
65
+
66
+include_once("inc/footer.inc.php");

+ 165
- 0
poweradmin/poweradmin-2.1.8/add_zone_templ_record.php View File

@@ -0,0 +1,165 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles requests to add new records to zone templates
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+/*
36
+  Check and make sure all post values have made it through
37
+  if not set them.
38
+ */
39
+$zone_templ_id = "-1";
40
+if ((isset($_GET['id'])) && (v_num($_GET['id']))) {
41
+    $zone_templ_id = $_GET['id'];
42
+}
43
+
44
+$ttl = $dns_ttl;
45
+if ((isset($_POST['ttl'])) && (v_num($_POST['ttl']))) {
46
+    $ttl = $_POST['ttl'];
47
+}
48
+
49
+$prio = "";
50
+if ((isset($_POST['prio'])) && (v_num($_POST['prio']))) {
51
+    $prio = $_POST['prio'];
52
+}
53
+
54
+if (isset($_POST['name'])) {
55
+    $name = $_POST['name'];
56
+} else {
57
+    $name = "";
58
+}
59
+
60
+if (isset($_POST['type'])) {
61
+    $type = $_POST['type'];
62
+} else {
63
+    $type = "";
64
+}
65
+
66
+if (isset($_POST['content'])) {
67
+    $content = $_POST['content'];
68
+} else {
69
+    $content = "";
70
+}
71
+
72
+if ($zone_templ_id == "-1") {
73
+    error(ERR_INV_INPUT);
74
+    include_once("inc/footer.inc.php");
75
+    exit;
76
+}
77
+
78
+$templ_details = get_zone_templ_details($zone_templ_id);
79
+$owner = get_zone_templ_is_owner($zone_templ_id, $_SESSION['userid']);
80
+
81
+/*
82
+  If the form as been submitted
83
+  process it!
84
+ */
85
+if (isset($_POST["commit"])) {
86
+    if (!(do_hook('verify_permission' , 'zone_master_add' )) || !$owner) {
87
+        error(ERR_PERM_ADD_RECORD);
88
+    } else {
89
+        if (add_zone_templ_record($zone_templ_id, $name, $type, $content, $ttl, $prio)) {
90
+            success(_('The record was successfully added.'));
91
+            $name = $type = $content = $ttl = $prio = "";
92
+        }
93
+    }
94
+}
95
+
96
+/*
97
+  Display form to add a record
98
+ */
99
+echo "    <h2>" . _('Add record to zone template') . " \"" . $templ_details['name'] . "\"</h2>\n";
100
+
101
+if (!(do_hook('verify_permission' , 'zone_master_add' )) || !$owner) {
102
+    error(ERR_PERM_ADD_RECORD);
103
+} else {
104
+    echo "     <form method=\"post\">\n";
105
+    echo "      <input type=\"hidden\" name=\"domain\" value=\"" . $zone_templ_id . "\">\n";
106
+    echo "      <table border=\"0\" cellspacing=\"4\">\n";
107
+    echo "       <tr>\n";
108
+    echo "        <td class=\"n\">" . _('Name') . "</td>\n";
109
+    echo "        <td class=\"n\">&nbsp;</td>\n";
110
+    echo "        <td class=\"n\">" . _('Type') . "</td>\n";
111
+    echo "        <td class=\"n\">" . _('Content') . "</td>\n";
112
+    echo "        <td class=\"n\">" . _('Priority') . "</td>\n";
113
+    echo "        <td class=\"n\">" . _('TTL') . "</td>\n";
114
+    echo "       </tr>\n";
115
+    echo "       <tr>\n";
116
+    echo "        <td class=\"n\"><input type=\"text\" name=\"name\" class=\"input\" value=\"" . $name . "\"></td>\n";
117
+    echo "        <td class=\"n\">IN</td>\n";
118
+    echo "        <td class=\"n\">\n";
119
+    echo "         <select name=\"type\">\n";
120
+    $found_selected_type = !(isset($type) && $type);
121
+    foreach (get_record_types() as $record_type) {
122
+        if (isset($type) && $type) {
123
+            if ($type == $record_type) {
124
+                $add = " SELECTED";
125
+                $found_selected_type = true;
126
+            } else {
127
+                $add = "";
128
+            }
129
+        } else {
130
+            // TODO: from where comes $zone_name value and why this check exists here?
131
+            if (isset($zone_name) && preg_match('/i(p6|n-addr).arpa/i', $zone_name) && strtoupper($record_type) == 'PTR') {
132
+                $add = " SELECTED";
133
+            } elseif (strtoupper($record_type) == 'A') {
134
+                $add = " SELECTED";
135
+            } else {
136
+                $add = "";
137
+            }
138
+        }
139
+        echo "          <option" . $add . " value=\"" . $record_type . "\">" . $record_type . "</option>\n";
140
+    }
141
+    if (!$found_selected_type)
142
+        echo "          <option SELECTED value=\"" . htmlspecialchars($type) . "\"><i>" . htmlspecialchars($type) . "</i></option>\n";
143
+    echo "         </select>\n";
144
+    echo "        </td>\n";
145
+    echo "        <td class=\"n\"><input type=\"text\" name=\"content\" class=\"input\" value=\"" . $content . "\"></td>\n";
146
+    echo "        <td class=\"n\"><input type=\"text\" name=\"prio\" class=\"sinput\" value=\"" . $prio . "\"></td>\n";
147
+    echo "        <td class=\"n\"><input type=\"text\" name=\"ttl\" class=\"sinput\" value=\"" . $ttl . "\"</td>\n";
148
+    echo "       </tr>\n";
149
+    echo "     <tr>\n";
150
+    echo "      <td colspan=\"6\"><br><b>Hint:</b></td>\n";
151
+    echo "     </tr>\n";
152
+    echo "     <tr>\n";
153
+    echo "      <td colspan=\"6\">" . _('The following placeholders can be used in template records') . "</td>\n";
154
+    echo "     </tr>\n";
155
+    echo "     <tr>\n";
156
+    echo "      <td colspan=\"6\"><br>&nbsp;&nbsp;&nbsp;&nbsp; * [ZONE] - " . _('substituted with current zone name') . "<br>";
157
+    echo "&nbsp;&nbsp;&nbsp;&nbsp; * [SERIAL] - " . _('substituted with current date and 2 numbers') . " (YYYYMMDD + 00)</td>\n";
158
+    echo "     </tr>\n";
159
+    echo "      </table>\n";
160
+    echo "      <br>\n";
161
+    echo "      <input type=\"submit\" name=\"commit\" value=\"" . _('Add record') . "\" class=\"button\">\n";
162
+    echo "     </form>\n";
163
+}
164
+
165
+include_once("inc/footer.inc.php");

+ 9
- 0
poweradmin/poweradmin-2.1.8/addons/clientip.php View File

@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+$client_ip = '';
4
+if (isset($_SERVER['X_HTTP_FORWARDED_FOR'])) {
5
+    $client_ip = $_SERVER['X_HTTP_FORWARDED_FOR'];
6
+} else if (isset($_SERVER['REMOTE_ADDR'])) {
7
+    $client_ip = $_SERVER['REMOTE_ADDR'];
8
+}
9
+echo $client_ip;

+ 43
- 0
poweradmin/poweradmin-2.1.8/addons/dynamic_dns_client.pl View File

@@ -0,0 +1,43 @@
1
+#!/usr/bin/env perl
2
+
3
+use LWP::Simple;
4
+
5
+use strict;
6
+use warnings;
7
+
8
+# change these values
9
+my $login          = 'username';
10
+my $password       = 'password';
11
+my $domain         = 'mydynamicdns.example.com';
12
+my $poweradmin_url = 'http://www.example.com/poweradmin';
13
+my $up_update_url  = $poweradmin_url . '/dynamic_update.php';
14
+my $ip_lookup_url  = $poweradmin_url . '/addons/clientip.php';
15
+my $verbose        = 1;
16
+
17
+my $ip_address = LWP::Simple::get($ip_lookup_url)
18
+  or die("Error: Could not get your global IP address!\n");
19
+
20
+# FIXME: doesn't support IPv6
21
+if ( $ip_address !~/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ )
22
+{
23
+    print
24
+      "Error: Invalid global IP address! Check if Poweradmin url is correct\n";
25
+    exit;
26
+}
27
+
28
+print "Updating the IP address ($ip_address) now ... \n" if $verbose;
29
+
30
+# insert authentication data to url
31
+$poweradmin_url =~ s/^(http[s]?:\/\/)/$1$login:$password\@/;
32
+
33
+my $response =
34
+  LWP::Simple::get( "$poweradmin_url/dynamic_update.php"
35
+      . "?hostname=$domain&myip=$ip_address&verbose=$verbose" )
36
+  or die($!);
37
+
38
+if ( !defined $response || $response eq "" ) {
39
+    print "Error: Could not contact your poweradmin web server\n";
40
+    exit(0);
41
+}
42
+
43
+print "Status: $response\n" if $verbose;

+ 164
- 0
poweradmin/poweradmin-2.1.8/bulk_registration.php View File

@@ -0,0 +1,164 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles bulk zone registration
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+$owner = "-1";
36
+if ((isset($_POST['owner'])) && (v_num($_POST['owner']))) {
37
+    $owner = $_POST['owner'];
38
+}
39
+
40
+$dom_type = "NATIVE";
41
+if (isset($_POST["dom_type"]) && (in_array($_POST['dom_type'], $server_types))) {
42
+    $dom_type = $_POST["dom_type"];
43
+}
44
+
45
+if (isset($_POST['domains'])) {
46
+    $domains = explode("\r\n", $_POST['domains']);
47
+    foreach ($domains as $key => $domain) {
48
+        $domain = trim($domain);
49
+        if ($domain == '') {
50
+            unset($domains[$key]);
51
+        } else {
52
+            $domains[$key] = $domain;
53
+        }
54
+    }
55
+} else {
56
+    $domains = array();
57
+}
58
+
59
+if (isset($_POST['zone_template'])) {
60
+    $zone_template = $_POST['zone_template'];
61
+} else {
62
+    $zone_template = "none";
63
+}
64
+
65
+/*
66
+  Check user permissions
67
+ */
68
+(do_hook('verify_permission' , 'zone_master_add' )) ? $zone_master_add = "1" : $zone_master_add = "0";
69
+(do_hook('verify_permission' , 'user_view_others' )) ? $perm_view_others = "1" : $perm_view_others = "0";
70
+
71
+if (isset($_POST['submit']) && $zone_master_add == "1") {
72
+    $error = false;
73
+    foreach ($domains as $domain) {
74
+        if (!is_valid_hostname_fqdn($domain, 0)) {
75
+            error($domain . ' failed - ' . ERR_DNS_HOSTNAME);
76
+        } elseif (domain_exists($domain)) {
77
+            error($domain . " failed - " . ERR_DOMAIN_EXISTS);
78
+            $error = true;
79
+        } elseif (add_domain($domain, $owner, $dom_type, '', $zone_template)) {
80
+            success("<a href=\"edit.php?id=" . get_zone_id_from_name($domain) . "\">" . $domain . " - " . SUC_ZONE_ADD . '</a>');
81
+        }
82
+    }
83
+
84
+    if (false === $error) {
85
+        unset($domains, $owner, $dom_type, $zone_template);
86
+    }
87
+}
88
+
89
+if ($zone_master_add != "1") {
90
+    error(ERR_PERM_ADD_ZONE_MASTER);
91
+} else {
92
+    echo "     <h2>" . _('Bulk registration') . "</h2>\n";
93
+
94
+    $available_zone_types = array("MASTER", "NATIVE");
95
+    $users = do_hook('show_users');
96
+    $zone_templates = get_list_zone_templ($_SESSION['userid']);
97
+
98
+    echo "     <form method=\"post\" action=\"bulk_registration.php\">\n";
99
+    echo "      <table>\n";
100
+    echo "       <tr>\n";
101
+    echo "        <td class=\"n\" width=\"100\">" . _('Owner') . ":</td>\n";
102
+    echo "        <td class=\"n\">\n";
103
+    echo "         <select name=\"owner\">\n";
104
+    /*
105
+      Display list of users to assign zone to if creating
106
+      user has the proper permission to do so.
107
+     */
108
+    foreach ($users as $user) {
109
+        if ($user['id'] === $_SESSION['userid']) {
110
+            echo "          <option value=\"" . $user['id'] . "\" selected>" . $user['fullname'] . "</option>\n";
111
+        } elseif ($perm_view_others == "1") {
112
+            echo "          <option value=\"" . $user['id'] . "\">" . $user['fullname'] . "</option>\n";
113
+        }
114
+    }
115
+    echo "         </select>\n";
116
+    echo "        </td>\n";
117
+    echo "       </tr>\n";
118
+    echo "       <tr>\n";
119
+    echo "        <td class=\"n\">" . _('Type') . ":</td>\n";
120
+    echo "        <td class=\"n\">\n";
121
+    echo "         <select name=\"dom_type\">\n";
122
+    foreach ($available_zone_types as $type) {
123
+        echo "          <option value=\"" . $type . "\">" . strtolower($type) . "</option>\n";
124
+    }
125
+    echo "         </select>\n";
126
+    echo "        </td>\n";
127
+    echo "       </tr>\n";
128
+    echo "       <tr>\n";
129
+    echo "        <td class=\"n\">" . _('Template') . ":</td>\n";
130
+    echo "        <td class=\"n\">\n";
131
+    echo "         <select name=\"zone_template\">\n";
132
+    echo "          <option value=\"none\">none</option>\n";
133
+    foreach ($zone_templates as $zone_template) {
134
+        echo "          <option value=\"" . $zone_template['id'] . "\">" . $zone_template['name'] . "</option>\n";
135
+    }
136
+    echo "         </select>\n";
137
+    echo "        </td>\n";
138
+    echo "       </tr>\n";
139
+
140
+    echo "       <tr>\n";
141
+    echo "        <td class=\"n\">" . _('Zones') . ":</td>\n";
142
+    echo "        <td class=\"n\">\n";
143
+    echo "         <ul id=\"domain_names\" style=\"list-style-type:none; padding:0 \">\n";
144
+    echo "		<li>" . _('Type one domain per line') . ":</li>\n";
145
+    echo "          <li><textarea class=\"input\" name=\"domains\" rows=\"10\" cols=\"30\" style=\"width: 500px;\">";
146
+    if (isset($error) && isset($_POST['domains'])) {
147
+        echo $_POST['domains'];
148
+    }
149
+    echo "</textarea></li>\n";
150
+    echo "         </ol>\n";
151
+    echo "        </td>\n";
152
+    echo "       </tr>\n";
153
+
154
+    echo "       <tr>\n";
155
+    echo "        <td class=\"n\">&nbsp;</td>\n";
156
+    echo "        <td class=\"n\">\n";
157
+    echo "         <input type=\"submit\" class=\"button\" name=\"submit\" value=\"" . _('Add zones') . "\">\n";
158
+    echo "        </td>\n";
159
+    echo "       </tr>\n";
160
+    echo "      </table>\n";
161
+    echo "     </form>\n";
162
+}
163
+
164
+include_once("inc/footer.inc.php");

+ 64
- 0
poweradmin/poweradmin-2.1.8/change_password.php View File

@@ -0,0 +1,64 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles user password changes
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+
34
+if (isset($_POST['submit']) && $_POST['submit']) {
35
+    do_hook('change_user_pass' , $_POST );
36
+}
37
+
38
+include_once("inc/header.inc.php");
39
+
40
+echo "    <h2>" . _('Change password') . "</h2>\n";
41
+echo "    <form method=\"post\" action=\"change_password.php\">\n";
42
+echo "     <table border=\"0\" cellspacing=\"4\">\n";
43
+echo "      <tr>\n";
44
+echo "       <td class=\"n\">" . _('Current password') . ":</td>\n";
45
+echo "       <td class=\"n\"><input type=\"password\" class=\"input\" name=\"currentpass\" value=\"\"></td>\n";
46
+echo "      </tr>\n";
47
+echo "      <tr>\n";
48
+echo "       <td class=\"n\">" . _('New password') . ":</td>\n";
49
+echo "       <td class=\"n\"><input type=\"password\" class=\"input\" name=\"newpass\" value=\"\"></td>\n";
50
+echo "      </tr>\n";
51
+echo "      <tr>\n";
52
+echo "       <td class=\"n\">" . _('New password') . ":</td>\n";
53
+echo "       <td class=\"n\"><input type=\"password\" class=\"input\" name=\"newpass2\" value=\"\"></td>\n";
54
+echo "      </tr>\n";
55
+echo "      <tr>\n";
56
+echo "       <td class=\"n\">&nbsp;</td>\n";
57
+echo "       <td class=\"n\">\n";
58
+echo "        <input type=\"submit\" class=\"button\" name=\"submit\" value=\"" . _('Change password') . "\">\n";
59
+echo "       </td>\n";
60
+echo "      </tr>\n";
61
+echo "     </table>\n";
62
+echo "    </form>\n";
63
+
64
+include_once("inc/footer.inc.php");

+ 23
- 0
poweradmin/poweradmin-2.1.8/composer.json View File

@@ -0,0 +1,23 @@
1
+{
2
+  "description": "A web-based control panel for PowerDNS.",
3
+  "name": "poweradmin/poweradmin",
4
+  "type": "project",
5
+  "homepage": "http://www.poweradmin.org",
6
+  "license": "GPL-3.0",
7
+  "support": {
8
+    "issues": "https://github.com/poweradmin/poweradmin/issues",
9
+    "wiki": "https://github.com/poweradmin/poweradmin/wiki",
10
+    "irc": "irc://irc.oftc.net/poweradmin",
11
+    "source": "https://github.com/poweradmin/poweradmin"
12
+  },
13
+  "require": {
14
+    "php": ">=5.5.0",
15
+    "twig/twig": "~1.0",
16
+    "twig/extensions": "^1.3"
17
+  },
18
+  "autoload": {
19
+    "psr-4": {
20
+      "Poweradmin\\": "vendor/poweradmin/"
21
+    }
22
+  }
23
+}

+ 103
- 0
poweradmin/poweradmin-2.1.8/delete_domain.php View File

@@ -0,0 +1,103 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles zone deletion
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+global $pdnssec_use;
36
+
37
+if (do_hook('verify_permission' , 'zone_content_edit_others' )) {
38
+    $perm_edit = "all";
39
+} elseif (do_hook('verify_permission' , 'zone_content_edit_own' )) {
40
+    $perm_edit = "own";
41
+} else {
42
+    $perm_edit = "none";
43
+}
44
+
45
+$zone_id = "-1";
46
+if (isset($_GET['id']) && v_num($_GET['id'])) {
47
+    $zone_id = $_GET['id'];
48
+}
49
+
50
+$confirm = "-1";
51
+if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
52
+    $confirm = $_GET['confirm'];
53
+}
54
+
55
+$zone_info = get_zone_info_from_id($zone_id);
56
+if (!$zone_info) {
57
+    header("Location: list_zones.php");
58
+    exit;
59
+}
60
+$zone_owners = do_hook('get_fullnames_owners_from_domainid' , $zone_id );
61
+$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zone_id );
62
+
63
+if ($zone_id == "-1") {
64
+    error(ERR_INV_INPUT);
65
+    include_once("inc/footer.inc.php");
66
+    exit;
67
+}
68
+
69
+echo "     <h2>" . _('Delete zone') . " \"" . $zone_info['name'] . "\"</h2>\n";
70
+
71
+if ($confirm == '1') {
72
+    if ($pdnssec_use && $zone_info['type'] == 'MASTER') {
73
+        $zone_name = get_zone_name_from_id($zone_id);
74
+        dnssec_unsecure_zone($zone_name);
75
+    }
76
+
77
+    if (delete_domain($zone_id)) {
78
+        success(SUC_ZONE_DEL);
79
+        log_info(sprintf('client_ip:%s user:%s operation:delete_zone zone:%s zone_type:%s',
80
+                          $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
81
+                          $zone_info['name'], $zone_info['type']));
82
+    }
83
+} else {
84
+    if ($perm_edit == "all" || ( $perm_edit == "own" && $user_is_zone_owner == "1")) {
85
+        echo "      " . _('Owner') . ": " . $zone_owners . "<br>\n";
86
+        echo "      " . _('Type') . ": " . $zone_info['type'] . "\n";
87
+        if ($zone_info['type'] == "SLAVE") {
88
+            $slave_master = get_domain_slave_master($zone_id);
89
+            if (supermaster_exists($slave_master)) {
90
+                echo "        <p>         \n";
91
+                printf(_('You are about to delete a slave zone of which the master nameserver, %s, is a supermaster. Deleting the zone now, will result in temporary removal only. Whenever the supermaster sends a notification for this zone, it will be added again!'), $slave_master);
92
+                echo "        </p>\n";
93
+            }
94
+        }
95
+        echo "     <p>" . _('Are you sure?') . "</p>\n";
96
+        echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_domain.php?id=" . $zone_id . "&amp;confirm=1'\" value=\"" . _('Yes') . "\">\n";
97
+        echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
98
+    } else {
99
+        error(ERR_PERM_DEL_ZONE);
100
+    }
101
+}
102
+
103
+include_once("inc/footer.inc.php");

+ 103
- 0
poweradmin/poweradmin-2.1.8/delete_domains.php View File

@@ -0,0 +1,103 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles zones deletion
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+if (do_hook('verify_permission' , 'zone_content_edit_others' )) {
36
+    $perm_edit = "all";
37
+} elseif (do_hook('verify_permission' , 'zone_content_edit_own' )) {
38
+    $perm_edit = "own";
39
+} else {
40
+    $perm_edit = "none";
41
+}
42
+
43
+$confirm = "-1";
44
+if (isset($_POST['confirm'])) {
45
+    $confirm = "1";
46
+}
47
+
48
+$zones = $_POST['zone_id'];
49
+if (!$zones) {
50
+    header("Location: list_zones.php");
51
+    exit;
52
+}
53
+
54
+echo "     <h2>" . _('Delete zones') . "</h2>\n";
55
+
56
+if ($confirm == '1') {
57
+    //Fetch information about zones before deleting them
58
+    $deleted_zones = array();
59
+    foreach ($zones as $zone) {
60
+        $zone_info = get_zone_info_from_id($zone);
61
+        array_push($deleted_zones,$zone_info);
62
+    }
63
+    $delete_domains = delete_domains($zones);
64
+    if ($delete_domains) {
65
+        count($deleted_zones) == 1 ? success(SUC_ZONE_DEL) : success(SUC_ZONES_DEL);
66
+        //Zones successfully deleted so generate log messages from information retrieved earlier
67
+        foreach ($deleted_zones as $zone_info) {
68
+            log_info(sprintf('client_ip:%s user:%s operation:delete_zone zone:%s zone_type:%s',
69
+                              $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
70
+                              $zone_info['name'], $zone_info['type']));
71
+        }
72
+    }
73
+} else {
74
+    echo "     <form method=\"post\" action=\"delete_domains.php\">\n";
75
+    foreach ($zones as $zone) {
76
+        $zone_owners = do_hook('get_fullnames_owners_from_domainid' , $zone );
77
+        $user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zone );
78
+        $zone_info = get_zone_info_from_id($zone);
79
+        if ($perm_edit == "all" || ( $perm_edit == "own" && $user_is_zone_owner == "1")) {
80
+            echo "      <input type=\"hidden\" name=\"zone_id[]\" value=\"" . $zone . "\">\n";
81
+            echo "      " . _('Name') . ": " . $zone_info['name'] . "<br>\n";
82
+            echo "      " . _('Owner') . ": " . $zone_owners . "<br>\n";
83
+            echo "      " . _('Type') . ": " . $zone_info['type'] . "\n";
84
+            if ($zone_info['type'] == "SLAVE") {
85
+                $slave_master = get_domain_slave_master($zone);
86
+                if (supermaster_exists($slave_master)) {
87
+                    echo "        <p>         \n";
88
+                    printf(_('You are about to delete a slave zone of which the master nameserver, %s, is a supermaster. Deleting the zone now, will result in temporary removal only. Whenever the supermaster sends a notification for this zone, it will be added again!'), $slave_master);
89
+                    echo "        </p>\n";
90
+                }
91
+            }
92
+            echo "     <br><br>\n";
93
+        } else {
94
+            error(ERR_PERM_DEL_ZONE);
95
+        }
96
+    }
97
+    echo "                     <p>" . _('Are you sure?') . "</p>\n";
98
+    echo "                     <input type=\"submit\" name=\"confirm\" value=\"" . _('Yes') . "\" class=\"button\">\n";
99
+    echo "                     <input type=\"button\" class=\"button\" OnClick=\"location.href='list_zones.php'\" value=\"" . _('No') . "\">\n";
100
+    echo "     </form>\n";
101
+}
102
+
103
+include_once("inc/footer.inc.php");

+ 67
- 0
poweradmin/poweradmin-2.1.8/delete_perm_templ.php View File

@@ -0,0 +1,67 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles deletion of zone templates
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+$perm_templ = "-1";
36
+if (isset($_GET['id']) && (v_num($_GET['id']))) {
37
+    $perm_templ = $_GET['id'];
38
+}
39
+
40
+$confirm = "-1";
41
+if ((isset($_GET['confirm'])) && v_num($_GET['confirm'])) {
42
+    $confirm = $_GET['confirm'];
43
+}
44
+
45
+if ($perm_templ == "-1") {
46
+    error(ERR_INV_INPUT);
47
+} else {
48
+    if (!(do_hook('verify_permission' , 'user_edit_templ_perm' ))) {
49
+        error(ERR_PERM_DEL_PERM_TEMPL);
50
+    } else {
51
+        $templ_details = do_hook('get_permission_template_details' , $perm_templ );
52
+        echo "     <h2>" . _('Delete permission template') . " \"" . $templ_details['name'] . "\"</h2>\n";
53
+
54
+        if (isset($_GET['confirm']) && $_GET["confirm"] == '1') {
55
+            if (delete_perm_templ($perm_templ)) {
56
+                success(SUC_PERM_TEMPL_DEL);
57
+            }
58
+        } else {
59
+            echo "     <p>" . _('Are you sure?') . "</p>\n";
60
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_perm_templ.php?id=" . $perm_templ . "&amp;confirm=1'\" value=\"" . _('Yes') . "\">\n";
61
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
62
+        }
63
+    }
64
+}
65
+
66
+include_once("inc/footer.inc.php");
67
+

+ 136
- 0
poweradmin/poweradmin-2.1.8/delete_record.php View File

@@ -0,0 +1,136 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles record deletions from zones
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+global $pdnssec_use;
36
+
37
+$record_id = "-1";
38
+if (isset($_GET['id']) && v_num($_GET['id'])) {
39
+    $record_id = $_GET['id'];
40
+}
41
+
42
+$confirm = "-1";
43
+if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
44
+    $confirm = $_GET['confirm'];
45
+}
46
+
47
+if (do_hook('verify_permission', 'zone_content_edit_others')) {
48
+    $perm_content_edit = "all";
49
+} elseif (do_hook('verify_permission', 'zone_content_edit_own')) {
50
+    $perm_content_edit = "own";
51
+} elseif (do_hook('verify_permission', 'zone_content_edit_own_as_client')) {
52
+    $perm_content_edit = "own_as_client";
53
+} else {
54
+    $perm_content_edit = "none";
55
+}
56
+
57
+$zid = get_zone_id_from_record_id($_GET['id']);
58
+if ($zid == NULL) {
59
+    header("Location: list_zones.php");
60
+    exit;
61
+}
62
+$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zid );
63
+
64
+$zone_info = get_zone_info_from_id($zid);
65
+
66
+if ($record_id == "-1") {
67
+    error(ERR_INV_INPUT);
68
+} else {
69
+    if ($confirm == '1') {
70
+        $record_info = get_record_from_id($record_id);
71
+        if (delete_record($record_id)) {
72
+            success("<a href=\"edit.php?id=" . $zid . "\">" . SUC_RECORD_DEL . "</a>");
73
+            if (isset($record_info['prio'])) {
74
+                log_info(sprintf('client_ip:%s user:%s operation:delete_record record_type:%s record:%s content:%s ttl:%s priority:%s',
75
+                     $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
76
+                     $record_info['type'], $record_info['name'], $record_info['content'], $record_info['ttl'], $record_info['prio'] ));
77
+            } else {
78
+                log_info(sprintf('client_ip:%s user:%s operation:delete_record record_type:%s record:%s content:%s ttl:%s',
79
+                     $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
80
+                     $record_info['type'], $record_info['name'], $record_info['content'], $record_info['ttl'] ));
81
+
82
+            }
83
+
84
+            delete_record_zone_templ($record_id);
85
+
86
+            // update serial after record deletion
87
+            update_soa_serial($zid);
88
+
89
+            if ($pdnssec_use) {
90
+                // do also rectify-zone
91
+                if (dnssec_rectify_zone($zid)) {
92
+                    success(SUC_EXEC_PDNSSEC_RECTIFY_ZONE);
93
+                }
94
+            }
95
+        }
96
+    } else {
97
+        $zone_id = recid_to_domid($record_id);
98
+        $zone_name = get_zone_name_from_id($zone_id);
99
+        $user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zone_id );
100
+        $record_info = get_record_from_id($record_id);
101
+
102
+        echo "     <h2>" . _('Delete record in zone') . " \"<a href=\"edit.php?id=" . $zid . "\">" . $zone_name . "</a>\"</h2>\n";
103
+
104
+        if ($zone_info['type'] == "SLAVE" || $perm_content_edit == "none" || ($perm_content_edit == "own" || $perm_content_edit == "own_as_client") && $user_is_zone_owner == "0") {
105
+            error(ERR_PERM_EDIT_RECORD);
106
+        } else {
107
+            echo "     <table>\n";
108
+            echo "      <tr>\n";
109
+            echo "       <th>Name</th>\n";
110
+            echo "       <th>Type</th>\n";
111
+            echo "       <th>Content</th>\n";
112
+            if (isset($record_info['prio'])) {
113
+                echo "       <th>Priority</th>\n";
114
+            }
115
+            echo "       <th>TTL</th>\n";
116
+            echo "      </tr>\n";
117
+            echo "      <tr>\n";
118
+            echo "       <td>" . $record_info['name'] . "</td>\n";
119
+            echo "       <td>" . $record_info['type'] . "</td>\n";
120
+            echo "       <td>" . $record_info['content'] . "</td>\n";
121
+            if (isset($record_info['prio'])) {
122
+                echo "       <td>" . $record_info['prio'] . "</td>\n";
123
+            }
124
+            echo "       <td>" . $record_info['ttl'] . "</td>\n";
125
+            echo "      </tr>\n";
126
+            echo "     </table>\n";
127
+            if (($record_info['type'] == 'NS' && $record_info['name'] == $zone_name) || $record_info['type'] == 'SOA') {
128
+                echo "     <p>" . _('You are trying to delete a record that is needed for this zone to work.') . "</p>\n";
129
+            }
130
+            echo "     <p>" . _('Are you sure?') . "</p>\n";
131
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_record.php?id=" . $record_id . "&amp;confirm=1'\" value=\"" . _('Yes') . "\">\n";
132
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='edit.php?id=" . $zid . "'\" value=\"" . _('No') . "\">\n";
133
+        }
134
+    }
135
+}
136
+include_once("inc/footer.inc.php");

+ 82
- 0
poweradmin/poweradmin-2.1.8/delete_supermaster.php View File

@@ -0,0 +1,82 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles deletion of supermasters
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+$master_ip = "-1";
36
+if (isset($_GET['master_ip']) && (is_valid_ipv4($_GET['master_ip']) || is_valid_ipv6($_GET['master_ip']))) {
37
+    $master_ip = $_GET['master_ip'];
38
+}
39
+
40
+$ns_name = "-1";
41
+if (isset($_GET['ns_name']) && (is_valid_hostname_fqdn($_GET['ns_name'], 0))) {
42
+    $ns_name = $_GET['ns_name'];
43
+}
44
+
45
+$confirm = "-1";
46
+if ((isset($_GET['confirm'])) && (v_num($_GET['confirm']))) {
47
+    $confirm = $_GET['confirm'];
48
+}
49
+
50
+if ($master_ip == "-1" || $ns_name == "-1") {
51
+    error(ERR_INV_INPUT);
52
+} else {
53
+    (do_hook('verify_permission' , 'supermaster_edit' )) ? $perm_sm_edit = "1" : $perm_sm_edit = "0";
54
+    if ($perm_sm_edit == "0") {
55
+        error(ERR_PERM_DEL_SM);
56
+    } else {
57
+        $info = get_supermaster_info_from_ip($master_ip);
58
+
59
+        echo "     <h2>" . _('Delete supermaster') . " \"" . $master_ip . "\"</h2>\n";
60
+
61
+        if (isset($_GET['confirm']) && $_GET["confirm"] == '1') {
62
+            if (!supermaster_ip_name_exists($master_ip, $ns_name)) {
63
+                header("Location: list_supermasters.php");
64
+                exit;
65
+            }
66
+
67
+            if (delete_supermaster($master_ip, $ns_name)) {
68
+                success(SUC_SM_DEL);
69
+            }
70
+        } else {
71
+            echo "     <p>\n";
72
+            echo "      " . _('Hostname in NS record') . ": " . $info['ns_name'] . "<br>\n";
73
+            echo "      " . _('Account') . ": " . $info['account'] . "\n";
74
+            echo "     </p>\n";
75
+            echo "     <p>" . _('Are you sure?') . "</p>\n";
76
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_supermaster.php?master_ip=" . $master_ip . "&amp;ns_name=" . $info['ns_name'] . "&amp;confirm=1'\" value=\"" . _('Yes') . "\">\n";
77
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
78
+        }
79
+    }
80
+}
81
+
82
+include_once("inc/footer.inc.php");

+ 127
- 0
poweradmin/poweradmin-2.1.8/delete_user.php View File

@@ -0,0 +1,127 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles user deletion
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+do_hook('verify_permission' , 'user_edit_own' ) ? $perm_edit_own = "1" : $perm_edit_own = "0";
36
+do_hook('verify_permission' , 'user_edit_others' ) ? $perm_edit_others = "1" : $perm_edit_others = "0";
37
+do_hook('verify_permission' , 'user_is_ueberuser' ) ? $perm_is_godlike = "1" : $perm_is_godlike = "0";
38
+
39
+if (!(isset($_GET['id']) && v_num($_GET['id']))) {
40
+    error(ERR_INV_INPUT);
41
+    include_once("inc/footer.inc.php");
42
+    exit;
43
+} else {
44
+    $uid = $_GET['id'];
45
+}
46
+
47
+if (isset($_POST['commit'])) {
48
+
49
+    if (do_hook('is_valid_user' , $uid )) {
50
+        $zones = array();
51
+        if (isset($_POST['zone'])) {
52
+            $zones = $_POST['zone'];
53
+        }
54
+
55
+        if (do_hook('delete_user' , $uid, $zones )) {
56
+            success(SUC_USER_DEL);
57
+        }
58
+    } else {
59
+        header("Location: users.php");
60
+        exit;
61
+    }
62
+} else {
63
+
64
+    if (($uid != $_SESSION['userid'] && $perm_edit_others == "0") || ($uid == $_SESSION['userid'] && $perm_is_godlike == "0")) {
65
+        error(ERR_PERM_DEL_USER);
66
+        include_once("inc/footer.inc.php");
67
+        exit;
68
+    } else {
69
+        $fullname = do_hook('get_fullname_from_userid' , $uid );
70
+        $zones = get_zones("own", $uid);
71
+
72
+        echo "     <h2>" . _('Delete user') . " \"" . $fullname . "\"</h2>\n";
73
+        echo "     <form method=\"post\" action=\"\">\n";
74
+        echo "      <table>\n";
75
+
76
+        if (count($zones) > 0) {
77
+
78
+            $users = do_hook('show_users');
79
+
80
+            echo "       <tr>\n";
81
+            echo "        <td colspan=\"5\">\n";
82
+
83
+            echo "         " . _('You are about to delete a user. This user is owner for a number of zones. Please decide what to do with these zones.') . "\n";
84
+            echo "        </td>\n";
85
+            echo "       </tr>\n";
86
+
87
+            echo "       <tr>\n";
88
+            echo "        <th>" . _('Zone') . "</th>\n";
89
+            echo "        <th>" . _('Delete') . "</th>\n";
90
+            echo "        <th>" . _('Leave') . "</th>\n";
91
+            echo "        <th>" . _('Add new owner') . "</th>\n";
92
+            echo "        <th>" . _('Owner to be added') . "</th>\n";
93
+            echo "       </tr>\n";
94
+
95
+            foreach ($zones as $zone) {
96
+                echo "       <input type=\"hidden\" name=\"zone[" . $zone['id'] . "][zid]\" value=\"" . $zone['id'] . "\">\n";
97
+                echo "       <tr>\n";
98
+                echo "        <td>" . $zone['name'] . "</td>\n";
99
+                echo "        <td><input type=\"radio\" name=\"zone[" . $zone['id'] . "][target]\" value=\"delete\"></td>\n";
100
+                echo "        <td><input type=\"radio\" name=\"zone[" . $zone['id'] . "][target]\" value=\"leave\" CHECKED></td>\n";
101
+                echo "        <td><input type=\"radio\" name=\"zone[" . $zone['id'] . "][target]\" value=\"new_owner\"></td>\n";
102
+                echo "        <td>\n";
103
+                echo "         <select name=\"zone[" . $zone['id'] . "][newowner]\">\n";
104
+
105
+                foreach ($users as $user) {
106
+                    echo "          <option value=\"" . $user["id"] . "\">" . $user["fullname"] . "</option>\n";
107
+                }
108
+
109
+                echo "         </select>\n";
110
+                echo "        </td>\n";
111
+                echo "       </tr>\n";
112
+            }
113
+        }
114
+        echo "       <tr>\n";
115
+        echo "        <td colspan=\"5\">\n";
116
+
117
+        echo "         " . _('Really delete this user?') . "\n";
118
+        echo "        </td>\n";
119
+        echo "       </tr>\n";
120
+
121
+        echo "      </table>\n";
122
+        echo "     <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
123
+        echo "     </form>\n";
124
+    }
125
+}
126
+
127
+include_once("inc/footer.inc.php");

+ 66
- 0
poweradmin/poweradmin-2.1.8/delete_zone_templ.php View File

@@ -0,0 +1,66 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles zone template deletion
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+$zone_templ_id = "-1";
36
+if (isset($_GET['id']) && (v_num($_GET['id']))) {
37
+    $zone_templ_id = $_GET['id'];
38
+}
39
+
40
+$confirm = "-1";
41
+if ((isset($_GET['confirm'])) && v_num($_GET['confirm'])) {
42
+    $confirm = $_GET['confirm'];
43
+}
44
+
45
+$owner = get_zone_templ_is_owner($zone_templ_id, $_SESSION['userid']);
46
+if ($zone_templ_id == "-1") {
47
+    error(ERR_INV_INPUT);
48
+} else {
49
+    if (!do_hook('verify_permission' , 'zone_master_add' ) || !$owner) {
50
+        error(ERR_PERM_DEL_ZONE_TEMPL);
51
+    } else {
52
+        $templ_details = get_zone_templ_details($zone_templ_id);
53
+        echo "     <h2>" . _('Delete zone template') . " \"" . $templ_details['name'] . "\"</h2>\n";
54
+
55
+        if (isset($_GET['confirm']) && $_GET["confirm"] == '1') {
56
+            delete_zone_templ($zone_templ_id);
57
+            success(SUC_ZONE_TEMPL_DEL);
58
+        } else {
59
+            echo "     <p>" . _('Are you sure?') . "</p>\n";
60
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_zone_templ.php?id=" . $zone_templ_id . "&amp;confirm=1'\" value=\"" . _('Yes') . "\">\n";
61
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
62
+        }
63
+    }
64
+}
65
+
66
+include_once("inc/footer.inc.php");

+ 89
- 0
poweradmin/poweradmin-2.1.8/delete_zone_templ_record.php View File

@@ -0,0 +1,89 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that record deletion from zone template
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+$record_id = "-1";
36
+if (isset($_GET['id']) && v_num($_GET['id'])) {
37
+    $record_id = $_GET['id'];
38
+}
39
+
40
+$zone_templ_id = "-1";
41
+if (isset($_GET['zone_templ_id']) && v_num($_GET['zone_templ_id'])) {
42
+    $zone_templ_id = $_GET['zone_templ_id'];
43
+}
44
+
45
+$confirm = "-1";
46
+if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
47
+    $confirm = $_GET['confirm'];
48
+}
49
+
50
+if ($record_id == "-1" || $zone_templ_id == "-1") {
51
+    error(ERR_INV_INPUT);
52
+} else {
53
+    $owner = get_zone_templ_is_owner($zone_templ_id, $_SESSION['userid']);
54
+    if ($confirm == '1' && $owner) {
55
+        if (delete_zone_templ_record($record_id)) {
56
+            success(SUC_RECORD_DEL);
57
+        }
58
+    } else {
59
+        $templ_details = get_zone_templ_details($zone_templ_id);
60
+        $record_info = get_zone_templ_record_from_id($record_id);
61
+
62
+        echo "     <h2>" . _('Delete record in zone') . " \"" . $templ_details['name'] . "\"</h2>\n";
63
+
64
+        if (!(do_hook('verify_permission' , 'zone_master_add' )) || !$owner) {
65
+            error(ERR_PERM_DEL_RECORD);
66
+        } else {
67
+            echo "     <table>\n";
68
+            echo "      <tr>\n";
69
+            echo "       <th>Name</th>\n";
70
+            echo "       <th>Type</th>\n";
71
+            echo "       <th>Content</th>\n";
72
+            echo "       <th>Priority</th>\n";
73
+            echo "       <th>TTL</th>\n";
74
+            echo "      </tr>\n";
75
+            echo "      <tr>\n";
76
+            echo "       <td>" . $record_info['name'] . "</td>\n";
77
+            echo "       <td>" . $record_info['type'] . "</td>\n";
78
+            echo "       <td>" . $record_info['content'] . "</td>\n";
79
+            echo "       <td>" . $record_info['prio'] . "</td>\n";
80
+            echo "       <td>" . $record_info['ttl'] . "</td>\n";
81
+            echo "      </tr>\n";
82
+            echo "     </table>\n";
83
+            echo "     <p>" . _('Are you sure?') . "</p>\n";
84
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_zone_templ_record.php?id=" . $record_id . "&amp;zone_templ_id=" . $zone_templ_id . "&amp;confirm=1'\" value=\"" . _('Yes') . "\">\n";
85
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
86
+        }
87
+    }
88
+}
89
+include_once("inc/footer.inc.php");

+ 113
- 0
poweradmin/poweradmin-2.1.8/dnssec.php View File

@@ -0,0 +1,113 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ *
23
+ */
24
+
25
+/**
26
+ * Script that handles editing of zone records
27
+ *
28
+ * @package     Poweradmin
29
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
30
+ * @copyright   2010-2017  Poweradmin Development Team
31
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
32
+ */
33
+require_once("inc/toolkit.inc.php");
34
+include_once("inc/header.inc.php");
35
+
36
+global $pdnssec_use;
37
+
38
+$zone_id = "-1";
39
+if (isset($_GET['id']) && v_num($_GET['id'])) {
40
+    $zone_id = $_GET['id'];
41
+}
42
+
43
+if ($zone_id == "-1") {
44
+    error(ERR_INV_INPUT);
45
+    include_once("inc/footer.inc.php");
46
+    exit;
47
+}
48
+
49
+/*
50
+  Check permissions
51
+ */
52
+$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zone_id );
53
+if ($perm_meta_edit == "all" || ( $perm_meta_edit == "own" && $user_is_zone_owner == "1")) {
54
+    $meta_edit = "1";
55
+} else {
56
+    $meta_edit = "0";
57
+}
58
+
59
+(do_hook('verify_permission' , 'user_view_others' )) ? $perm_view_others = "1" : $perm_view_others = "0";
60
+
61
+if ($perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0") {
62
+    error(ERR_PERM_VIEW_ZONE);
63
+    include_once("inc/footer.inc.php");
64
+    exit();
65
+}
66
+
67
+if (zone_id_exists($zone_id) == "0") {
68
+    error(ERR_ZONE_NOT_EXIST);
69
+    include_once("inc/footer.inc.php");
70
+    exit();
71
+}
72
+
73
+$domain_type = get_domain_type($zone_id);
74
+$domain_name = get_zone_name_from_id($zone_id);
75
+$record_count = count_zone_records($zone_id);
76
+$zone_templates = get_list_zone_templ($_SESSION['userid']);
77
+$zone_template_id = get_zone_template($zone_id);
78
+
79
+echo "   <h2>" . _('DNSSEC keys for zone') . " \"" . get_zone_name_from_id($zone_id) . "\"</h2>\n";
80
+
81
+echo "     <table>\n";
82
+echo "      <tr>\n";
83
+echo "       <th>&nbsp;</th>\n";
84
+echo "       <th>" . _('ID') . "</th>\n";
85
+echo "       <th>" . _('Type') . "</th>\n";
86
+echo "       <th>" . _('Tag') . "</th>\n";
87
+echo "       <th>" . _('Algorithm') . "</th>\n";
88
+echo "       <th>" . _('Bits') . "</th>\n";
89
+echo "       <th>" . _('Active') . "</th>\n";
90
+echo "      </tr>\n";
91
+
92
+$keys = dnssec_get_keys($domain_name);
93
+
94
+foreach ($keys as $item) {
95
+    echo "<tr>\n";
96
+    echo "<td width=\"60\" class=\"actions\">&nbsp;\n";
97
+    echo "<a href=\"dnssec_edit_key.php?id=" . $zone_id . "&key_id=" . $item[0] . "\"><img src=\"images/edit.gif\" title=\"" . _('Edit zone key') . " " . $item[0] . "\" alt=\"[ " . _('Edit zone key') . " " . $domain_name . " ]\"></a>\n";
98
+    echo "<a href=\"dnssec_delete_key.php?id=" . $zone_id . "&key_id=" . $item[0] . "\"><img src=\"images/delete.gif\" title=\"" . _('Delete zone key') . " " . $item[0] . "\" alt=\"[ " . _('Delete zone key') . " " . $domain_name . " ]\"></a>\n";
99
+    echo "</td>";
100
+    echo "<td class=\"cell\">".$item[0]."</td>\n";
101
+    echo "<td class=\"cell\">".$item[1]."</td>\n";
102
+    echo "<td class=\"cell\">".$item[2]."</td>\n";
103
+    echo "<td class=\"cell\">".dnssec_algorithm_to_name($item[3])."</td>\n";
104
+    echo "<td class=\"cell\">".$item[4]."</td>\n";
105
+    echo "<td class=\"cell\">".($item[5] ? _('Yes') : _('No'))."</td>\n";
106
+    echo "</tr>\n";
107
+}
108
+
109
+echo "     </table>\n";
110
+echo "      <input type=\"button\" class=\"button\" onclick=\"location.href = 'dnssec_add_key.php?id=".$zone_id."';\" value=\"" . _('Add new key') . "\">\n";
111
+echo "      <input type=\"button\" class=\"button\" onclick=\"location.href = 'dnssec_ds_dnskey.php?id=".$zone_id."';\" value=\"" . _('Show DS and DNSKEY') . "\">\n";
112
+
113
+include_once("inc/footer.inc.php");

+ 150
- 0
poweradmin/poweradmin-2.1.8/dnssec_add_key.php View File

@@ -0,0 +1,150 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles requests to add new supermaster servers
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+$zone_id = "-1";
36
+if (isset($_GET['id']) && v_num($_GET['id'])) {
37
+    $zone_id = $_GET['id'];
38
+}
39
+
40
+$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zone_id );
41
+
42
+if ($user_is_zone_owner == "0") {
43
+    error(ERR_PERM_VIEW_ZONE);
44
+    include_once("inc/footer.inc.php");
45
+    exit();
46
+}
47
+
48
+if (zone_id_exists($zone_id) == "0") {
49
+    error(ERR_ZONE_NOT_EXIST);
50
+    include_once("inc/footer.inc.php");
51
+    exit();
52
+}
53
+
54
+$key_type = "";
55
+if (isset($_POST['key_type'])) {
56
+    $key_type = $_POST['key_type'];
57
+
58
+    if ($key_type != 'ksk' && $key_type != 'zsk') {
59
+        error(ERR_INV_INPUT);
60
+        include_once("inc/footer.inc.php");
61
+        exit;
62
+    }
63
+}
64
+
65
+$bits = "";
66
+if (isset($_POST["bits"])) {
67
+    $bits = $_POST["bits"];
68
+
69
+    $valid_values = array('2048', '1024', '768', '384', '256');
70
+    if (!in_array($bits, $valid_values)) {
71
+        error(ERR_INV_INPUT);
72
+        include_once("inc/footer.inc.php");
73
+        exit;
74
+    }
75
+}
76
+
77
+$algorithm = "";
78
+if (isset($_POST["algorithm"])) {
79
+    $algorithm = $_POST["algorithm"];
80
+
81
+    $valid_algorithm = array('rsasha1', 'rsasha256', 'rsasha512', 'gost', 'ecdsa256', 'ecdsa384');
82
+    if (!in_array($algorithm, $valid_algorithm)) {
83
+        error(ERR_INV_INPUT);
84
+        include_once("inc/footer.inc.php");
85
+        exit;
86
+    }
87
+}
88
+
89
+$domain_name = get_zone_name_from_id($zone_id);
90
+if (isset($_POST["submit"])) {
91
+    if (dnssec_add_zone_key($domain_name, $key_type, $bits, $algorithm)) {
92
+        success(SUC_EXEC_PDNSSEC_ADD_ZONE_KEY);
93
+    } else {
94
+        error(ERR_EXEC_PDNSSEC_ADD_ZONE_KEY);
95
+    }
96
+}
97
+
98
+echo "     <h2>" . _('Add key for zone '). $domain_name . "</h2>\n";
99
+
100
+echo "     <form method=\"post\" action=\"dnssec_add_key.php?id=".$zone_id."\">\n";
101
+echo "      <table>\n";
102
+echo "       <tr>\n";
103
+echo "        <td width=\"100\" class=\"n\">" . _('Key type') . "</td>\n";
104
+echo "        <td class=\"n\">\n";
105
+echo "         <select name=\"key_type\">\n";
106
+echo "          <option value=\"\"></option>\n";
107
+echo "          <option value=\"ksk\">KSK</option>\n";
108
+echo "          <option value=\"zsk\">ZSK</option>\n";
109
+echo "         </select>\n";
110
+echo "        </td>\n";
111
+echo "       </tr>\n";
112
+echo "       <tr>\n";
113
+echo "        <td class=\"n\">" . _('Bits in length') . "</td>\n";
114
+echo "        <td class=\"n\">\n";
115
+echo "         <select name=\"bits\">\n";
116
+echo "          <option value=\"\"></option>\n";
117
+echo "          <option value=\"2048\">2048</option>\n";
118
+echo "          <option value=\"1024\">1024</option>\n";
119
+echo "          <option value=\"768\">768</option>\n";
120
+echo "          <option value=\"384\">384</option>\n";
121
+echo "          <option value=\"256\">256</option>\n";
122
+echo "         </select>\n";
123
+echo "        </td>\n";
124
+echo "       </tr>\n";
125
+echo "       <tr>\n";
126
+echo "        <td class=\"n\">" . _('Algorithm') . "</td>\n";
127
+echo "        <td class=\"n\">\n";
128
+
129
+echo "         <select name=\"algorithm\">\n";
130
+echo "          <option value=\"\"></option>\n";
131
+echo "          <option value=\"rsasha1\">".dnssec_shorthand_to_algorithm_name('rsasha1')."</option>\n";
132
+echo "          <option value=\"rsasha256\">".dnssec_shorthand_to_algorithm_name('rsasha256')."</option>\n";
133
+echo "          <option value=\"rsasha512\">".dnssec_shorthand_to_algorithm_name('rsasha512')."</option>\n";
134
+echo "          <option value=\"gost\">".dnssec_shorthand_to_algorithm_name('gost')."</option>\n";
135
+echo "          <option value=\"ecdsa256\">".dnssec_shorthand_to_algorithm_name('ecdsa256')."</option>\n";
136
+echo "          <option value=\"ecdsa384\">".dnssec_shorthand_to_algorithm_name('ecdsa384')."</option>\n";
137
+echo "         </select>\n";
138
+
139
+echo "        </td>\n";
140
+echo "       </tr>\n";
141
+echo "       <tr>\n";
142
+echo "        <td class=\"n\">&nbsp;</td>\n";
143
+echo "        <td class=\"n\">\n";
144
+echo "         <input type=\"submit\" class=\"button\" name=\"submit\" value=\"" . _('Add key') . "\">\n";
145
+echo "        </td>\n";
146
+echo "       </tr>\n";
147
+echo "      </table>\n";
148
+echo "     </form>\n";
149
+
150
+include_once("inc/footer.inc.php");

+ 98
- 0
poweradmin/poweradmin-2.1.8/dnssec_delete_key.php View File

@@ -0,0 +1,98 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles zone deletion
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+global $pdnssec_use;
36
+
37
+$zone_id = "-1";
38
+if (isset($_GET['id']) && v_num($_GET['id'])) {
39
+    $zone_id = $_GET['id'];
40
+}
41
+
42
+$key_id = "-1";
43
+if (isset($_GET['key_id']) && v_num($_GET['key_id'])) {
44
+    $key_id = (int) $_GET['key_id'];
45
+}
46
+
47
+$confirm = "-1";
48
+if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
49
+    $confirm = $_GET['confirm'];
50
+}
51
+
52
+$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zone_id );
53
+
54
+if ($zone_id == "-1") {
55
+    error(ERR_INV_INPUT);
56
+    include_once("inc/footer.inc.php");
57
+    exit;
58
+}
59
+
60
+$domain_name = get_zone_name_from_id($zone_id);
61
+
62
+if ($key_id == "-1") {
63
+    error(ERR_INV_INPUT);
64
+    include_once("inc/footer.inc.php");
65
+    exit;
66
+}
67
+
68
+if (!dnssec_zone_key_exists($domain_name, $key_id)) {
69
+    error(ERR_INV_INPUT);
70
+    include_once("inc/footer.inc.php");
71
+    exit;    
72
+}
73
+
74
+echo "     <h2>" . _('Delete zone key') . "</h2>\n";
75
+
76
+if ($confirm == '1') {
77
+    if (dnssec_remove_zone_key($domain_name, $key_id)) {
78
+        success(SUC_EXEC_PDNSSEC_REMOVE_ZONE_KEY);
79
+    }
80
+} else {
81
+    if ($user_is_zone_owner == "1") {
82
+        $key_info = dnssec_get_zone_key($domain_name, $key_id);
83
+        echo "      " . _('Domain') . ": " . $domain_name . "<br>\n";
84
+        echo "      " . _('Id') . ": " . $key_info[0] . "<br>\n";
85
+        echo "      " . _('Type') . ": " . $key_info[1] . "<br>\n";
86
+        echo "      " . _('Tag') . ": " . $key_info[2] . "<br>\n";
87
+        echo "      " . _('Algorithm') . ": " . dnssec_algorithm_to_name($key_info[3]) . "<br>\n";
88
+        echo "      " . _('Bits') . ": " . $key_info[4] . "<br>\n";
89
+        echo "      " . _('Active') . ": " . ($key_info[5] ? _('Yes') : _('No')) . "\n";
90
+        echo "     <p>" . _('Are you sure?') . "</p>\n";
91
+        echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='dnssec_delete_key.php?id=" . $zone_id . "&amp;key_id=$key_id&amp;confirm=1'\" value=\"" . _('Yes') . "\">\n";
92
+        echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
93
+    } else {
94
+        error(ERR_PDNSSEC_DEL_ZONE_KEY);
95
+    }
96
+}
97
+
98
+include_once("inc/footer.inc.php");

+ 95
- 0
poweradmin/poweradmin-2.1.8/dnssec_ds_dnskey.php View File

@@ -0,0 +1,95 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ *
23
+ */
24
+
25
+/**
26
+ * Script that handles editing of zone records
27
+ *
28
+ * @package     Poweradmin
29
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
30
+ * @copyright   2010-2017  Poweradmin Development Team
31
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
32
+ */
33
+require_once("inc/toolkit.inc.php");
34
+include_once("inc/header.inc.php");
35
+
36
+global $pdnssec_use;
37
+
38
+$zone_id = "-1";
39
+if (isset($_GET['id']) && v_num($_GET['id'])) {
40
+    $zone_id = $_GET['id'];
41
+}
42
+
43
+if ($zone_id == "-1") {
44
+    error(ERR_INV_INPUT);
45
+    include_once("inc/footer.inc.php");
46
+    exit;
47
+}
48
+
49
+/*
50
+  Check permissions
51
+ */
52
+$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zone_id );
53
+if ($perm_meta_edit == "all" || ( $perm_meta_edit == "own" && $user_is_zone_owner == "1")) {
54
+    $meta_edit = "1";
55
+} else {
56
+    $meta_edit = "0";
57
+}
58
+
59
+(do_hook('verify_permission' , 'user_view_others' )) ? $perm_view_others = "1" : $perm_view_others = "0";
60
+
61
+if ($perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0") {
62
+    error(ERR_PERM_VIEW_ZONE);
63
+    include_once("inc/footer.inc.php");
64
+    exit();
65
+}
66
+
67
+if (zone_id_exists($zone_id) == "0") {
68
+    error(ERR_ZONE_NOT_EXIST);
69
+    include_once("inc/footer.inc.php");
70
+    exit();
71
+}
72
+
73
+$domain_type = get_domain_type($zone_id);
74
+$domain_name = get_zone_name_from_id($zone_id);
75
+$record_count = count_zone_records($zone_id);
76
+$zone_templates = get_list_zone_templ($_SESSION['userid']);
77
+$zone_template_id = get_zone_template($zone_id);
78
+
79
+echo "   <h2>" . _('DNSSEC public records for zone') . " \"" . get_zone_name_from_id($zone_id) . "\"</h2>\n";
80
+
81
+echo "   <h3>" . _('DNSKEY') . "</h3>\n";
82
+$dnskey_record = dnssec_get_dnskey_record($domain_name);
83
+echo $dnskey_record."<br>\n";
84
+
85
+echo "<br>";
86
+
87
+echo "   <h3>" . _('DS record') . "</h3>\n";
88
+$ds_records = dnssec_get_ds_records($domain_name);
89
+foreach ($ds_records as $record) {
90
+    echo $record."<br>\n";
91
+}
92
+
93
+echo "<br>";
94
+
95
+include_once("inc/footer.inc.php");

+ 108
- 0
poweradmin/poweradmin-2.1.8/dnssec_edit_key.php View File

@@ -0,0 +1,108 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles zone deletion
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+global $pdnssec_use;
36
+
37
+$zone_id = "-1";
38
+if (isset($_GET['id']) && v_num($_GET['id'])) {
39
+    $zone_id = $_GET['id'];
40
+}
41
+
42
+$key_id = "-1";
43
+if (isset($_GET['key_id']) && v_num($_GET['key_id'])) {
44
+    $key_id = (int) $_GET['key_id'];
45
+}
46
+
47
+$confirm = "-1";
48
+if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
49
+    $confirm = $_GET['confirm'];
50
+}
51
+
52
+$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zone_id );
53
+
54
+if ($zone_id == "-1") {
55
+    error(ERR_INV_INPUT);
56
+    include_once("inc/footer.inc.php");
57
+    exit;
58
+}
59
+
60
+$domain_name = get_zone_name_from_id($zone_id);
61
+
62
+if ($key_id == "-1") {
63
+    error(ERR_INV_INPUT);
64
+    include_once("inc/footer.inc.php");
65
+    exit;
66
+}
67
+
68
+if (!dnssec_zone_key_exists($domain_name, $key_id)) {
69
+    error(ERR_INV_INPUT);
70
+    include_once("inc/footer.inc.php");
71
+    exit;
72
+}
73
+
74
+$key_info = dnssec_get_zone_key($domain_name, $key_id);
75
+if ($key_info[5]) {
76
+    echo "     <h2>" . _('Deactivate zone key') . "</h2>\n";
77
+} else {
78
+    echo "     <h2>" . _('Activate zone key') . "</h2>\n";
79
+}
80
+
81
+if ($confirm == '1') {
82
+    if ($key_info[5]) {
83
+        if (dnssec_deactivate_zone_key($domain_name, $key_id)) {
84
+            success(SUC_EXEC_PDNSSEC_DEACTIVATE_ZONE_KEY);
85
+        }
86
+    } else {
87
+        if (dnssec_activate_zone_key($domain_name, $key_id)) {
88
+            success(SUC_EXEC_PDNSSEC_ACTIVATE_ZONE_KEY);
89
+        }
90
+    }
91
+} else {
92
+    if ($user_is_zone_owner == "1") {
93
+        echo "      " . _('Domain') . ": " . $domain_name . "<br>\n";
94
+        echo "      " . _('Id') . ": " . $key_info[0] . "<br>\n";
95
+        echo "      " . _('Type') . ": " . $key_info[1] . "<br>\n";
96
+        echo "      " . _('Tag') . ": " . $key_info[2] . "<br>\n";
97
+        echo "      " . _('Algorithm') . ": " . dnssec_algorithm_to_name($key_info[3]) . "<br>\n";
98
+        echo "      " . _('Bits') . ": " . $key_info[4] . "<br>\n";
99
+        echo "      " . _('Active') . ": " . ($key_info[5] ? _('Yes') : _('No')) . "\n";
100
+        echo "     <p>" . _('Are you sure?') . "</p>\n";
101
+        echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='dnssec_edit_key.php?id=" . $zone_id . "&amp;key_id=$key_id&amp;confirm=1'\" value=\"" . _('Yes') . "\">\n";
102
+        echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
103
+    } else {
104
+        error(ERR_PDNSSEC_DEL_ZONE_KEY);
105
+    }
106
+}
107
+
108
+include_once("inc/footer.inc.php");

+ 238
- 0
poweradmin/poweradmin-2.1.8/dynamic_update.php View File

@@ -0,0 +1,238 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles requests to update DNS records, required for clients
26
+ * with dynamic ip addresses
27
+ *
28
+ * @package     Poweradmin
29
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
30
+ * @copyright   2010-2016 Poweradmin Development Team
31
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
32
+ */
33
+require('inc/config.inc.php');
34
+require('inc/database.inc.php');
35
+require('inc/record.inc.php');
36
+
37
+$db = dbConnect();
38
+
39
+/** Make sql query safe
40
+ *
41
+ * @param mixed $value Unsafe Value
42
+ *
43
+ * @return mixed $value Safe Value
44
+ */
45
+function safe($value)
46
+{
47
+    global $db, $db_type;
48
+
49
+    if ($db_type == 'mysql' || $db_type == 'sqlite') {
50
+        $value = $db->quote($value, 'text');
51
+        $value = substr($value, 1, -1); // remove quotes
52
+    } elseif ($db_type == 'pgsql') {
53
+        $value = pg_escape_string($value);
54
+    } else {
55
+        return status_exit('baddbtype');
56
+    }
57
+
58
+    return $value;
59
+}
60
+
61
+/** Get exit status message
62
+ *
63
+ * Print verbose status message for request
64
+ *
65
+ * @param string $status Short status message
66
+ *
67
+ * @return boolean false
68
+ */
69
+function status_exit($status)
70
+{
71
+    $verbose_codes = array(
72
+        'badagent' => 'Your user agent is not valid.',
73
+        'badauth' => 'No username available.',
74
+        'badauth2' => 'Invalid username or password.  Authentication failed.',
75
+        'notfqdn' => 'The hostname you specified was not valid.',
76
+        'dnserr' => 'A DNS error has occurred on our end.  We apologize for any inconvenience.',
77
+        '!yours' => 'The specified hostname does not belong to you.',
78
+        'nohost' => 'The specified hostname does not exist.',
79
+        'good' => 'Your hostname has been updated.',
80
+        '911' => 'A critical error has occurred on our end.  We apologize for any inconvenience.',
81
+        'nochg' => 'This update was identical to your last update, so no changes were made to your hostname configuration.',
82
+        'baddbtype' => 'Unsupported database type',
83
+    );
84
+
85
+    if (isset($_REQUEST['verbose'])) {
86
+        $pieces = preg_split('/\s/', $status);
87
+        $status = $verbose_codes[$pieces[0]];
88
+    }
89
+    echo "$status\n";
90
+    return false;
91
+}
92
+
93
+/** Check whether the given address is an IP address
94
+ *
95
+ * @param string $ip Given IP address
96
+ *
97
+ * @return string A if IPv4, AAAA if IPv6 or 0 if invalid
98
+ */
99
+function valid_ip_address($ip)
100
+{
101
+    if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
102
+        $value = 'A';
103
+    } elseif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
104
+        $value = 'AAAA';
105
+    } else {
106
+        $value = 0;
107
+    }
108
+    return $value;
109
+}
110
+
111
+if (!(isset($_SERVER)) && !$_SERVER['HTTP_USER_AGENT']) {
112
+    return status_exit('badagent');
113
+}
114
+
115
+// Grab username & password based on HTTP auth, alternatively the query string
116
+if (isset($_SERVER['PHP_AUTH_USER'])) {
117
+    $auth_username = $_SERVER['PHP_AUTH_USER'];
118
+} elseif (isset($_REQUEST['username'])) {
119
+    $auth_username = $_REQUEST['username'];
120
+}
121
+if (isset($_SERVER['PHP_AUTH_PW'])) {
122
+    $auth_password = $_SERVER['PHP_AUTH_PW'];
123
+} elseif (isset($_REQUEST['password'])) {
124
+    $auth_password = $_REQUEST['password'];
125
+}
126
+
127
+// If we still don't have a username, throw up
128
+if (!isset($auth_username)) {
129
+    header('WWW-Authenticate: Basic realm="DNS Update"');
130
+    header('HTTP/1.0 401 Unauthorized');
131
+    return status_exit('badauth');
132
+}
133
+
134
+$username = safe($auth_username);
135
+// FIXME: supports only md5 hashes
136
+$password = md5(safe($auth_password));
137
+$hostname = safe($_REQUEST['hostname']);
138
+
139
+// Grab IP to use
140
+$given_ip = "";
141
+$given_ip6 = "";
142
+if (!empty($_REQUEST['myip'])) {
143
+    $given_ip = $_REQUEST['myip'];
144
+} elseif (!empty($_REQUEST['ip'])) {
145
+    $given_ip = $_REQUEST['ip'];
146
+}
147
+if (!empty($_REQUEST['myip6'])) {
148
+    $given_ip6 = $_REQUEST['myip6'];
149
+} elseif (!empty($_REQUEST['ip6'])) {
150
+    $given_ip6 = $_REQUEST['ip6'];
151
+}
152
+
153
+if (valid_ip_address($given_ip) === 'AAAA') {
154
+    $given_ip6 = $given_ip;
155
+}
156
+// Look for tag to grab the IP we coming from
157
+if (($given_ip6 == "whatismyip") && (valid_ip_address($_SERVER['REMOTE_ADDR']) === 'AAAA')) {
158
+    $given_ip6 = $_SERVER['REMOTE_ADDR'];
159
+}
160
+if (($given_ip == "whatismyip") && (valid_ip_address($_SERVER['REMOTE_ADDR']) === 'A')) {
161
+    $given_ip = $_SERVER['REMOTE_ADDR'];
162
+} elseif (($given_ip == "whatismyip") && (valid_ip_address($_SERVER['REMOTE_ADDR']) === 'AAAA') && (!(valid_ip_address($given_ip6) === 'AAAA'))) {
163
+    $given_ip6 = $_SERVER['REMOTE_ADDR'];
164
+}
165
+
166
+// Finally get safe version of the IP
167
+$ip = safe($given_ip);
168
+$ip6 = safe($given_ip6);
169
+// Check its ok...
170
+if ((!valid_ip_address($ip)) && (!valid_ip_address($ip6))) {
171
+    return status_exit('dnserr');
172
+}
173
+
174
+if (!strlen($hostname)) {
175
+    return status_exit('notfqdn');
176
+}
177
+
178
+$user_query = "
179
+    SELECT
180
+        users.id
181
+    FROM
182
+        users, perm_templ, perm_templ_items, perm_items
183
+    WHERE
184
+        users.username = '$username'
185
+        AND users.password = '$password'
186
+        AND users.active = 1
187
+        AND perm_templ.id = users.perm_templ
188
+        AND perm_templ_items.templ_id = perm_templ.id
189
+        AND perm_items.id = perm_templ_items.perm_id
190
+        AND (
191
+                perm_items.name = 'zone_content_edit_own'
192
+                OR perm_items.name = 'zone_content_edit_others'
193
+        )
194
+";
195
+$user = $db->queryRow($user_query);
196
+if (!$user) {
197
+    return status_exit('badauth2');
198
+}
199
+
200
+$zones_query = "SELECT domain_id FROM zones WHERE owner='{$user["id"]}'";
201
+$zones_result = $db->query($zones_query);
202
+$was_updated = false;
203
+$no_update_necessary = false;
204
+
205
+while ($zone = $zones_result->fetchRow()) {
206
+    $zone_updated = false;
207
+    $name_query = "SELECT name, type, content FROM records WHERE domain_id='{$zone["domain_id"]}' and (type = 'A' OR type = 'AAAA') ";
208
+    $result = $db->query($name_query);
209
+
210
+    while ($record = $result->fetchRow()) {
211
+        if ($hostname == $record['name']) {
212
+            if (($record['type'] == 'A') && (valid_ip_address($ip) === 'A')) {
213
+                if ($ip == $record['content']) {
214
+                    $no_update_necessary = true;
215
+                } else {
216
+                    $update_query = "UPDATE records SET content ='{$ip}' where name='{$record["name"]}' and type='A'";
217
+                    $update_result = $db->query($update_query);
218
+                    $zone_updated = true;
219
+                    $was_updated = true;
220
+                }
221
+            } elseif (($record['type'] == 'AAAA') && (valid_ip_address($ip6) === 'AAAA')) {
222
+                if ($ip6 == $record['content']) {
223
+                    $no_update_necessary = true;
224
+                } else {
225
+                    $update_query = "UPDATE records SET content ='{$ip6}' where name='{$record["name"]}' and type='AAAA'";
226
+                    $update_result = $db->query($update_query);
227
+                    $zone_updated = true;
228
+                    $was_updated = true;
229
+                }
230
+            }
231
+        }
232
+    }
233
+    if ($zone_updated) {
234
+        update_soa_serial($zone['domain_id']);
235
+    }
236
+}
237
+
238
+return (($was_updated || $no_update_necessary) ? status_exit('good') : status_exit('!yours'));

+ 521
- 0
poweradmin/poweradmin-2.1.8/edit.php View File

@@ -0,0 +1,521 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ *
23
+ */
24
+
25
+/**
26
+ * Script that handles editing of zone records
27
+ *
28
+ * @package     Poweradmin
29
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
30
+ * @copyright   2010-2017  Poweradmin Development Team
31
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
32
+ */
33
+require_once("inc/toolkit.inc.php");
34
+include_once("inc/header.inc.php");
35
+include_once("inc/RecordLog.class.php");
36
+
37
+global $pdnssec_use;
38
+
39
+$zone_id = "-1";
40
+if (isset($_GET['id']) && v_num($_GET['id'])) {
41
+    $zone_id = $_GET['id'];
42
+}
43
+
44
+if ($zone_id == "-1") {
45
+    error(ERR_INV_INPUT);
46
+    include_once("inc/footer.inc.php");
47
+    exit;
48
+}
49
+
50
+if (isset($_POST['commit'])) {
51
+    $error = false;
52
+    $one_record_changed = false;
53
+
54
+    if (isset($_POST['record'])) {
55
+        foreach ($_POST['record'] as $record) {
56
+            $old_record_info = get_record_from_id($record['rid']);
57
+
58
+            // Check if a record changed and save the state
59
+            $log = new RecordLog();
60
+            $log->log_prior($record['rid']);
61
+            if (!$log->has_changed($record)) {
62
+                continue;
63
+            } else {
64
+                $one_record_changed = true;
65
+            }
66
+
67
+            $edit_record = edit_record($record);
68
+            if (false === $edit_record) {
69
+                $error = true;
70
+            } else {
71
+                // Log the state after saving and write it to logging table
72
+                $log->log_after($record['rid']);
73
+                $log->write();
74
+            }
75
+        }
76
+    }
77
+
78
+    edit_zone_comment($_GET['id'], $_POST['comment']);
79
+
80
+    if (false === $error) {
81
+        update_soa_serial($_GET['id']);
82
+
83
+        if ($one_record_changed) {
84
+            success(SUC_ZONE_UPD);
85
+        } else {
86
+            success(SUC_ZONE_NOCHANGE);
87
+        }
88
+
89
+        if ($pdnssec_use) {
90
+            if (dnssec_rectify_zone($_GET['id'])) {
91
+                success(SUC_EXEC_PDNSSEC_RECTIFY_ZONE);
92
+            }
93
+        }
94
+    } else {
95
+        error(ERR_ZONE_UPD);
96
+    }
97
+}
98
+
99
+if (isset($_POST['save_as'])) {
100
+    if (zone_templ_name_exists($_POST['templ_name'])) {
101
+        error(ERR_ZONE_TEMPL_EXIST);
102
+    } elseif ($_POST['templ_name'] == '') {
103
+        error(ERR_ZONE_TEMPL_IS_EMPTY);
104
+    } else {
105
+        success(SUC_ZONE_TEMPL_ADD);
106
+        $records = get_records_from_domain_id($zone_id);
107
+        add_zone_templ_save_as($_POST['templ_name'], $_POST['templ_descr'], $_SESSION['userid'], $records, get_zone_name_from_id($zone_id));
108
+    }
109
+}
110
+
111
+/*
112
+  Check permissions
113
+ */
114
+if (do_hook('verify_permission', 'zone_content_view_others')) {
115
+    $perm_view = "all";
116
+} elseif (do_hook('verify_permission', 'zone_content_view_own')) {
117
+    $perm_view = "own";
118
+} else {
119
+    $perm_view = "none";
120
+}
121
+
122
+if (do_hook('verify_permission', 'zone_content_edit_others')) {
123
+    $perm_content_edit = "all";
124
+} elseif (do_hook('verify_permission', 'zone_content_edit_own')) {
125
+    $perm_content_edit = "own";
126
+} elseif (do_hook('verify_permission', 'zone_content_edit_own_as_client')) {
127
+    $perm_content_edit = "own_as_client";
128
+} else {
129
+    $perm_content_edit = "none";
130
+}
131
+
132
+if (do_hook('verify_permission', 'zone_meta_edit_others')) {
133
+    $perm_meta_edit = "all";
134
+} elseif (do_hook('verify_permission', 'zone_meta_edit_own')) {
135
+    $perm_meta_edit = "own";
136
+} else {
137
+    $perm_meta_edit = "none";
138
+}
139
+
140
+do_hook('verify_permission' , 'zone_master_add' ) ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0";
141
+do_hook('verify_permission' , 'zone_slave_add' ) ? $perm_zone_slave_add = "1" : $perm_zone_slave_add = "0";
142
+
143
+$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zone_id );
144
+if ($perm_meta_edit == "all" || ( $perm_meta_edit == "own" && $user_is_zone_owner == "1")) {
145
+    $meta_edit = "1";
146
+} else {
147
+    $meta_edit = "0";
148
+}
149
+
150
+(do_hook('verify_permission' , 'user_view_others' )) ? $perm_view_others = "1" : $perm_view_others = "0";
151
+
152
+if (isset($_POST['slave_master_change']) && is_numeric($_POST["domain"])) {
153
+    change_zone_slave_master($_POST['domain'], $_POST['new_master']);
154
+}
155
+if (isset($_POST['type_change']) && in_array($_POST['newtype'], $server_types)) {
156
+    change_zone_type($_POST['newtype'], $zone_id);
157
+}
158
+if (isset($_POST["newowner"]) && is_numeric($_POST["domain"]) && is_numeric($_POST["newowner"])) {
159
+    add_owner_to_zone($_POST["domain"], $_POST["newowner"]);
160
+}
161
+if (isset($_POST["delete_owner"]) && is_numeric($_POST["delete_owner"])) {
162
+    delete_owner_from_zone($zone_id, $_POST["delete_owner"]);
163
+}
164
+if (isset($_POST["template_change"])) {
165
+    if (!isset($_POST['zone_template']) || "none" == $_POST['zone_template']) {
166
+        $new_zone_template = 0;
167
+    } else {
168
+        $new_zone_template = $_POST['zone_template'];
169
+    }
170
+    if ($_POST['current_zone_template'] != $new_zone_template) {
171
+        update_zone_records($zone_id, $new_zone_template);
172
+    }
173
+}
174
+
175
+if ($perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0") {
176
+    error(ERR_PERM_VIEW_ZONE);
177
+    include_once("inc/footer.inc.php");
178
+    exit();
179
+}
180
+
181
+if (zone_id_exists($zone_id) == "0") {
182
+    error(ERR_ZONE_NOT_EXIST);
183
+    include_once("inc/footer.inc.php");
184
+    exit();
185
+}
186
+
187
+if (isset($_POST['sign_zone'])) {
188
+    $zone_name = get_zone_name_from_id($zone_id);
189
+    update_soa_serial($zone_id);
190
+    dnssec_secure_zone($zone_name);
191
+    dnssec_rectify_zone($zone_id);
192
+}
193
+
194
+if (isset($_POST['unsign_zone'])) {
195
+    $zone_name = get_zone_name_from_id($zone_id);
196
+    dnssec_unsecure_zone($zone_name);
197
+    update_soa_serial($zone_id);
198
+}
199
+
200
+$domain_type = get_domain_type($zone_id);
201
+$record_count = count_zone_records($zone_id);
202
+$zone_templates = get_list_zone_templ($_SESSION['userid']);
203
+$zone_template_id = get_zone_template($zone_id);
204
+
205
+echo "   <h2>" . _('Edit zone') . " \"" . get_zone_name_from_id($zone_id) . "\"</h2>\n";
206
+
207
+echo "   <div class=\"showmax\">\n";
208
+show_pages($record_count, $iface_rowamount, $zone_id);
209
+echo "   </div>\n";
210
+
211
+$records = get_records_from_domain_id($zone_id, ROWSTART, $iface_rowamount, RECORD_SORT_BY);
212
+if ($records == "-1") {
213
+    echo " <p>" . _("This zone does not have any records. Weird.") . "</p>\n";
214
+} else {
215
+    echo "   <form method=\"post\" action=\"\">\n";
216
+    echo "   <table>\n";
217
+    echo "    <tr>\n";
218
+    echo "     <th>&nbsp;</th>\n";
219
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=id\">" . _('Id') . "</a></th>\n";
220
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=name\">" . _('Name') . "</a></th>\n";
221
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=type\">" . _('Type') . "</a></th>\n";
222
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=content\">" . _('Content') . "</a></th>\n";
223
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=prio\">" . _('Priority') . "</a></th>\n";
224
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=ttl\">" . _('TTL') . "</a></th>\n";
225
+    echo "    </tr>\n";
226
+    foreach ($records as $r) {
227
+        if (!($r['type'] == "SOA" || ($r['type'] == "NS" && $perm_content_edit == "own_as_client"))) {
228
+            echo "    <input type=\"hidden\" name=\"record[" . $r['id'] . "][rid]\" value=\"" . $r['id'] . "\">\n";
229
+            echo "    <input type=\"hidden\" name=\"record[" . $r['id'] . "][zid]\" value=\"" . $zone_id . "\">\n";
230
+        }
231
+        echo "    <tr>\n";
232
+
233
+        if ($domain_type == "SLAVE" || $perm_content_edit == "none" || (($perm_content_edit == "own" || $perm_content_edit == "own_as_client") && $user_is_zone_owner == "0")) {
234
+            echo "     <td class=\"n\">&nbsp;</td>\n";
235
+        }
236
+        elseif ($r['type'] == "SOA" && $perm_content_edit != "all" || ($r['type'] == "NS" && $perm_content_edit == "own_as_client")) {
237
+        	echo "     <td class=\"n\">&nbsp;</td>\n";
238
+        }
239
+        else {
240
+            echo "     <td class=\"n\">\n";
241
+            echo "      <a href=\"edit_record.php?id=" . $r['id'] . "&amp;domain=" . $zone_id . "\">
242
+                                                <img src=\"images/edit.gif\" alt=\"[ " . _('Edit record') . " ]\"></a>\n";
243
+            echo "      <a href=\"delete_record.php?id=" . $r['id'] . "&amp;domain=" . $zone_id . "\">
244
+                                                <img src=\"images/delete.gif\" ALT=\"[ " . _('Delete record') . " ]\" BORDER=\"0\"></a>\n";
245
+            echo "     </td>\n";
246
+        }
247
+        echo "     <td class=\"n\">{$r['id']}</td>\n";
248
+        if ($r['type'] == "SOA" || ($r['type'] == "NS" && $perm_content_edit == "own_as_client")) {
249
+            echo "     <td class=\"n\">" . $r['name'] . "</td>\n";
250
+            echo "     <td class=\"n\">" . $r['type'] . "</td>\n";
251
+            echo "     <td class=\"n\">" . $r['content'] . "</td>\n";
252
+            echo "     <td class=\"n\">&nbsp;</td>\n";
253
+            echo "     <td class=\"n\">" . $r['ttl'] . "</td>\n";
254
+        } else {
255
+            echo "      <td class=\"u\"><input class=\"wide\" name=\"record[" . $r['id'] . "][name]\" value=\"" . htmlspecialchars($r['name']) . "\"></td>\n";
256
+            echo "      <td class=\"u\">\n";
257
+            echo "       <select name=\"record[" . $r['id'] . "][type]\">\n";
258
+            $found_selected_type = false;
259
+            foreach (get_record_types() as $type_available) {
260
+                if ($type_available == $r['type']) {
261
+                    $add = " SELECTED";
262
+                    $found_selected_type = true;
263
+                } else {
264
+                    $add = "";
265
+                }
266
+                echo "         <option" . $add . " value=\"" . htmlspecialchars($type_available) . "\" >" . $type_available . "</option>\n";
267
+            }
268
+            if (!$found_selected_type)
269
+                echo "         <option SELECTED value=\"" . htmlspecialchars($r['type']) . "\"><i>" . $r['type'] . "</i></option>\n";
270
+
271
+            echo "       </select>\n";
272
+            echo "      </td>\n";
273
+            echo "      <td class=\"u\"><input class=\"wide\" name=\"record[" . $r['id'] . "][content]\" value=\"" . htmlspecialchars($r['content']) . "\"></td>\n";
274
+            echo "      <td class=\"u\"><input size=\"4\" id=\"priority_field_" . $r['id'] . "\" name=\"record[" . $r['id'] . "][prio]\" value=\"" . htmlspecialchars($r['prio']) . "\"></td>\n";
275
+            echo "      <td class=\"u\"><input size=\"4\" name=\"record[" . $r['id'] . "][ttl]\" value=\"" . htmlspecialchars($r['ttl']) . "\"></td>\n";
276
+        }
277
+        echo "     </tr>\n";
278
+    }
279
+    echo "    <tr>\n";
280
+    echo "     <td colspan=\"6\">&nbsp;</td>\n";
281
+    echo "    </tr>\n";
282
+    echo "    <tr>\n";
283
+    echo "     <td>&nbsp;</td><td colspan=\"5\">Comments:</td>\n";
284
+    echo "    </tr>\n";
285
+    echo "    <tr>\n";
286
+    echo "     <td class=\"n\">\n";
287
+    echo "      <a href=\"edit_comment.php?domain=" . $zone_id . "\">
288
+                            <img src=\"images/edit.gif\" alt=\"[ " . _('Edit comment') . " ]\"></a>\n";
289
+    echo "     </td>\n";
290
+    echo "     <td colspan=\"4\"><textarea rows=\"5\" cols=\"80\" name=\"comment\">" . htmlspecialchars(get_zone_comment($zone_id)) . "</textarea></td>\n";
291
+    echo "     <td>&nbsp;</td>\n";
292
+
293
+    echo "     <tr>\n";
294
+    echo "      <th colspan=\"6\"><br>Save as new template:</th>\n";
295
+    echo "     </tr>\n";
296
+    echo "     <tr>\n";
297
+    echo "       <td colspan=\"2\">" . _('Template Name') . "</td>\n";
298
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"\"></td>\n";
299
+    echo "      </tr>\n";
300
+    echo "      <tr>\n";
301
+    echo "       <td colspan=\"2\">" . _('Template Description') . "</td>\n";
302
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"\"></td>\n";
303
+    echo "      </tr>\n";
304
+    echo "    </table>\n";
305
+    echo "     <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
306
+    echo "     <input type=\"reset\" class=\"button\" name=\"reset\" value=\"" . _('Reset changes') . "\">\n";
307
+    echo "     <input type=\"submit\" class=\"button\" name=\"save_as\" value=\"" . _('Save as template') . "\">\n";
308
+
309
+    if ($pdnssec_use) {
310
+        $zone_name = get_zone_name_from_id($zone_id);
311
+
312
+        if (dnssec_is_zone_secured($zone_name)) {
313
+            echo "     <input type=\"button\" class=\"button\" name=\"dnssec\" onclick=\"location.href = 'dnssec.php?id=".$zone_id."';\" value=\"" . _('DNSSEC') . "\">\n";
314
+            echo "     <input type=\"submit\" class=\"button\" name=\"unsign_zone\" value=\"" . _('Unsign this zone') . "\">\n";
315
+        } else {
316
+            echo "     <input type=\"submit\" class=\"button\" name=\"sign_zone\" value=\"" . _('Sign this zone') . "\">\n";
317
+        }
318
+    }
319
+
320
+    echo "    </form>\n";
321
+}
322
+
323
+if ($perm_content_edit == "all" || ($perm_content_edit == "own" || $perm_content_edit == "own_as_client") && $user_is_zone_owner == "1") {
324
+    if ($domain_type != "SLAVE") {
325
+        $zone_name = get_zone_name_from_id($zone_id);
326
+        echo "     <form method=\"post\" action=\"add_record.php?id=" . $zone_id . "\">\n";
327
+        echo "      <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
328
+        echo "      <table border=\"0\" cellspacing=\"4\">\n";
329
+        echo "       <tr>\n";
330
+        echo "        <td class=\"n\">" . _('Name') . "</td>\n";
331
+        echo "        <td class=\"n\">&nbsp;</td>\n";
332
+        echo "        <td class=\"n\">" . _('Type') . "</td>\n";
333
+        echo "        <td class=\"n\">" . _('Content') . "</td>\n";
334
+        echo "        <td class=\"n\">" . _('Priority') . "</td>\n";
335
+        echo "        <td class=\"n\">" . _('TTL') . "</td>\n";
336
+        echo "       </tr>\n";
337
+        echo "       <tr>\n";
338
+        echo "        <td class=\"n\"><input type=\"text\" name=\"name\" class=\"input\" value=\"\">." . $zone_name . "</td>\n";
339
+        echo "        <td class=\"n\">IN</td>\n";
340
+        echo "        <td class=\"n\">\n";
341
+        echo "         <select name=\"type\">\n";
342
+        $found_selected_type = !(isset($type) && $type);
343
+        foreach (get_record_types() as $record_type) {
344
+            if (isset($type) && $type) {
345
+                if ($type == $record_type) {
346
+                    $add = " SELECTED";
347
+                    $found_selected_type = true;
348
+                } else {
349
+                    $add = "";
350
+                }
351
+            } else {
352
+                if (preg_match('/i(p6|n-addr).arpa/i', $zone_name) && strtoupper($record_type) == 'PTR') {
353
+                    $add = " SELECTED";
354
+                    $rev = "";
355
+                } else if ((strtoupper($record_type) == 'A') && $iface_add_reverse_record) {
356
+                    $add = " SELECTED";
357
+                    $rev = "<input type=\"checkbox\" name=\"reverse\"><span class=\"normaltext\">" . _('Add also reverse record') . "</span>\n";
358
+                } else {
359
+                    $add = "";
360
+                }
361
+            }
362
+            echo "          <option" . $add . " value=\"" . htmlspecialchars($record_type) . "\">" . $record_type . "</option>\n";
363
+        }
364
+        if (!$found_selected_type)
365
+            echo "         <option SELECTED value=\"" . htmlspecialchars($type) . "\"><i>" . htmlspecialchars($type) . "</i></option>\n";
366
+        echo "         </select>\n";
367
+        echo "        </td>\n";
368
+        echo "        <td class=\"n\"><input type=\"text\" name=\"content\" class=\"input\" value=\"\"></td>\n";
369
+        echo "        <td class=\"n\"><input type=\"text\" name=\"prio\" class=\"sinput\" value=\"\"></td>\n";
370
+        echo "        <td class=\"n\"><input type=\"text\" name=\"ttl\" class=\"sinput\" value=\"\"></td>\n";
371
+        echo "       </tr>\n";
372
+        echo "      </table>\n";
373
+        echo "      <input type=\"submit\" name=\"commit\" value=\"" . _('Add record') . "\" class=\"button\">\n";
374
+        echo "      $rev";
375
+        echo "     </form>\n";
376
+    }
377
+}
378
+
379
+echo "   <div id=\"meta\">\n";
380
+echo "    <table>\n";
381
+echo "     <tr>\n";
382
+echo "      <th colspan=\"2\">" . _('Owner of zone') . "</th>\n";
383
+echo "     </tr>\n";
384
+
385
+$owners = get_users_from_domain_id($zone_id);
386
+
387
+if ($owners == "-1") {
388
+    echo "      <tr><td>" . _('No owner set for this zone.') . "</td></tr>";
389
+} else {
390
+    if ($meta_edit) {
391
+        foreach ($owners as $owner) {
392
+            echo "       <tr>\n";
393
+            echo "        <form method=\"post\" action=\"edit.php?id=" . $zone_id . "\">\n";
394
+            echo "        <td>" . $owner["fullname"] . "</td>\n";
395
+            echo "        <td>\n";
396
+            echo "         <input type=\"hidden\" name=\"delete_owner\" value=\"" . $owner["id"] . "\">\n";
397
+            echo "         <input type=\"submit\" class=\"sbutton\" name=\"co\" value=\"" . _('Delete') . "\">\n";
398
+            echo "        </td>\n";
399
+            echo "        </form>\n";
400
+            echo "       </tr>\n";
401
+        }
402
+    } else {
403
+        foreach ($owners as $owner) {
404
+            echo "    <tr><td>" . $owner["fullname"] . "</td><td>&nbsp;</td></tr>";
405
+        }
406
+    }
407
+}
408
+if ($meta_edit) {
409
+    echo "      <form method=\"post\" action=\"edit.php?id=" . $zone_id . "\">\n";
410
+    echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
411
+    echo "       <tr>\n";
412
+    echo "        <td>\n";
413
+    echo "         <select name=\"newowner\">\n";
414
+    /*
415
+      Show list of users to add as owners of this domain, only if we have permission to do so.
416
+     */
417
+    $users = do_hook('show_users');
418
+    foreach ($users as $user) {
419
+        $add = '';
420
+        if ($user["id"] == $_SESSION["userid"]) {
421
+            echo "          <option" . $add . " value=\"" . $user["id"] . "\">" . $user["fullname"] . "</option>\n";
422
+        } elseif ($perm_view_others == "1") {
423
+            echo "          <option  value=\"" . $user["id"] . "\">" . $user["fullname"] . "</option>\n";
424
+        }
425
+    }
426
+    echo "         </select>\n";
427
+    echo "        </td>\n";
428
+    echo "        <td>\n";
429
+    echo "         <input type=\"submit\" class=\"sbutton\" name=\"co\" value=\"" . _('Add') . "\">\n";
430
+    echo "        </td>\n";
431
+    echo "       </tr>\n";
432
+    echo "      </form>\n";
433
+}
434
+echo "      <tr>\n";
435
+echo "       <th colspan=\"2\">" . _('Type') . "</th>\n";
436
+echo "      </tr>\n";
437
+
438
+if ($meta_edit) {
439
+    echo "      <form action=\"" . htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES) . "?id=" . $zone_id . "\" method=\"post\">\n";
440
+    echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
441
+    echo "       <tr>\n";
442
+    echo "        <td>\n";
443
+    echo "         <select name=\"newtype\">\n";
444
+    foreach ($server_types as $type) {
445
+        $add = '';
446
+        if ($type == $domain_type) {
447
+            $add = " SELECTED";
448
+        }
449
+
450
+        if (($perm_zone_master_add == "0" && $type == "MASTER") || ($perm_zone_slave_add == "0" && $type == "SLAVE")) {
451
+            continue;
452
+        }
453
+        echo "          <option" . $add . " value=\"" . $type . "\">" . strtolower($type) . "</option>\n";
454
+    }
455
+    echo "         </select>\n";
456
+    echo "        </td>\n";
457
+    echo "        <td>\n";
458
+    echo "         <input type=\"submit\" class=\"sbutton\" name=\"type_change\" value=\"" . _('Change') . "\">\n";
459
+    echo "        </td>\n";
460
+    echo "       </tr>\n";
461
+    echo "      </form>\n";
462
+} else {
463
+    echo "      <tr><td>" . strtolower($domain_type) . "</td><td>&nbsp;</td></tr>\n";
464
+}
465
+
466
+echo "      <tr>\n";
467
+echo "       <th colspan=\"2\">" . _('Template') . "</th>\n";
468
+echo "      </tr>\n";
469
+
470
+if ($meta_edit) {
471
+    echo "      <form action=\"" . htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES) . "?id=" . $zone_id . "\" method=\"post\">\n";
472
+    echo "       <input type=\"hidden\" name=\"current_zone_template\" value=\"" . $zone_template_id . "\">\n";
473
+    echo "       <tr>\n";
474
+    echo "        <td>\n";
475
+    echo "         <select name=\"zone_template\">\n";
476
+    echo "          <option value=\"none\">none</option>\n";
477
+    foreach ($zone_templates as $zone_template) {
478
+        $add = '';
479
+        if ($zone_template['id'] == $zone_template_id) {
480
+            $add = " SELECTED";
481
+        }
482
+        echo "          <option .  $add . value=\"" . $zone_template['id'] . "\">" . $zone_template['name'] . "</option>\n";
483
+    }
484
+    echo "         </select>\n";
485
+    echo "        </td>\n";
486
+    echo "        <td>\n";
487
+    echo "         <input type=\"submit\" class=\"sbutton\" name=\"template_change\" value=\"" . _('Change') . "\">\n";
488
+    echo "        </td>\n";
489
+    echo "       </tr>\n";
490
+    echo "      </form>\n";
491
+} else {
492
+    $zone_template_details = get_zone_templ_details($zone_template_id);
493
+    echo "      <tr><td>" . (isset($zone_template_details) ? strtolower($zone_template_details['name']) : "none" ) . "</td><td>&nbsp;</td></tr>\n";
494
+}
495
+
496
+if ($domain_type == "SLAVE") {
497
+    $slave_master = get_domain_slave_master($zone_id);
498
+    echo "      <tr>\n";
499
+    echo "       <th colspan=\"2\">" . _('IP address of master NS') . "</th>\n";
500
+    echo "      </tr>\n";
501
+
502
+    if ($meta_edit) {
503
+        echo "      <form action=\"" . htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES) . "?id=" . $zone_id . "\" method=\"post\">\n";
504
+        echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
505
+        echo "       <tr>\n";
506
+        echo "        <td>\n";
507
+        echo "         <input type=\"text\" name=\"new_master\" value=\"" . $slave_master . "\" class=\"input\">\n";
508
+        echo "        </td>\n";
509
+        echo "        <td>\n";
510
+        echo "         <input type=\"submit\" class=\"sbutton\" name=\"slave_master_change\" value=\"" . _('Change') . "\">\n";
511
+        echo "        </td>\n";
512
+        echo "       </tr>\n";
513
+        echo "      </form>\n";
514
+    } else {
515
+        echo "      <tr><td>" . $slave_master . "</td><td>&nbsp;</td></tr>\n";
516
+    }
517
+}
518
+echo "     </table>\n";
519
+echo "   </div>\n"; // eo div meta
520
+
521
+include_once("inc/footer.inc.php");

+ 117
- 0
poweradmin/poweradmin-2.1.8/edit_comment.php View File

@@ -0,0 +1,117 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles editing of zone comments
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+if (do_hook('verify_permission', 'zone_content_view_others')) {
36
+    $perm_view = "all";
37
+} elseif (do_hook('verify_permission', 'zone_content_view_own')) {
38
+    $perm_view = "own";
39
+} else {
40
+    $perm_view = "none";
41
+}
42
+
43
+if (do_hook('verify_permission', 'zone_content_edit_others')) {
44
+    $perm_content_edit = "all";
45
+} elseif (do_hook('verify_permission', 'zone_content_edit_own')) {
46
+    $perm_content_edit = "own";
47
+} elseif (do_hook('verify_permission', 'zone_content_edit_own_as_client')) {
48
+    $perm_content_edit = "own_as_client";
49
+} else {
50
+    $perm_content_edit = "none";
51
+}
52
+
53
+if (do_hook('verify_permission', 'zone_meta_edit_others')) {
54
+    $perm_meta_edit = "all";
55
+} elseif (do_hook('verify_permission', 'zone_meta_edit_own')) {
56
+    $perm_meta_edit = "own";
57
+} else {
58
+    $perm_meta_edit = "none";
59
+}
60
+
61
+$zid = $_GET['domain'];
62
+
63
+$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zid );
64
+$zone_type = get_domain_type($zid);
65
+$zone_name = get_zone_name_from_id($zid);
66
+
67
+if (isset($_POST["commit"])) {
68
+    if ($zone_type == "SLAVE" || $perm_content_edit == "none" || ($perm_content_edit == "own" || $perm_content_edit == "own_as_client") && $user_is_zone_owner == "0") {
69
+        error(ERR_PERM_EDIT_COMMENT);
70
+    } else {
71
+        edit_zone_comment($_GET['domain'], $_POST['comment']);
72
+        success(SUC_COMMENT_UPD);
73
+    }
74
+}
75
+
76
+echo "    <h2>" . _('Edit comment in zone') . " " . $zone_name . "</h2>\n";
77
+
78
+if ($perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0") {
79
+    error(ERR_PERM_VIEW_COMMENT);
80
+} else {
81
+    $comment = get_zone_comment($zid);
82
+    echo "     <form method=\"post\" action=\"edit_comment.php?domain=" . $zid . "\">\n";
83
+    echo "      <table>\n";
84
+    echo "      <tr>\n";
85
+    echo "       <td colspan=\"6\">&nbsp;</td>\n";
86
+    echo "      </tr>\n";
87
+    echo "      <tr>\n";
88
+    echo "       <td>&nbsp;</td><td colspan=\"5\">Comments:</td>\n";
89
+    echo "      </tr>\n";
90
+
91
+    if ($zone_type == "SLAVE" || $perm_content_edit == "none" || ($perm_content_edit == "own" || $perm_content_edit == "own_as_client") && $user_is_zone_owner == "0") {
92
+        echo "    <tr>\n";
93
+        echo "     <td class=\"n\">\n";
94
+        echo "      &nbsp;\n";
95
+        echo "     </td>\n";
96
+        echo "     <td colspan=\"4\"><textarea rows=\"15\" name=\"comment\" disabled>" . $comment . "</textarea></td>\n";
97
+        echo "     <td>&nbsp;</td>\n";
98
+        echo "    </tr>\n";
99
+    } else {
100
+        echo "    <tr>\n";
101
+        echo "     <td class=\"n\">\n";
102
+        echo "      &nbsp;\n";
103
+        echo "     </td>\n";
104
+        echo "     <td colspan=\"4\"><textarea rows=\"15\" name=\"comment\">" . $comment . "</textarea></td>\n";
105
+        echo "     <td>&nbsp;</td>\n";
106
+        echo "    </tr>\n";
107
+    }
108
+    echo "      </table>\n";
109
+    echo "      <p>\n";
110
+    echo "       <input type=\"submit\" name=\"commit\" value=\"" . _('Commit changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
111
+    echo "       <input type=\"reset\" name=\"reset\" value=\"" . _('Reset changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
112
+    echo "      </p>\n";
113
+    echo "     </form>\n";
114
+}
115
+
116
+
117
+include_once("inc/footer.inc.php");

+ 99
- 0
poweradmin/poweradmin-2.1.8/edit_perm_templ.php View File

@@ -0,0 +1,99 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles editing of permission templates
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+$id = "-1";
36
+if ((isset($_GET['id'])) || (v_num($_GET['id']))) {
37
+    $id = $_GET['id'];
38
+}
39
+
40
+if ($id == "-1") {
41
+    error(ERR_INV_INPUT);
42
+} elseif (!do_hook('verify_permission' , 'templ_perm_edit' )) {
43
+    error(ERR_PERM_EDIT_PERM_TEMPL);
44
+} else {
45
+    $id = $_GET['id'];
46
+
47
+    if (isset($_POST['commit'])) {
48
+        do_hook('update_perm_templ_details' , $_POST );
49
+        success(SUC_RECORD_UPD);
50
+    }
51
+
52
+    $templ = do_hook('get_permission_template_details' , $id );
53
+    $perms_templ = do_hook('get_permissions_by_template_id' , $id );
54
+    $perms_avail = do_hook('get_permissions_by_template_id' );
55
+
56
+    echo "    <h2>" . _('Edit permission template') . "</h2>\n";
57
+    echo "    <form method=\"post\" action=\"\">\n";
58
+    echo "    <input type=\"hidden\" name=\"templ_id\" value=\"" . $id . "\">\n";
59
+
60
+    echo "     <table>\n";
61
+    echo "      <tr>\n";
62
+    echo "       <th>" . _('Name') . "</th>\n";
63
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"" . $templ['name'] . "\"></td>\n";
64
+    echo "      </tr>\n";
65
+    echo "      <tr>\n";
66
+    echo "       <th>" . _('Description') . "</th>\n";
67
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"" . $templ['descr'] . "\"></td>\n";
68
+    echo "      </tr>\n";
69
+    echo "     </table>\n";
70
+
71
+    echo "     <table>\n";
72
+    echo "      <tr>\n";
73
+    echo "       <th>&nbsp;</th>\n";
74
+    echo "       <th>" . _('Name') . "</th>\n";
75
+    echo "       <th>" . _('Description') . "</th>\n";
76
+    echo "      </tr>\n";
77
+
78
+    foreach ($perms_avail as $perm_a) {
79
+
80
+        echo "      <tr>\n";
81
+
82
+        $has_perm = "";
83
+        foreach ($perms_templ as $perm_t) {
84
+            if (in_array($perm_a['id'], $perm_t)) {
85
+                $has_perm = "checked";
86
+            }
87
+        }
88
+
89
+        echo "       <td><input type=\"checkbox\" name=\"perm_id[]\" value=\"" . $perm_a['id'] . "\" " . $has_perm . "></td>\n";
90
+        echo "       <td>" . $perm_a['name'] . "</td>\n";
91
+        echo "       <td>" . _($perm_a['descr']) . "</td>\n";
92
+        echo "      </tr>\n";
93
+    }
94
+    echo "     </table>\n";
95
+    echo "     <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
96
+    echo "     </form>\n";
97
+}
98
+
99
+include_once("inc/footer.inc.php");

+ 157
- 0
poweradmin/poweradmin-2.1.8/edit_record.php View File

@@ -0,0 +1,157 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles requests to edit zone records
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+global $pdnssec_use;
36
+
37
+if (do_hook('verify_permission', 'zone_content_view_others')) {
38
+    $perm_view = "all";
39
+} elseif (do_hook('verify_permission', 'zone_content_view_own')) {
40
+    $perm_view = "own";
41
+} else {
42
+    $perm_view = "none";
43
+}
44
+
45
+if (do_hook('verify_permission', 'zone_content_edit_others')) {
46
+    $perm_content_edit = "all";
47
+} elseif (do_hook('verify_permission', 'zone_content_edit_own')) {
48
+    $perm_content_edit = "own";
49
+} elseif (do_hook('verify_permission', 'zone_content_edit_own_as_client')) {
50
+    $perm_content_edit = "own_as_client";
51
+} else {
52
+    $perm_content_edit = "none";
53
+}
54
+
55
+if (do_hook('verify_permission', 'zone_meta_edit_others')) {
56
+    $perm_meta_edit = "all";
57
+} elseif (do_hook('verify_permission', 'zone_meta_edit_own')) {
58
+    $perm_meta_edit = "own";
59
+} else {
60
+    $perm_meta_edit = "none";
61
+}
62
+
63
+$zid = get_zone_id_from_record_id($_GET['id']);
64
+
65
+$user_is_zone_owner = do_hook('verify_user_is_owner_zoneid' , $zid );
66
+$zone_type = get_domain_type($zid);
67
+$zone_name = get_zone_name_from_id($zid);
68
+
69
+if (isset($_POST["commit"])) {
70
+    if ($zone_type == "SLAVE" || $perm_content_edit == "none" || ($perm_content_edit == "own" || $perm_content_edit == "own_as_client") && $user_is_zone_owner == "0") {
71
+        error(ERR_PERM_EDIT_RECORD);
72
+    } else {
73
+        $old_record_info = get_record_from_id($_POST["rid"]);
74
+        $ret_val = edit_record($_POST);
75
+        if ($ret_val == "1") {
76
+            if ($_POST['type'] != "SOA") {
77
+                update_soa_serial($zid);
78
+            }
79
+            success(SUC_RECORD_UPD);
80
+            $new_record_info = get_record_from_id($_POST["rid"]);
81
+            log_info(sprintf('client_ip:%s user:%s operation:edit_record'
82
+                             .' old_record_type:%s old_record:%s old_content:%s old_ttl:%s old_priority:%s'
83
+                             .' record_type:%s record:%s content:%s ttl:%s priority:%s',
84
+                              $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
85
+                              $old_record_info['type'], $old_record_info['name'], $old_record_info['content'], $old_record_info['ttl'], $old_record_info['prio'],
86
+                              $new_record_info['type'], $new_record_info['name'], $new_record_info['content'], $new_record_info['ttl'], $new_record_info['prio']));
87
+
88
+            if ($pdnssec_use) {
89
+                if (dnssec_rectify_zone($zid)) {
90
+                    success(SUC_EXEC_PDNSSEC_RECTIFY_ZONE);
91
+                }
92
+            }
93
+        }
94
+    }
95
+}
96
+
97
+echo "    <h2>" . _('Edit record in zone') . " \"<a href=\"edit.php?id=" . $zid . "\">" . $zone_name . "</a>\"</h2>\n";
98
+
99
+if ($perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0") {
100
+    error(ERR_PERM_VIEW_RECORD);
101
+} else {
102
+    $record = get_record_from_id($_GET["id"]);
103
+    echo "     <form method=\"post\" action=\"edit_record.php?domain=" . $zid . "&amp;id=" . $_GET["id"] . "\">\n";
104
+    echo "      <table>\n";
105
+    echo "       <tr>\n";
106
+    echo "        <th>" . _('Name') . "</th>\n";
107
+    echo "        <th>&nbsp;</th>\n";
108
+    echo "        <th>" . _('Type') . "</th>\n";
109
+    echo "        <th>" . _('Content') . "</th>\n";
110
+    echo "        <th>" . _('Priority') . "</th>\n";
111
+    echo "        <th>" . _('TTL') . "</th>\n";
112
+    echo "       </tr>\n";
113
+
114
+    if ($zone_type == "SLAVE" || $perm_content_edit == "none" || ($perm_content_edit == "own" || $perm_content_edit == "own_as_client") && $user_is_zone_owner == "0") {
115
+        echo "      <tr>\n";
116
+        echo "       <td>" . $record["name"] . "</td>\n";
117
+        echo "       <td>IN</td>\n";
118
+        echo "       <td>" . htmlspecialchars($record["type"]) . "</td>\n";
119
+        echo "       <td>" . htmlspecialchars($record['content']) . "</td>\n";
120
+        echo "       <td>" . htmlspecialchars($record["prio"]) . "</td>\n";
121
+        echo "       <td>" . htmlspecialchars($record["ttl"]) . "</td>\n";
122
+        echo "      </tr>\n";
123
+    } else {
124
+        echo "      <tr>\n";
125
+        echo "       <td><input type=\"hidden\" name=\"rid\" value=\"" . $_GET["id"] . "\">\n";
126
+        echo "       <input type=\"hidden\" name=\"zid\" value=\"" . $zid . "\">\n";
127
+        echo "       <input type=\"text\" name=\"name\" value=\"" . htmlspecialchars(trim(str_replace($zone_name, '', $record["name"]), '.')) . "\" class=\"input\">." . $zone_name . "</td>\n";
128
+        echo "       <td>IN</td>\n";
129
+        echo "       <td>\n";
130
+        echo "        <select name=\"type\">\n";
131
+        $found_selected_type = false;
132
+        foreach (get_record_types() as $type_available) {
133
+            if ($type_available == $record["type"]) {
134
+                $add = " SELECTED";
135
+                $found_selected_type = true;
136
+            } else {
137
+                $add = "";
138
+            }
139
+            echo "         <option" . $add . " value=\"" . htmlspecialchars($type_available) . "\" >" . $type_available . "</option>\n";
140
+        }
141
+        if (!$found_selected_type)
142
+            echo "         <option SELECTED value=\"" . htmlspecialchars($record['type']) . "\"><i>" . $record['type'] . "</i></option>\n";
143
+        echo "        </select>\n";
144
+        echo "       </td>\n";
145
+        echo "       <td><input type=\"text\" name=\"content\" value=\"" . htmlspecialchars($record['content']) . "\" class=\"input\"></td>\n";
146
+        echo "       <td><input type=\"text\" name=\"prio\" value=\"" . htmlspecialchars($record["prio"]) . "\" class=\"sinput\"></td>\n";
147
+        echo "       <td><input type=\"text\" name=\"ttl\" value=\"" . htmlspecialchars($record["ttl"]) . "\" class=\"sinput\"></td>\n";
148
+        echo "      </tr>\n";
149
+    }
150
+    echo "      </table>\n";
151
+    echo "       <input type=\"submit\" name=\"commit\" value=\"" . _('Commit changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
152
+    echo "       <input type=\"reset\" name=\"reset\" value=\"" . _('Reset changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
153
+    echo "     </form>\n";
154
+}
155
+
156
+
157
+include_once("inc/footer.inc.php");

+ 172
- 0
poweradmin/poweradmin-2.1.8/edit_user.php View File

@@ -0,0 +1,172 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles user editing requests
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+$edit_id = "-1";
36
+if (isset($_GET['id']) && v_num($_GET['id'])) {
37
+    $edit_id = $_GET['id'];
38
+}
39
+
40
+do_hook('verify_permission' , 'user_edit_own' ) ? $perm_edit_own = "1" : $perm_edit_own = "0";
41
+do_hook('verify_permission' , 'user_edit_others' ) ? $perm_edit_others = "1" : $perm_edit_others = "0";
42
+
43
+if ($edit_id == "-1") {
44
+    error(ERR_INV_INPUT);
45
+} elseif (($edit_id == $_SESSION["userid"] && $perm_edit_own == "1") || ($edit_id != $_SESSION["userid"] && $perm_edit_others == "1" )) {
46
+
47
+    if (isset($_POST["commit"])) {
48
+
49
+        $i_username = "-1";
50
+        $i_fullname = "-1";
51
+        $i_email = "-1";
52
+        $i_description = "-1";
53
+        $i_password = "-1";
54
+        $i_perm_templ = "0";
55
+        $i_active = "0";
56
+
57
+        if (isset($_POST['username'])) {
58
+            $i_username = $_POST['username'];
59
+        }
60
+
61
+        if (isset($_POST['fullname'])) {
62
+            $i_fullname = $_POST['fullname'];
63
+        }
64
+
65
+        if (isset($_POST['email'])) {
66
+            $i_email = $_POST['email'];
67
+        }
68
+
69
+        if (isset($_POST['description'])) {
70
+            $i_description = $_POST['description'];
71
+        }
72
+
73
+        if (isset($_POST['password'])) {
74
+            $i_password = $_POST['password'];
75
+        }
76
+
77
+        if (isset($_POST['perm_templ']) && v_num($_POST['perm_templ'])) {
78
+            $i_perm_templ = $_POST['perm_templ'];
79
+        }
80
+
81
+        if (isset($_POST['active']) && v_num($_POST['active'])) {
82
+            $i_active = $_POST['active'];
83
+        }
84
+
85
+        if ($i_username == "-1" || $i_fullname == "-1" || $i_email < "1" || $i_description == "-1" || $i_password == "-1") {
86
+            error(ERR_INV_INPUT);
87
+        } else {
88
+            if ($i_username != "" && $i_perm_templ > "0" && $i_fullname) {
89
+                if (!isset($i_active)) {
90
+                    $active = 0;
91
+                } else {
92
+                    $active = 1;
93
+                }
94
+                if (do_hook('edit_user' , $edit_id, $i_username, $i_fullname, $i_email, $i_perm_templ, $i_description, $active, $i_password )) {
95
+                    success(SUC_USER_UPD);
96
+                }
97
+            }
98
+        }
99
+    }
100
+
101
+    $users = do_hook('get_user_detail_list' , $edit_id );
102
+
103
+    foreach ($users as $user) {
104
+
105
+        (($user['active']) == "1") ? $check = " CHECKED" : $check = "";
106
+
107
+        echo "     <h2>" . _('Edit user') . " \"" . $user['fullname'] . "\"</h2>\n";
108
+        echo "     <form method=\"post\" action=\"\">\n";
109
+        echo "      <input type=\"hidden\" name=\"number\" value=\"" . $edit_id . "\">\n";
110
+        echo "      <table>\n";
111
+        echo "       <tr>\n";
112
+        echo "        <td class=\"n\">" . _('Username') . "</td>\n";
113
+        echo "        <td class=\"n\"><input type=\"text\" class=\"input\" name=\"username\" value=\"" . $user['username'] . "\"></td>\n";
114
+        echo "       </tr>\n";
115
+        echo "       <tr>\n";
116
+        echo "        <td class=\"n\">" . _('Fullname') . "</td>\n";
117
+        echo "        <td class=\"n\"><input type=\"text\" class=\"input\" name=\"fullname\" value=\"" . $user['fullname'] . "\"></td>\n";
118
+        echo "       </tr>\n";
119
+        echo "       <tr>\n";
120
+        echo "        <td class=\"n\">" . _('Password') . "</td>\n";
121
+        echo "        <td class=\"n\"><input type=\"password\" class=\"input\" name=\"password\"></td>\n";
122
+        echo "       </tr>\n";
123
+        echo "       <tr>\n";
124
+        echo "        <td class=\"n\">" . _('Email address') . "</td>\n";
125
+        echo "        <td class=\"n\"><input type=\"text\" class=\"input\" name=\"email\" value=\"" . $user['email'] . "\"></td>\n";
126
+        echo "       </tr>\n";
127
+        if (do_hook('verify_permission' , 'user_edit_templ_perm' )) {
128
+            echo "       <tr>\n";
129
+            echo "        <td class=\"n\">" . _('Permission template') . "</td>\n";
130
+            echo "        <td class=\"n\">\n";
131
+            echo "         <select name=\"perm_templ\">\n";
132
+            foreach (do_hook('list_permission_templates' ) as $template) {
133
+                ($template['id'] == $user['tpl_id']) ? $select = " SELECTED" : $select = "";
134
+                echo "          <option value=\"" . $template['id'] . "\"" . $select . ">" . $template['name'] . "</option>\n";
135
+            }
136
+            echo "         </select>\n";
137
+            echo "       </td>\n";
138
+        }
139
+        echo "       </tr>\n";
140
+        echo "       <tr>\n";
141
+        echo "        <td class=\"n\">" . _('Description') . "</td>\n";
142
+        echo "        <td class=\"n\"><textarea rows=\"4\" cols=\"30\" class=\"inputarea\" name=\"description\">" . $user['descr'] . "</textarea></td>\n";
143
+        echo "       </tr>\n";
144
+        echo "       <tr>\n";
145
+        echo "        <td class=\"n\">" . _('Enabled') . "</td>\n";
146
+        echo "        <td class=\"n\"><input type=\"checkbox\" class=\"input\" name=\"active\" value=\"1\"" . $check . "></td>\n";
147
+        echo "       </tr>\n";
148
+        echo "       <tr>\n";
149
+        echo "        <td class=\"n\">&nbsp;</td>\n";
150
+        echo "        <td class=\"n\"><input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
151
+        echo "        <input type=\"reset\" class=\"button\" name=\"reset\" value=\"" . _('Reset changes') . "\"></td>\n";
152
+        echo "      </table>\n";
153
+        echo "     </form>\n";
154
+
155
+        echo "     <p>\n";
156
+        printf(_('This user has been assigned the permission template "%s".'), $user['tpl_name']);
157
+        if ($user['tpl_descr'] != "") {
158
+            echo " " . _('The description for this template is') . ": \"" . $user['tpl_descr'] . "\".";
159
+        }
160
+        echo " " . _('Based on this template, this user has the following permissions') . ":";
161
+        echo "     </p>\n";
162
+        echo "     <ul>\n";
163
+        foreach (do_hook('get_permissions_by_template_id' , $user['tpl_id'] ) as $item) {
164
+            echo "      <li>" . _($item['descr']) . " (" . $item['name'] . ")</li>\n";
165
+        }
166
+        echo "     </ul>\n";
167
+    }
168
+} else {
169
+    error(ERR_PERM_EDIT_USER);
170
+}
171
+
172
+include_once("inc/footer.inc.php");

+ 193
- 0
poweradmin/poweradmin-2.1.8/edit_zone_templ.php View File

@@ -0,0 +1,193 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles zone templates editing
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+$zone_templ_id = "-1";
36
+if (isset($_GET['id']) && v_num($_GET['id'])) {
37
+    $zone_templ_id = $_GET['id'];
38
+}
39
+
40
+if ($zone_templ_id == "-1") {
41
+    error(ERR_INV_INPUT);
42
+    include_once("inc/footer.inc.php");
43
+    exit;
44
+}
45
+
46
+/*
47
+  Check permissions
48
+ */
49
+$owner = get_zone_templ_is_owner($zone_templ_id, $_SESSION['userid']);
50
+
51
+if (isset($_POST['commit']) && $owner) {
52
+    success(SUC_ZONE_TEMPL_UPD);
53
+    foreach ($_POST['record'] as $record) {
54
+        edit_zone_templ_record($record);
55
+    }
56
+}
57
+
58
+if (isset($_POST['edit']) && $owner) {
59
+    edit_zone_templ($_POST, $zone_templ_id);
60
+}
61
+
62
+if (isset($_POST['save_as'])) {
63
+    if (zone_templ_name_exists($_POST['templ_name'])) {
64
+        error(ERR_ZONE_TEMPL_EXIST);
65
+    } elseif ($_POST['templ_name'] == '') {
66
+        error(ERR_ZONE_TEMPL_IS_EMPTY);
67
+    } else {
68
+        success(SUC_ZONE_TEMPL_ADD);
69
+        $templ_details = get_zone_templ_details($zone_templ_id);
70
+        add_zone_templ_save_as($_POST['templ_name'], $_POST['templ_descr'], $_SESSION['userid'], $_POST['record']);
71
+    }
72
+}
73
+
74
+if (isset($_POST['update_zones'])) {
75
+    $zones = get_list_zone_use_templ($zone_templ_id, $_SESSION['userid']);
76
+    success(SUC_ZONES_UPD);
77
+    foreach ($zones as $zone) {
78
+        update_zone_records($zone['id'], $zone_templ_id);
79
+    }
80
+}
81
+
82
+if (!(do_hook('verify_permission' , 'zone_master_add' )) || !$owner) {
83
+    error(ERR_PERM_EDIT_ZONE_TEMPL);
84
+} else {
85
+    if (zone_templ_id_exists($zone_templ_id) == "0") {
86
+        error(ERR_ZONE_TEMPL_NOT_EXIST);
87
+    } else {
88
+        $record_count = count_zone_templ_records($zone_templ_id);
89
+        $templ_details = get_zone_templ_details($zone_templ_id);
90
+        echo "   <h2>" . _('Edit zone template') . " \"" . $templ_details['name'] . "\"</h2>\n";
91
+
92
+        echo "   <div class=\"showmax\">\n";
93
+        show_pages($record_count, $iface_rowamount, $zone_templ_id);
94
+        echo "   </div>\n";
95
+
96
+        $records = get_zone_templ_records($zone_templ_id, ROWSTART, $iface_rowamount, RECORD_SORT_BY);
97
+        if ($records == "-1") {
98
+            echo " <p>" . _("This template zone does not have any records yet.") . "</p>\n";
99
+        } else {
100
+            echo "   <form method=\"post\" action=\"\">\n";
101
+            echo "   <table>\n";
102
+            echo "    <tr>\n";
103
+            echo "     <th>&nbsp;</th>\n";
104
+            echo "     <th><a href=\"edit_zone_templ.php?id=" . $zone_templ_id . "&amp;record_sort_by=name\">" . _('Name') . "</a></th>\n";
105
+            echo "     <th><a href=\"edit_zone_templ.php?id=" . $zone_templ_id . "&amp;record_sort_by=type\">" . _('Type') . "</a></th>\n";
106
+            echo "     <th><a href=\"edit_zone_templ.php?id=" . $zone_templ_id . "&amp;record_sort_by=content\">" . _('Content') . "</a></th>\n";
107
+            echo "     <th><a href=\"edit_zone_templ.php?id=" . $zone_templ_id . "&amp;record_sort_by=prio\">" . _('Priority') . "</a></th>\n";
108
+            echo "     <th><a href=\"edit_zone_templ.php?id=" . $zone_templ_id . "&amp;record_sort_by=ttl\">" . _('TTL') . "</a></th>\n";
109
+            echo "    </tr>\n";
110
+            foreach ($records as $r) {
111
+                echo "    <tr>\n";
112
+                echo "     <td class=\"n\">\n";
113
+                echo "    <input type=\"hidden\" name=\"record[" . $r['id'] . "][rid]\" value=\"" . $r['id'] . "\">\n";
114
+                echo "      <a href=\"edit_zone_templ_record.php?id=" . $r['id'] . "&amp;zone_templ_id=" . $zone_templ_id . "\">
115
+						<img src=\"images/edit.gif\" alt=\"[ " . _('Edit record') . " ]\"></a>\n";
116
+                echo "      <a href=\"delete_zone_templ_record.php?id=" . $r['id'] . "&amp;zone_templ_id=" . $zone_templ_id . "\">
117
+						<img src=\"images/delete.gif\" ALT=\"[ " . _('Delete record') . " ]\" BORDER=\"0\"></a>\n";
118
+                echo "     </td>\n";
119
+                echo "      <td class=\"u\"><input class=\"wide\" name=\"record[" . $r['id'] . "][name]\" value=\"" . $r['name'] . "\"></td>\n";
120
+                echo "      <td class=\"u\">\n";
121
+                echo "       <select name=\"record[" . $r['id'] . "][type]\">\n";
122
+                $found_selected_type = false;
123
+                foreach (get_record_types() as $type_available) {
124
+                    if ($type_available == $r['type']) {
125
+                        $add = " SELECTED";
126
+                        $found_selected_type = true;
127
+                    } else {
128
+                        $add = "";
129
+                    }
130
+                    echo "         <option" . $add . " value=\"" . $type_available . "\" >" . $type_available . "</option>\n";
131
+                }
132
+                if (!$found_selected_type) {
133
+                    echo "         <option SELECTED value=\"" . htmlspecialchars($r['type']) . "\"><i>" . $r['type'] . "</i></option>\n";
134
+                }
135
+                echo "       </select>\n";
136
+                echo "      </td>\n";
137
+                echo "      <td class=\"u\"><input class=\"wide\" name=\"record[" . $r['id'] . "][content]\" value='" . $r['content'] . "'></td>\n";
138
+                if ($r['type'] == "MX" || $r['type'] == "SRV") {
139
+                    echo "      <td class=\"u\"><input name=\"record[" . $r['id'] . "][prio]\" value=\"" . $r['prio'] . "\"></td>\n";
140
+                } else {
141
+                    echo "      <td class=\"n\">&nbsp;</td>\n";
142
+                }
143
+                echo "      <td class=\"u\"><input name=\"record[" . $r['id'] . "][ttl]\" value=\"" . $r['ttl'] . "\"></td>\n";
144
+                echo "     </tr>\n";
145
+            }
146
+            echo "     <tr>\n";
147
+            echo "      <td colspan=\"6\"><br><b>Hint:</b></td>\n";
148
+            echo "     </tr>\n";
149
+            echo "     <tr>\n";
150
+            echo "      <td colspan=\"6\">" . _('The following placeholders can be used in template records') . "</td>\n";
151
+            echo "     </tr>\n";
152
+            echo "     <tr>\n";
153
+            echo "      <td colspan=\"6\"><br>&nbsp;&nbsp;&nbsp;&nbsp; * [ZONE] - " . _('substituted with current zone name') . "<br>";
154
+            echo "&nbsp;&nbsp;&nbsp;&nbsp; * [SERIAL] - " . _('substituted with current date and 2 numbers') . " (YYYYMMDD + 00)</td>\n";
155
+            echo "     </tr>\n";
156
+            echo "     <tr>\n";
157
+            echo "      <td colspan=\"6\"><br>Save as new template:</td>\n";
158
+            echo "     </tr>\n";
159
+            echo "      <tr>\n";
160
+            echo "       <th>" . _('Template Name') . "</th>\n";
161
+            echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"\"></td>\n";
162
+            echo "      </tr>\n";
163
+            echo "      <tr>\n";
164
+            echo "       <th>" . _('Template Description') . "</th>\n";
165
+            echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"\"></td>\n";
166
+            echo "      </tr>\n";
167
+            echo "    </table>\n";
168
+            echo "     <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
169
+            echo "     <input type=\"reset\" class=\"button\" name=\"reset\" value=\"" . _('Reset changes') . "\">\n";
170
+            echo "     <input type=\"submit\" class=\"button\" name=\"save_as\" value=\"" . _('Save as template') . "\">\n";
171
+            echo "     <input type=\"submit\" class=\"button\" name=\"update_zones\" value=\"" . _('Update zones') . "\">\n";
172
+            echo "    </form>";
173
+        }
174
+
175
+        echo "    <form method=\"post\" action=\"\">\n";
176
+        echo "     <table>\n";
177
+        echo "      <tr>\n";
178
+        echo "       <th>" . _('Name') . "</th>\n";
179
+        echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"" . $templ_details['name'] . "\"></td>\n";
180
+        echo "      </tr>\n";
181
+        echo "      <tr>\n";
182
+        echo "       <th>" . _('Description') . "</th>\n";
183
+        echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"" . $templ_details['descr'] . "\"></td>\n";
184
+        echo "      </tr>\n";
185
+        echo "     </table>\n";
186
+        echo "     <input type=\"submit\" class=\"button\" name=\"edit\" value=\"" . _('Commit changes') . "\">\n";
187
+        echo "     </form>\n";
188
+        echo "    <input type=\"button\" class=\"button\" OnClick=\"location.href='add_zone_templ_record.php?id=" . $zone_templ_id . "'\" value=\"" . _('Add record') . "\">&nbsp;&nbsp\n";
189
+        echo "    <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_zone_templ.php?id=" . $zone_templ_id . "'\" value=\"" . _('Delete zone template') . "\">\n";
190
+    }
191
+}
192
+
193
+include_once("inc/footer.inc.php");

+ 110
- 0
poweradmin/poweradmin-2.1.8/edit_zone_templ_record.php View File

@@ -0,0 +1,110 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that handles records editing in zone templates
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+$record_id = "-1";
36
+if (isset($_GET['id']) && v_num($_GET['id'])) {
37
+    $record_id = $_GET['id'];
38
+}
39
+
40
+$zone_templ_id = "-1";
41
+if (isset($_GET['zone_templ_id']) && v_num($_GET['zone_templ_id'])) {
42
+    $zone_templ_id = $_GET['zone_templ_id'];
43
+}
44
+
45
+$owner = get_zone_templ_is_owner($zone_templ_id, $_SESSION['userid']);
46
+
47
+if (isset($_POST["commit"])) {
48
+    if (!(do_hook('verify_permission' , 'zone_master_add' )) || !$owner) {
49
+        error(ERR_PERM_EDIT_RECORD);
50
+    } else {
51
+        $ret_val = edit_zone_templ_record($_POST);
52
+        if ($ret_val == "1") {
53
+            success(SUC_RECORD_UPD);
54
+        } else {
55
+            echo "     <div class=\"error\">" . $ret_val . "</div>\n";
56
+        }
57
+    }
58
+}
59
+
60
+$templ_details = get_zone_templ_details($zone_templ_id);
61
+echo "    <h2>" . _('Edit record in zone template') . " \"" . $templ_details['name'] . "\"</h2>\n";
62
+
63
+if (!(do_hook('verify_permission' , 'zone_master_add' )) || !$owner) {
64
+    error(ERR_PERM_VIEW_RECORD);
65
+} else {
66
+    $record = get_zone_templ_record_from_id($record_id);
67
+    echo "     <form method=\"post\" action=\"edit_zone_templ_record.php?zone_templ_id=" . $zone_templ_id . "&id=" . $record_id . "\">\n";
68
+    echo "      <table>\n";
69
+    echo "       <tr>\n";
70
+    echo "        <th>" . _('Name') . "</td>\n";
71
+    echo "        <th>&nbsp;</td>\n";
72
+    echo "        <th>" . _('Type') . "</td>\n";
73
+    echo "        <th>" . _('Content') . "</td>\n";
74
+    echo "        <th>" . _('Priority') . "</td>\n";
75
+    echo "        <th>" . _('TTL') . "</td>\n";
76
+    echo "       </tr>\n";
77
+    echo "      <input type=\"hidden\" name=\"rid\" value=\"" . $record_id . "\">\n";
78
+    echo "      <input type=\"hidden\" name=\"zid\" value=\"" . $zone_templ_id . "\">\n";
79
+    echo "      <tr>\n";
80
+    echo "       <td><input type=\"text\" name=\"name\" value=\"" . htmlspecialchars($record["name"]) . "\" class=\"input\"></td>\n";
81
+    echo "       <td>IN</td>\n";
82
+    echo "       <td>\n";
83
+    echo "        <select name=\"type\">\n";
84
+    $found_selected_type = false;
85
+    foreach (get_record_types() as $type_available) {
86
+        if ($type_available == $record["type"]) {
87
+            $add = " SELECTED";
88
+            $found_selected_type = true;
89
+        } else {
90
+            $add = "";
91
+        }
92
+        echo "         <option" . $add . " value=\"" . $type_available . "\" >" . $type_available . "</option>\n";
93
+    }
94
+    if (!$found_selected_type)
95
+        echo "         <option SELECTED value=\"" . htmlspecialchars($record['type']) . "\"><i>" . $record['type'] . "</i></option>\n";
96
+    echo "        </select>\n";
97
+    echo "       </td>\n";
98
+    echo "       <td><input type=\"text\" name=\"content\" value=\"" . htmlspecialchars($record['content']) . "\" class=\"input\"></td>\n";
99
+    echo "       <td><input type=\"text\" name=\"prio\" value=\"" . htmlspecialchars($record["prio"]) . "\" class=\"sinput\"></td>\n";
100
+    echo "       <td><input type=\"text\" name=\"ttl\" value=\"" . htmlspecialchars($record["ttl"]) . "\" class=\"sinput\"></td>\n";
101
+    echo "      </tr>\n";
102
+    echo "      </table>\n";
103
+    echo "      <p>\n";
104
+    echo "       <input type=\"submit\" name=\"commit\" value=\"" . _('Commit changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
105
+    echo "       <input type=\"reset\" name=\"reset\" value=\"" . _('Reset changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
106
+    echo "      </p>\n";
107
+    echo "     </form>\n";
108
+}
109
+
110
+include_once("inc/footer.inc.php");

BIN
poweradmin/poweradmin-2.1.8/favicon.ico View File


BIN
poweradmin/poweradmin-2.1.8/images/arrow.png View File


BIN
poweradmin/poweradmin-2.1.8/images/background.jpg View File


BIN
poweradmin/poweradmin-2.1.8/images/delete.gif View File


BIN
poweradmin/poweradmin-2.1.8/images/edit.gif View File


BIN
poweradmin/poweradmin-2.1.8/images/logo.png View File


BIN
poweradmin/poweradmin-2.1.8/images/switch_user.png View File


+ 249
- 0
poweradmin/poweradmin-2.1.8/inc/PDOCommon.class.php View File

@@ -0,0 +1,249 @@
1
+<?php
2
+
3
+/*
4
+  Copyright 2011 Aldo Gonzalez. All rights reserved.
5
+
6
+  Redistribution and use in source and binary forms, with or without modification, are
7
+  permitted provided that the following conditions are met:
8
+
9
+  1. Redistributions of source code must retain the above copyright notice, this list of
10
+  conditions and the following disclaimer.
11
+
12
+  2. Redistributions in binary form must reproduce the above copyright notice, this list
13
+  of conditions and the following disclaimer in the documentation and/or other materials
14
+  provided with the distribution.
15
+
16
+  THIS SOFTWARE IS PROVIDED BY Aldo Gonzalez ''AS IS'' AND ANY EXPRESS OR IMPLIED
17
+  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
18
+  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <copyright HOLDER> OR
19
+  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22
+  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23
+  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24
+  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+
26
+  The views and conclusions contained in the software and documentation are those of the
27
+  authors and should not be interpreted as representing official policies, either expressed
28
+  or implied, of Aldo Gonzalez.
29
+ */
30
+
31
+/**
32
+ * Extends PDO to ensure compatibility with some used functionality from PEAR::MDB2
33
+ *
34
+ * @package     Poweradmin
35
+ * @copyright   2011 Aldo Gonzalez
36
+ * @license     http://opensource.org/licenses/BSD-2-Clause BSD
37
+ */
38
+
39
+/**
40
+ * MDB2 over PDO
41
+ */
42
+class PDOStatementCommon {
43
+
44
+    /**
45
+     * Internal resource
46
+     * @var mixed
47
+     */
48
+    private $pdoStatement;
49
+
50
+    /**
51
+     * Class constructor
52
+     *
53
+     * @param mixed $obj
54
+     */
55
+    public function __construct($obj) {
56
+        $this->pdoStatement = $obj;
57
+    }
58
+
59
+    /**
60
+     * Returns the number of rows in a result object
61
+     *
62
+     * @return int
63
+     */
64
+    public function numRows() {
65
+        // NOTE: Doesn't work properly with PDO and SQLite3
66
+        return $this->pdoStatement->rowCount();
67
+    }
68
+
69
+    /**
70
+     * Fetch and return a row of data
71
+     *
72
+     * @param int $fetch_style
73
+     * @return mixed
74
+     */
75
+    public function fetch($fetch_style = PDO::FETCH_ASSOC) {
76
+        return $this->pdoStatement->fetch($fetch_style);
77
+    }
78
+
79
+    /**
80
+     * Fetch and return a row of data
81
+     *
82
+     * @param int $fetch_style
83
+     * @return mixed
84
+     */
85
+    public function fetchRow($fetch_style = PDO::FETCH_ASSOC) {
86
+        $row = $this->pdoStatement->fetch($fetch_style);
87
+        return $row;
88
+    }
89
+
90
+}
91
+
92
+/**
93
+ * Implements common PDO methods
94
+ */
95
+class PDOCommon extends PDO {
96
+
97
+    /**
98
+     * result limit used in the next query
99
+     * @var int
100
+     */
101
+    private $limit = 0;
102
+
103
+    /**
104
+     * result offset used in the next query
105
+     * @var int
106
+     */
107
+    private $from = 0;
108
+
109
+    /**
110
+     * PDOCommon constructor
111
+     *
112
+     * @param string $dsn
113
+     * @param string $username
114
+     * @param string $password
115
+     * @param array $driver_options
116
+     * @param boolean $isQuiet
117
+     */
118
+    public function __construct($dsn, $username = '', $password = '', $driver_options = array(), $isQuiet = false) {
119
+        try {
120
+            parent::__construct($dsn, $username, $password, $driver_options);
121
+        } catch (Exception $e) {
122
+            error_log($e->getMessage());
123
+            if ($isQuiet) {
124
+                die();
125
+            } else {
126
+                die("Unable to connect to the database server. " .
127
+                        "Please report the problem to an Administrator.");
128
+            }
129
+        }
130
+        $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
131
+        // only allow one statement per query
132
+        // should check that this attribute is only set on
133
+        // mysql databases
134
+        if ($this->getAttribute(PDO::ATTR_DRIVER_NAME) == "mysql") {
135
+            $this->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, false);
136
+        }
137
+    }
138
+
139
+    /**
140
+     * Send a query to the database and return any results
141
+     *
142
+     * @param string $str
143
+     * @return \PDOStatementCommon
144
+     */
145
+    public function query($str) {
146
+        // check if limit has been specified. if so, modify the query
147
+        if (!empty($this->limit)) {
148
+            $str .= " LIMIT " . $this->limit;
149
+            if (!empty($this->from)) {
150
+                $str .= " OFFSET " . $this->from;
151
+            }
152
+
153
+            // after a query is executed the limits are reset, so that
154
+            // other queries may be performed with the same object
155
+            $this->limit = 0;
156
+            $this->from = 0;
157
+        }
158
+
159
+        try {
160
+            $obj_pdoStatement = parent::query($str);
161
+        } catch (Exception $e) {
162
+            error_log("[* SQL ERROR MESSAGE FOLLOWS:\n" .
163
+                    $e->getTraceAsString() .
164
+                    "\n" . $e->getMessage() .
165
+                    "\nFull SQL Statement:" . $str .
166
+                    "\n*]");
167
+            die("<b>An error occurred while executing the SQL statement. " .
168
+                    "Please contact an Administrator and report the problem.</b>" .
169
+                    "<br /><hr />The following query generated an error:<br />" .
170
+                    "<pre>" .
171
+                    $this->formatSQLforHTML($str) .
172
+                    "\n\n" . $e->getMessage() .
173
+                    "</pre>");
174
+        }
175
+
176
+        $obj_pdoStatementCommon = new PDOStatementCommon($obj_pdoStatement);
177
+
178
+        return $obj_pdoStatementCommon;
179
+    }
180
+
181
+    /**
182
+     * Return an HTML formatted SQL string
183
+     *
184
+     * @param string $str
185
+     * @return string
186
+     */
187
+    protected function formatSQLforHTML($str) {
188
+        $Keyword = array("SELECT ", "WHERE ", " ON ", "AND ", "OR ",
189
+            "FROM ", "LIMIT ", "UNION ",
190
+            "INNER ", "LEFT ", "RIGHT ", "JOIN ", ",",
191
+            "GROUP BY ", "ORDER BY ", "HAVING ");
192
+        foreach ($Keyword as $key => $value) {
193
+            if ($value == ",") {
194
+                $Replace[$key] = "<b>" . $value . "</b>\n";
195
+            } else {
196
+                $Replace[$key] = "\n<b>" . $value . "</b>";
197
+            }
198
+        }
199
+
200
+        return str_replace($Keyword, $Replace, $str);
201
+    }
202
+
203
+    /**
204
+     * Execute the specified query, fetch the value from the first column of
205
+     * the the first result row
206
+     *
207
+     * @param string $str
208
+     * @return array
209
+     */
210
+    public function queryOne($str) {
211
+        $result = $this->query($str);
212
+        $row = $result->fetch(PDO::FETCH_NUM);
213
+
214
+        return $row[0];
215
+    }
216
+
217
+    /**
218
+     * Execute the specified query, fetch values from first result row
219
+     *
220
+     * @param string $str
221
+     * @return mixed
222
+     */
223
+    public function queryRow($str) {
224
+        $obj_pdoStatement = parent::query($str);
225
+        return $obj_pdoStatement->fetch(PDO::FETCH_ASSOC);
226
+    }
227
+
228
+    /**
229
+     * Set the range of the next query
230
+     *
231
+     * @param int $limit
232
+     * @param int $from
233
+     */
234
+    public function setLimit($limit, $from = 0) {
235
+        $this->limit = $limit;
236
+        $this->from = $from;
237
+    }
238
+
239
+    /**
240
+     * Quotes a string so it can be safely used in a query.
241
+     *
242
+     * @param string $str
243
+     * @return string
244
+     */
245
+    public function escape($str) {
246
+        return $this->quote($str);
247
+    }
248
+
249
+}

+ 253
- 0
poweradmin/poweradmin-2.1.8/inc/PDOLayer.php View File

@@ -0,0 +1,253 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2009  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * PDO DB access layer
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+include_once "PDOCommon.class.php";
33
+
34
+/**
35
+ * Overrided PEAR class
36
+ */
37
+class PEAR {
38
+
39
+    /**
40
+     * Overrided isError method
41
+     */
42
+    public static function isError() {
43
+
44
+    }
45
+
46
+}
47
+
48
+/**
49
+ * Fake PDO Extended module
50
+ */
51
+class PDOExtended {
52
+
53
+    /**
54
+     * Does several execute() calls on the same statement handle
55
+     *
56
+     * @link http://pear.php.net/package/MDB2/docs/2.5.0b3/MDB2/MDB2_Extended.html#methodexecuteMultiple
57
+     * @param resource $stmt Statement handle
58
+     * @param array $params numeric array containing the data to insert into the query
59
+     */
60
+    public function executeMultiple($stmt, $params) {
61
+        foreach ($params as $values) {
62
+            $stmt->execute($values);
63
+        }
64
+    }
65
+
66
+}
67
+
68
+/**
69
+ * PDO access layer
70
+ */
71
+class PDOLayer extends PDOCommon {
72
+
73
+    /**
74
+     * Enables/disables debugging
75
+     * @var boolean
76
+     */
77
+    private $debug = false;
78
+
79
+    /**
80
+     * Internal storage for queries
81
+     * @var array
82
+     */
83
+    private $queries = array();
84
+
85
+    /**
86
+     * Quotes a string
87
+     *
88
+     * @param string $string
89
+     * @param string $paramtype
90
+     * @return string Returns quoted string
91
+     */
92
+    public function quote($string, $paramtype = NULL) {
93
+        if ($paramtype == 'integer') {
94
+            $paramtype = PDO::PARAM_INT;
95
+        } elseif ($paramtype == 'text') {
96
+            $paramtype = PDO::PARAM_STR;
97
+        }
98
+        return parent::quote($string, $paramtype);
99
+    }
100
+
101
+    /**
102
+     * Set execution options
103
+     *
104
+     * @param string $option Option name
105
+     * @param int $value Option value
106
+     */
107
+    public function setOption($option, $value) {
108
+        if ($option == 'debug' && $value == 1) {
109
+            $this->debug = true;
110
+        }
111
+    }
112
+
113
+    /**
114
+     * Return debug output
115
+     *
116
+     * @param string Debug output
117
+     */
118
+    public function getDebugOutput() {
119
+        echo join("<br>", $this->queries);
120
+    }
121
+
122
+    /**
123
+     * Executes SQL query
124
+     *
125
+     * @param string $str SQL query
126
+     * @return PDOStatement
127
+     */
128
+    public function query($str) {
129
+        if ($this->debug) {
130
+            $this->queries[] = $str;
131
+        }
132
+
133
+        return parent::query($str);
134
+    }
135
+
136
+    /**
137
+     * Dummy method
138
+     */
139
+    public function disconnect() {
140
+
141
+    }
142
+
143
+    /**
144
+     * Load PDO module
145
+     *
146
+     * @param string $name Module name to load
147
+     */
148
+    public function loadModule($name) {
149
+        if ($name == 'Extended') {
150
+            $this->extended = new PDOExtended();
151
+        }
152
+    }
153
+
154
+    /**
155
+     * List all tables in the current database
156
+     *
157
+     * @link http://pear.php.net/package/MDB2/docs/2.5.0b3/MDB2/MDB2_Driver_Manager_Common.html#methodlistTables
158
+     */
159
+    public function listTables() {
160
+        // TODO: addapt this function also to pgsql & sqlite
161
+
162
+        $tables = array();
163
+        $db_type = $this->getAttribute(PDO::ATTR_DRIVER_NAME);
164
+        $query = '';
165
+
166
+        if ($db_type == 'mysql') {
167
+            $query = 'SHOW TABLES';
168
+        } elseif ($db_type == 'pgsql') {
169
+            $query = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'";
170
+        } elseif ($db_type == 'sqlite') {
171
+            $query = "SELECT name FROM sqlite_master WHERE type='table'";
172
+        } else {
173
+            die(ERR_DB_UNK_TYPE);
174
+        }
175
+
176
+        $result = $this->query($query);
177
+        while ($row = $result->fetch(PDO::FETCH_NUM)) {
178
+            $tables[] = $row[0];
179
+        }
180
+        return $tables;
181
+    }
182
+
183
+    /**
184
+     * Create a new table
185
+     *
186
+     * @link http://pear.php.net/package/MDB2/docs/2.5.0b3/MDB2/MDB2_Driver_Manager_Common.html#methodcreateTable
187
+     * @param string $name Name of the table that should be created
188
+     * @param mixed[] $fields Associative array that contains the definition of each field of the new table
189
+     * @param mixed[] $options An associative array of table options
190
+     */
191
+    public function createTable($name, $fields, $options = array()) {
192
+        $db_type = $this->getAttribute(PDO::ATTR_DRIVER_NAME);
193
+        $query_fields = array();
194
+
195
+        foreach ($fields as $key => $arr) {
196
+            if ($arr['type'] == 'text' and isset($arr['length'])) {
197
+                $arr['type'] = 'VARCHAR';
198
+            }
199
+
200
+            if ($db_type == 'pgsql' && isset($arr['autoincrement'])) {
201
+                $line = $key . ' SERIAL';
202
+            } elseif ($db_type == 'pgsql' && $arr['type'] == 'integer') {
203
+                $line = $key . ' ' . $arr['type'];
204
+            } else {
205
+                $line = $key . ' ' . $arr['type'] . (isset($arr['length']) ? '(' . $arr['length'] . ')' : '');
206
+            }
207
+
208
+            if ($arr['notnull'] && $db_type != 'pgsql' && !isset($arr['autoincrement'])) {
209
+                $line .= ' NOT NULL';
210
+            }
211
+
212
+            if ($db_type == 'mysql' && isset($arr['autoincrement'])) {
213
+                $line .= ' AUTO_INCREMENT';
214
+            }
215
+
216
+            if ($arr['flags'] == 'primary_keynot_null') {
217
+                $line .= ' PRIMARY KEY';
218
+            }
219
+
220
+            $query_fields[] = $line;
221
+        }
222
+
223
+        $query = "CREATE TABLE $name (" . implode(', ', $query_fields) . ')';
224
+
225
+        if ($db_type == 'mysql') {
226
+            if (isset($options['type'])) {
227
+                $query .= ' ENGINE=' . $options['type'];
228
+            }
229
+
230
+            if (isset($options['charset'])) {
231
+                $query .= ' DEFAULT CHARSET=' . $options['charset'];
232
+            }
233
+
234
+            if (isset($options['collation'])) {
235
+                $query .= ' COLLATE=' . $options['collation'];
236
+            }
237
+        }
238
+
239
+        $this->exec($query);
240
+    }
241
+
242
+    /**
243
+     * Drop an existing table
244
+     *
245
+     * @link http://pear.php.net/package/MDB2/docs/2.5.0b3/MDB2/MDB2_Driver_Manager_Common.html#methoddropTable
246
+     * @param string $name name of the table that should be dropped
247
+     */
248
+    public function dropTable($name) {
249
+        $query = "DROP TABLE $name";
250
+        $this->exec($query);
251
+    }
252
+
253
+}

+ 64
- 0
poweradmin/poweradmin-2.1.8/inc/RecordLog.class.php View File

@@ -0,0 +1,64 @@
1
+<?php
2
+
3
+class RecordLog {
4
+
5
+    private $record_prior;
6
+    private $record_after;
7
+
8
+    private $record_changed = false;
9
+
10
+    public function log_prior($rid) {
11
+        $this->record_prior = $this->getRecord($rid);
12
+    }
13
+
14
+    public function log_after($rid) {
15
+        $this->record_after = $this->getRecord($rid);
16
+    }
17
+
18
+    private function getRecord($rid) {
19
+        return get_record_from_id($rid);
20
+    }
21
+
22
+    public function has_changed(array $record) {
23
+        // Arrays are assigned by copy.
24
+        // Copy arrays to avoid side effects caused by unset().
25
+        $record_copy = $record;
26
+        $record_prior_copy = $this->record_prior;
27
+
28
+        // Don't compare the 'change_date'
29
+        unset($record_copy["change_date"]);
30
+        unset($record_prior_copy["change_date"]);
31
+
32
+        // PowerDNS only searches for lowercase records
33
+        $record_copy['name'] = strtolower($record_copy['name']);
34
+        $record_prior_copy['name'] = strtolower($record_prior_copy['name']);
35
+
36
+        // Quotes are special for SPF and TXT
37
+        $type = $record_prior_copy['type'];
38
+        if ($type == "SPF" || $type == "TXT") {
39
+            $record_prior_copy['content'] = trim($record_prior_copy['content'], '"');
40
+            $record_copy['content'] = trim($record_copy['content'], '"');
41
+        }
42
+
43
+        // Make $record_copy and $record_prior_copy compatible
44
+        $record_copy['id'] = $record_copy['rid'];
45
+        $record_copy['domain_id'] = $record_copy['zid'];
46
+        unset($record_copy['zid']);
47
+        unset($record_copy['rid']);
48
+
49
+        // Do the comparison
50
+        $this->record_changed = ($record_copy != $record_prior_copy);
51
+        return $this->record_changed;
52
+    }
53
+
54
+    public function write() {
55
+        log_info(sprintf('client_ip:%s user:%s operation:edit_record'
56
+            . ' old_record_type:%s old_record:%s old_content:%s old_ttl:%s old_priority:%s'
57
+            . ' record_type:%s record:%s content:%s ttl:%s priority:%s',
58
+            $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
59
+            $this->record_prior['type'], $this->record_prior['name'],
60
+            $this->record_prior['content'], $this->record_prior['ttl'], $this->record_prior['prio'],
61
+            $this->record_after['type'], $this->record_after['name'],
62
+            $this->record_after['content'], $this->record_after['ttl'], $this->record_after['prio']));
63
+    }
64
+}

+ 36
- 0
poweradmin/poweradmin-2.1.8/inc/auth.inc.php View File

@@ -0,0 +1,36 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2009  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/*
25
+ * Only the first function gets called, so put the preferred functions first
26
+ *
27
+ */
28
+
29
+/** Authenticate Session
30
+ *
31
+ * Checks if user is logging in, logging out, or session expired and performs
32
+ * actions accordingly
33
+ *
34
+ * @return null
35
+ */
36
+add_listener('authenticate', 'authenticate_local');

+ 44
- 0
poweradmin/poweradmin-2.1.8/inc/benchmark.php View File

@@ -0,0 +1,44 @@
1
+<?php
2
+
3
+/**
4
+ * Benchmarking functions
5
+ *
6
+ * @package Poweradmin
7
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
8
+ * @copyright   2010-2017  Poweradmin Development Team
9
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
10
+ */
11
+$start_memory = memory_get_usage();
12
+$start_time = microtime(true);
13
+
14
+/** Get Human Readable Size
15
+ *
16
+ * Convert size to human readable units
17
+ *
18
+ * @param int $size Size to convert
19
+ *
20
+ * @return string $result Human readable size
21
+ */
22
+function get_human_readable_usage($size) {
23
+    $units = array('B', 'KB', 'MB', 'GB');
24
+    $result = $size . ' B';
25
+
26
+    if ($size < 1024)
27
+        return $result;
28
+
29
+    $index = (int)floor(log($size, 1024));
30
+    if ($index < sizeof($units)) {
31
+        $result = round($size / pow(1024, ($index)), 2) . ' ' . $units[$index];
32
+    }
33
+
34
+    return $result;
35
+}
36
+
37
+/** Print Current Memory and Runtime Stats
38
+ */
39
+function display_current_stats() {
40
+    global $start_time, $start_memory;
41
+    $memory_usage = get_human_readable_usage(memory_get_usage() - $start_memory);
42
+    $elapsed_time = sprintf("%.5f", microtime(true) - $start_time);
43
+    echo "Memory usage: " . $memory_usage . ", elapsed time: " . $elapsed_time;
44
+}

+ 79
- 0
poweradmin/poweradmin-2.1.8/inc/config-me.inc.php View File

@@ -0,0 +1,79 @@
1
+<?php
2
+
3
+/**
4
+ * Sample configuration file with default values
5
+ *
6
+ * @package     Poweradmin
7
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
8
+ * @copyright   2010-2017  Poweradmin Development Team
9
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
10
+ */
11
+// NOTE: Do not edit this file, otherwise it's very likely your changes
12
+// will be overwritten with an upgrade.
13
+// Instead, create the file "inc/config.inc.php" and set the variables you
14
+// want to set there. Your changes will override the defaults provided by us.
15
+// Better description of available configuration settings you can find here:
16
+// <https://github.com/poweradmin/poweradmin/wiki/Configuration-File>
17
+// Database settings
18
+$db_host = '';
19
+$db_port = '';
20
+$db_user = '';
21
+$db_pass = '';
22
+$db_name = '';
23
+$db_type = '';
24
+//$db_charset = 'latin1'; // or utf8
25
+//$db_file		= '';		# used only for SQLite, provide full path to database file
26
+//$db_debug		= false;	# show all SQL queries
27
+//$db_ssl_ca            = '';
28
+
29
+// Security settings
30
+// This should be changed upon install
31
+$session_key = 'p0w3r4dm1n';
32
+$password_encryption = 'md5'; // md5, md5salt or bcrypt
33
+//$password_encryption_cost = 12; // needed for bcrypt
34
+
35
+// Interface settings
36
+$iface_lang = 'en_EN';
37
+$iface_style = 'example';
38
+$iface_rowamount = 50;
39
+$iface_expire = 1800;
40
+$iface_zonelist_serial = false;
41
+$iface_title = 'Poweradmin';
42
+$iface_add_reverse_record = true;
43
+
44
+// Predefined DNS settings
45
+$dns_hostmaster = '';
46
+$dns_ns1 = '';
47
+$dns_ns2 = '';
48
+$dns_ttl = 86400;
49
+$dns_fancy = false;
50
+$dns_strict_tld_check = false;
51
+$dns_top_level_tld_check = false;     // Don't allow to create top level TLDs
52
+$dns_third_level_check = false;
53
+
54
+// Timezone settings
55
+// See <http://www.php.net/manual/en/timezones.php> for help.
56
+//$timezone		= 'UTC';
57
+
58
+// Logging settings
59
+// Syslog usage - writes authentication attempts to syslog
60
+// This facility could be used in combination with fail2ban to
61
+// ban IPs with break-in attempts
62
+$syslog_use = false;
63
+$syslog_ident = 'poweradmin';
64
+// On Windows usually only LOG_USER is available
65
+$syslog_facility = LOG_USER;
66
+
67
+// PowerDNSSEC settings
68
+$pdnssec_use = false;
69
+$pdnssec_command = '/usr/bin/pdnssec';
70
+
71
+// LDAP settings
72
+$ldap_use = false;
73
+$ldap_debug = false;
74
+$ldap_uri = 'ldap://domaincontroller.example.com';
75
+$ldap_basedn = 'OU=Users,DC=example,DC=com';
76
+$ldap_binddn = 'GROUP\lookupuser';
77
+$ldap_bindpw = 'some_password';
78
+$ldap_user_attribute = 'sAMAccountName';
79
+$ldap_proto = 3;

+ 79
- 0
poweradmin/poweradmin-2.1.8/inc/config.inc.php View File

@@ -0,0 +1,79 @@
1
+<?php
2
+
3
+/**
4
+ * Sample configuration file with default values
5
+ *
6
+ * @package     Poweradmin
7
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
8
+ * @copyright   2010-2017  Poweradmin Development Team
9
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
10
+ */
11
+// NOTE: Do not edit this file, otherwise it's very likely your changes
12
+// will be overwritten with an upgrade.
13
+// Instead, create the file "inc/config.inc.php" and set the variables you
14
+// want to set there. Your changes will override the defaults provided by us.
15
+// Better description of available configuration settings you can find here:
16
+// <https://github.com/poweradmin/poweradmin/wiki/Configuration-File>
17
+// Database settings
18
+$db_host = 'POSTGRES_HOST';
19
+//$db_port = '';
20
+$db_user = 'POSTGRES_PASSWORD';
21
+$db_pass = 'POSTGRES_PASSWORD';
22
+$db_name = 'POSTGRES_DB';
23
+$db_type = 'pgsql';
24
+$db_charset = 'utf8';
25
+//$db_file		= '';		# used only for SQLite, provide full path to database file
26
+//$db_debug		= false;	# show all SQL queries
27
+//$db_ssl_ca            = '';
28
+
29
+// Security settings
30
+// This should be changed upon install
31
+$session_key = 'SESSION_KEY';
32
+$password_encryption = 'md5'; // md5, md5salt or bcrypt
33
+//$password_encryption_cost = 12; // needed for bcrypt
34
+
35
+// Interface settings
36
+$iface_lang = 'en_EN';
37
+$iface_style = 'example';
38
+$iface_rowamount = 50;
39
+$iface_expire = 1800;
40
+$iface_zonelist_serial = false;
41
+$iface_title = 'Poweradmin';
42
+$iface_add_reverse_record = true;
43
+
44
+// Predefined DNS settings
45
+$dns_hostmaster = 'DNS_HOSTMASTER';
46
+$dns_ns1 = 'DNS_NS1';
47
+$dns_ns2 = 'DNS_NS2';
48
+$dns_ttl = DNS_TTL;
49
+$dns_fancy = false;
50
+$dns_strict_tld_check = false;
51
+$dns_top_level_tld_check = false;     // Don't allow to create top level TLDs
52
+$dns_third_level_check = false;
53
+
54
+// Timezone settings
55
+// See <http://www.php.net/manual/en/timezones.php> for help.
56
+//$timezone		= 'UTC';
57
+
58
+// Logging settings
59
+// Syslog usage - writes authentication attempts to syslog
60
+// This facility could be used in combination with fail2ban to
61
+// ban IPs with break-in attempts
62
+$syslog_use = false;
63
+$syslog_ident = 'poweradmin';
64
+// On Windows usually only LOG_USER is available
65
+$syslog_facility = LOG_USER;
66
+
67
+// PowerDNSSEC settings
68
+$pdnssec_use = true;
69
+$pdnssec_command = '/usr/bin/pdnsutil';
70
+
71
+// LDAP settings
72
+#$ldap_use = false;
73
+#$ldap_debug = false;
74
+#$ldap_uri = 'ldap://domaincontroller.example.com';
75
+#$ldap_basedn = 'OU=Users,DC=example,DC=com';
76
+#$ldap_binddn = 'GROUP\lookupuser';
77
+#$ldap_bindpw = 'some_password';
78
+#$ldap_user_attribute = 'sAMAccountName';
79
+#$ldap_proto = 3;

+ 188
- 0
poweradmin/poweradmin-2.1.8/inc/countrycodes.inc.php View File

@@ -0,0 +1,188 @@
1
+<?php
2
+
3
+$country_codes = array(
4
+    'aa' => 'Afar',
5
+    'ab' => 'Abkhaz',
6
+    'ae' => 'Avestan',
7
+    'af' => 'Afrikaans',
8
+    'ak' => 'Akan',
9
+    'am' => 'Amharic',
10
+    'an' => 'Aragonese',
11
+    'ar' => 'Arabic',
12
+    'as' => 'Assamese',
13
+    'av' => 'Avaric',
14
+    'ay' => 'Aymara',
15
+    'az' => 'Azerbaijani',
16
+    'ba' => 'Bashkir',
17
+    'be' => 'Belarusian',
18
+    'bg' => 'Bulgarian',
19
+    'bh' => 'Bihari',
20
+    'bi' => 'Bislama',
21
+    'bm' => 'Bambara',
22
+    'bn' => 'Bengali',
23
+    'bo' => 'Tibetan Standard, Tibetan, Central',
24
+    'br' => 'Breton',
25
+    'bs' => 'Bosnian',
26
+    'ca' => 'Catalan; Valencian',
27
+    'ce' => 'Chechen',
28
+    'ch' => 'Chamorro',
29
+    'co' => 'Corsican',
30
+    'cr' => 'Cree',
31
+    'cs' => 'Czech',
32
+    'cu' => 'Old Church Slavonic, Church Slavic, Church Slavonic, Old Bulgarian, Old Slavonic',
33
+    'cv' => 'Chuvash',
34
+    'cy' => 'Welsh',
35
+    'da' => 'Danish',
36
+    'de' => 'German',
37
+    'dv' => 'Divehi; Dhivehi; Maldivian;',
38
+    'dz' => 'Dzongkha',
39
+    'ee' => 'Ewe',
40
+    'el' => 'Greek, Modern',
41
+    'en' => 'English',
42
+    'eo' => 'Esperanto',
43
+    'es' => 'Spanish; Castilian',
44
+    'et' => 'Estonian',
45
+    'eu' => 'Basque',
46
+    'fa' => 'Persian',
47
+    'ff' => 'Fula; Fulah; Pulaar; Pular',
48
+    'fi' => 'Finnish',
49
+    'fj' => 'Fijian',
50
+    'fo' => 'Faroese',
51
+    'fr' => 'French',
52
+    'fy' => 'Western Frisian',
53
+    'ga' => 'Irish',
54
+    'gd' => 'Scottish Gaelic; Gaelic',
55
+    'gl' => 'Galician',
56
+    'gn' => 'GuaranÃ',
57
+    'gu' => 'Gujarati',
58
+    'gv' => 'Manx',
59
+    'ha' => 'Hausa',
60
+    'he' => 'Hebrew',
61
+    'hi' => 'Hindi',
62
+    'ho' => 'Hiri Motu',
63
+    'hr' => 'Croatian',
64
+    'ht' => 'Haitian; Haitian Creole',
65
+    'hu' => 'Hungarian',
66
+    'hy' => 'Armenian',
67
+    'hz' => 'Herero',
68
+    'ia' => 'Interlingua',
69
+    'id' => 'Indonesian',
70
+    'ie' => 'Interlingue',
71
+    'ig' => 'Igbo',
72
+    'ii' => 'Nuosu',
73
+    'ik' => 'Inupiaq',
74
+    'io' => 'Ido',
75
+    'is' => 'Icelandic',
76
+    'it' => 'Italian',
77
+    'iu' => 'Inuktitut',
78
+    'ja' => 'Japanese',
79
+    'jv' => 'Javanese',
80
+    'ka' => 'Georgian',
81
+    'kg' => 'Kongo',
82
+    'ki' => 'Kikuyu, Gikuyu',
83
+    'kj' => 'Kwanyama, Kuanyama',
84
+    'kk' => 'Kazakh',
85
+    'kl' => 'Kalaallisut, Greenlandic',
86
+    'km' => 'Khmer',
87
+    'kn' => 'Kannada',
88
+    'ko' => 'Korean',
89
+    'kr' => 'Kanuri',
90
+    'ks' => 'Kashmiri',
91
+    'ku' => 'Kurdish',
92
+    'kv' => 'Komi',
93
+    'kw' => 'Cornish',
94
+    'ky' => 'Kirghiz, Kyrgyz',
95
+    'la' => 'Latin',
96
+    'lb' => 'Luxembourgish, Letzeburgesch',
97
+    'lg' => 'Luganda',
98
+    'li' => 'Limburgish, Limburgan, Limburger',
99
+    'ln' => 'Lingala',
100
+    'lo' => 'Lao',
101
+    'lt' => 'Lithuanian',
102
+    'lu' => 'Luba-Katanga',
103
+    'lv' => 'Latvian',
104
+    'mg' => 'Malagasy',
105
+    'mh' => 'Marshallese',
106
+    'mi' => 'Maori',
107
+    'mk' => 'Macedonian',
108
+    'ml' => 'Malayalam',
109
+    'mn' => 'Mongolian',
110
+    'mr' => 'Marathi (Mara?hi)',
111
+    'ms' => 'Malay',
112
+    'mt' => 'Maltese',
113
+    'my' => 'Burmese',
114
+    'na' => 'Nauru',
115
+    'nb' => 'Norwegian Bokmål',
116
+    'nd' => 'North Ndebele',
117
+    'ne' => 'Nepali',
118
+    'ng' => 'Ndonga',
119
+    'nl' => 'Dutch',
120
+    'nn' => 'Norwegian Nynorsk',
121
+    'no' => 'Norwegian',
122
+    'nr' => 'South Ndebele',
123
+    'nv' => 'Navajo, Navaho',
124
+    'ny' => 'Chichewa; Chewa; Nyanja',
125
+    'oc' => 'Occitan',
126
+    'oj' => 'Ojibwe, Ojibwa',
127
+    'om' => 'Oromo',
128
+    'or' => 'Oriya',
129
+    'os' => 'Ossetian, Ossetic',
130
+    'pa' => 'Panjabi, Punjabi',
131
+    'pi' => 'Pali',
132
+    'pl' => 'Polish',
133
+    'ps' => 'Pashto, Pushto',
134
+    'pt' => 'Portuguese',
135
+    'qu' => 'Quechua',
136
+    'rm' => 'Romansh',
137
+    'rn' => 'Kirundi',
138
+    'ro' => 'Romanian, Moldavian, Moldovan',
139
+    'ru' => 'Russian',
140
+    'rw' => 'Kinyarwanda',
141
+    'sa' => 'Sanskrit',
142
+    'sc' => 'Sardinian',
143
+    'sd' => 'Sindhi',
144
+    'se' => 'Northern Sami',
145
+    'sg' => 'Sango',
146
+    'si' => 'Sinhala, Sinhalese',
147
+    'sk' => 'Slovak',
148
+    'sl' => 'Slovene',
149
+    'sm' => 'Samoan',
150
+    'sn' => 'Shona',
151
+    'so' => 'Somali',
152
+    'sq' => 'Albanian',
153
+    'sr' => 'Serbian',
154
+    'ss' => 'Swati',
155
+    'st' => 'Southern Sotho',
156
+    'su' => 'Sundanese',
157
+    'sv' => 'Swedish',
158
+    'sw' => 'Swahili',
159
+    'ta' => 'Tamil',
160
+    'te' => 'Telugu',
161
+    'tg' => 'Tajik',
162
+    'th' => 'Thai',
163
+    'ti' => 'Tigrinya',
164
+    'tk' => 'Turkmen',
165
+    'tl' => 'Tagalog',
166
+    'tn' => 'Tswana',
167
+    'to' => 'Tonga (Tonga Islands)',
168
+    'tr' => 'Turkish',
169
+    'ts' => 'Tsonga',
170
+    'tt' => 'Tatar',
171
+    'tw' => 'Twi',
172
+    'ty' => 'Tahitian',
173
+    'ug' => 'Uighur, Uyghur',
174
+    'uk' => 'Ukrainian',
175
+    'ur' => 'Urdu',
176
+    'uz' => 'Uzbek',
177
+    've' => 'Venda',
178
+    'vi' => 'Vietnamese',
179
+    'vo' => 'Volapük',
180
+    'wa' => 'Walloon',
181
+    'wo' => 'Wolof',
182
+    'xh' => 'Xhosa',
183
+    'yi' => 'Yiddish',
184
+    'yo' => 'Yoruba',
185
+    'za' => 'Zhuang, Chuang',
186
+    'zh' => 'Chinese',
187
+    'zu' => 'Zulu'
188
+);

+ 168
- 0
poweradmin/poweradmin-2.1.8/inc/database.inc.php View File

@@ -0,0 +1,168 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2009  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Database functions
26
+ *
27
+ * @package Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+
33
+if (class_exists('PDO', false)) {
34
+    include_once 'PDOLayer.php';
35
+} else {
36
+    die(error('You have to install PDO library!'));
37
+}
38
+
39
+/** Print database error message
40
+ *
41
+ * @param object $msg Database error object
42
+ */
43
+function dbError($msg) {
44
+    $debug = $msg->getDebugInfo();
45
+
46
+    if (preg_match("/Unknown column 'zone_templ_id'/", $debug)) {
47
+        $debug = ERR_DB_NO_DB_UPDATE;
48
+    }
49
+
50
+    echo "     <div class=\"error\">Error: " . $debug . "</div>\n";
51
+    include_once("footer.inc.php");
52
+    die();
53
+}
54
+
55
+/**  Connect to Database
56
+ *
57
+ * @return object $db Database object
58
+ */
59
+function dbConnect() {
60
+    // XXX: one day all globals will die, I promise
61
+    global $db_type;
62
+    global $db_user;
63
+    global $db_pass;
64
+    global $db_host;
65
+    global $db_port;
66
+    global $db_name;
67
+    global $db_charset;
68
+    global $db_file;
69
+    global $db_debug;
70
+    global $db_ssl_ca;
71
+
72
+    global $sql_regexp;
73
+
74
+    if (!(isset($db_type) && $db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'pgsql' || $db_type == 'sqlite' || $db_type == 'sqlite3' || $db_type == 'oci8')) {
75
+        include_once("header.inc.php");
76
+        error(ERR_DB_NO_DB_TYPE);
77
+        include_once("footer.inc.php");
78
+        exit;
79
+    }
80
+
81
+    if ($db_type != 'sqlite' && $db_type != 'sqlite3' && !(isset($db_user) && $db_user != "")) {
82
+        include_once("header.inc.php");
83
+        error(ERR_DB_NO_DB_USER);
84
+        include_once("footer.inc.php");
85
+        exit;
86
+    }
87
+
88
+    if ($db_type != 'sqlite' && $db_type != 'sqlite3' && !(isset($db_pass) && $db_pass != '')) {
89
+        include_once("header.inc.php");
90
+        error(ERR_DB_NO_DB_PASS);
91
+        include_once("footer.inc.php");
92
+        exit;
93
+    }
94
+
95
+    if ($db_type != 'sqlite' && $db_type != 'sqlite3' && !(isset($db_host) && $db_host != '')) {
96
+        include_once("header.inc.php");
97
+        error(ERR_DB_NO_DB_HOST);
98
+        include_once("footer.inc.php");
99
+        exit;
100
+    }
101
+
102
+    if ($db_type != 'sqlite' && $db_type != 'sqlite3' && !(isset($db_name) && $db_name != '')) {
103
+        include_once("header.inc.php");
104
+        error(ERR_DB_NO_DB_NAME);
105
+        include_once("footer.inc.php");
106
+        exit;
107
+    }
108
+
109
+    if ($db_type != 'sqlite' && $db_type != 'sqlite3' && !(isset($db_port)) || $db_port == '') {
110
+        if ($db_type == "mysql" || $db_type == "mysqli") {
111
+            $db_port = 3306;
112
+        } else if ($db_type == 'oci8') {
113
+            $db_port = 1521;
114
+        } else {
115
+            $db_port = 5432;
116
+        }
117
+    }
118
+
119
+    if (($db_type == 'sqlite' || $db_type == 'sqlite3') && (!(isset($db_file) && $db_file != ''))) {
120
+        include_once("header.inc.php");
121
+        error(ERR_DB_NO_DB_FILE);
122
+        include_once("footer.inc.php");
123
+        exit;
124
+    }
125
+
126
+    if ($db_type == 'sqlite' || $db_type == 'sqlite3') {
127
+        $dsn = "$db_type:$db_file";
128
+    } else {
129
+        if ($db_type == 'oci8') {
130
+            $db_name = '?service=' . $db_name;
131
+        }
132
+        $dsn = "$db_type:host=$db_host;port=$db_port;dbname=$db_name";
133
+    }
134
+
135
+    if ($db_type === 'mysql' && $db_charset === 'utf8') {
136
+        $dsn .= ';charset=utf8';
137
+    }
138
+
139
+    $db = new PDOLayer($dsn, $db_user, $db_pass);
140
+
141
+    // http://stackoverflow.com/a/4361485/567193
142
+    if ($db_type === 'mysql' && $db_charset === 'utf8' && version_compare(phpversion(), '5.3.6', '<')) {
143
+        $db->exec('set names utf8');
144
+    }
145
+
146
+    if (isset($db_debug) && $db_debug) {
147
+        $db->setOption('debug', 1);
148
+    }
149
+
150
+    /* erase info */
151
+    $dsn = '';
152
+
153
+    // Add support for regular expressions in both MySQL and PostgreSQL
154
+    if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'sqlite' || $db_type == 'sqlite3') {
155
+        $sql_regexp = "REGEXP";
156
+    } elseif ($db_type == "oci8") {
157
+        # TODO: what is regexp syntax in Oracle?
158
+        $sql_regexp = "";
159
+    } elseif ($db_type == "pgsql") {
160
+        $sql_regexp = "~";
161
+    } else {
162
+        include_once("header.inc.php");
163
+        error(ERR_DB_NO_DB_TYPE);
164
+        include_once("footer.inc.php");
165
+        exit;
166
+    }
167
+    return $db;
168
+}

+ 849
- 0
poweradmin/poweradmin-2.1.8/inc/dns.inc.php View File

@@ -0,0 +1,849 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2009  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * DNS functions
26
+ *
27
+ * @package Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+
33
+/** Validate DNS record input
34
+ *
35
+ * @param int $rid Record ID
36
+ * @param int $zid Zone ID
37
+ * @param string $type Record Type
38
+ * @param mixed $content content part of record
39
+ * @param mixed $name Name part of record
40
+ * @param mixed $prio Priority
41
+ * @param mixed $ttl TTL
42
+ *
43
+ * @return boolean true on success, false otherwise
44
+ */
45
+function validate_input($rid, $zid, $type, &$content, &$name, &$prio, &$ttl) {
46
+
47
+    $zone = get_zone_name_from_id($zid);    // TODO check for return
48
+
49
+    if (!endsWith(strtolower($zone), strtolower($name))) {
50
+        if (isset($name) && $name != "") {
51
+            $name = $name . "." . $zone;
52
+        } else {
53
+            $name = $zone;
54
+        }
55
+    }
56
+
57
+    switch ($type) {
58
+
59
+      case "A":
60
+        if (!is_valid_ipv4($content)) {
61
+          return false;
62
+        }
63
+        if (!is_valid_rr_cname_exists($name, $rid)) {
64
+          return false;
65
+        }
66
+        if (!is_valid_hostname_fqdn($name, 1)) {
67
+          return false;
68
+        }
69
+      break;
70
+
71
+      case "A6": // TODO: implement validation.
72
+      break;
73
+
74
+      case "AAAA":
75
+        if (!is_valid_ipv6($content)) {
76
+          return false;
77
+        }
78
+        if (!is_valid_rr_cname_exists($name, $rid)) {
79
+          return false;
80
+        }
81
+        if (!is_valid_hostname_fqdn($name, 1)) {
82
+          return false;
83
+        }
84
+      break;
85
+
86
+      case "AFSDB": // TODO: implement validation.
87
+      break;
88
+
89
+      case "ALIAS": // TODO: implement validation.
90
+      break;
91
+
92
+      case "CAA": // TODO: implement validation.
93
+      break;
94
+
95
+      case "CDNSKEY": // TODO: implement validation.
96
+      break;
97
+
98
+      case "CDS": // TODO: implement validation.
99
+      break;
100
+
101
+      case "CERT": // TODO: implement validation.
102
+      break;
103
+
104
+      case "CNAME":
105
+        if (!is_valid_rr_cname_name($name)) {
106
+          return false;
107
+        }
108
+        if (!is_valid_rr_cname_unique($name, $rid)) {
109
+          return false;
110
+        }
111
+        if (!is_valid_hostname_fqdn($name, 1)) {
112
+          return false;
113
+        }
114
+        if (!is_valid_hostname_fqdn($content, 0)) {
115
+          return false;
116
+        }
117
+        if (!is_not_empty_cname_rr($name, $zone)) {
118
+          return false;
119
+        }
120
+        break;
121
+
122
+      case 'DHCID': // TODO: implement validation
123
+      break;
124
+
125
+      case 'DLV': // TODO: implement validation
126
+      break;
127
+
128
+      case "DNAME": // TODO: implement validation.
129
+      break;
130
+
131
+      case 'DNSKEY': // TODO: implement validation
132
+      break;
133
+
134
+      case 'DS': // TODO: implement validation
135
+      break;
136
+
137
+      case 'EUI48': // TODO: implement validation
138
+      break;
139
+
140
+      case 'EUI64': // TODO: implement validation
141
+      break;
142
+
143
+      case "HINFO":
144
+        if (!is_valid_rr_hinfo_content($content)) {
145
+          return false;
146
+        }
147
+        if (!is_valid_hostname_fqdn($name, 1)) {
148
+          return false;
149
+        }
150
+      break;
151
+
152
+      case 'IPSECKEY': // TODO: implement validation
153
+      break;
154
+
155
+      case 'KEY': // TODO: implement validation
156
+      break;
157
+
158
+      case 'KX': // TODO: implement validation
159
+      break;
160
+
161
+      case "LOC":
162
+        if (!is_valid_loc($content)) {
163
+          return false;
164
+        }
165
+        if (!is_valid_hostname_fqdn($name, 1)) {
166
+          return false;
167
+        }
168
+      break;
169
+
170
+      case "MAILA": // TODO: implement validation.
171
+      break;
172
+
173
+      case "MAILB": // TODO: implement validation.
174
+      break;
175
+
176
+      case 'MINFO': // TODO: implement validation
177
+      break;
178
+
179
+      case 'MR': // TODO: implement validation
180
+      break;
181
+
182
+      case "MX":
183
+        if (!is_valid_hostname_fqdn($content, 0)) {
184
+          return false;
185
+        }
186
+        if (!is_valid_hostname_fqdn($name, 1)) {
187
+          return false;
188
+        }
189
+        if (!is_valid_non_alias_target($content)) {
190
+          return false;
191
+        }
192
+      break;
193
+
194
+      case 'NAPTR': // TODO: implement validation
195
+      break;
196
+
197
+      case "NS":
198
+        if (!is_valid_hostname_fqdn($content, 0)) {
199
+          return false;
200
+        }
201
+        if (!is_valid_hostname_fqdn($name, 1)) {
202
+          return false;
203
+        }
204
+        if (!is_valid_non_alias_target($content)) {
205
+          return false;
206
+        }
207
+      break;
208
+
209
+      case 'NSEC': // TODO: implement validation
210
+      break;
211
+
212
+      case 'NSEC3': // TODO: implement validation
213
+      break;
214
+
215
+      case 'NSEC3PARAM': // TODO: implement validation
216
+      break;
217
+
218
+      case "OPENPGPKEY": // TODO: implement validation.
219
+      break;
220
+
221
+      case 'OPT': // TODO: implement validation
222
+      break;
223
+
224
+      case "PTR":
225
+        if (!is_valid_hostname_fqdn($content, 0)) {
226
+          return false;
227
+        }
228
+        if (!is_valid_hostname_fqdn($name, 1)) {
229
+          return false;
230
+        }
231
+      break;
232
+
233
+      case 'RKEY': // TODO: implement validation
234
+      break;
235
+
236
+      case 'RP': // TODO: implement validation
237
+      break;
238
+
239
+      case 'RRSIG': // TODO: implement validation
240
+      break;
241
+
242
+      case "SIG": // TODO: implement validation.
243
+      break;
244
+
245
+      case "SOA":
246
+        if (!is_valid_rr_soa_name($name, $zone)) {
247
+          return false;
248
+        }
249
+        if (!is_valid_hostname_fqdn($name, 1)) {
250
+          return false;
251
+        }
252
+        if (!is_valid_rr_soa_content($content)) {
253
+          error(ERR_DNS_CONTENT);
254
+          return false;
255
+        }
256
+      break;
257
+
258
+      case "SPF":
259
+        if (!is_valid_spf($content)) {
260
+          return false;
261
+        }
262
+      break;
263
+
264
+      case "SRV":
265
+        if (!is_valid_rr_srv_name($name)) {
266
+          return false;
267
+        }
268
+        if (!is_valid_rr_srv_content($content)) {
269
+          return false;
270
+        }
271
+      break;
272
+
273
+      case 'SSHFP': // TODO: implement validation
274
+      break;
275
+
276
+      case "TKEY": // TODO: implement validation.
277
+      break;
278
+
279
+      case 'TLSA': // TODO: implement validation
280
+      break;
281
+
282
+      case 'TSIG': // TODO: implement validation
283
+      break;
284
+
285
+      case "TXT":
286
+        if (!is_valid_printable($name)) {
287
+          return false;
288
+        }
289
+        if (!is_valid_printable($content)) {
290
+          return false;
291
+        }
292
+      break;
293
+
294
+      case 'WKS': // TODO: implement validation
295
+      break;
296
+
297
+      case "MBOXFW": // TODO: implement validation
298
+      break;
299
+
300
+      case "URL": // TODO: implement validation.
301
+      break;
302
+
303
+      default:
304
+        error(ERR_DNS_RR_TYPE);
305
+        return false;
306
+    }
307
+
308
+    if (!is_valid_rr_prio($prio, $type)) {
309
+        return false;
310
+    }
311
+    if (!is_valid_rr_ttl($ttl)) {
312
+        return false;
313
+    }
314
+
315
+    return true;
316
+}
317
+
318
+/** Test if hostname is valid FQDN
319
+ *
320
+ * @param mixed $hostname Hostname string
321
+ * @param string $wildcard Hostname includes wildcard '*'
322
+ *
323
+ * @return boolean true if valid, false otherwise
324
+ */
325
+function is_valid_hostname_fqdn(&$hostname, $wildcard) {
326
+    global $dns_top_level_tld_check;
327
+    global $dns_strict_tld_check;
328
+    global $valid_tlds;
329
+
330
+    $hostname = preg_replace("/\.$/", "", $hostname);
331
+
332
+    # The full domain name may not exceed a total length of 253 characters.
333
+    if (strlen($hostname) > 253) {
334
+        error(ERR_DNS_HN_TOO_LONG);
335
+        return false;
336
+    }
337
+
338
+    $hostname_labels = explode('.', $hostname);
339
+    $label_count = count($hostname_labels);
340
+
341
+    if ($dns_top_level_tld_check && $label_count == 1) {
342
+        return false;
343
+    }
344
+
345
+    foreach ($hostname_labels as $hostname_label) {
346
+        if ($wildcard == 1 && !isset($first)) {
347
+            if (!preg_match('/^(\*|[\w-\/]+)$/', $hostname_label)) {
348
+                error(ERR_DNS_HN_INV_CHARS);
349
+                return false;
350
+            }
351
+            $first = 1;
352
+        } else {
353
+            if (!preg_match('/^[\w-\/]+$/', $hostname_label)) {
354
+                error(ERR_DNS_HN_INV_CHARS);
355
+                return false;
356
+            }
357
+        }
358
+        if (substr($hostname_label, 0, 1) == "-") {
359
+            error(ERR_DNS_HN_DASH);
360
+            return false;
361
+        }
362
+        if (substr($hostname_label, -1, 1) == "-") {
363
+            error(ERR_DNS_HN_DASH);
364
+            return false;
365
+        }
366
+        if (strlen($hostname_label) < 1 || strlen($hostname_label) > 63) {
367
+            error(ERR_DNS_HN_LENGTH);
368
+            return false;
369
+        }
370
+    }
371
+
372
+    if ($hostname_labels[$label_count - 1] == "arpa" && (substr_count($hostname_labels[0], "/") == 1 XOR substr_count($hostname_labels[1], "/") == 1)) {
373
+        if (substr_count($hostname_labels[0], "/") == 1) {
374
+            $array = explode("/", $hostname_labels[0]);
375
+        } else {
376
+            $array = explode("/", $hostname_labels[1]);
377
+        }
378
+        if (count($array) != 2) {
379
+            error(ERR_DNS_HOSTNAME);
380
+            return false;
381
+        }
382
+        if (!is_numeric($array[0]) || $array[0] < 0 || $array[0] > 255) {
383
+            error(ERR_DNS_HOSTNAME);
384
+            return false;
385
+        }
386
+        if (!is_numeric($array[1]) || $array[1] < 25 || $array[1] > 31) {
387
+            error(ERR_DNS_HOSTNAME);
388
+            return false;
389
+        }
390
+    } else {
391
+        if (substr_count($hostname, "/") > 0) {
392
+            error(ERR_DNS_HN_SLASH);
393
+            return false;
394
+        }
395
+    }
396
+
397
+    if ($dns_strict_tld_check && !in_array(strtolower($hostname_labels[$label_count - 1]), $valid_tlds)) {
398
+        error(ERR_DNS_INV_TLD);
399
+        return false;
400
+    }
401
+
402
+    return true;
403
+}
404
+
405
+/** Test if IPv4 address is valid
406
+ *
407
+ * @param string $ipv4 IPv4 address string
408
+ * @param boolean $answer print error if true
409
+ * [default=true]
410
+ *
411
+ * @return boolean true if valid, false otherwise
412
+ */
413
+function is_valid_ipv4($ipv4, $answer = true) {
414
+
415
+  if(filter_var($ipv4, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === FALSE) {
416
+    if($answer) {
417
+      error(ERR_DNS_IPV4);
418
+    }
419
+    return false;
420
+  }
421
+
422
+  return true;
423
+}
424
+
425
+/** Test if IPv6 address is valid
426
+ *
427
+ * @param string $ipv6 IPv6 address string
428
+ * @param boolean $answer print error if true
429
+ * [default=true]
430
+ *
431
+ * @return boolean true if valid, false otherwise
432
+ */
433
+function is_valid_ipv6($ipv6, $answer = true) {
434
+
435
+  if(filter_var($ipv6, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === FALSE) {
436
+    if($answer) {
437
+      error(ERR_DNS_IPV6);
438
+    }
439
+    return false;
440
+  }
441
+
442
+  return true;
443
+}
444
+
445
+/** Test if multiple IP addresses are valid
446
+ *
447
+ *  Takes a string of comma seperated IP addresses and tests validity
448
+ *
449
+ *  @param string $ips Comma seperated IP addresses
450
+ *
451
+ *  @return boolean true if valid, false otherwise
452
+ */
453
+function are_multipe_valid_ips($ips) {
454
+
455
+// multiple master NS-records are permitted and must be separated by ,
456
+// eg. "192.0.0.1, 192.0.0.2, 2001:1::1"
457
+
458
+    $are_valid = false;
459
+    $multiple_ips = explode(",", $ips);
460
+    if (is_array($multiple_ips)) {
461
+        foreach ($multiple_ips as $m_ip) {
462
+            $trimmed_ip = trim($m_ip);
463
+            if (is_valid_ipv4($trimmed_ip, false) || is_valid_ipv6($trimmed_ip, true)) {
464
+                $are_valid = true;
465
+            } else {
466
+                // as soon there is an invalid ip-addr
467
+                // exit and return false
468
+                echo "hin:=$trimmed_ip=";
469
+                return false;
470
+            }
471
+        }
472
+    } elseif (is_valid_ipv4($ips) || is_valid_ipv6($ips)) {
473
+        $are_valid = true;
474
+    }
475
+    if ($are_valid) {
476
+        return true;
477
+    } else {
478
+        return false;
479
+    }
480
+}
481
+
482
+/** Test if string is printable
483
+ *
484
+ * @param string $string string
485
+ *
486
+ * @return boolean true if valid, false otherwise
487
+ */
488
+function is_valid_printable($string) {
489
+    if (!preg_match('/^[[:print:]]+$/', trim($string))) {
490
+        error(ERR_DNS_PRINTABLE);
491
+        return false;
492
+    }
493
+    return true;
494
+}
495
+
496
+/** Test if CNAME is valid
497
+ *
498
+ * Check if any MX or NS entries exist which invalidated CNAME
499
+ *
500
+ * @param string $name CNAME to lookup
501
+ *
502
+ * @return boolean true if valid, false otherwise
503
+ */
504
+function is_valid_rr_cname_name($name) {
505
+    global $db;
506
+
507
+    $query = "SELECT id FROM records
508
+			WHERE content = " . $db->quote($name, 'text') . "
509
+			AND (type = " . $db->quote('MX', 'text') . " OR type = " . $db->quote('NS', 'text') . ")";
510
+
511
+    $response = $db->queryOne($query);
512
+
513
+    if (!empty($response)) {
514
+        error(ERR_DNS_CNAME);
515
+        return false;
516
+    }
517
+
518
+    return true;
519
+}
520
+
521
+/** Check if CNAME already exists
522
+ *
523
+ * @param string $name CNAME
524
+ * @param int $rid Record ID
525
+ *
526
+ * @return boolean true if non-existant, false if exists
527
+ */
528
+function is_valid_rr_cname_exists($name, $rid) {
529
+    global $db;
530
+
531
+    $where = ($rid > 0 ? " AND id != " . $db->quote($rid, 'integer') : '');
532
+    $query = "SELECT id FROM records
533
+                        WHERE name = " . $db->quote($name, 'text') . $where . "
534
+                        AND TYPE = 'CNAME'";
535
+
536
+    $response = $db->queryOne($query);
537
+    if ($response) {
538
+        error(ERR_DNS_CNAME_EXISTS);
539
+        return false;
540
+    }
541
+    return true;
542
+}
543
+
544
+/** Check if CNAME is unique (doesn't overlap A/AAAA)
545
+ *
546
+ * @param string $name CNAME
547
+ * @param string $rid Record ID
548
+ *
549
+ * @return boolean true if unique, false if duplicate
550
+ */
551
+function is_valid_rr_cname_unique($name, $rid) {
552
+    global $db;
553
+
554
+    $where = ($rid > 0 ? " AND id != " . $db->quote($rid, 'integer') : '');
555
+    $query = "SELECT id FROM records
556
+                        WHERE name = " . $db->quote($name, 'text') . $where . "
557
+                        AND TYPE IN ('A', 'AAAA', 'CNAME')";
558
+
559
+    $response = $db->queryOne($query);
560
+    if ($response) {
561
+        error(ERR_DNS_CNAME_UNIQUE);
562
+        return false;
563
+    }
564
+    return true;
565
+}
566
+
567
+/**
568
+ * Check that the zone does not have a empty CNAME RR
569
+ *
570
+ * @param string $name
571
+ * @param string $zone
572
+ */
573
+function is_not_empty_cname_rr($name, $zone) {
574
+
575
+    if ($name == $zone) {
576
+        error(ERR_DNS_CNAME_EMPTY);
577
+        return false;
578
+    }
579
+    return true;
580
+}
581
+
582
+/** Check if target is not a CNAME
583
+ *
584
+ * @param string $target target to check
585
+ *
586
+ * @return boolean true if not alias, false if CNAME exists
587
+ */
588
+function is_valid_non_alias_target($target) {
589
+    global $db;
590
+
591
+    $query = "SELECT id FROM records
592
+			WHERE name = " . $db->quote($target, 'text') . "
593
+			AND TYPE = " . $db->quote('CNAME', 'text');
594
+
595
+    $response = $db->queryOne($query);
596
+    if ($response) {
597
+        error(ERR_DNS_NON_ALIAS_TARGET);
598
+        return false;
599
+    }
600
+    return true;
601
+}
602
+
603
+/** Check if HINFO content is valid
604
+ *
605
+ * @param string $content HINFO record content
606
+ *
607
+ * @return boolean true if valid, false otherwise
608
+ */
609
+function is_valid_rr_hinfo_content($content) {
610
+
611
+    if ($content[0] == "\"") {
612
+        $fields = preg_split('/(?<=") /', $content, 2);
613
+    } else {
614
+        $fields = preg_split('/ /', $content, 2);
615
+    }
616
+
617
+    for ($i = 0; ($i < 2); $i++) {
618
+        if (!preg_match("/^([^\s]{1,1000})|\"([^\"]{1,998}\")$/i", $fields[$i])) {
619
+            error(ERR_DNS_HINFO_INV_CONTENT);
620
+            return false;
621
+        }
622
+    }
623
+
624
+    return true;
625
+}
626
+
627
+/** Check if SOA content is valid
628
+ *
629
+ * @param mixed $content SOA record content
630
+ *
631
+ * @return boolean true if valid, false otherwise
632
+ */
633
+function is_valid_rr_soa_content(&$content) {
634
+
635
+    $fields = preg_split("/\s+/", trim($content));
636
+    $field_count = count($fields);
637
+
638
+    if ($field_count == 0 || $field_count > 7) {
639
+        return false;
640
+    } else {
641
+        if (!is_valid_hostname_fqdn($fields[0], 0) || preg_match('/\.arpa\.?$/', $fields[0])) {
642
+            return false;
643
+        }
644
+        $final_soa = $fields[0];
645
+
646
+        if (isset($fields[1])) {
647
+            $addr_input = $fields[1];
648
+        } else {
649
+            global $dns_hostmaster;
650
+            $addr_input = $dns_hostmaster;
651
+        }
652
+        if (!preg_match("/@/", $addr_input)) {
653
+            $addr_input = preg_split('/(?<!\\\)\./', $addr_input, 2);
654
+            $addr_to_check = str_replace("\\", "", $addr_input[0]) . "@" . $addr_input[1];
655
+        } else {
656
+            $addr_to_check = $addr_input;
657
+        }
658
+
659
+        if (!is_valid_email($addr_to_check)) {
660
+            return false;
661
+        } else {
662
+            $addr_final = explode('@', $addr_to_check, 2);
663
+            $final_soa .= " " . str_replace(".", "\\.", $addr_final[0]) . "." . $addr_final[1];
664
+        }
665
+
666
+        if (isset($fields[2])) {
667
+            if (!is_numeric($fields[2])) {
668
+                return false;
669
+            }
670
+            $final_soa .= " " . $fields[2];
671
+        } else {
672
+            $final_soa .= " 0";
673
+        }
674
+
675
+        if ($field_count != 7) {
676
+            return false;
677
+        } else {
678
+            for ($i = 3; ($i < 7); $i++) {
679
+                if (!is_numeric($fields[$i])) {
680
+                    return false;
681
+                } else {
682
+                    $final_soa .= " " . $fields[$i];
683
+                }
684
+            }
685
+        }
686
+    }
687
+    $content = $final_soa;
688
+    return true;
689
+}
690
+
691
+/** Check if SOA name is valid
692
+ *
693
+ * Checks if SOA name = zone name
694
+ *
695
+ * @param string $name SOA name
696
+ * @param string $zone Zone name
697
+ *
698
+ * @return boolean true if valid, false otherwise
699
+ */
700
+function is_valid_rr_soa_name($name, $zone) {
701
+    if ($name != $zone) {
702
+        error(ERR_DNS_SOA_NAME);
703
+        return false;
704
+    }
705
+    return true;
706
+}
707
+
708
+/** Check if Priority is valid
709
+ *
710
+ * Check if MX or SRV priority is within range, otherwise set to 0
711
+ *
712
+ * @param mixed $prio Priority
713
+ * @param string $type Record type
714
+ *
715
+ * @return boolean true if valid, false otherwise
716
+ */
717
+function is_valid_rr_prio(&$prio, $type) {
718
+    if ($type == "MX" || $type == "SRV") {
719
+        if (!is_numeric($prio) || $prio < 0 || $prio > 65535) {
720
+            error(ERR_DNS_INV_PRIO);
721
+            return false;
722
+        }
723
+    } else {
724
+        $prio = 0;
725
+    }
726
+
727
+    return true;
728
+}
729
+
730
+/** Check if SRV name is valid
731
+ *
732
+ * @param mixed $name SRV name
733
+ *
734
+ * @return boolean true if valid, false otherwise
735
+ */
736
+function is_valid_rr_srv_name(&$name) {
737
+
738
+    if (strlen($name) > 255) {
739
+        error(ERR_DNS_HN_TOO_LONG);
740
+        return false;
741
+    }
742
+
743
+    $fields = explode('.', $name, 3);
744
+    if (!preg_match('/^_[\w-]+$/i', $fields[0])) {
745
+        error(ERR_DNS_SRV_NAME_SERVICE, $name);
746
+        return false;
747
+    }
748
+    if (!preg_match('/^_[\w]+$/i', $fields[1])) {
749
+        error(ERR_DNS_SRV_NAME_PROTO, $name);
750
+        return false;
751
+    }
752
+    if (!is_valid_hostname_fqdn($fields[2], 0)) {
753
+        error(ERR_DNS_SRV_NAME, $name);
754
+        return false;
755
+    }
756
+    $name = join('.', $fields);
757
+    return true;
758
+}
759
+
760
+/** Check if SRV content is valid
761
+ *
762
+ * @param mixed $content SRV content
763
+ *
764
+ * @return boolean true if valid, false otherwise
765
+ */
766
+function is_valid_rr_srv_content(&$content) {
767
+    $fields = preg_split("/\s+/", trim($content), 3);
768
+    if (!is_numeric($fields[0]) || $fields[0] < 0 || $fields[0] > 65535) {
769
+        error(ERR_DNS_SRV_WGHT, $name);
770
+        return false;
771
+    }
772
+    if (!is_numeric($fields[1]) || $fields[1] < 0 || $fields[1] > 65535) {
773
+        error(ERR_DNS_SRV_PORT, $name);
774
+        return false;
775
+    }
776
+    if ($fields[2] == "" || ($fields[2] != "." && !is_valid_hostname_fqdn($fields[2], 0))) {
777
+        error(ERR_DNS_SRV_TRGT, $name);
778
+        return false;
779
+    }
780
+    $content = join(' ', $fields);
781
+    return true;
782
+}
783
+
784
+/** Check if TTL is valid and within range
785
+ *
786
+ * @param int $ttl TTL
787
+ *
788
+ * @return boolean true if valid,false otherwise
789
+ */
790
+function is_valid_rr_ttl(&$ttl) {
791
+
792
+    if (!isset($ttl) || $ttl == "") {
793
+        global $dns_ttl;
794
+        $ttl = $dns_ttl;
795
+    }
796
+
797
+    if (!is_numeric($ttl) || $ttl < 0 || $ttl > 2147483647) {
798
+        error(ERR_DNS_INV_TTL);
799
+        return false;
800
+    }
801
+
802
+    return true;
803
+}
804
+
805
+/** Check if search string is valid
806
+ *
807
+ * @param string $search_string search string
808
+ *
809
+ * @return boolean true if valid, false otherwise
810
+ */
811
+function is_valid_search($search_string) {
812
+
813
+    // Only allow for alphanumeric, numeric, dot, dash, underscore and
814
+    // percent in search string. The last two are wildcards for SQL.
815
+    // Needs extension probably for more usual record types.
816
+
817
+    return preg_match('/^[a-z0-9.\-%_]+$/i', $search_string);
818
+}
819
+
820
+/** Check if SPF content is valid
821
+ *
822
+ * @param string $content SPF content
823
+ *
824
+ * @return boolean true if valid, false otherwise
825
+ */
826
+function is_valid_spf($content) {
827
+    //Regex from http://www.schlitt.net/spf/tests/spf_record_regexp-03.txt
828
+    $regex = "^[Vv]=[Ss][Pp][Ff]1( +([-+?~]?([Aa][Ll][Ll]|[Ii][Nn][Cc][Ll][Uu][Dd][Ee]:(%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}|%%|%_|%-|[!-$&-~])*(\.([A-Za-z]|[A-Za-z]([-0-9A-Za-z]?)*[0-9A-Za-z])|%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\})|[Aa](:(%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}|%%|%_|%-|[!-$&-~])*(\.([A-Za-z]|[A-Za-z]([-0-9A-Za-z]?)*[0-9A-Za-z])|%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}))?((/([1-9]|1[0-9]|2[0-9]|3[0-2]))?(//([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8]))?)?|[Mm][Xx](:(%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}|%%|%_|%-|[!-$&-~])*(\.([A-Za-z]|[A-Za-z]([-0-9A-Za-z]?)*[0-9A-Za-z])|%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}))?((/([1-9]|1[0-9]|2[0-9]|3[0-2]))?(//([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8]))?)?|[Pp][Tt][Rr](:(%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}|%%|%_|%-|[!-$&-~])*(\.([A-Za-z]|[A-Za-z]([-0-9A-Za-z]?)*[0-9A-Za-z])|%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}))?|[Ii][Pp]4:([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(/([1-9]|1[0-9]|2[0-9]|3[0-2]))?|[Ii][Pp]6:(::|([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|([0-9A-Fa-f]{1,4}:){1,8}:|([0-9A-Fa-f]{1,4}:){7}:[0-9A-Fa-f]{1,4}|([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}){1,2}|([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,3}|([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,4}|([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,5}|([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,6}|[0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,7}|:(:[0-9A-Fa-f]{1,4}){1,8}|([0-9A-Fa-f]{1,4}:){6}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([0-9A-Fa-f]{1,4}:){6}:([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|[0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|::([0-9A-Fa-f]{1,4}:){0,6}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(/([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8]))?|[Ee][Xx][Ii][Ss][Tt][Ss]:(%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}|%%|%_|%-|[!-$&-~])*(\.([A-Za-z]|[A-Za-z]([-0-9A-Za-z]?)*[0-9A-Za-z])|%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}))|[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]=(%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}|%%|%_|%-|[!-$&-~])*(\.([A-Za-z]|[A-Za-z]([-0-9A-Za-z]?)*[0-9A-Za-z])|%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\})|[Ee][Xx][Pp]=(%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}|%%|%_|%-|[!-$&-~])*(\.([A-Za-z]|[A-Za-z]([-0-9A-Za-z]?)*[0-9A-Za-z])|%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\})|[A-Za-z][-.0-9A-Z_a-z]*=(%\{[CDHILOPR-Tcdhilopr-t]([1-9][0-9]?|10[0-9]|11[0-9]|12[0-8])?[Rr]?[+-/=_]*\}|%%|%_|%-|[!-$&-~])*))* *$^";
829
+    if (!preg_match($regex, $content)) {
830
+        return false;
831
+    } else {
832
+        return true;
833
+    }
834
+}
835
+
836
+/** Check if LOC content is valid
837
+ *
838
+ * @param string $content LOC content
839
+ *
840
+ * @return boolean true if valid, false otherwise
841
+ */
842
+function is_valid_loc($content) {
843
+    $regex = "^(90|[1-8]\d|0?\d)( ([1-5]\d|0?\d)( ([1-5]\d|0?\d)(\.\d{1,3})?)?)? [NS] (180|1[0-7]\d|[1-9]\d|0?\d)( ([1-5]\d|0?\d)( ([1-5]\d|0?\d)(\.\d{1,3})?)?)? [EW] (-(100000(\.00)?|\d{1,5}(\.\d\d)?)|([1-3]?\d{1,7}(\.\d\d)?|4([01][0-9]{6}|2([0-7][0-9]{5}|8([0-3][0-9]{4}|4([0-8][0-9]{3}|9([0-5][0-9]{2}|6([0-6][0-9]|7[01]))))))(\.\d\d)?|42849672(\.([0-8]\d|9[0-5]))?))[m]?( (\d{1,7}|[1-8]\d{7})(\.\d\d)?[m]?){0,3}$^";
844
+    if (!preg_match($regex, $content)) {
845
+        return false;
846
+    } else {
847
+        return true;
848
+    }
849
+}

+ 617
- 0
poweradmin/poweradmin-2.1.8/inc/dnssec.inc.php View File

@@ -0,0 +1,617 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2009  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * DNSSEC functions
26
+ *
27
+ * @package Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+
33
+/** Check if it's possible to execute dnssec command
34
+ *
35
+ * @return boolean true on success, false on failure
36
+ */
37
+function dnssec_is_pdnssec_callable() {
38
+    global $pdnssec_command;
39
+
40
+    if (!function_exists('exec')) {
41
+        error(ERR_EXEC_NOT_ALLOWED);
42
+        return false;
43
+    }
44
+
45
+    if (!file_exists($pdnssec_command) || !is_executable($pdnssec_command)) {
46
+        error(ERR_EXEC_PDNSSEC);
47
+        return false;
48
+    }
49
+
50
+    return true;
51
+}
52
+
53
+/** Execute dnssec utility
54
+ *
55
+ * @param string $command Command name
56
+ * @param string $args Command arguments
57
+ *
58
+ * @return mixed[] Array with output from command execution and error code
59
+ */
60
+function dnssec_call_pdnssec($command, $args) {
61
+    global $pdnssec_command;
62
+    $output = '';
63
+    $return_code = -1;
64
+
65
+    if (!dnssec_is_pdnssec_callable()) {
66
+        return array($output, $return_code);
67
+    }
68
+
69
+    $command = join(' ', array(
70
+        $pdnssec_command,
71
+        $command,
72
+        $args)
73
+    );
74
+
75
+    exec($command, $output, $return_code);
76
+
77
+    return array($output, $return_code);
78
+}
79
+
80
+/** Execute PDNSSEC rectify-zone command for Domain ID
81
+ *
82
+ * If a Domain is dnssec enabled, or uses features as
83
+ * e.g. ALSO-NOTIFY, ALLOW-AXFR-FROM, TSIG-ALLOW-AXFR
84
+ * following has to be executed
85
+ * pdnssec rectify-zone $domain
86
+ *
87
+ * @param int $domain_id Domain ID
88
+ *
89
+ * @return boolean true on success, false on failure or unnecessary
90
+ */
91
+function dnssec_rectify_zone($domain_id) {
92
+    global $db;
93
+    global $pdnssec_command;
94
+
95
+    $output = array();
96
+
97
+    /* if pdnssec_command is set we perform ``pdnssec rectify-zone $domain`` on all zones,
98
+     * as pdns needs the "auth" column for all zones if dnssec is enabled
99
+     *
100
+     * If there is any entry at domainmetadata table for this domain,
101
+     * it is an error if pdnssec_command is not set */
102
+    $query = "SELECT COUNT(id) FROM domainmetadata WHERE domain_id = " . $db->quote($domain_id, 'integer');
103
+    $count = $db->queryOne($query);
104
+
105
+    if (PEAR::isError($count)) {
106
+        error($count->getMessage());
107
+        return false;
108
+    }
109
+
110
+    if (isset($pdnssec_command)) {
111
+        $domain = get_zone_name_from_id($domain_id);
112
+        $command = $pdnssec_command . " rectify-zone " . $domain;
113
+
114
+        if (!dnssec_is_pdnssec_callable()) {
115
+            return false;
116
+        }
117
+
118
+        exec($command, $output, $return_code);
119
+        if ($return_code != 0) {
120
+            error(ERR_EXEC_PDNSSEC_RECTIFY_ZONE);
121
+            return false;
122
+        }
123
+
124
+        return true;
125
+    } else if ($count >= 1) {
126
+        error(ERR_EXEC_PDNSSEC);
127
+        return false;
128
+    }
129
+
130
+    return false;
131
+}
132
+
133
+/** Execute PDNSSEC secure-zone command for Domain Name
134
+ *
135
+ * @param string $domain_name Domain Name
136
+ *
137
+ * @return boolean true on success, false on failure or unnecessary
138
+ */
139
+function dnssec_secure_zone($domain_name) {
140
+    $call_result = dnssec_call_pdnssec('secure-zone', $domain_name);
141
+    $return_code = $call_result[1];
142
+
143
+    if ($return_code != 0) {
144
+        error(ERR_EXEC_PDNSSEC_SECURE_ZONE);
145
+        return false;
146
+    }
147
+
148
+    log_info(sprintf('client_ip:%s user:%s operation:dnssec_secure_zone zone:%s',
149
+        $_SERVER['REMOTE_ADDR'], $_SESSION['userlogin'], $domain_name));
150
+
151
+    return true;
152
+}
153
+
154
+/** Execute PDNSSEC disable-dnssec command for Domain Name
155
+ *
156
+ * @param string $domain_name Domain Name
157
+ *
158
+ * @return boolean true on success, false on failure or unnecessary
159
+ */
160
+function dnssec_unsecure_zone($domain_name) {
161
+    $call_result = dnssec_call_pdnssec('disable-dnssec', $domain_name);
162
+    $return_code = $call_result[1];
163
+
164
+    if ($return_code != 0) {
165
+        error(ERR_EXEC_PDNSSEC_DISABLE_ZONE);
166
+        return false;
167
+    }
168
+
169
+    log_info(sprintf('client_ip:%s user:%s operation:dnssec_unsecure_zone zone:%s',
170
+        $_SERVER['REMOTE_ADDR'], $_SESSION['userlogin'], $domain_name));
171
+
172
+    return true;
173
+}
174
+
175
+/** Check if zone is secured
176
+ *
177
+ * @param string $domain_name Domain Name
178
+ *
179
+ * @return boolean true on success, false on failure
180
+ */
181
+function dnssec_is_zone_secured($domain_name) {
182
+    global $db;
183
+    $query = $db->prepare("SELECT
184
+                  COUNT(cryptokeys.id) AS active_keys,
185
+                  COUNT(domainmetadata.id) > 0 AS presigned
186
+                  FROM domains
187
+                  LEFT JOIN cryptokeys ON domains.id = cryptokeys.domain_id
188
+                  LEFT JOIN domainmetadata ON domains.id = domainmetadata.domain_id AND domainmetadata.kind = 'PRESIGNED'
189
+                  WHERE domains.name = ?
190
+                  GROUP BY domains.id
191
+        ");
192
+    $query->execute(array($domain_name));
193
+    $row = $query->fetch();
194
+    return $row['active_keys'] > 0 || $row['presigned'];
195
+}
196
+
197
+/** Use presigned RRSIGs from storage
198
+ *
199
+ * @param string $domain_name Domain Name
200
+ */
201
+function dnssec_set_nsec3($domain_name) {
202
+    dnssec_call_pdnssec('set-nsec3', $domain_name);
203
+    log_info(sprintf('client_ip:%s user:%s operation:dnssec_set_nsec3 zone:%s',
204
+        $_SERVER['REMOTE_ADDR'], $_SESSION['userlogin'], $domain_name));
205
+}
206
+
207
+/** Switch back to NSEC
208
+ *
209
+ * @param string $domain_name Domain Name
210
+ */
211
+function dnssec_unset_nsec3($domain_name) {
212
+    dnssec_call_pdnssec('unset-nsec3', $domain_name);
213
+    log_info(sprintf('client_ip:%s user:%s operation:dnssec_unset_nsec3 zone:%s',
214
+        $_SERVER['REMOTE_ADDR'], $_SESSION['userlogin'], $domain_name));
215
+}
216
+
217
+/** Return nsec type
218
+ *
219
+ * @param string $domain_name Domain Name
220
+ *
221
+ * @return string nsec or nsec3
222
+ */
223
+function dnssec_get_nsec_type($domain_name) {
224
+    $call_result = dnssec_call_pdnssec('show-zone', $domain_name);
225
+    $output = $call_result[0];
226
+
227
+    return ($output[0] == 'Zone has NSEC semantics' ? 'nsec' : 'nsec3');
228
+}
229
+
230
+/** Use presigned RRSIGs from storage
231
+ *
232
+ * @param string $domain_name Domain Name
233
+ */
234
+function dnssec_set_presigned($domain_name) {
235
+    dnssec_call_pdnssec('set-presigned', $domain_name);
236
+    log_info(sprintf('client_ip:%s user:%s operation:dnssec_set_presigned zone:%s',
237
+        $_SERVER['REMOTE_ADDR'], $_SESSION['userlogin'], $domain_name));
238
+}
239
+
240
+/** No longer use presigned RRSIGs
241
+ *
242
+ * @param string $domain_name Domain Name
243
+ */
244
+function dnssec_unset_presigned($domain_name) {
245
+    dnssec_call_pdnssec('unset-presigned', $domain_name);
246
+    log_info(sprintf('client_ip:%s user:%s operation:unset-presigned zone:%s',
247
+        $_SERVER['REMOTE_ADDR'], $_SESSION['userlogin'], $domain_name));
248
+}
249
+
250
+/** Return presigned status
251
+ *
252
+ * @param string $domain_name Domain Name
253
+ *
254
+ * @return boolean true if zone is presigned, otherwise false
255
+ */
256
+function dnssec_get_presigned_status($domain_name) {
257
+    $call_result = dnssec_call_pdnssec('show-zone', $domain_name);
258
+    $output = $call_result[0];
259
+
260
+    return ($output[1] == 'Zone is presigned' ? true : false);
261
+}
262
+
263
+/** Rectify all zones.
264
+ */
265
+function dnssec_rectify_all_zones() {
266
+    dnssec_call_pdnssec('rectify-all-zones', '');
267
+    log_info(sprintf('client_ip:%s user:%s operation:dnssec_rectify_all_zones',
268
+        $_SERVER['REMOTE_ADDR'], $_SESSION['userlogin']));
269
+}
270
+
271
+/** Return DS records
272
+ *
273
+ * @param string $domain_name Domain Name
274
+ *
275
+ * @return mixed[] DS records
276
+ */
277
+function dnssec_get_ds_records($domain_name) {
278
+    $call_result = dnssec_call_pdnssec('show-zone', $domain_name);
279
+    $output = $call_result[0];
280
+    $return_code = $call_result[1];
281
+
282
+    if ($return_code != 0) {
283
+        error(ERR_EXEC_PDNSSEC_SHOW_ZONE);
284
+        return false;
285
+    }
286
+
287
+    $ds_records = array();
288
+    foreach ($output as $line) {
289
+        if (substr($line, 0, 2) == 'DS') {
290
+            $items = explode(' ', $line);
291
+            $ds_line = join(" ", array_slice($items, 2));
292
+            $ds_records[] = $ds_line;
293
+        }
294
+    }
295
+
296
+    return $ds_records;
297
+}
298
+
299
+/** Return algorithm name for given number
300
+ *
301
+ * @param int $algo Algorithm id
302
+ *
303
+ * @return string algorithm name
304
+ */
305
+function dnssec_algorithm_to_name($algo) {
306
+    $name = 'Unallocated/Reserved';
307
+
308
+    switch ($algo) {
309
+        case 0:
310
+            $name = 'Reserved';
311
+            break;
312
+        case 1:
313
+            $name = 'RSAMD5';
314
+            break;
315
+        case 2:
316
+            $name = 'DH';
317
+            break;
318
+        case 3:
319
+            $name = 'DSA';
320
+            break;
321
+        case 4:
322
+            $name = 'ECC';
323
+            break;
324
+        case 5:
325
+            $name = 'RSASHA1';
326
+            break;
327
+        case 6:
328
+            $name = 'DSA-NSEC3-SHA1';
329
+            break;
330
+        case 7:
331
+            $name = 'RSASHA1-NSEC3-SHA1';
332
+            break;
333
+        case 8:
334
+            $name = 'RSASHA256';
335
+            break;
336
+        case 9:
337
+            $name = 'Reserved';
338
+            break;
339
+        case 10:
340
+            $name = 'RSASHA512';
341
+            break;
342
+        case 11:
343
+            $name = 'Reserved';
344
+            break;
345
+        case 12:
346
+            $name = 'ECC-GOST';
347
+            break;
348
+        case 13:
349
+            $name = 'ECDSAP256SHA256';
350
+            break;
351
+        case 14:
352
+            $name = 'ECDSAP384SHA384';
353
+            break;
354
+        case 252:
355
+            $name = 'INDIRECT';
356
+            break;
357
+        case 253:
358
+            $name = 'PRIVATEDNS';
359
+            break;
360
+        case 254:
361
+            $name = 'PRIVATEOID';
362
+            break;
363
+    }
364
+
365
+    return $name;
366
+}
367
+
368
+/** Return algorithm name for given short name
369
+ *
370
+ * @param string $short_name Short algorithm name
371
+ * @return string Algorithm name
372
+ */
373
+function dnssec_shorthand_to_algorithm_name($short_name) {
374
+    $name = 'Unknown';
375
+
376
+    switch ($short_name) {
377
+        case "rsamd5":
378
+            $name = dnssec_algorithm_to_name(1);
379
+            break;
380
+        case "dh":
381
+            $name = dnssec_algorithm_to_name(2);
382
+            break;
383
+        case "dsa":
384
+            $name = dnssec_algorithm_to_name(3);
385
+            break;
386
+        case "ecc":
387
+            $name = dnssec_algorithm_to_name(4);
388
+            break;
389
+        case "rsasha1":
390
+            $name = dnssec_algorithm_to_name(5);
391
+            break;
392
+        case "rsasha256":
393
+            $name = dnssec_algorithm_to_name(8);
394
+            break;
395
+        case "rsasha512":
396
+            $name = dnssec_algorithm_to_name(10);
397
+            break;
398
+        case "gost":
399
+            $name = dnssec_algorithm_to_name(12);
400
+            break;
401
+        case "ecdsa256":
402
+            $name = dnssec_algorithm_to_name(13);
403
+            break;
404
+        case "ecdsa384":
405
+            $name = dnssec_algorithm_to_name(14);
406
+            break;
407
+        case "ed25519":
408
+            $name = dnssec_algorithm_to_name(250);
409
+            break;
410
+    }
411
+
412
+    return $name;
413
+}
414
+
415
+/** Get name of digest type
416
+ *
417
+ * @param int $type Digest type id
418
+ *
419
+ * @return string digest name
420
+ */
421
+function dnssec_get_digest_name($type) {
422
+    $name = 'Unknown';
423
+
424
+    switch ($type) {
425
+        case 1:
426
+            $name = 'SHA-1';
427
+            break;
428
+        case 2:
429
+            $name = 'SHA-256 ';
430
+            break;
431
+    }
432
+
433
+    return $name;
434
+}
435
+
436
+/** Check if zone is secured
437
+ *
438
+ * @param string $domain_name Domain Name
439
+ *
440
+ * @return string string containing dns key
441
+ */
442
+function dnssec_get_dnskey_record($domain_name) {
443
+    $call_result = dnssec_call_pdnssec('show-zone', $domain_name);
444
+    $output = $call_result[0];
445
+    $return_code = $call_result[1];
446
+
447
+    if ($return_code != 0) {
448
+        error(ERR_EXEC_PDNSSEC_SHOW_ZONE);
449
+        return false;
450
+    }
451
+
452
+    $dns_key = '';
453
+    foreach ($output as $line) {
454
+        if (substr($line, 0, 3) == 'KSK') {
455
+            $items = explode(' ', $line);
456
+            $dns_key = join(" ", array_slice($items, 3));
457
+        }
458
+    }
459
+
460
+    return $dns_key;
461
+}
462
+
463
+/** Activate zone key
464
+ *
465
+ * @param string $domain_name Domain Name
466
+ * @param $key_id
467
+ *
468
+ * @return bool true on success, false on failure
469
+ */
470
+function dnssec_activate_zone_key($domain_name, $key_id) {
471
+    $call_result = dnssec_call_pdnssec('activate-zone-key', join(" ", array($domain_name, $key_id)));
472
+    $return_code = $call_result[1];
473
+
474
+    if ($return_code != 0) {
475
+        error(ERR_EXEC_PDNSSEC_SHOW_ZONE);
476
+        return false;
477
+    }
478
+
479
+    log_info(sprintf('client_ip:%s user:%s operation:dnssec_activate_zone_key zone:%s key_id:%s',
480
+        $_SERVER['REMOTE_ADDR'], $_SESSION['userlogin'], $domain_name, $key_id));
481
+
482
+    return true;
483
+}
484
+
485
+/** Deactivate zone key
486
+ *
487
+ * @param string $domain_name Domain Name
488
+ * @param $key_id
489
+ *
490
+ * @return bool true on success, false on failure
491
+ */
492
+function dnssec_deactivate_zone_key($domain_name, $key_id) {
493
+    $call_result = dnssec_call_pdnssec('deactivate-zone-key', join(" ", array($domain_name, $key_id)));
494
+    $return_code = $call_result[1];
495
+
496
+    if ($return_code != 0) {
497
+        error(ERR_EXEC_PDNSSEC_SHOW_ZONE);
498
+        return false;
499
+    }
500
+
501
+    log_info(sprintf('client_ip:%s user:%s operation:dnssec_deactivate_zone_key zone:%s key_id:%s',
502
+        $_SERVER['REMOTE_ADDR'], $_SESSION['userlogin'], $domain_name, $key_id));
503
+
504
+    return true;
505
+}
506
+
507
+/** Get list of existing DNSSEC keys
508
+ *
509
+ * @param string $domain_name Domain Name
510
+ *
511
+ * @return mixed[] array with DNSSEC keys
512
+ */
513
+function dnssec_get_keys($domain_name) {
514
+    $call_result = dnssec_call_pdnssec('show-zone', $domain_name);
515
+    $output = $call_result[0];
516
+    $return_code = $call_result[1];
517
+
518
+    if ($return_code != 0) {
519
+        error(ERR_EXEC_PDNSSEC_SHOW_ZONE);
520
+        return false;
521
+    }
522
+
523
+    $keys = array();
524
+    foreach ($output as $line) {
525
+        if (substr($line, 0, 2) == 'ID') {
526
+            $items = explode(' ', $line);
527
+            $bits_array = explode("\t", $items[12]);
528
+            $keys[] = array($items[2], substr($items[3], 1, -2), substr($items[6], 0, -1), substr($items[9], 0, -1), $bits_array[0], $items[13]);
529
+        }
530
+    }
531
+
532
+    return $keys;
533
+}
534
+
535
+/** Create new DNSSEC key
536
+ *
537
+ * @param string $domain_name Domain Name
538
+ * @param string $key_type Key type
539
+ * @param string $bits Bits in length
540
+ * @param string $algorithm Algorithm
541
+ *
542
+ * @return boolean true on success, false on failure
543
+ */
544
+function dnssec_add_zone_key($domain_name, $key_type, $bits, $algorithm) {
545
+    $call_result = dnssec_call_pdnssec('add-zone-key', join(" ", array($domain_name, $key_type, $bits, $algorithm)));
546
+    $return_code = $call_result[1];
547
+
548
+    if ($return_code != 0) {
549
+        error(ERR_EXEC_PDNSSEC_ADD_ZONE_KEY);
550
+        return false;
551
+    }
552
+
553
+    log_info(sprintf('client_ip:%s user:%s operation:dnssec_add_zone_key zone:%s type:%s bits:%s algorithm:%s',
554
+        $_SERVER['REMOTE_ADDR'], $_SESSION['userlogin'], $domain_name, $key_type, $bits, $algorithm));
555
+
556
+    return true;
557
+}
558
+
559
+/** Remove DNSSEC key
560
+ *
561
+ * @param string $domain_name Domain Name
562
+ * @param int $key_id Key ID
563
+ *
564
+ * @return boolean true on success, false on failure
565
+ */
566
+function dnssec_remove_zone_key($domain_name, $key_id) {
567
+    $call_result = dnssec_call_pdnssec('remove-zone-key', join(" ", array($domain_name, $key_id)));
568
+    $return_code = $call_result[1];
569
+
570
+    if ($return_code != 0) {
571
+        error(ERR_EXEC_PDNSSEC_ADD_ZONE_KEY);
572
+        return false;
573
+    }
574
+
575
+    log_info(sprintf('client_ip:%s user:%s operation:dnssec_remove_zone_key zone:%s key_id:%s',
576
+        $_SERVER['REMOTE_ADDR'], $_SESSION['userlogin'], $domain_name, $key_id));
577
+
578
+    return true;
579
+}
580
+
581
+/** Check if given key exists
582
+ *
583
+ * @param string $domain_name Domain Name
584
+ * @param int $key_id Key ID
585
+ *
586
+ * @return boolean true if exists, otherwise false
587
+ */
588
+function dnssec_zone_key_exists($domain_name, $key_id) {
589
+    $keys = dnssec_get_keys($domain_name);
590
+
591
+    foreach ($keys as $key) {
592
+        if ($key[0] == $key_id) {
593
+            return true;
594
+        }
595
+    }
596
+
597
+    return false;
598
+}
599
+
600
+/** Return requested key
601
+ *
602
+ * @param string $domain_name Domain Name
603
+ * @param int $key_id Key ID
604
+ *
605
+ * @return mixed[] true if exists, otherwise false
606
+ */
607
+function dnssec_get_zone_key($domain_name, $key_id) {
608
+    $keys = dnssec_get_keys($domain_name);
609
+
610
+    foreach ($keys as $key) {
611
+        if ($key[0] == $key_id) {
612
+            return $key;
613
+        }
614
+    }
615
+
616
+    return array();
617
+}

+ 171
- 0
poweradmin/poweradmin-2.1.8/inc/error.inc.php View File

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

+ 35
- 0
poweradmin/poweradmin-2.1.8/inc/file.inc.php View File

@@ -0,0 +1,35 @@
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
+/**
24
+ * Migration functions
25
+ *
26
+ * @package Poweradmin
27
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
28
+ * @copyright   2010-2017  Poweradmin Development Team
29
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
30
+ */
31
+
32
+function file_get_name_without_extension($path) {
33
+    return basename($path, '.php');
34
+}
35
+

+ 71
- 0
poweradmin/poweradmin-2.1.8/inc/footer.inc.php View File

@@ -0,0 +1,71 @@
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
+/**
24
+ * Web interface footer
25
+ *
26
+ * @package     Poweradmin
27
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
28
+ * @copyright   2010-2017  Poweradmin Development Team
29
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
30
+ */
31
+require_once dirname(__DIR__) . '/vendor/autoload.php';
32
+
33
+$VERSION = Poweradmin\Version::VERSION;
34
+
35
+global $db;
36
+if (is_object($db)) {
37
+    $db->disconnect();
38
+}
39
+?>
40
+</div> <!-- /content -->
41
+<div class="footer">
42
+    <a href="http://www.poweradmin.org/">a complete(r) <strong>poweradmin</strong><?php
43
+        if (isset($_SESSION["userid"])) {
44
+            echo " v$VERSION";
45
+        }
46
+        ?></a> - <a href="http://www.poweradmin.org/credits.html">credits</a>
47
+</div>
48
+<?php
49
+if (file_exists('inc/custom_footer.inc.php')) {
50
+    include('inc/custom_footer.inc.php');
51
+}
52
+?>
53
+</body>
54
+</html>
55
+
56
+<?php
57
+if (isset($db_debug) && $db_debug == true) {
58
+    $debug = $db->getDebugOutput();
59
+    $debug = str_replace("query(1)", "", $debug);
60
+    $lines = explode(":", $debug);
61
+
62
+    foreach ($lines as $line) {
63
+        echo "$line<br>";
64
+    }
65
+}
66
+?>
67
+
68
+<?php
69
+global $display_stats;
70
+if ($display_stats)
71
+    display_current_stats();

+ 108
- 0
poweradmin/poweradmin-2.1.8/inc/header.inc.php View File

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

+ 148
- 0
poweradmin/poweradmin-2.1.8/inc/helper.js View File

@@ -0,0 +1,148 @@
1
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
2
+ *  See <https://www.poweradmin.org> for more details.
3
+ *
4
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
5
+ *  Copyright 2010-2017  Poweradmin Development Team
6
+ *      <http://www.poweradmin.org/credits.html>
7
+ *
8
+ *  This program is free software: you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation, either version 3 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+
22
+function changePort(db_type) {
23
+    var dbport = document.getElementById("dbport");
24
+    var host = document.getElementById("host");
25
+    var db_name_title = document.getElementById("db_name_title");
26
+    var db_path_title = document.getElementById("db_path_title");
27
+    var username_row = document.getElementById("username_row");
28
+    var password_row = document.getElementById("password_row");
29
+    var hostname_row = document.getElementById("hostname_row");
30
+    var dbport_row = document.getElementById("dbport_row");
31
+
32
+    if (db_type == "mysql") {
33
+        dbport.value = "3306";
34
+        host.value = "localhost";
35
+        db_name_title.style.display = '';
36
+        db_path_title.style.display = "none";
37
+        username_row.style.display = '';
38
+        password_row.style.display = '';
39
+        hostname_row.style.display = '';
40
+        dbport_row.style.display = '';
41
+    } else if (db_type == "pgsql") {
42
+        dbport.value = "5432";
43
+        host.value = "localhost";
44
+        db_name_title.style.display = '';
45
+        db_path_title.style.display = "none";
46
+        username_row.style.display = '';
47
+        password_row.style.display = '';
48
+        hostname_row.style.display = '';
49
+        dbport_row.style.display = '';
50
+    } else {
51
+        dbport.value = "";
52
+        host.value = "";
53
+        db_name_title.style.display = "none";
54
+        db_path_title.style.display = '';
55
+        username_row.style.display = "none";
56
+        password_row.style.display = "none";
57
+        hostname_row.style.display = "none";
58
+        dbport_row.style.display = "none";
59
+    }
60
+}
61
+
62
+//Add more fields dynamically.
63
+function addField(area, field, limit) {
64
+    if (!document.getElementById)
65
+        return; //Prevent older browsers from getting any further.
66
+    var field_area = document.getElementById(area);
67
+    var all_inputs = field_area.getElementsByTagName("input"); //Get all the input fields in the given area.
68
+    //Find the count of the last element of the list. It will be in the format '<field><number>'. If the
69
+    //		field given in the argument is 'friend_' the last id will be 'friend_4'.
70
+    var last_item = all_inputs.length - 1;
71
+    var last = all_inputs[last_item].id;
72
+    var count = Number(last.split("_")[1]) + 1;
73
+
74
+    //If the maximum number of elements have been reached, exit the function.
75
+    //		If the given limit is lower than 0, infinite number of fields can be created.
76
+    if (count > limit && limit > 0)
77
+        return;
78
+
79
+    if (document.createElement) { //W3C Dom method.
80
+        var li = document.createElement("li");
81
+        var input = document.createElement("input");
82
+        input.id = field + count;
83
+        input.name = "domain[]";
84
+        input.type = "text"; //Type of field - can be any valid input type like text,file,checkbox etc.
85
+        input.className = "input";
86
+        li.appendChild(input);
87
+        var editLink = document.createElement("input");
88
+        editLink.id = 'remove_button';
89
+        editLink.type = 'button';
90
+        editLink.value = 'Remove field';
91
+        editLink.setAttribute('class', 'button');
92
+        editLink.onclick = function() {
93
+            this.parentNode.parentNode.removeChild(this.parentNode);
94
+        };
95
+        li.appendChild(editLink);
96
+        field_area.appendChild(li);
97
+    } else { //Older Method
98
+        field_area.innerHTML += "<li><input name='domain[]' id='" + (field + count) + "' type='text' class='input' /> <a onclick=\"this.parentNode.parentNode.removeChild(this.parentNode);\">Remove Field</a></li>";
99
+    }
100
+}
101
+
102
+function getDomainsElements() {
103
+    var
104
+            coll = document.getElementsByTagName('input'),
105
+            re = /^domain\[\]$/,
106
+            t,
107
+            elm,
108
+            i = 0,
109
+            key = 0,
110
+            records = [];
111
+
112
+    while (elm = coll.item(i++))
113
+    {
114
+        t = re.exec(elm.name);
115
+        if (t != null)
116
+        {
117
+            records[key] = elm;
118
+            key++;
119
+        }
120
+    }
121
+    return records;
122
+}
123
+
124
+function checkDomainFilled() {
125
+    var
126
+            allEmpty = true,
127
+            domains = getDomainsElements();
128
+
129
+    if (domains.length == 1) {
130
+        if ((domains[0].value.length == 0 || domains[0].value == null || domains[0].value == "")) {
131
+            alert('Zone name cannot be empty');
132
+            return false;
133
+        }
134
+    } else {
135
+        for (var key in domains) {
136
+            if ((domains[key].value.length != 0)) {
137
+                allEmpty = false;
138
+            }
139
+        }
140
+
141
+        if (true === allEmpty) {
142
+            alert('Please fill in at least one Zone name');
143
+            return false;
144
+        }
145
+    }
146
+
147
+    add_zone_master.submit();
148
+}

+ 50
- 0
poweradmin/poweradmin-2.1.8/inc/i18n.inc.php View File

@@ -0,0 +1,50 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2009  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Interface localisation helper
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+if (file_exists('inc/config.inc.php')) {
33
+    include_once("inc/config.inc.php");
34
+} else {
35
+    $iface_lang = 'en_EN';
36
+}
37
+
38
+if ($iface_lang != 'en_EN') {
39
+    $locale = setlocale(LC_ALL, $iface_lang, $iface_lang . '.UTF-8');
40
+    if ($locale == false) {
41
+        error(ERR_LOCALE_FAILURE);
42
+    }
43
+
44
+    $gettext_domain = 'messages';
45
+    bindtextdomain($gettext_domain, "./locale");
46
+    bind_textdomain_codeset($gettext_domain, 'utf-8');
47
+    textdomain($gettext_domain);
48
+    @putenv('LANG=' . $iface_lang);
49
+    @putenv('LANGUAGE=' . $iface_lang);
50
+}

+ 80
- 0
poweradmin/poweradmin-2.1.8/inc/migrations.inc.php View File

@@ -0,0 +1,80 @@
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
+/**
24
+ * Migration functions
25
+ *
26
+ * @package Poweradmin
27
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
28
+ * @copyright   2010-2017  Poweradmin Development Team
29
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
30
+ */
31
+
32
+/** Check if given migration exists
33
+ *
34
+ * @param resource $db DB link
35
+ * @param string $file_name Migration file name
36
+ *
37
+ * @return boolean true on success, false on failure
38
+ */
39
+function migration_exists($db, $file_name) {
40
+    $query = "SELECT COUNT(version) FROM migrations WHERE version = " . $db->quote($file_name, 'text');
41
+    $count = $db->queryOne($query);
42
+    if ($count == 0) {
43
+        return false;
44
+    }
45
+
46
+    return true;
47
+}
48
+
49
+/** Save migration status to database
50
+ *
51
+ * @param resource $db DB link
52
+ * @param string $file_name Migration file name
53
+ *
54
+ * @return boolean true on success, false on failure
55
+ */
56
+function migration_save($db, $file_name) {
57
+    $query = "INSERT INTO migrations (version, apply_time) VALUES(" . $db->quote($file_name, 'text') . "," . $db->quote(time(), 'text') . ")";
58
+    return $db->query($query);
59
+}
60
+
61
+/** Get newline symbol depending on environment
62
+ *
63
+ * @return string newline for run environment
64
+ */
65
+function migration_get_environment_newline() {
66
+    $new_line = '<br/>';
67
+    if (php_sapi_name() == 'cli') {
68
+        $new_line = PHP_EOF;
69
+    }
70
+    return $new_line;
71
+}
72
+
73
+/** Display given message
74
+ * 
75
+ * @param string $msg Message that needs to be dispalyed
76
+ */
77
+function migration_message($msg) {
78
+    $new_line = migration_get_environment_newline();
79
+    echo $msg.$new_line;
80
+}

+ 105
- 0
poweradmin/poweradmin-2.1.8/inc/plugin.inc.php View File

@@ -0,0 +1,105 @@
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
+/**
24
+ * Plugin API
25
+ *
26
+ * Dynamically add behavior by putting code in the plugins directory
27
+ * of the application root.  For the loader to include a plugin,
28
+ * there must be a file named:
29
+ *
30
+ *     plugins/[name]/[name].plugin.php
31
+ *
32
+ * Further imports, functions, or definitions can be done from
33
+ * that top-level script.
34
+ */
35
+$hook_listeners = array();
36
+
37
+/**
38
+ * Register function to be executed for the given hook
39
+ *
40
+ * @param string $hook
41
+ * @param mixed $function
42
+ */
43
+function add_listener($hook, $function) {
44
+    if (!$hook || !$function) {
45
+        trigger_error('add_listener requires both a hook name and a function', E_USER_ERROR);
46
+    }
47
+    global $hook_listeners;
48
+    $hook_listeners [$hook] [] = $function;
49
+}
50
+
51
+/**
52
+ * Removes all listeners from the given hook
53
+ *
54
+ * @param string $hook
55
+ */
56
+function clear_listeners($hook) {
57
+    if (!$hook) {
58
+        trigger_error('clear_listeners requires a hook name', E_USER_ERROR);
59
+    }
60
+    global $hook_listeners;
61
+    $hook_listeners [$hook] = array();
62
+}
63
+
64
+/**
65
+ * Execute a hook, call registered listener functions
66
+ */
67
+function do_hook() {
68
+    global $hook_listeners;
69
+    $argc = func_num_args();
70
+    $argv = func_get_args();
71
+    if ($argc < 1) {
72
+        trigger_error('Missing argument in do_hook', E_USER_ERROR);
73
+    }
74
+
75
+    $hook_name = array_shift($argv);
76
+
77
+    if (!isset($hook_listeners [$hook_name])) {
78
+        return;
79
+    }
80
+
81
+    foreach ($hook_listeners [$hook_name] as $func) {
82
+        $response = call_user_func_array($func, (array) $argv);
83
+        return $response;
84
+    }
85
+}
86
+
87
+/**
88
+ * Look for plugins and perform imports
89
+ */
90
+function import_plugins() {
91
+    $plugins_dir = 'inc/plugins';
92
+    $contents = scandir($plugins_dir);
93
+    foreach ($contents as $dir) {
94
+        if ($dir == '.' || $dir == '..') {
95
+            continue;
96
+        }
97
+        $plugin_file = $plugins_dir . DIRECTORY_SEPARATOR . $dir . DIRECTORY_SEPARATOR . $dir . '.plugin.php';
98
+        if (file_exists($plugin_file)) {
99
+
100
+            require_once $plugin_file;
101
+        }
102
+    }
103
+}
104
+
105
+import_plugins();

+ 2
- 0
poweradmin/poweradmin-2.1.8/inc/plugins/.gitignore View File

@@ -0,0 +1,2 @@
1
+/users_wefact/
2
+/auth_wefact/

+ 223
- 0
poweradmin/poweradmin-2.1.8/inc/plugins/auth_local/auth_local.plugin.php View File

@@ -0,0 +1,223 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2009  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Authentication functions
26
+ *
27
+ * @package Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once dirname(dirname(dirname(__DIR__))) . '/vendor/poweradmin/Password.php';
33
+
34
+/** Authenticate Session
35
+ *
36
+ * Checks if user is logging in, logging out, or session expired and performs
37
+ * actions accordingly
38
+ *
39
+ * @return null
40
+ */
41
+function authenticate_local() {
42
+    global $iface_expire;
43
+    global $session_key;
44
+    global $ldap_use;
45
+
46
+    if (isset($_SESSION['userid']) && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] == "logout") {
47
+        logout(_('You have logged out.'), 'success');
48
+    }
49
+
50
+    // If a user had just entered his/her login && password, store them in our session.
51
+    if (isset($_POST["authenticate"])) {
52
+        $_SESSION["userpwd"] = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($session_key), $_POST['password'], MCRYPT_MODE_CBC, md5(md5($session_key))));
53
+
54
+        $_SESSION["userlogin"] = $_POST["username"];
55
+        $_SESSION["userlang"] = $_POST["userlang"];
56
+    }
57
+
58
+    // Check if the session hasnt expired yet.
59
+    if ((isset($_SESSION["userid"])) && ($_SESSION["lastmod"] != "") && ((time() - $_SESSION["lastmod"]) > $iface_expire)) {
60
+        logout(_('Session expired, please login again.'), 'error');
61
+    }
62
+
63
+    // If the session hasn't expired yet, give our session a fresh new timestamp.
64
+    $_SESSION["lastmod"] = time();
65
+
66
+    if ($ldap_use && userUsesLDAP()) {
67
+        LDAPAuthenticate();
68
+    } else {
69
+        SQLAuthenticate();
70
+    }
71
+}
72
+
73
+function userUsesLDAP() {
74
+    global $db;
75
+
76
+    $rowObj = $db->queryRow("SELECT id FROM users WHERE username=" . $db->quote($_SESSION["userlogin"], 'text') . " AND use_ldap=1");
77
+    if ($rowObj) {
78
+        return true;
79
+    }
80
+    return false;
81
+}
82
+
83
+function LDAPAuthenticate() {
84
+    global $db;
85
+    global $session_key;
86
+    global $ldap_uri;
87
+    global $ldap_basedn;
88
+    global $ldap_binddn;
89
+    global $ldap_bindpw;
90
+    global $ldap_proto;
91
+    global $ldap_debug;
92
+    global $ldap_user_attribute;
93
+
94
+    if (isset($_SESSION["userlogin"]) && isset($_SESSION["userpwd"])) {
95
+        if ($ldap_debug) {
96
+            ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
97
+        }
98
+        $ldapconn = ldap_connect($ldap_uri);
99
+        if (!$ldapconn) {
100
+            if (isset($_POST["authenticate"]))
101
+                log_error(sprintf('Failed LDAP authentication attempt from [%s] Reason: ldap_connect failed', $_SERVER['REMOTE_ADDR']));
102
+            logout(_('Failed to connect to LDAP server!'), 'error');
103
+            return;
104
+        }
105
+
106
+        ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, $ldap_proto);
107
+        $ldapbind = ldap_bind($ldapconn, $ldap_binddn, $ldap_bindpw);
108
+        if (!$ldapbind) {
109
+            if (isset($_POST["authenticate"]))
110
+                log_error(sprintf('Failed LDAP authentication attempt from [%s] Reason: ldap_bind failed', $_SERVER['REMOTE_ADDR']));
111
+            logout(_('Failed to bind to LDAP server!'), 'error');
112
+            return;
113
+        }
114
+
115
+        $attributes = array($ldap_user_attribute, 'dn');
116
+        $filter = "(" . $ldap_user_attribute . "=" . $_SESSION["userlogin"] . ")";
117
+        $ldapsearch = ldap_search($ldapconn, $ldap_basedn, $filter, $attributes);
118
+        if (!$ldapsearch) {
119
+            if (isset($_POST["authenticate"]))
120
+                log_error(sprintf('Failed LDAP authentication attempt from [%s] Reason: ldap_search failed', $_SERVER['REMOTE_ADDR']));
121
+            logout(_('Failed to search LDAP.'), 'error');
122
+            return;
123
+        }
124
+
125
+        //Checking first that we only found exactly 1 user, get the DN of this user.  We'll use this to perform the actual authentication.
126
+        $entries = ldap_get_entries($ldapconn, $ldapsearch);
127
+        if ($entries["count"] != 1) {
128
+            if (isset($_POST["authenticate"])) {
129
+                if ($entries["count"] == 0) {
130
+                    log_warn(sprintf('Failed LDAP authentication attempt from [%s] for user \'%s\' Reason: No such user', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"]));
131
+                } else {
132
+                    log_error(sprintf('Failed LDAP authentication attempt from [%s] for user \'%s\' Reason: Duplicate usernames detected', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"]));
133
+                }
134
+            }
135
+            logout(_('Failed to authenticate against LDAP.'), 'error');
136
+            return;
137
+        }
138
+        $user_dn = $entries[0]["dn"];
139
+
140
+        $session_pass = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($session_key), base64_decode($_SESSION["userpwd"]), MCRYPT_MODE_CBC, md5(md5($session_key))), "\0");
141
+        $ldapbind = ldap_bind($ldapconn, $user_dn, $session_pass);
142
+        if (!$ldapbind) {
143
+            if (isset($_POST["authenticate"]))
144
+                log_warn(sprintf('Failed LDAP authentication attempt from [%s] for user \'%s\' Reason: Incorrect password', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"]));
145
+            auth(_('LDAP Authentication failed!'), "error");
146
+            return;
147
+        }
148
+        //LDAP AUTH SUCCESSFUL
149
+        //Make sure the user is 'active' and fetch id and name.
150
+        $rowObj = $db->queryRow("SELECT id, fullname FROM users WHERE username=" . $db->quote($_SESSION["userlogin"], 'text') . " AND active=1");
151
+        if (!$rowObj) {
152
+            if (isset($_POST["authenticate"]))
153
+                log_warn(sprintf('Failed LDAP authentication attempt from [%s] for user \'%s\' Reason: User is inactive', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"]));
154
+            auth(_('LDAP Authentication failed!'), "error");
155
+            return;
156
+        }
157
+        $_SESSION["userid"] = $rowObj["id"];
158
+        $_SESSION["name"] = $rowObj["fullname"];
159
+        $_SESSION["auth_used"] = "ldap";
160
+
161
+        if (isset($_POST["authenticate"])) {
162
+            log_notice(sprintf('Successful LDAP authentication attempt from [%s] for user \'%s\'', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"]));
163
+            //If a user has just authenticated, redirect him to requested page
164
+            session_write_close();
165
+            $redirect_url = ($_POST["query_string"] ? $_SERVER['SCRIPT_NAME'] . "?" . $_POST["query_string"] : $_SERVER['SCRIPT_NAME']);
166
+            clean_page($redirect_url);
167
+            exit;
168
+        }
169
+    } else {
170
+        //No username and password set, show auth form (again).
171
+        auth();
172
+    }
173
+}
174
+
175
+function SQLAuthenticate() {
176
+    global $db;
177
+    global $password_encryption;
178
+    global $session_key;
179
+
180
+    if (isset($_SESSION["userlogin"]) && isset($_SESSION["userpwd"])) {
181
+        //Username and password are set, lets try to authenticate.
182
+        $session_pass = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($session_key), base64_decode($_SESSION["userpwd"]), MCRYPT_MODE_CBC, md5(md5($session_key))), "\0");
183
+
184
+        $rowObj = $db->queryRow("SELECT id, fullname, password FROM users WHERE username=" . $db->quote($_SESSION["userlogin"], 'text') . " AND active=1");
185
+
186
+        if ($rowObj) {
187
+
188
+            if (Poweradmin\Password::verify($session_pass, $rowObj['password'])) {
189
+
190
+                $_SESSION["userid"] = $rowObj["id"];
191
+                $_SESSION["name"] = $rowObj["fullname"];
192
+                $_SESSION["auth_used"] = "internal";
193
+
194
+                if (isset($_POST["authenticate"])) {
195
+                    log_notice(sprintf('Successful authentication attempt from [%s] for user \'%s\'', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"]));
196
+                    //If a user has just authenticated, redirect him to requested page
197
+                    session_write_close();
198
+                    $redirect_url = ($_POST["query_string"] ? $_SERVER['SCRIPT_NAME'] . "?" . $_POST["query_string"] : $_SERVER['SCRIPT_NAME']);
199
+                    clean_page($redirect_url);
200
+                    exit;
201
+                }
202
+            } else if (isset($_POST['authenticate'])) {
203
+//				auth( _('Authentication failed! - <a href="reset_password.php">(forgot password)</a>'),"error");
204
+                auth(_('Authentication failed!'), "error");
205
+            } else {
206
+                auth();
207
+            }
208
+        } else if (isset($_POST['authenticate'])) {
209
+            log_warn(sprintf('Failed authentication attempt from [%s]', $_SERVER['REMOTE_ADDR']));
210
+
211
+            //Authentication failed, retry.
212
+//			auth( _('Authentication failed! - <a href="reset_password.php">(forgot password)</a>'),"error");
213
+            auth(_('Authentication failed!'), "error");
214
+        } else {
215
+            unset($_SESSION["userpwd"]);
216
+            unset($_SESSION["userlogin"]);
217
+            auth();
218
+        }
219
+    } else {
220
+        //No username and password set, show auth form (again).
221
+        auth();
222
+    }
223
+}

+ 884
- 0
poweradmin/poweradmin-2.1.8/inc/plugins/users_local/users_local.plugin.php View File

@@ -0,0 +1,884 @@
1
+<?php
2
+
3
+/*
4
+ * Poweradmin, a friendly web-based admin tool for PowerDNS. See <http://www.poweradmin.org> for more details. Copyright 2007-2009 Rejo Zenger <rejo@zenger.nl> Copyright 2010-2017  Poweradmin Development Team <http://www.poweradmin.org/credits.html> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
5
+ */
6
+
7
+/**
8
+ * User profile functions
9
+ *
10
+ * @package Poweradmin
11
+ * @copyright 2007-2010 Rejo Zenger <rejo@zenger.nl>
12
+ * @copyright 2010-2017  Poweradmin Development Team
13
+ * @license http://opensource.org/licenses/GPL-3.0 GPL
14
+ *
15
+ */
16
+require_once 'inc/toolkit.inc.php';
17
+
18
+require_once dirname(dirname(dirname(__DIR__))) . '/vendor/poweradmin/Password.php';
19
+
20
+/**
21
+ * Verify User has Permission Name
22
+ *
23
+ * Function to see if user has right to do something. It will check if
24
+ * user has "ueberuser" bit set. If it isn't, it will check if the user has
25
+ * the specific permission. It returns "false" if the user doesn't have the
26
+ * right, and "true" if the user has.
27
+ *
28
+ * @param array arg[0] Permission name
29
+ *
30
+ * @return boolean true if user has permission, false otherwise
31
+ */
32
+function verify_permission_local($arg) {
33
+    if (is_array($arg)) {
34
+        $permission = $arg [0];
35
+    } else {
36
+        $permission = $arg;
37
+    }
38
+
39
+    static $cache = false;
40
+
41
+    if ($cache !== false) {
42
+        return array_key_exists('user_is_ueberuser', $cache) || array_key_exists($permission, $cache);
43
+    }
44
+
45
+    global $db;
46
+    if ((!isset($_SESSION['userid'])) || (!is_object($db))) {
47
+        return 0;
48
+    }
49
+    // Set current user ID.
50
+    $userid = $_SESSION['userid'];
51
+
52
+    $query = $db->prepare("SELECT
53
+        perm_items.name AS permission
54
+        FROM perm_templ_items
55
+        LEFT JOIN perm_items ON perm_items.id = perm_templ_items.perm_id
56
+        LEFT JOIN perm_templ ON perm_templ.id = perm_templ_items.templ_id
57
+        LEFT JOIN users ON perm_templ.id = users.perm_templ
58
+        WHERE users.id = ?");
59
+    $query->execute(array($userid));
60
+    $cache = $query->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_ASSOC);
61
+
62
+    return array_key_exists('user_is_ueberuser', $cache) || array_key_exists($permission, $cache);
63
+}
64
+
65
+/**
66
+ * Get a list of all available permission templates
67
+ *
68
+ * @return mixed[] array of templates [id, name, descr]
69
+ */
70
+function list_permission_templates_local() {
71
+    global $db;
72
+    $query = "SELECT * FROM perm_templ ORDER BY name";
73
+    $response = $db->query($query);
74
+    if (PEAR::isError($response)) {
75
+        error($response->getMessage());
76
+        return false;
77
+    }
78
+
79
+    $template_list = array();
80
+    while ($template = $response->fetchRow()) {
81
+        $template_list [] = array(
82
+            "id" => $template ['id'],
83
+            "name" => $template ['name'],
84
+            "descr" => $template ['descr']
85
+        );
86
+    }
87
+    return $template_list;
88
+}
89
+
90
+/**
91
+ * Retrieve all users
92
+ *
93
+ * Its to show_users therefore the odd name. Has to be changed.
94
+ *
95
+ * @param int $id Exclude User ID
96
+ * @param int $rowstart Startring row number
97
+ * @param int $rowamount Number of rows to return this query
98
+ *
99
+ * @return mixed[] array with all users [id,username,fullname,email,description,active,numdomains]
100
+ */
101
+function show_users_local($id = '', $rowstart = 0, $rowamount = 9999999) {
102
+
103
+    global $db;
104
+    $add = '';
105
+    if (is_numeric($id)) {
106
+        // When a user id is given, it is excluded from the userlist returned.
107
+        $add = " WHERE users.id!=" . $db->quote($id, 'integer');
108
+    }
109
+
110
+    // Make a huge query.
111
+    $query = "SELECT users.id AS id,
112
+	users.username AS username,
113
+	users.fullname AS fullname,
114
+	users.email AS email,
115
+	users.description AS description,
116
+	users.active AS active,
117
+	users.perm_templ AS perm_templ,
118
+	count(zones.owner) AS aantal FROM users
119
+	LEFT JOIN zones ON users.id=zones.owner$add
120
+	GROUP BY
121
+	users.id,
122
+	users.username,
123
+	users.fullname,
124
+	users.email,
125
+	users.description,
126
+	users.perm_templ,
127
+	users.active
128
+	ORDER BY
129
+	users.fullname";
130
+
131
+    // Execute the huge query.
132
+    $db->setLimit($rowamount, $rowstart);
133
+    $response = $db->query($query);
134
+    if (PEAR::isError($response)) {
135
+        error($response->getMessage());
136
+        return false;
137
+    }
138
+    $ret = array();
139
+    while ($r = $response->fetchRow()) {
140
+        $ret [] = array(
141
+            "id" => $r ["id"],
142
+            "username" => $r ["username"],
143
+            "fullname" => $r ["fullname"],
144
+            "email" => $r ["email"],
145
+            "description" => $r ["description"],
146
+            "active" => $r ["active"],
147
+            "numdomains" => $r ["aantal"]
148
+        );
149
+    }
150
+    return $ret;
151
+}
152
+
153
+/**
154
+ * Check if Valid User
155
+ *
156
+ * Check if the given $userid is connected to a valid user.
157
+ *
158
+ * @param int $id User ID
159
+ *
160
+ * @return boolean true if user exists, false if users doesnt exist
161
+ */
162
+function is_valid_user_local($id) {
163
+    global $db;
164
+    if (is_numeric($id)) {
165
+        $response = $db->queryOne("SELECT id FROM users WHERE id=" . $db->quote($id, 'integer'));
166
+        return ($response ? true : false);
167
+    }
168
+}
169
+
170
+/**
171
+ * Check if Username Exists
172
+ *
173
+ * Checks if a given username exists in the database.
174
+ *
175
+ * @param string $user Username
176
+ *
177
+ * @return boolean true if exists, false if not
178
+ */
179
+function user_exists($user) {
180
+    global $db;
181
+    $response = $db->queryOne("SELECT id FROM users WHERE username=" . $db->quote($user, 'text'));
182
+    return ($response ? true : false);
183
+}
184
+
185
+/**
186
+ * Delete User ID
187
+ *
188
+ * Delete a user from the system. Will also delete zones owned by user or
189
+ * re-assign those zones to a new specified owner.
190
+ * $zones is an array of zone 'zid's to delete or re-assign depending on
191
+ * 'target' value [delete,new_owner] and 'newowner' value
192
+ *
193
+ * @param int $uid User ID to delete
194
+ * @param mixed[] $zones Array of zones
195
+ *
196
+ * @return boolean true on success, false otherwise
197
+ */
198
+function delete_user_local($uid, $zones) {
199
+    global $db;
200
+
201
+    if (($uid != $_SESSION ['userid'] && !do_hook('verify_permission', 'user_edit_others')) || ($uid == $_SESSION ['userid'] && !do_hook('verify_permission', 'user_edit_own'))) {
202
+        error(ERR_PERM_DEL_USER);
203
+        return false;
204
+    } else {
205
+
206
+        if (is_array($zones)) {
207
+            foreach ($zones as $zone) {
208
+                if ($zone ['target'] == "delete") {
209
+                    delete_domain($zone ['zid']);
210
+                } elseif ($zone ['target'] == "new_owner") {
211
+                    add_owner_to_zone($zone ['zid'], $zone ['newowner']);
212
+                }
213
+            }
214
+        }
215
+
216
+        $query = "DELETE FROM zones WHERE owner = " . $db->quote($uid, 'integer');
217
+        $response = $db->query($query);
218
+        if (PEAR::isError($response)) {
219
+            error($response->getMessage());
220
+            return false;
221
+        }
222
+
223
+        $query = "DELETE FROM users WHERE id = " . $db->quote($uid, 'integer');
224
+        $response = $db->query($query);
225
+        if (PEAR::isError($response)) {
226
+            error($response->getMessage());
227
+            return false;
228
+        }
229
+
230
+        delete_zone_templ_userid($uid);
231
+    }
232
+    return true;
233
+}
234
+
235
+/**
236
+ * Delete Permission Template ID
237
+ *
238
+ * @param int $ptid Permission template ID
239
+ *
240
+ * @return boolean true on success, false otherwise
241
+ */
242
+function delete_perm_templ_local($ptid) {
243
+    global $db;
244
+    if (!(do_hook('verify_permission', 'user_edit_templ_perm'))) {
245
+        error(ERR_PERM_DEL_PERM_TEMPL);
246
+    } else {
247
+        $query = "SELECT id FROM users WHERE perm_templ = " . $ptid;
248
+        $response = $db->queryOne($query);
249
+        if (PEAR::isError($response)) {
250
+            error($response->getMessage());
251
+            return false;
252
+        }
253
+
254
+        if ($response) {
255
+            error(ERR_PERM_TEMPL_ASSIGNED);
256
+            return false;
257
+        } else {
258
+            $query = "DELETE FROM perm_templ_items WHERE templ_id = " . $ptid;
259
+            $response = $db->query($query);
260
+            if (PEAR::isError($response)) {
261
+                error($response->getMessage());
262
+                return false;
263
+            }
264
+
265
+            $query = "DELETE FROM perm_templ WHERE id = " . $ptid;
266
+            $response = $db->query($query);
267
+            if (PEAR::isError($response)) {
268
+                error($response->getMessage());
269
+                return false;
270
+            }
271
+
272
+            return true;
273
+        }
274
+    }
275
+}
276
+
277
+/**
278
+ * Modify User Details
279
+ *
280
+ * Edit the information of an user.. sloppy implementation with too many queries.. (2) :)
281
+ *
282
+ * @param int $id User ID
283
+ * @param string $user Username
284
+ * @param string $fullname Full Name
285
+ * @param string $email Email address
286
+ * @param string $perm_templ Permission Template Name
287
+ * @param string $description Description
288
+ * @param int $active Active User
289
+ * @param string $password Password
290
+ *
291
+ * @return boolean true if succesful, false otherwise
292
+ */
293
+function edit_user_local($id, $user, $fullname, $email, $perm_templ, $description, $active, $password) {
294
+    global $db;
295
+
296
+    do_hook('verify_permission', 'user_edit_own') ? $perm_edit_own = "1" : $perm_edit_own = "0";
297
+    do_hook('verify_permission', 'user_edit_others') ? $perm_edit_others = "1" : $perm_edit_others = "0";
298
+
299
+    if (($id == $_SESSION ["userid"] && $perm_edit_own == "1") || ($id != $_SESSION ["userid"] && $perm_edit_others == "1")) {
300
+
301
+        if (!is_valid_email($email)) {
302
+            error(ERR_INV_EMAIL);
303
+            return false;
304
+        }
305
+
306
+        if ($active != 1) {
307
+            $active = 0;
308
+        }
309
+
310
+        // Before updating the database we need to check whether the user wants to
311
+        // change the username. If the user wants to change the username, we need
312
+        // to make sure it doesn't already exists.
313
+        //
314
+		// First find the current username of the user ID we want to change. If the
315
+        // current username is not the same as the username that was given by the
316
+        // user, the username should apparantly changed. If so, check if the "new"
317
+        // username already exists.
318
+
319
+        $query = "SELECT username FROM users WHERE id = " . $db->quote($id, 'integer');
320
+        $response = $db->query($query);
321
+        if (PEAR::isError($response)) {
322
+            error($response->getMessage());
323
+            return false;
324
+        }
325
+
326
+        $usercheck = array();
327
+        $usercheck = $response->fetchRow();
328
+
329
+        if ($usercheck ['username'] != $user) {
330
+
331
+            // Username of user ID in the database is different from the name
332
+            // we have been given. User wants a change of username. Now, make
333
+            // sure it doesn't already exist.
334
+
335
+            $query = "SELECT id FROM users WHERE username = " . $db->quote($user, 'text');
336
+            $response = $db->queryOne($query);
337
+            if ($response) {
338
+                error(ERR_USER_EXIST);
339
+                return false;
340
+            }
341
+        }
342
+
343
+        // So, user doesn't want to change username or, if he wants, there is not
344
+        // another user that goes by the wanted username. So, go ahead!
345
+
346
+        $query = "UPDATE users SET username = " . $db->quote($user, 'text') . ",
347
+fullname = " . $db->quote($fullname, 'text') . ",
348
+email = " . $db->quote($email, 'text') . ",";
349
+        if (do_hook('verify_permission', 'user_edit_templ_perm')) {
350
+            $query .= "perm_templ = " . $db->quote($perm_templ, 'integer') . ",";
351
+        }
352
+        $query .= "description = " . $db->quote($description, 'text') . ",
353
+				active = " . $db->quote($active, 'integer');
354
+
355
+        if ($password != "") {
356
+            $query .= ", password = " . $db->quote(Poweradmin\Password::hash($password), 'text');
357
+        }
358
+
359
+        $query .= " WHERE id = " . $db->quote($id, 'integer');
360
+
361
+        $response = $db->query($query);
362
+        if (PEAR::isError($response)) {
363
+            error($response->getMessage());
364
+            return false;
365
+        }
366
+    } else {
367
+        error(ERR_PERM_EDIT_USER);
368
+        return false;
369
+    }
370
+    return true;
371
+}
372
+
373
+/**
374
+ * Change User Password
375
+ *
376
+ * Change the pass of the user.
377
+ * The user is automatically logged out after the pass change.
378
+ *
379
+ * @param mixed[] $details User Details
380
+ *
381
+ * @return null
382
+ */
383
+function change_user_pass_local($details) {
384
+    global $db;
385
+
386
+    if ($details ['newpass'] != $details ['newpass2']) {
387
+        error(ERR_USER_MATCH_NEW_PASS);
388
+        return false;
389
+    }
390
+
391
+    $query = "SELECT id, password FROM users WHERE username = " . $db->quote($_SESSION ["userlogin"], 'text');
392
+    $response = $db->query($query);
393
+    if (PEAR::isError($response)) {
394
+        error($response->getMessage());
395
+        return false;
396
+    }
397
+
398
+    $rinfo = $response->fetchRow();
399
+
400
+    if (Poweradmin\Password::verify($details['currentpass'], $rinfo['password'])) {
401
+        $query = "UPDATE users SET password = " . $db->quote(Poweradmin\Password::hash($details['newpass']), 'text') . " WHERE id = " . $db->quote($rinfo ['id'], 'integer');
402
+        $response = $db->query($query);
403
+        if (PEAR::isError($response)) {
404
+            error($response->getMessage());
405
+            return false;
406
+        }
407
+
408
+        logout(_('Password has been changed, please login.'), 'success');
409
+    } else {
410
+        error(ERR_USER_WRONG_CURRENT_PASS);
411
+        return false;
412
+    }
413
+}
414
+
415
+/**
416
+ * Get User FullName from User ID
417
+ *
418
+ * Get a fullname when you have a userid.
419
+ *
420
+ * @param int $id User ID
421
+ *
422
+ * @return string Full Name
423
+ */
424
+function get_fullname_from_userid_local($id) {
425
+    global $db;
426
+    if (is_numeric($id)) {
427
+        $response = $db->query("SELECT fullname FROM users WHERE id=" . $db->quote($id, 'integer'));
428
+        if (PEAR::isError($response)) {
429
+            error($response->getMessage());
430
+            return false;
431
+        }
432
+        $r = $response->fetchRow();
433
+        return $r ["fullname"];
434
+    } else {
435
+        error(ERR_INV_ARG);
436
+        return false;
437
+    }
438
+}
439
+
440
+/**
441
+ * Get User FullName from User ID
442
+ * fixme: Duplicate function
443
+ *
444
+ * Get a fullname when you have a userid.
445
+ *
446
+ * @param int $id User ID
447
+ *
448
+ * @return string Full Name
449
+ */
450
+function get_owner_from_id_local($id) {
451
+    global $db;
452
+    if (is_numeric($id)) {
453
+        $response = $db->queryRow("SELECT fullname FROM users WHERE id=" . $db->quote($id, 'integer'));
454
+
455
+        if ($response) {
456
+            return $response ["fullname"];
457
+        } else {
458
+            error(ERR_USER_NOT_EXIST);
459
+        }
460
+    }
461
+    error(ERR_INV_ARG);
462
+}
463
+
464
+/**
465
+ * Get Full Names of owners for a Domain ID
466
+ *
467
+ * @todo also fetch the subowners
468
+ *
469
+ * @param int $id Domain ID
470
+ *
471
+ * @return string[] array of owners for domain
472
+ */
473
+function get_fullnames_owners_from_domainid_local($id) {
474
+    global $db;
475
+    if (is_numeric($id)) {
476
+        $response = $db->query("SELECT users.id, users.fullname FROM users, zones WHERE zones.domain_id=" . $db->quote($id, 'integer') . " AND zones.owner=users.id ORDER by fullname");
477
+        if ($response) {
478
+            $names = array();
479
+            while ($r = $response->fetchRow()) {
480
+                $names [] = $r ['fullname'];
481
+            }
482
+            return implode(', ', $names);
483
+        }
484
+        return "";
485
+    }
486
+    error(ERR_INV_ARG);
487
+}
488
+
489
+/**
490
+ * Verify User is Zone ID owner
491
+ *
492
+ * @param int $zoneid Zone ID
493
+ *
494
+ * @return int 1 if owner, 0 if not owner
495
+ */
496
+function verify_user_is_owner_zoneid_local($zoneid) {
497
+    global $db;
498
+
499
+    $userid = $_SESSION ["userid"];
500
+    if (is_numeric($zoneid)) {
501
+        $response = $db->queryOne("SELECT zones.id FROM zones
502
+				WHERE zones.owner = " . $db->quote($userid, 'integer') . "
503
+				AND zones.domain_id = " . $db->quote($zoneid, 'integer'));
504
+        return ($response ? "1" : "0");
505
+    }
506
+    error(ERR_INV_ARG);
507
+}
508
+
509
+/**
510
+ * Get User Details
511
+ *
512
+ * Gets an array of all users and their details
513
+ *
514
+ * @param int $specific User ID (optional)
515
+ *
516
+ * @return mixed[] array of user details
517
+ */
518
+function get_user_detail_list_local($specific) {
519
+    global $db;
520
+    global $ldap_use;
521
+
522
+    $userid = $_SESSION ['userid'];
523
+
524
+    // fixme: does this actually verify the permission?
525
+    if (v_num($specific)) {
526
+        $sql_add = "AND users.id = " . $db->quote($specific, 'integer');
527
+    } else {
528
+        if (do_hook('verify_permission', 'user_view_others')) {
529
+            $sql_add = "";
530
+        } else {
531
+            $sql_add = "AND users.id = " . $db->quote($userid, 'integer');
532
+        }
533
+    }
534
+
535
+    $query = "SELECT users.id AS uid,
536
+			username,
537
+			fullname,
538
+			email,
539
+			description AS descr,
540
+			active,";
541
+    if ($ldap_use) {
542
+        $query .= "use_ldap,";
543
+    }
544
+
545
+    $query .= "perm_templ.id AS tpl_id,
546
+			perm_templ.name AS tpl_name,
547
+			perm_templ.descr AS tpl_descr
548
+			FROM users, perm_templ
549
+			WHERE users.perm_templ = perm_templ.id " . $sql_add . "
550
+			ORDER BY username";
551
+
552
+    $response = $db->query($query);
553
+    if (PEAR::isError($response)) {
554
+        error($response->getMessage());
555
+        return false;
556
+    }
557
+
558
+    while ($user = $response->fetchRow()) {
559
+        $userlist [] = array(
560
+            "uid" => $user ['uid'],
561
+            "username" => $user ['username'],
562
+            "fullname" => $user ['fullname'],
563
+            "email" => $user ['email'],
564
+            "descr" => $user ['descr'],
565
+            "active" => $user ['active'],
566
+            "use_ldap" => isset($user['use_ldap']) ? $user ['use_ldap'] : 0,
567
+            "tpl_id" => $user ['tpl_id'],
568
+            "tpl_name" => $user ['tpl_name'],
569
+            "tpl_descr" => $user ['tpl_descr']
570
+        );
571
+    }
572
+    return $userlist;
573
+}
574
+
575
+/**
576
+ * Get List of Permissions
577
+ *
578
+ * Get a list of permissions that are available. If first argument is "0", it
579
+ * should return all available permissions. If the first argument is > "0", it
580
+ * should return the permissions assigned to that particular template only. If
581
+ * second argument is true, only the permission names are returned.
582
+ *
583
+ * @param int $templ_id Template ID (optional) [default=0]
584
+ * @param boolean $return_name_only Return name only or all details (optional) [default=false]
585
+ *
586
+ * @return mixed[] array of permissions [id,name,descr] or permission names [name]
587
+ */
588
+function get_permissions_by_template_id_local($templ_id = 0, $return_name_only = false) {
589
+    global $db;
590
+
591
+    $limit = '';
592
+    if ($templ_id > 0) {
593
+        $limit = ", perm_templ_items
594
+			WHERE perm_templ_items.templ_id = " . $db->quote($templ_id, 'integer') . "
595
+			AND perm_templ_items.perm_id = perm_items.id";
596
+    }
597
+
598
+    $query = "SELECT perm_items.id AS id,
599
+			perm_items.name AS name,
600
+			perm_items.descr AS descr
601
+			FROM perm_items" . $limit . "
602
+			ORDER BY name";
603
+    $response = $db->query($query);
604
+    if (PEAR::isError($response)) {
605
+        error($response->getMessage());
606
+        return false;
607
+    }
608
+
609
+    $permission_list = array();
610
+    while ($permission = $response->fetchRow()) {
611
+        if ($return_name_only == false) {
612
+            $permission_list [] = array(
613
+                "id" => $permission ['id'],
614
+                "name" => $permission ['name'],
615
+                "descr" => $permission ['descr']
616
+            );
617
+        } else {
618
+            $permission_list [] = $permission ['name'];
619
+        }
620
+    }
621
+    return $permission_list;
622
+}
623
+
624
+/**
625
+ * Get name and description of template from Template ID
626
+ *
627
+ * @param int $templ_id Template ID
628
+ *
629
+ * @return mixed[] Template details
630
+ */
631
+function get_permission_template_details_local($templ_id) {
632
+    global $db;
633
+
634
+    $query = "SELECT *
635
+			FROM perm_templ
636
+			WHERE perm_templ.id = " . $db->quote($templ_id, 'integer');
637
+
638
+    $response = $db->query($query);
639
+    if (PEAR::isError($response)) {
640
+        error($response->getMessage());
641
+        return false;
642
+    }
643
+
644
+    $details = $response->fetchRow();
645
+    return $details;
646
+}
647
+
648
+/**
649
+ * Add a Permission Template
650
+ *
651
+ * @param mixed[] $details Permission template details [templ_name,templ_descr,perm_id]
652
+ *
653
+ * @return boolean true on success, false otherwise
654
+ */
655
+function add_perm_templ_local($details) {
656
+    global $db;
657
+    global $db_type;
658
+
659
+    // Fix permission template name and description first.
660
+
661
+    $query = "INSERT INTO perm_templ (name, descr)
662
+			VALUES (" . $db->quote($details ['templ_name'], 'text') . ", " . $db->quote($details ['templ_descr'], 'text') . ")";
663
+
664
+    $response = $db->query($query);
665
+    if (PEAR::isError($response)) {
666
+        error($response->getMessage());
667
+        return false;
668
+    }
669
+
670
+    if ($db_type == 'pgsql') {
671
+        $perm_templ_id = $db->lastInsertId('perm_templ_id_seq');
672
+    } else {
673
+        $perm_templ_id = $db->lastInsertId();
674
+    }
675
+
676
+    if (isset($details ['perm_id'])) {
677
+        foreach ($details ['perm_id'] as $perm_id) {
678
+            $query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES (" . $db->quote($perm_templ_id, 'integer') . "," . $db->quote($perm_id, 'integer') . ")";
679
+            $response = $db->query($query);
680
+            if (PEAR::isError($response)) {
681
+                error($response->getMessage());
682
+                return false;
683
+            }
684
+        }
685
+    }
686
+
687
+    return true;
688
+}
689
+
690
+/**
691
+ * Update permission template details
692
+ *
693
+ * @param mixed[] $details Permission Template Details
694
+ *
695
+ * @return boolean true on success, false otherwise
696
+ */
697
+function update_perm_templ_details_local($details) {
698
+    global $db;
699
+
700
+    // Fix permission template name and description first.
701
+
702
+    $query = "UPDATE perm_templ
703
+			SET name = " . $db->quote($details ['templ_name'], 'text') . ",
704
+			descr = " . $db->quote($details ['templ_descr'], 'text') . "
705
+			WHERE id = " . $db->quote($details ['templ_id'], 'integer');
706
+    $response = $db->query($query);
707
+    if (PEAR::isError($response)) {
708
+        error($response->getMessage());
709
+        return false;
710
+    }
711
+
712
+    // Now, update list of permissions assigned to this template. We could do
713
+    // this The Correct Way [tm] by comparing the list of permissions that are
714
+    // currently assigned with a list of permissions that should be assigned and
715
+    // apply the difference between these two lists to the database. That sounds
716
+    // like too much work. Just delete all the permissions currently assigned to
717
+    // the template, than assign all the permessions the template should have.
718
+
719
+    $query = "DELETE FROM perm_templ_items WHERE templ_id = " . $details ['templ_id'];
720
+    $response = $db->query($query);
721
+    if (PEAR::isError($response)) {
722
+        error($response->getMessage());
723
+        return false;
724
+    }
725
+
726
+    if (isset($details ['perm_id'])) {
727
+        foreach ($details ['perm_id'] as $perm_id) {
728
+            $query = "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES (" . $db->quote($details ['templ_id'], 'integer') . "," . $db->quote($perm_id, 'integer') . ")";
729
+            $response = $db->query($query);
730
+            if (PEAR::isError($response)) {
731
+                error($response->getMessage());
732
+                return false;
733
+            }
734
+        }
735
+    }
736
+
737
+    return true;
738
+}
739
+
740
+/**
741
+ * Update User Details
742
+ *
743
+ * @param mixed[] $details User details
744
+ *
745
+ * @return boolean true on success, false otherise
746
+ */
747
+function update_user_details_local($details) {
748
+    global $db;
749
+
750
+    do_hook('verify_permission', 'user_edit_own') ? $perm_edit_own = "1" : $perm_edit_own = "0";
751
+    do_hook('verify_permission', 'user_edit_others') ? $perm_edit_others = "1" : $perm_edit_others = "0";
752
+    do_hook('verify_permission', 'templ_perm_edit') ? $perm_templ_perm_edit = "1" : $perm_templ_perm_edit = "0";
753
+    do_hook('verify_permission', 'user_is_ueberuser') ? $perm_is_godlike = "1" : $perm_is_godlike = "0";
754
+
755
+    if (($details ['uid'] == $_SESSION ["userid"] && $perm_edit_own == "1") || ($details ['uid'] != $_SESSION ["userid"] && $perm_edit_others == "1")) {
756
+
757
+        if (!is_valid_email($details ['email'])) {
758
+            error(ERR_INV_EMAIL);
759
+            return false;
760
+        }
761
+
762
+        if (!isset($details ['active']) || $details ['active'] != "on") {
763
+            $active = 0;
764
+        } else {
765
+            $active = 1;
766
+        }
767
+        if (isset($details ['use_ldap'])) {
768
+            $use_ldap = 1;
769
+        } else {
770
+            $use_ldap = 0;
771
+        }
772
+
773
+        // Before updating the database we need to check whether the user wants to
774
+        // change the username. If the user wants to change the username, we need
775
+        // to make sure it doesn't already exists.
776
+        //
777
+        // First find the current username of the user ID we want to change. If the
778
+        // current username is not the same as the username that was given by the
779
+        // user, the username should apparantly changed. If so, check if the "new"
780
+        // username already exists.
781
+        $query = "SELECT username FROM users WHERE id = " . $db->quote($details ['uid'], 'integer');
782
+        $response = $db->query($query);
783
+        if (PEAR::isError($response)) {
784
+            error($response->getMessage());
785
+            return false;
786
+        }
787
+
788
+        $usercheck = array();
789
+        $usercheck = $response->fetchRow();
790
+
791
+        if ($usercheck ['username'] != $details ['username']) {
792
+            // Username of user ID in the database is different from the name
793
+            // we have been given. User wants a change of username. Now, make
794
+            // sure it doesn't already exist.
795
+            $query = "SELECT id FROM users WHERE username = " . $db->quote($details ['username'], 'text');
796
+            $response = $db->queryOne($query);
797
+            if ($response) {
798
+                error(ERR_USER_EXIST);
799
+                return false;
800
+            }
801
+        }
802
+
803
+        // So, user doesn't want to change username or, if he wants, there is not
804
+        // another user that goes by the wanted username. So, go ahead!
805
+
806
+        $query = "UPDATE users SET username = " . $db->quote($details ['username'], 'text') . ",
807
+            fullname = " . $db->quote($details ['fullname'], 'text') . ",
808
+            email = " . $db->quote($details ['email'], 'text') . ",
809
+            description = " . $db->quote($details ['descr'], 'text') . ",
810
+        active = " . $db->quote($active, 'integer');
811
+
812
+        // If the user is alllowed to change the permission template, set it.
813
+        if ($perm_templ_perm_edit == "1") {
814
+            $query .= ", perm_templ = " . $db->quote($details ['templ_id'], 'integer');
815
+        }
816
+
817
+        // If the user is allowed to change the use_ldap flag, set it.
818
+        if ($perm_is_godlike == "1") {
819
+            $query .= ", use_ldap = " . $db->quote($use_ldap, 'integer');
820
+        }
821
+
822
+        if (isset($details ['password']) && $details ['password'] != "") {
823
+            $query .= ", password = " . $db->quote(Poweradmin\Password::hash($details['password'], 'text'));
824
+        }
825
+
826
+        $query .= " WHERE id = " . $db->quote($details ['uid'], 'integer');
827
+
828
+        $response = $db->query($query);
829
+        if (PEAR::isError($response)) {
830
+            error($response->getMessage());
831
+            return false;
832
+        }
833
+    } else {
834
+        error(ERR_PERM_EDIT_USER);
835
+        return false;
836
+    }
837
+    return true;
838
+}
839
+
840
+/**
841
+ * Add a new user
842
+ *
843
+ * @param mixed[] $details Array of User details
844
+ *
845
+ * @return boolean true on success, false otherwise
846
+ */
847
+function add_new_user_local($details) {
848
+    global $db;
849
+
850
+    if (!do_hook('verify_permission', 'user_add_new')) {
851
+        error(ERR_PERM_ADD_USER);
852
+        return false;
853
+    } elseif (user_exists($details ['username'])) {
854
+        error(ERR_USER_EXIST);
855
+        return false;
856
+    } elseif (!is_valid_email($details ['email'])) {
857
+        error(ERR_INV_EMAIL);
858
+        return false;
859
+    } elseif ($details ['active'] == 1) {
860
+        $active = 1;
861
+    } else {
862
+        $active = 0;
863
+    }
864
+
865
+    $query = "INSERT INTO users (username, password, fullname, email, description,";
866
+    if (do_hook('verify_permission', 'user_edit_templ_perm')) {
867
+        $query .= ' perm_templ,';
868
+    }
869
+
870
+    $password_hash = Poweradmin\Password::hash($details['password']);
871
+
872
+    $query .= " active) VALUES (" . $db->quote($details ['username'], 'text') . ", " . $db->quote($password_hash, 'text') . ", " . $db->quote($details ['fullname'], 'text') . ", " . $db->quote($details ['email'], 'text') . ", " . $db->quote($details ['descr'], 'text') . ", ";
873
+    if (do_hook('verify_permission', 'user_edit_templ_perm')) {
874
+        $query .= $db->quote($details ['perm_templ'], 'integer') . ", ";
875
+    }
876
+    $query .= $db->quote($active, 'integer') . ")";
877
+    $response = $db->query($query);
878
+    if (PEAR::isError($response)) {
879
+        error($response->getMessage());
880
+        return false;
881
+    }
882
+
883
+    return true;
884
+}

+ 2143
- 0
poweradmin/poweradmin-2.1.8/inc/record.inc.php
File diff suppressed because it is too large
View File


+ 635
- 0
poweradmin/poweradmin-2.1.8/inc/templates.inc.php View File

@@ -0,0 +1,635 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2009  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ *  Template functions
26
+ *
27
+ * @package Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+
33
+/** Get a list of all available zone templates
34
+ *
35
+ * @param int $userid User ID
36
+ *
37
+ * @return mixed[] array of zone templates [id,name,descr]
38
+ */
39
+function get_list_zone_templ($userid) {
40
+    global $db;
41
+
42
+    $query = "SELECT * FROM zone_templ "
43
+            . "WHERE owner = '" . $userid . "' "
44
+            . "ORDER BY name";
45
+    $result = $db->query($query);
46
+    if (PEAR::isError($result)) {
47
+        error("Not all tables available in database, please make sure all upgrade/install proceedures were followed");
48
+        return false;
49
+    }
50
+
51
+    $zone_templ_list = array();
52
+    while ($zone_templ = $result->fetchRow()) {
53
+        $zone_templ_list[] = array(
54
+            "id" => $zone_templ['id'],
55
+            "name" => $zone_templ['name'],
56
+            "descr" => $zone_templ['descr']
57
+        );
58
+    }
59
+    return $zone_templ_list;
60
+}
61
+
62
+/** Add a zone template
63
+ *
64
+ * @param mixed[] $details zone template details
65
+ * @param $userid User ID that owns template
66
+ *
67
+ * @return boolean true on success, false otherwise
68
+ */
69
+function add_zone_templ($details, $userid) {
70
+    global $db;
71
+
72
+    $zone_name_exists = zone_templ_name_exists($details['templ_name']);
73
+    if (!(do_hook('verify_permission' , 'zone_master_add' ))) {
74
+        error(ERR_PERM_ADD_ZONE_TEMPL);
75
+        return false;
76
+    } elseif ($zone_name_exists != '0') {
77
+        error(ERR_ZONE_TEMPL_EXIST);
78
+    } else {
79
+        $query = "INSERT INTO zone_templ (name, descr, owner)
80
+			VALUES ("
81
+                . $db->quote($details['templ_name'], 'text') . ", "
82
+                . $db->quote($details['templ_descr'], 'text') . ", "
83
+                . $db->quote($userid, 'integer') . ")";
84
+
85
+        $result = $db->query($query);
86
+        if (PEAR::isError($result)) {
87
+            error($result->getMessage());
88
+            return false;
89
+        }
90
+
91
+        return true;
92
+    }
93
+}
94
+
95
+/** Get name and description of template based on template ID
96
+ *
97
+ * @param int $zone_templ_id Zone template ID
98
+ *
99
+ * @return mixed[] zone template details
100
+ */
101
+function get_zone_templ_details($zone_templ_id) {
102
+    global $db;
103
+
104
+    $query = "SELECT *"
105
+            . " FROM zone_templ"
106
+            . " WHERE id = " . $db->quote($zone_templ_id, 'integer');
107
+
108
+    $result = $db->query($query);
109
+    if (PEAR::isError($result)) {
110
+        error($result->getMessage());
111
+        return false;
112
+    }
113
+
114
+    $details = $result->fetchRow();
115
+    return $details;
116
+}
117
+
118
+/** Delete a zone template
119
+ *
120
+ * @param int $zone_templ_id Zone template ID
121
+ *
122
+ * @return boolean true on success, false otherwise
123
+ */
124
+function delete_zone_templ($zone_templ_id) {
125
+    global $db;
126
+
127
+    if (!(do_hook('verify_permission' , 'zone_master_add' ))) {
128
+        error(ERR_PERM_DEL_ZONE_TEMPL);
129
+        return false;
130
+    } else {
131
+        // Delete the zone template
132
+        $query = "DELETE FROM zone_templ"
133
+                . " WHERE id = " . $db->quote($zone_templ_id, 'integer');
134
+        $result = $db->query($query);
135
+        if (PEAR::isError($result)) {
136
+            error($result->getMessage());
137
+            return false;
138
+        }
139
+
140
+        // Delete the zone template records
141
+        $query = "DELETE FROM zone_templ_records"
142
+                . " WHERE zone_templ_id = " . $db->quote($zone_templ_id, 'integer');
143
+        $result = $db->query($query);
144
+        if (PEAR::isError($result)) {
145
+            error($result->getMessage());
146
+            return false;
147
+        }
148
+
149
+        // Delete references to zone template
150
+        $query = "DELETE FROM records_zone_templ"
151
+                . " WHERE zone_templ_id = " . $db->quote($zone_templ_id, 'integer');
152
+        $result = $db->query($query);
153
+        if (PEAR::isError($result)) {
154
+            error($result->getMessage());
155
+            return false;
156
+        }
157
+
158
+        return true;
159
+    }
160
+}
161
+
162
+/** Delete all zone templates for specific user
163
+ *
164
+ * @param $userid User ID
165
+ *
166
+ * @return boolean true on success, false otherwise
167
+ */
168
+function delete_zone_templ_userid($userid) {
169
+    global $db;
170
+
171
+    if (!(do_hook('verify_permission' , 'zone_master_add' ))) {
172
+        error(ERR_PERM_DEL_ZONE_TEMPL);
173
+        return false;
174
+    } else {
175
+        $query = "DELETE FROM zone_templ"
176
+                . " WHERE owner = " . $db->quote($userid, 'integer');
177
+        $result = $db->query($query);
178
+        if (PEAR::isError($result)) {
179
+            error($result->getMessage());
180
+            return false;
181
+        }
182
+
183
+        return true;
184
+    }
185
+}
186
+
187
+/** Count zone template records
188
+ *
189
+ * @param int $zone_templ_id Zone template ID
190
+ *
191
+ * @return boolean true on success, false otherwise
192
+ */
193
+function count_zone_templ_records($zone_templ_id) {
194
+    global $db;
195
+    $query = "SELECT COUNT(id) FROM zone_templ_records WHERE zone_templ_id = " . $db->quote($zone_templ_id, 'integer');
196
+    $record_count = $db->queryOne($query);
197
+    if (PEAR::isError($record_count)) {
198
+        error($record_count->getMessage());
199
+        return false;
200
+    }
201
+    return $record_count;
202
+}
203
+
204
+/** Check if zone template exist
205
+ *
206
+ * @param int $zone_templ_id Zone template ID
207
+ *
208
+ * @return boolean true on success, false otherwise
209
+ */
210
+function zone_templ_id_exists($zone_templ_id) {
211
+    global $db;
212
+    $query = "SELECT COUNT(id) FROM zone_templ WHERE id = " . $db->quote($zone_templ_id, 'integer');
213
+    $count = $db->queryOne($query);
214
+    if (PEAR::isError($count)) {
215
+        error($count->getMessage());
216
+        return false;
217
+    }
218
+    return $count;
219
+}
220
+
221
+/** Get a zone template record from an id
222
+ *
223
+ * Retrieve all fields of the record and send it back to the function caller.
224
+ *
225
+ * @param int $id zone template record id
226
+ *
227
+ * @return mixed[] zone template record
228
+ * [id,zone_templ_id,name,type,content,ttl,prio] or -1 if nothing is found
229
+ */
230
+function get_zone_templ_record_from_id($id) {
231
+    global $db;
232
+    if (is_numeric($id)) {
233
+        $result = $db->queryRow("SELECT id, zone_templ_id, name, type, content, ttl, prio FROM zone_templ_records WHERE id=" . $db->quote($id, 'integer'));
234
+        if ($result) {
235
+            $ret = array(
236
+                "id" => $result["id"],
237
+                "zone_templ_id" => $result["zone_templ_id"],
238
+                "name" => $result["name"],
239
+                "type" => $result["type"],
240
+                "content" => $result["content"],
241
+                "ttl" => $result["ttl"],
242
+                "prio" => $result["prio"],
243
+            );
244
+            return $ret;
245
+        } else {
246
+            return -1;
247
+        }
248
+    } else {
249
+        error(sprintf(ERR_INV_ARG, "get_zone_templ_record_from_id"));
250
+    }
251
+}
252
+
253
+/** Get all zone template records from a zone template id
254
+ *
255
+ * Retrieve all fields of the records and send it back to the function caller.
256
+ *
257
+ * @param int $id zone template ID
258
+ * @param int $rowstart Starting row (default=0)
259
+ * @param int $rowamount Number of rows per query (default=999999)
260
+ * @param string $sortby Column to sort by (default='name')
261
+ *
262
+ * @return mixed[] zone template records numerically indexed
263
+ * [id,zone_templd_id,name,type,content,ttl,pro] or -1 if nothing is found
264
+ */
265
+function get_zone_templ_records($id, $rowstart = 0, $rowamount = 999999, $sortby = 'name') {
266
+    global $db;
267
+
268
+    if (is_numeric($id)) {
269
+        $db->setLimit($rowamount, $rowstart);
270
+        $result = $db->query("SELECT id FROM zone_templ_records WHERE zone_templ_id=" . $db->quote($id, 'integer') . " ORDER BY " . $sortby);
271
+        $ret[] = array();
272
+        $retcount = 0;
273
+        while ($r = $result->fetchRow()) {
274
+            // Call get_record_from_id for each row.
275
+            $ret[$retcount] = get_zone_templ_record_from_id($r["id"]);
276
+            $retcount++;
277
+        }
278
+        return ($retcount > 0 ? $ret : -1);
279
+    } else {
280
+        error(sprintf(ERR_INV_ARG, "get_zone_templ_records"));
281
+    }
282
+}
283
+
284
+/** Add a record for a zone template
285
+ *
286
+ * This function validates and if correct it inserts it into the database.
287
+ * TODO: actual validation?
288
+ *
289
+ * @param int $zone_templ_id zone template ID
290
+ * @param string $name name part of record
291
+ * @param string $type record type
292
+ * @param string $content record content
293
+ * @param int $ttl TTL
294
+ * @param int $prio Priority
295
+ *
296
+ * @return boolean true if succesful, false otherwise
297
+ */
298
+function add_zone_templ_record($zone_templ_id, $name, $type, $content, $ttl, $prio) {
299
+    global $db;
300
+
301
+    if (!(do_hook('verify_permission' , 'zone_master_add' ))) {
302
+        error(ERR_PERM_ADD_RECORD);
303
+        return false;
304
+    } else {
305
+        if ($content == '') {
306
+            error(ERR_DNS_CONTENT);
307
+            return false;
308
+        }
309
+
310
+        if ($name != '') {
311
+            $query = "INSERT INTO zone_templ_records (zone_templ_id, name, type, content, ttl, prio) VALUES ("
312
+                    . $db->quote($zone_templ_id, 'integer') . ","
313
+                    . $db->quote($name, 'text') . ","
314
+                    . $db->quote($type, 'text') . ","
315
+                    . $db->quote($content, 'text') . ","
316
+                    . $db->quote($ttl, 'integer') . ","
317
+                    . $db->quote($prio, 'integer') . ")";
318
+            $result = $db->query($query);
319
+            if (PEAR::isError($result)) {
320
+                error($result->getMessage());
321
+                return false;
322
+            }
323
+            return true;
324
+        } else {
325
+            error(ERR_DNS_HOSTNAME);
326
+            return false;
327
+        }
328
+    }
329
+}
330
+
331
+/** Modify zone template reocrd
332
+ *
333
+ * Edit a record for a zone template.
334
+ * This function validates it if correct it inserts it into the database.
335
+ *
336
+ * @param mixed[] $record zone record array
337
+ *
338
+ * @return boolean true on success, false otherwise
339
+ */
340
+function edit_zone_templ_record($record) {
341
+    global $db;
342
+
343
+    if (!(do_hook('verify_permission' , 'zone_master_add' ))) {
344
+        error(ERR_PERM_EDIT_RECORD);
345
+        return false;
346
+    } else {
347
+        if ("" != $record['name']) {
348
+            $query = "UPDATE zone_templ_records
349
+                                SET name=" . $db->quote($record['name'], 'text') . ",
350
+                                type=" . $db->quote($record['type'], 'text') . ",
351
+                                content=" . $db->quote($record['content'], 'text') . ",
352
+                                ttl=" . $db->quote($record['ttl'], 'integer') . ",
353
+                                prio=" . $db->quote(isset($record['prio']) ? $record['prio'] : 0, 'integer') . "
354
+                                WHERE id=" . $db->quote($record['rid'], 'integer');
355
+            $result = $db->query($query);
356
+            if (PEAR::isError($result)) {
357
+                error($result->getMessage());
358
+                return false;
359
+            }
360
+            return true;
361
+        } else {
362
+            error(ERR_DNS_HOSTNAME);
363
+            return false;
364
+        }
365
+    }
366
+}
367
+
368
+/** Delete a record for a zone template by a given id
369
+ *
370
+ * @param int $rid template record id
371
+ *
372
+ * @return boolean true on success, false otherwise
373
+ */
374
+function delete_zone_templ_record($rid) {
375
+    global $db;
376
+
377
+    if (!(do_hook('verify_permission' , 'zone_master_add' ))) {
378
+        error(ERR_PERM_DEL_RECORD);
379
+        return false;
380
+    } else {
381
+        $query = "DELETE FROM zone_templ_records WHERE id = " . $db->quote($rid, 'integer');
382
+        $result = $db->query($query);
383
+        if (PEAR::isError($result)) {
384
+            error($result->getMessage());
385
+            return false;
386
+        }
387
+        return true;
388
+    }
389
+}
390
+
391
+/** Check if the session user is the owner for the zone template
392
+ *
393
+ * @param int $zone_templ_id zone template id
394
+ * @param int $userid user id
395
+ *
396
+ * @return boolean true on success, false otherwise
397
+ */
398
+function get_zone_templ_is_owner($zone_templ_id, $userid) {
399
+    global $db;
400
+
401
+    $query = "SELECT owner FROM zone_templ WHERE id = " . $db->quote($zone_templ_id, 'integer');
402
+    $result = $db->queryOne($query);
403
+    if (PEAR::isError($result)) {
404
+        error($result->getMessage());
405
+        return false;
406
+    }
407
+
408
+    if ($result == $userid) {
409
+        return true;
410
+    } else {
411
+        return false;
412
+    }
413
+}
414
+
415
+/** Add a zone template from zone / another template
416
+ *
417
+ * @param string $template_name template name
418
+ * @param string $description description
419
+ * @param int $userid user id
420
+ * @param mixed[] $records array of zone records
421
+ * @param string $domain domain to substitute with '[ZONE]' (optional) [default=null]
422
+ *
423
+ * @return boolean true on success, false otherwise
424
+ */
425
+function add_zone_templ_save_as($template_name, $description, $userid, $records, $domain = null) {
426
+    global $db;
427
+    global $db_type;
428
+
429
+    if (!(do_hook('verify_permission' , 'zone_master_add' ))) {
430
+        error(ERR_PERM_ADD_ZONE_TEMPL);
431
+        return false;
432
+    } else {
433
+        $result = $db->beginTransaction();
434
+
435
+        $query = "INSERT INTO zone_templ (name, descr, owner)
436
+			VALUES ("
437
+                . $db->quote($template_name, 'text') . ", "
438
+                . $db->quote($description, 'text') . ", "
439
+                . $db->quote($userid, 'integer') . ")";
440
+
441
+        $result = $db->exec($query);
442
+
443
+        if ($db_type == 'pgsql') {
444
+            $zone_templ_id = $db->lastInsertId('zone_templ_id_seq');
445
+        } else {
446
+            $zone_templ_id = $db->lastInsertId();
447
+        }
448
+
449
+        $owner = get_zone_templ_is_owner($zone_templ_id, $_SESSION['userid']);
450
+
451
+        foreach ($records as $record) {
452
+
453
+            $name = $domain ? preg_replace('/' . $domain . '/', '[ZONE]', $record['name']) : $record['name'];
454
+            $content = $domain ? preg_replace('/' . $domain . '/', '[ZONE]', $content) : $content;
455
+
456
+            $query2 = "INSERT INTO zone_templ_records (zone_templ_id, name, type, content, ttl, prio) VALUES ("
457
+                    . $db->quote($zone_templ_id, 'integer') . ","
458
+                    . $db->quote($name, 'text') . ","
459
+                    . $db->quote($record['type'], 'text') . ","
460
+                    . $db->quote($record['content'], 'text') . ","
461
+                    . $db->quote($record['ttl'], 'integer') . ","
462
+                    . $db->quote(isset($record['prio']) ? $record['prio'] : 0, 'integer') . ")";
463
+            $result = $db->exec($query2);
464
+        }
465
+
466
+        if (PEAR::isError($result)) {
467
+            $result = $db->rollback();
468
+        } else {
469
+            $result = $db->commit();
470
+        }
471
+    }
472
+    return true;
473
+}
474
+
475
+/** Get list of all zones using template
476
+ *
477
+ * @param int $zone_templ_id zone template id
478
+ * @param int $userid user id
479
+ *
480
+ * @return mixed[] array of zones [id,name,type,count_records]
481
+ */
482
+function get_list_zone_use_templ($zone_templ_id, $userid) {
483
+    global $db;
484
+
485
+    if (do_hook('verify_permission' , 'zone_content_edit_others' )) {
486
+        $perm_edit = "all";
487
+    } elseif (do_hook('verify_permission' , 'zone_content_edit_own' )) {
488
+        $perm_edit = "own";
489
+    } else {
490
+        $perm_edit = "none";
491
+    }
492
+
493
+    $sql_add = '';
494
+    if ($perm_edit != "all") {
495
+        $sql_add = " AND zones.domain_id = domains.id
496
+				AND zones.owner = " . $db->quote($userid, 'integer');
497
+    }
498
+
499
+    $query = "SELECT domains.id,
500
+			domains.name,
501
+			domains.type,
502
+			Record_Count.count_records
503
+			FROM domains
504
+			LEFT JOIN zones ON domains.id=zones.domain_id
505
+			LEFT JOIN (
506
+				SELECT COUNT(domain_id) AS count_records, domain_id FROM records GROUP BY domain_id
507
+			) Record_Count ON Record_Count.domain_id=domains.id
508
+			WHERE 1=1" . $sql_add . "
509
+                        AND zone_templ_id = " . $db->quote($zone_templ_id, 'integer') . "
510
+			GROUP BY domains.name, domains.id, domains.type, Record_Count.count_records";
511
+
512
+    $result = $db->query($query);
513
+    if (PEAR::isError($result)) {
514
+        error("Not all tables available in database, please make sure all upgrade/install proceedures were followed");
515
+        return false;
516
+    }
517
+
518
+    $zone_list = array();
519
+    while ($zone = $result->fetchRow()) {
520
+        $zone_list[] = array(
521
+            "id" => $zone['id'],
522
+            "name" => $zone['name'],
523
+            "type" => $zone['type'],
524
+            "count_records" => $zone['count_records']
525
+        );
526
+    }
527
+    return $zone_list;
528
+}
529
+
530
+/** Modify zone template
531
+ *
532
+ * @param mixed[] $details array of new zone template details
533
+ * @param int $zone_templ_id zone template id
534
+ *
535
+ * @return boolean true on success, false otherwise
536
+ */
537
+function edit_zone_templ($details, $zone_templ_id) {
538
+    global $db;
539
+    $zone_name_exists = zone_templ_name_exists($details['templ_name'], $zone_templ_id);
540
+    if (!(do_hook('verify_permission' , 'zone_master_add' ))) {
541
+        error(ERR_PERM_ADD_ZONE_TEMPL);
542
+        return false;
543
+    } elseif ($zone_name_exists != '0') {
544
+        error(ERR_ZONE_TEMPL_EXIST);
545
+        return false;
546
+    } else {
547
+        $query = "UPDATE zone_templ
548
+			SET name=" . $db->quote($details['templ_name'], 'text') . ",
549
+			descr=" . $db->quote($details['templ_descr'], 'text') . "
550
+			WHERE id=" . $db->quote($zone_templ_id, 'integer');
551
+
552
+        $result = $db->query($query);
553
+        if (PEAR::isError($result)) {
554
+            error($result->getMessage());
555
+            return false;
556
+        }
557
+
558
+        return true;
559
+    }
560
+}
561
+
562
+/** Check if zone template name exists
563
+ *
564
+ * @param string $zone_templ_name zone template name
565
+ * @param int $zone_templ_id zone template id (optional) [default=null]
566
+ *
567
+ * @return int number of matching templates
568
+ */
569
+function zone_templ_name_exists($zone_templ_name, $zone_templ_id = null) {
570
+    global $db;
571
+
572
+    $sql_add = '';
573
+    if ($zone_templ_id) {
574
+        $sql_add = " AND id != " . $db->quote($zone_templ_id, 'integer');
575
+    }
576
+
577
+    $query = "SELECT COUNT(id) FROM zone_templ WHERE name = " . $db->quote($zone_templ_name, 'text') . "" . $sql_add;
578
+    $count = $db->queryOne($query);
579
+    if (PEAR::isError($count)) {
580
+        error($count->getMessage());
581
+        return false;
582
+    }
583
+
584
+    return $count;
585
+}
586
+
587
+/** Parse string and substitute domain and serial
588
+ *
589
+ * @param string $val string to parse containing tokens '[ZONE]' and '[SERIAL]'
590
+ * @param string $domain domain to subsitute for '[ZONE]'
591
+ *
592
+ * @return string interpolated/parsed string
593
+ */
594
+function parse_template_value($val, $domain) {
595
+    $serial = date("Ymd");
596
+    $serial .= "00";
597
+
598
+    $val = str_replace('[ZONE]', $domain, $val);
599
+    $val = str_replace('[SERIAL]', $serial, $val);
600
+    return $val;
601
+}
602
+
603
+/** Add relation between zone record and template
604
+ *
605
+ * @param type $db DB link
606
+ * @param type $domain_id Domain id
607
+ * @param type $record_id Record id
608
+ * @param type $zone_templ_id Zone template id
609
+ */
610
+function add_record_relation_to_templ($db, $domain_id, $record_id, $zone_templ_id) {
611
+    $query = "INSERT INTO records_zone_templ (domain_id, record_id, zone_templ_id) VALUES ("
612
+            . $db->quote($domain_id, 'integer') . ","
613
+            . $db->quote($record_id, 'integer') . ","
614
+            . $db->quote($zone_templ_id, 'integer') . ")";
615
+    $db->query($query);
616
+}
617
+
618
+/** Check if given relation exists
619
+ *
620
+ * @param type $db
621
+ * @param type $domain_id
622
+ * @param type $record_id
623
+ * @param type $zone_templ_id
624
+ * @return boolean true on success, false on failure
625
+ */
626
+function record_relation_to_templ_exists($db, $domain_id, $record_id, $zone_templ_id) {
627
+    $query = "SELECT COUNT(*) FROM records_zone_templ WHERE domain_id = " . $db->quote($domain_id, 'integer') .
628
+            " AND record_id = " . $db->quote($record_id, 'integer') . " AND zone_templ_id = " . $db->quote($zone_templ_id, 'integer');
629
+    $count = $db->queryOne($query);
630
+    if ($count == 0) {
631
+        return false;
632
+    }
633
+
634
+    return true;
635
+}

+ 819
- 0
poweradmin/poweradmin-2.1.8/inc/toolkit.inc.php View File

@@ -0,0 +1,819 @@
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
+/**
24
+ *  Toolkit functions
25
+ *
26
+ * @package     Poweradmin
27
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
28
+ * @copyright   2010-2017  Poweradmin Development Team
29
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
30
+ */
31
+// TODO: display elapsed time and memory consumption,
32
+// used to check improvements in refactored version
33
+$display_stats = false;
34
+if ($display_stats)
35
+    include('inc/benchmark.php');
36
+
37
+ob_start();
38
+
39
+require_once("error.inc.php");
40
+
41
+if (!function_exists('session_start'))
42
+    die(error('You have to install PHP session extension!'));
43
+if (!function_exists('_'))
44
+    die(error('You have to install PHP gettext extension!'));
45
+if (!function_exists('mcrypt_encrypt'))
46
+    die(error('You have to install PHP mcrypt extension!'));
47
+
48
+session_start();
49
+
50
+include_once("config-me.inc.php");
51
+
52
+if (!@include_once("config.inc.php")) {
53
+    error(_('You have to create a config.inc.php!'));
54
+}
55
+
56
+/* * ***********
57
+ * Constants *
58
+ * *********** */
59
+
60
+if (isset($_GET["start"])) {
61
+    define('ROWSTART', (($_GET["start"] - 1) * $iface_rowamount));
62
+} else {
63
+    /** Starting row
64
+     */
65
+    define('ROWSTART', 0);
66
+}
67
+
68
+if (isset($_GET["letter"])) {
69
+    define('LETTERSTART', $_GET["letter"]);
70
+    $_SESSION["letter"] = $_GET["letter"];
71
+} elseif (isset($_SESSION["letter"])) {
72
+    define('LETTERSTART', $_SESSION["letter"]);
73
+} else {
74
+    /** Starting letter
75
+     */
76
+    define('LETTERSTART', "a");
77
+}
78
+
79
+if (isset($_GET["zone_sort_by"]) && preg_match("/^[a-z_]+$/", $_GET["zone_sort_by"])) {
80
+    define('ZONE_SORT_BY', $_GET["zone_sort_by"]);
81
+    $_SESSION["zone_sort_by"] = $_GET["zone_sort_by"];
82
+} elseif (isset($_POST["zone_sort_by"]) && preg_match("/^[a-z_]+$/", $_POST["zone_sort_by"])) {
83
+    define('ZONE_SORT_BY', $_POST["zone_sort_by"]);
84
+    $_SESSION["zone_sort_by"] = $_POST["zone_sort_by"];
85
+} elseif (isset($_SESSION["zone_sort_by"])) {
86
+    define('ZONE_SORT_BY', $_SESSION["zone_sort_by"]);
87
+} else {
88
+    /** Field to sort zone by
89
+     */
90
+    define('ZONE_SORT_BY', "name");
91
+}
92
+
93
+if (isset($_SESSION["userlang"])) {
94
+    $iface_lang = $_SESSION["userlang"];
95
+}
96
+
97
+if (isset($_GET["record_sort_by"]) && preg_match("/^[a-z_]+$/", $_GET["record_sort_by"])) {
98
+    define('RECORD_SORT_BY', $_GET["record_sort_by"]);
99
+    $_SESSION["record_sort_by"] = $_GET["record_sort_by"];
100
+} elseif (isset($_POST["record_sort_by"]) && preg_match("/^[a-z_]+$/", $_POST["record_sort_by"])) {
101
+    define('RECORD_SORT_BY', $_POST["record_sort_by"]);
102
+    $_SESSION["record_sort_by"] = $_POST["record_sort_by"];
103
+} elseif (isset($_SESSION["record_sort_by"])) {
104
+    define('RECORD_SORT_BY', $_SESSION["record_sort_by"]);
105
+} else {
106
+    /** Record to sort zone by
107
+     */
108
+    define('RECORD_SORT_BY', "name");
109
+}
110
+
111
+// Updated on 2017011600 - 1592 TLDs
112
+// http://data.iana.org/TLD/tlds-alpha-by-domain.txt
113
+$valid_tlds = array("aaa", "aarp", "abarth", "abb", "abbott", "abbvie", "abc", "able",
114
+  "abogado", "abudhabi", "ac", "academy", "accenture", "accountant",
115
+  "accountants", "aco", "active", "actor", "ad", "adac", "ads", "adult", "ae",
116
+  "aeg", "aero", "aetna", "af", "afamilycompany", "afl", "ag", "agakhan",
117
+  "agency", "ai", "aig", "aigo", "airbus", "airforce", "airtel", "akdn", "al",
118
+  "alfaromeo", "alibaba", "alipay", "allfinanz", "allstate", "ally", "alsace",
119
+  "alstom", "am", "americanexpress", "americanfamily", "amex", "amfam", "amica",
120
+  "amsterdam", "analytics", "android", "anquan", "anz", "ao", "aol", "apartments",
121
+  "app", "apple", "aq", "aquarelle", "ar", "aramco", "archi", "army", "arpa",
122
+  "art", "arte", "as", "asda", "asia", "associates", "at", "athleta", "attorney",
123
+  "au", "auction", "audi", "audible", "audio", "auspost", "author", "auto",
124
+  "autos", "avianca", "aw", "aws", "ax", "axa", "az", "azure", "ba", "baby",
125
+  "baidu", "banamex", "bananarepublic", "band", "bank", "bar", "barcelona",
126
+  "barclaycard", "barclays", "barefoot", "bargains", "baseball", "basketball",
127
+  "bauhaus", "bayern", "bb", "bbc", "bbt", "bbva", "bcg", "bcn", "bd", "be",
128
+  "beats", "beauty", "beer", "bentley", "berlin", "best", "bestbuy", "bet", "bf",
129
+  "bg", "bh", "bharti", "bi", "bible", "bid", "bike", "bing", "bingo", "bio",
130
+  "biz", "bj", "black", "blackfriday", "blanco", "blockbuster", "blog",
131
+  "bloomberg", "blue", "bm", "bms", "bmw", "bn", "bnl", "bnpparibas", "bo",
132
+  "boats", "boehringer", "bofa", "bom", "bond", "boo", "book", "booking", "boots",
133
+  "bosch", "bostik", "boston", "bot", "boutique", "box", "br", "bradesco",
134
+  "bridgestone", "broadway", "broker", "brother", "brussels", "bs", "bt",
135
+  "budapest", "bugatti", "build", "builders", "business", "buy", "buzz", "bv",
136
+  "bw", "by", "bz", "bzh", "ca", "cab", "cafe", "cal", "call", "calvinklein",
137
+  "cam", "camera", "camp", "cancerresearch", "canon", "capetown", "capital",
138
+  "capitalone", "car", "caravan", "cards", "care", "career", "careers", "cars",
139
+  "cartier", "casa", "case", "caseih", "cash", "casino", "cat", "catering",
140
+  "catholic", "cba", "cbn", "cbre", "cbs", "cc", "cd", "ceb", "center", "ceo",
141
+  "cern", "cf", "cfa", "cfd", "cg", "ch", "chanel", "channel", "chase", "chat",
142
+  "cheap", "chintai", "chloe", "christmas", "chrome", "chrysler", "church", "ci",
143
+  "cipriani", "circle", "cisco", "citadel", "citi", "citic", "city", "cityeats",
144
+  "ck", "cl", "claims", "cleaning", "click", "clinic", "clinique", "clothing",
145
+  "cloud", "club", "clubmed", "cm", "cn", "co", "coach", "codes", "coffee",
146
+  "college", "cologne", "com", "comcast", "commbank", "community", "company",
147
+  "compare", "computer", "comsec", "condos", "construction", "consulting",
148
+  "contact", "contractors", "cooking", "cookingchannel", "cool", "coop",
149
+  "corsica", "country", "coupon", "coupons", "courses", "cr", "credit",
150
+  "creditcard", "creditunion", "cricket", "crown", "crs", "cruise", "cruises",
151
+  "csc", "cu", "cuisinella", "cv", "cw", "cx", "cy", "cymru", "cyou", "cz",
152
+  "dabur", "dad", "dance", "data", "date", "dating", "datsun", "day", "dclk",
153
+  "dds", "de", "deal", "dealer", "deals", "degree", "delivery", "dell",
154
+  "deloitte", "delta", "democrat", "dental", "dentist", "desi", "design", "dev",
155
+  "dhl", "diamonds", "diet", "digital", "direct", "directory", "discount",
156
+  "discover", "dish", "diy", "dj", "dk", "dm", "dnp", "do", "docs", "doctor",
157
+  "dodge", "dog", "doha", "domains", "dot", "download", "drive", "dtv", "dubai",
158
+  "duck", "dunlop", "duns", "dupont", "durban", "dvag", "dvr", "dz", "earth",
159
+  "eat", "ec", "eco", "edeka", "edu", "education", "ee", "eg", "email", "emerck",
160
+  "energy", "engineer", "engineering", "enterprises", "epost", "epson",
161
+  "equipment", "er", "ericsson", "erni", "es", "esq", "estate", "esurance", "et",
162
+  "eu", "eurovision", "eus", "events", "everbank", "exchange", "expert",
163
+  "exposed", "express", "extraspace", "fage", "fail", "fairwinds", "faith",
164
+  "family", "fan", "fans", "farm", "farmers", "fashion", "fast", "fedex",
165
+  "feedback", "ferrari", "ferrero", "fi", "fiat", "fidelity", "fido", "film",
166
+  "final", "finance", "financial", "fire", "firestone", "firmdale", "fish",
167
+  "fishing", "fit", "fitness", "fj", "fk", "flickr", "flights", "flir", "florist",
168
+  "flowers", "fly", "fm", "fo", "foo", "food", "foodnetwork", "football", "ford",
169
+  "forex", "forsale", "forum", "foundation", "fox", "fr", "free", "fresenius",
170
+  "frl", "frogans", "frontdoor", "frontier", "ftr", "fujitsu", "fujixerox", "fun",
171
+  "fund", "furniture", "futbol", "fyi", "ga", "gal", "gallery", "gallo", "gallup",
172
+  "game", "games", "gap", "garden", "gb", "gbiz", "gd", "gdn", "ge", "gea",
173
+  "gent", "genting", "george", "gf", "gg", "ggee", "gh", "gi", "gift", "gifts",
174
+  "gives", "giving", "gl", "glade", "glass", "gle", "global", "globo", "gm",
175
+  "gmail", "gmbh", "gmo", "gmx", "gn", "godaddy", "gold", "goldpoint", "golf",
176
+  "goo", "goodhands", "goodyear", "goog", "google", "gop", "got", "gov", "gp",
177
+  "gq", "gr", "grainger", "graphics", "gratis", "green", "gripe", "group", "gs",
178
+  "gt", "gu", "guardian", "gucci", "guge", "guide", "guitars", "guru", "gw", "gy",
179
+  "hair", "hamburg", "hangout", "haus", "hbo", "hdfc", "hdfcbank", "health",
180
+  "healthcare", "help", "helsinki", "here", "hermes", "hgtv", "hiphop",
181
+  "hisamitsu", "hitachi", "hiv", "hk", "hkt", "hm", "hn", "hockey", "holdings",
182
+  "holiday", "homedepot", "homegoods", "homes", "homesense", "honda", "honeywell",
183
+  "horse", "hospital", "host", "hosting", "hot", "hoteles", "hotmail", "house",
184
+  "how", "hr", "hsbc", "ht", "htc", "hu", "hughes", "hyatt", "hyundai", "ibm",
185
+  "icbc", "ice", "icu", "id", "ie", "ieee", "ifm", "ikano", "il", "im", "imamat",
186
+  "imdb", "immo", "immobilien", "in", "industries", "infiniti", "info", "ing",
187
+  "ink", "institute", "insurance", "insure", "int", "intel", "international",
188
+  "intuit", "investments", "io", "ipiranga", "iq", "ir", "irish", "is", "iselect",
189
+  "ismaili", "ist", "istanbul", "it", "itau", "itv", "iveco", "iwc", "jaguar",
190
+  "java", "jcb", "jcp", "je", "jeep", "jetzt", "jewelry", "jio", "jlc", "jll",
191
+  "jm", "jmp", "jnj", "jo", "jobs", "joburg", "jot", "joy", "jp", "jpmorgan",
192
+  "jprs", "juegos", "juniper", "kaufen", "kddi", "ke", "kerryhotels",
193
+  "kerrylogistics", "kerryproperties", "kfh", "kg", "kh", "ki", "kia", "kim",
194
+  "kinder", "kindle", "kitchen", "kiwi", "km", "kn", "koeln", "komatsu", "kosher",
195
+  "kp", "kpmg", "kpn", "kr", "krd", "kred", "kuokgroup", "kw", "ky", "kyoto",
196
+  "kz", "la", "lacaixa", "ladbrokes", "lamborghini", "lamer", "lancaster",
197
+  "lancia", "lancome", "land", "landrover", "lanxess", "lasalle", "lat", "latino",
198
+  "latrobe", "law", "lawyer", "lb", "lc", "lds", "lease", "leclerc", "lefrak",
199
+  "legal", "lego", "lexus", "lgbt", "li", "liaison", "lidl", "life",
200
+  "lifeinsurance", "lifestyle", "lighting", "like", "lilly", "limited", "limo",
201
+  "lincoln", "linde", "link", "lipsy", "live", "living", "lixil", "lk", "loan",
202
+  "loans", "locker", "locus", "loft", "lol", "london", "lotte", "lotto", "love",
203
+  "lpl", "lplfinancial", "lr", "ls", "lt", "ltd", "ltda", "lu", "lundbeck",
204
+  "lupin", "luxe", "luxury", "lv", "ly", "ma", "macys", "madrid", "maif",
205
+  "maison", "makeup", "man", "management", "mango", "market", "marketing",
206
+  "markets", "marriott", "marshalls", "maserati", "mattel", "mba", "mc", "mcd",
207
+  "mcdonalds", "mckinsey", "md", "me", "med", "media", "meet", "melbourne",
208
+  "meme", "memorial", "men", "menu", "meo", "metlife", "mg", "mh", "miami",
209
+  "microsoft", "mil", "mini", "mint", "mit", "mitsubishi", "mk", "ml", "mlb",
210
+  "mls", "mm", "mma", "mn", "mo", "mobi", "mobile", "mobily", "moda", "moe",
211
+  "moi", "mom", "monash", "money", "monster", "montblanc", "mopar", "mormon",
212
+  "mortgage", "moscow", "moto", "motorcycles", "mov", "movie", "movistar", "mp",
213
+  "mq", "mr", "ms", "msd", "mt", "mtn", "mtpc", "mtr", "mu", "museum", "mutual",
214
+  "mv", "mw", "mx", "my", "mz", "na", "nab", "nadex", "nagoya", "name",
215
+  "nationwide", "natura", "navy", "nba", "nc", "ne", "nec", "net", "netbank",
216
+  "netflix", "network", "neustar", "new", "newholland", "news", "next",
217
+  "nextdirect", "nexus", "nf", "nfl", "ng", "ngo", "nhk", "ni", "nico", "nike",
218
+  "nikon", "ninja", "nissan", "nissay", "nl", "no", "nokia", "northwesternmutual",
219
+  "norton", "now", "nowruz", "nowtv", "np", "nr", "nra", "nrw", "ntt", "nu",
220
+  "nyc", "nz", "obi", "observer", "off", "office", "okinawa", "olayan",
221
+  "olayangroup", "oldnavy", "ollo", "om", "omega", "one", "ong", "onl", "online",
222
+  "onyourside", "ooo", "open", "oracle", "orange", "org", "organic",
223
+  "orientexpress", "origins", "osaka", "otsuka", "ott", "ovh", "pa", "page",
224
+  "pamperedchef", "panasonic", "panerai", "paris", "pars", "partners", "parts",
225
+  "party", "passagens", "pay", "pccw", "pe", "pet", "pf", "pfizer", "pg", "ph",
226
+  "pharmacy", "philips", "phone", "photo", "photography", "photos", "physio",
227
+  "piaget", "pics", "pictet", "pictures", "pid", "pin", "ping", "pink", "pioneer",
228
+  "pizza", "pk", "pl", "place", "play", "playstation", "plumbing", "plus", "pm",
229
+  "pn", "pnc", "pohl", "poker", "politie", "porn", "post", "pr", "pramerica",
230
+  "praxi", "press", "prime", "pro", "prod", "productions", "prof", "progressive",
231
+  "promo", "properties", "property", "protection", "pru", "prudential", "ps",
232
+  "pt", "pub", "pw", "pwc", "py", "qa", "qpon", "quebec", "quest", "qvc",
233
+  "racing", "radio", "raid", "re", "read", "realestate", "realtor", "realty",
234
+  "recipes", "red", "redstone", "redumbrella", "rehab", "reise", "reisen", "reit",
235
+  "reliance", "ren", "rent", "rentals", "repair", "report", "republican", "rest",
236
+  "restaurant", "review", "reviews", "rexroth", "rich", "richardli", "ricoh",
237
+  "rightathome", "ril", "rio", "rip", "rmit", "ro", "rocher", "rocks", "rodeo",
238
+  "rogers", "room", "rs", "rsvp", "ru", "ruhr", "run", "rw", "rwe", "ryukyu",
239
+  "sa", "saarland", "safe", "safety", "sakura", "sale", "salon", "samsclub",
240
+  "samsung", "sandvik", "sandvikcoromant", "sanofi", "sap", "sapo", "sarl", "sas",
241
+  "save", "saxo", "sb", "sbi", "sbs", "sc", "sca", "scb", "schaeffler", "schmidt",
242
+  "scholarships", "school", "schule", "schwarz", "science", "scjohnson", "scor",
243
+  "scot", "sd", "se", "seat", "secure", "security", "seek", "select", "sener",
244
+  "services", "ses", "seven", "sew", "sex", "sexy", "sfr", "sg", "sh",
245
+  "shangrila", "sharp", "shaw", "shell", "shia", "shiksha", "shoes", "shop",
246
+  "shopping", "shouji", "show", "showtime", "shriram", "si", "silk", "sina",
247
+  "singles", "site", "sj", "sk", "ski", "skin", "sky", "skype", "sl", "sling",
248
+  "sm", "smart", "smile", "sn", "sncf", "so", "soccer", "social", "softbank",
249
+  "software", "sohu", "solar", "solutions", "song", "sony", "soy", "space",
250
+  "spiegel", "spot", "spreadbetting", "sr", "srl", "srt", "st", "stada",
251
+  "staples", "star", "starhub", "statebank", "statefarm", "statoil", "stc",
252
+  "stcgroup", "stockholm", "storage", "store", "stream", "studio", "study",
253
+  "style", "su", "sucks", "supplies", "supply", "support", "surf", "surgery",
254
+  "suzuki", "sv", "swatch", "swiftcover", "swiss", "sx", "sy", "sydney",
255
+  "symantec", "systems", "sz", "tab", "taipei", "talk", "taobao", "target",
256
+  "tatamotors", "tatar", "tattoo", "tax", "taxi", "tc", "tci", "td", "tdk",
257
+  "team", "tech", "technology", "tel", "telecity", "telefonica", "temasek",
258
+  "tennis", "teva", "tf", "tg", "th", "thd", "theater", "theatre", "tiaa",
259
+  "tickets", "tienda", "tiffany", "tips", "tires", "tirol", "tj", "tjmaxx", "tjx",
260
+  "tk", "tkmaxx", "tl", "tm", "tmall", "tn", "to", "today", "tokyo", "tools",
261
+  "top", "toray", "toshiba", "total", "tours", "town", "toyota", "toys", "tr",
262
+  "trade", "trading", "training", "travel", "travelchannel", "travelers",
263
+  "travelersinsurance", "trust", "trv", "tt", "tube", "tui", "tunes", "tushu",
264
+  "tv", "tvs", "tw", "tz", "ua", "ubank", "ubs", "uconnect", "ug", "uk", "unicom",
265
+  "university", "uno", "uol", "ups", "us", "uy", "uz", "va", "vacations", "vana",
266
+  "vanguard", "vc", "ve", "vegas", "ventures", "verisign", "versicherung", "vet",
267
+  "vg", "vi", "viajes", "video", "vig", "viking", "villas", "vin", "vip",
268
+  "virgin", "visa", "vision", "vista", "vistaprint", "viva", "vivo", "vlaanderen",
269
+  "vn", "vodka", "volkswagen", "volvo", "vote", "voting", "voto", "voyage", "vu",
270
+  "vuelos", "wales", "walmart", "walter", "wang", "wanggou", "warman", "watch",
271
+  "watches", "weather", "weatherchannel", "webcam", "weber", "website", "wed",
272
+  "wedding", "weibo", "weir", "wf", "whoswho", "wien", "wiki", "williamhill",
273
+  "win", "windows", "wine", "winners", "wme", "wolterskluwer", "woodside", "work",
274
+  "works", "world", "wow", "ws", "wtc", "wtf", "xbox", "xerox", "xfinity",
275
+  "xihuan", "xin", "xn--11b4c3d", "xn--1ck2e1b", "xn--1qqw23a", "xn--30rr7y",
276
+  "xn--3bst00m", "xn--3ds443g", "xn--3e0b707e", "xn--3oq18vl8pn36a", "xn--3pxu8k",
277
+  "xn--42c2d9a", "xn--45brj9c", "xn--45q11c", "xn--4gbrim", "xn--54b7fta0cc",
278
+  "xn--55qw42g", "xn--55qx5d", "xn--5su34j936bgsg", "xn--5tzm5g", "xn--6frz82g",
279
+  "xn--6qq986b3xl", "xn--80adxhks", "xn--80ao21a", "xn--80aqecdr1a",
280
+  "xn--80asehdb", "xn--80aswg", "xn--8y0a063a", "xn--90a3ac", "xn--90ae",
281
+  "xn--90ais", "xn--9dbq2a", "xn--9et52u", "xn--9krt00a", "xn--b4w605ferd",
282
+  "xn--bck1b9a5dre4c", "xn--c1avg", "xn--c2br7g", "xn--cck2b3b", "xn--cg4bki",
283
+  "xn--clchc0ea0b2g2a9gcd", "xn--czr694b", "xn--czrs0t", "xn--czru2d",
284
+  "xn--d1acj3b", "xn--d1alf", "xn--e1a4c", "xn--eckvdtc9d", "xn--efvy88h",
285
+  "xn--estv75g", "xn--fct429k", "xn--fhbei", "xn--fiq228c5hs", "xn--fiq64b",
286
+  "xn--fiqs8s", "xn--fiqz9s", "xn--fjq720a", "xn--flw351e", "xn--fpcrj9c3d",
287
+  "xn--fzc2c9e2c", "xn--fzys8d69uvgm", "xn--g2xx48c", "xn--gckr3f0f",
288
+  "xn--gecrj9c", "xn--gk3at1e", "xn--h2brj9c", "xn--hxt814e", "xn--i1b6b1a6a2e",
289
+  "xn--imr513n", "xn--io0a7i", "xn--j1aef", "xn--j1amh", "xn--j6w193g",
290
+  "xn--jlq61u9w7b", "xn--jvr189m", "xn--kcrx77d1x4a", "xn--kprw13d",
291
+  "xn--kpry57d", "xn--kpu716f", "xn--kput3i", "xn--l1acc", "xn--lgbbat1ad8j",
292
+  "xn--mgb9awbf", "xn--mgba3a3ejt", "xn--mgba3a4f16a", "xn--mgba7c0bbn0a",
293
+  "xn--mgbaam7a8h", "xn--mgbab2bd", "xn--mgbayh7gpa", "xn--mgbb9fbpob",
294
+  "xn--mgbbh1a71e", "xn--mgbc0a9azcg", "xn--mgbca7dzdo", "xn--mgberp4a5d4ar",
295
+  "xn--mgbi4ecexp", "xn--mgbpl2fh", "xn--mgbt3dhd", "xn--mgbtx2b",
296
+  "xn--mgbx4cd0ab", "xn--mix891f", "xn--mk1bu44c", "xn--mxtq1m", "xn--ngbc5azd",
297
+  "xn--ngbe9e0a", "xn--node", "xn--nqv7f", "xn--nqv7fs00ema", "xn--nyqy26a",
298
+  "xn--o3cw4h", "xn--ogbpf8fl", "xn--p1acf", "xn--p1ai", "xn--pbt977c",
299
+  "xn--pgbs0dh", "xn--pssy2u", "xn--q9jyb4c", "xn--qcka1pmc", "xn--qxam",
300
+  "xn--rhqv96g", "xn--rovu88b", "xn--s9brj9c", "xn--ses554g", "xn--t60b56a",
301
+  "xn--tckwe", "xn--tiq49xqyj", "xn--unup4y", "xn--vermgensberater-ctb",
302
+  "xn--vermgensberatung-pwb", "xn--vhquv", "xn--vuq861b", "xn--w4r85el8fhu5dnra",
303
+  "xn--w4rs40l", "xn--wgbh1c", "xn--wgbl6a", "xn--xhq521b", "xn--xkc2al3hye2a",
304
+  "xn--xkc2dl3a5ee0h", "xn--y9a3aq", "xn--yfro4i67o", "xn--ygbi2ammx",
305
+  "xn--zfr164b", "xperia", "xxx", "xyz", "yachts", "yahoo", "yamaxun", "yandex",
306
+  "ye", "yodobashi", "yoga", "yokohama", "you", "youtube", "yt", "yun", "za",
307
+  "zappos", "zara", "zero", "zip", "zippo", "zm", "zone", "zuerich", "zw");
308
+
309
+// Special TLDs for testing and documentation purposes
310
+// http://tools.ietf.org/html/rfc2606#section-2
311
+array_push($valid_tlds, 'test', 'example', 'invalid', 'localhost');
312
+
313
+/* Database connection */
314
+require_once("database.inc.php");
315
+// Generates $db variable to access database.
316
+// Array of the available zone types
317
+$server_types = array("MASTER", "SLAVE", "NATIVE");
318
+
319
+// $rtypes - array of possible record types
320
+$rtypes = array(
321
+    'A',
322
+    'A6',
323
+    'AAAA',
324
+    'AFSDB',
325
+    'ALIAS',
326
+    'CAA',
327
+    'CDNSKEY',
328
+    'CDS',
329
+    'CERT',
330
+    'CNAME',
331
+    'DHCID',
332
+    'DLV',
333
+    'DNSKEY',
334
+    'DNAME',
335
+    'DS',
336
+    'EUI48',
337
+    'EUI64',
338
+    'HINFO',
339
+    'IPSECKEY',
340
+    'KEY',
341
+    'KX',
342
+    'LOC',
343
+    'MAILA',
344
+    'MAILB',
345
+    'MINFO',
346
+    'MR',
347
+    'MX',
348
+    'NAPTR',
349
+    'NS',
350
+    'NSEC',
351
+    'NSEC3',
352
+    'NSEC3PARAM',
353
+    'OPENPGPKEY',
354
+    'OPT',
355
+    'PTR',
356
+    'RKEY',
357
+    'RP',
358
+    'RRSIG',
359
+    'SIG',
360
+    'SOA',
361
+    'SPF',
362
+    'SRV',
363
+    'SSHFP',
364
+    'TLSA',
365
+    'TKEY',
366
+    'TSIG',
367
+    'TXT',
368
+    'WKS',
369
+    'URI'
370
+);
371
+
372
+// If fancy records is enabled, extend this field.
373
+if ($dns_fancy) {
374
+    $rtypes[] = 'URL';
375
+    $rtypes[] = 'MBOXFW';
376
+    $rtypes[] = 'CURL';
377
+}
378
+
379
+
380
+/* * ***********
381
+ * Includes  *
382
+ * *********** */
383
+$db = dbConnect();
384
+require_once "plugin.inc.php";
385
+require_once "i18n.inc.php";
386
+require_once "auth.inc.php";
387
+require_once "users.inc.php";
388
+require_once "dns.inc.php";
389
+require_once "record.inc.php";
390
+require_once "dnssec.inc.php";
391
+require_once "templates.inc.php";
392
+
393
+//do_hook('hook_post_includes');
394
+do_hook('authenticate');
395
+
396
+
397
+/* * ***********
398
+ * Functions *
399
+ * *********** */
400
+
401
+/** Print paging menu
402
+ *
403
+ * Display the page option: [ < ][ 1 ] .. [ 8 ][ 9 ][ 10 ][ 11 ][ 12 ][ 13 ][ 14 ][ 15 ][ 16 ] .. [ 34 ][ > ]
404
+ *
405
+ * @param int $amount Total number of items
406
+ * @param int $rowamount Per page number of items
407
+ * @param int $id Page specific ID (Zone ID, Template ID, etc)
408
+ *
409
+ * @return null
410
+ */
411
+function show_pages($amount, $rowamount, $id = '') {
412
+    if ($amount > $rowamount) {
413
+        $num = 8;
414
+        $poutput = '';
415
+        $lastpage = ceil($amount / $rowamount);
416
+        $startpage = 1;
417
+
418
+        if (!isset($_GET["start"]))
419
+            $_GET["start"] = 1;
420
+        $start = $_GET["start"];
421
+
422
+        if ($lastpage > $num & $start > ($num / 2)) {
423
+            $startpage = ($start - ($num / 2));
424
+        }
425
+
426
+        echo _('Show page') . ":<br>";
427
+
428
+        if ($lastpage > $num & $start > 1) {
429
+            $poutput .= '<a href=" ' . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES);
430
+            $poutput .= '?start=' . ($start - 1);
431
+            if ($id != '')
432
+                $poutput .= '&id=' . $id;
433
+            $poutput .= '">';
434
+            $poutput .= '[ < ]';
435
+            $poutput .= '</a>';
436
+        }
437
+        if ($start != 1) {
438
+            $poutput .= '<a href=" ' . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES);
439
+            $poutput .= '?start=1';
440
+            if ($id != '')
441
+                $poutput .= '&id=' . $id;
442
+            $poutput .= '">';
443
+            $poutput .= '[ 1 ]';
444
+            $poutput .= '</a>';
445
+            if ($startpage > 2)
446
+                $poutput .= ' .. ';
447
+        }
448
+
449
+        for ($i = $startpage; $i <= min(($startpage + $num), $lastpage); $i++) {
450
+            if ($start == $i) {
451
+                $poutput .= '[ <b>' . $i . '</b> ]';
452
+            } elseif ($i != $lastpage & $i != 1) {
453
+                $poutput .= '<a href=" ' . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES);
454
+                $poutput .= '?start=' . $i;
455
+                if ($id != '')
456
+                    $poutput .= '&id=' . $id;
457
+                $poutput .= '">';
458
+                $poutput .= '[ ' . $i . ' ]';
459
+                $poutput .= '</a>';
460
+            }
461
+        }
462
+
463
+        if ($start != $lastpage) {
464
+            if (min(($startpage + $num), $lastpage) < ($lastpage - 1))
465
+                $poutput .= ' .. ';
466
+            $poutput .= '<a href=" ' . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES);
467
+            $poutput .= '?start=' . $lastpage;
468
+            if ($id != '')
469
+                $poutput .= '&id=' . $id;
470
+            $poutput .= '">';
471
+            $poutput .= '[ ' . $lastpage . ' ]';
472
+            $poutput .= '</a>';
473
+        }
474
+
475
+        if ($lastpage > $num & $start < $lastpage) {
476
+            $poutput .= '<a href=" ' . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES);
477
+            $poutput .= '?start=' . ($start + 1);
478
+            if ($id != '')
479
+                $poutput .= '&id=' . $id;
480
+            $poutput .= '">';
481
+            $poutput .= '[ > ]';
482
+            $poutput .= '</a>';
483
+        }
484
+
485
+        echo $poutput;
486
+    }
487
+}
488
+
489
+/** Print alphanumeric paging menu
490
+ *
491
+ * Display the alphabetic option: [0-9] [a] [b] .. [z]
492
+ *
493
+ * @param string $letterstart Starting letter/number or 'all'
494
+ * @param int $userid Current user ID
495
+ *
496
+ * @return null
497
+ */
498
+function show_letters($letterstart, $userid) {
499
+    global $db;
500
+
501
+    $char_range = array_merge(range('a', 'z'), array('_'));
502
+
503
+    $allowed = zone_content_view_others($userid);
504
+
505
+    $query = "SELECT
506
+			DISTINCT SUBSTRING(domains.name, 1, 1) AS letter
507
+			FROM domains
508
+			LEFT JOIN zones ON domains.id = zones.domain_id
509
+			WHERE " . $allowed . " = 1
510
+			OR zones.owner = " . $userid . "
511
+			ORDER BY 1";
512
+    $db->setLimit(36);
513
+
514
+    $available_chars = array();
515
+    $digits_available = 0;
516
+
517
+    $response = $db->query($query);
518
+
519
+    while ($row = $response->fetchRow()) {
520
+        if (preg_match("/[0-9]/", $row['letter'])) {
521
+	    $digits_available = 1;
522
+	} elseif (in_array($row['letter'], $char_range)) {
523
+	    array_push($available_chars, $row['letter']);
524
+	}
525
+    }
526
+
527
+    echo _('Show zones beginning with') . ":<br>";
528
+
529
+    if ($letterstart == "1") {
530
+        echo "<span class=\"lettertaken\">[ 0-9 ]</span> ";
531
+    } elseif ($digits_available) {
532
+        echo "<a href=\"" . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES) . "?letter=1\">[ 0-9 ]</a> ";
533
+    } else {
534
+        echo "[ <span class=\"letternotavailable\">0-9</span> ] ";
535
+    }
536
+
537
+    foreach ($char_range as $letter) {
538
+        if ($letter == $letterstart) {
539
+            echo "<span class=\"lettertaken\">[ " . $letter . " ]</span> ";
540
+        } elseif (in_array($letter, $available_chars)) {
541
+            echo "<a href=\"" . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES) . "?letter=" . $letter . "\">[ " . $letter . " ]</a> ";
542
+        } else {
543
+            echo "[ <span class=\"letternotavailable\">" . $letter . "</span> ] ";
544
+        }
545
+    }
546
+
547
+    if ($letterstart == 'all') {
548
+        echo "<span class=\"lettertaken\">[ Show all ]</span>";
549
+    } else {
550
+        echo "<a href=\"" . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES) . "?letter=all\">[ Show all ]</a> ";
551
+    }
552
+}
553
+
554
+/** Check if current user allowed to view any zone content
555
+ *
556
+ * @param int $userid Current user ID
557
+ *
558
+ * @return int 1 if user has permission to view other users zones content, 0 otherwise
559
+ */
560
+function zone_content_view_others($userid) {
561
+    global $db;
562
+
563
+    $query = "SELECT
564
+		DISTINCT u.id
565
+		FROM 	users u,
566
+		        perm_templ pt,
567
+		        perm_templ_items pti,
568
+		        (SELECT id FROM perm_items WHERE name
569
+			    IN ('zone_content_view_others', 'user_is_ueberuser')) pit
570
+                WHERE u.id = " . $userid . "
571
+                AND u.perm_templ = pt.id
572
+                AND pti.templ_id = pt.id
573
+                AND pti.perm_id  = pit.id";
574
+
575
+    $result = $db->queryOne($query);
576
+
577
+    return ($result ? 1 : 0);
578
+}
579
+
580
+/** Print success message (toolkit.inc)
581
+ *
582
+ * @param string $msg Success message
583
+ *
584
+ * @return null
585
+ */
586
+function success($msg) {
587
+    if ($msg) {
588
+        echo "     <div class=\"success\">" . $msg . "</div>\n";
589
+    } else {
590
+        echo "     <div class=\"success\">" . _('Something has been successfully performed. What exactly, however, will remain a mystery.') . "</div>\n";
591
+    }
592
+}
593
+
594
+/** Print message
595
+ *
596
+ * Something has been done nicely, display a message and a back button.
597
+ *
598
+ * @param string $msg Message
599
+ *
600
+ * @return null
601
+ */
602
+function message($msg) {
603
+    include_once("header.inc.php");
604
+    ?>
605
+    <P><TABLE CLASS="messagetable"><TR><TD CLASS="message"><H2><?php echo _('Success!'); ?></H2>
606
+                <BR>
607
+                <FONT STYLE="font-weight: Bold">
608
+                <P>
609
+                    <?php
610
+                    if ($msg) {
611
+                        echo nl2br($msg);
612
+                    } else {
613
+                        echo _('Successful!');
614
+                    }
615
+                    ?>
616
+                </P>
617
+                <BR>
618
+                <P>
619
+                    <a href="javascript:history.go(-1)">&lt;&lt; <?php echo _('back'); ?></a></FONT>
620
+                </P>
621
+            </TD></TR></TABLE></P>
622
+    <?php
623
+    include_once("footer.inc.php");
624
+}
625
+
626
+/** Send 302 Redirect with optional argument
627
+ *
628
+ * Reroute a user to a cleanpage of (if passed) arg
629
+ *
630
+ * @param string $arg argument string to add to url
631
+ *
632
+ * @return null
633
+ */
634
+function clean_page($arg = '') {
635
+    if (!$arg) {
636
+        header("Location: " . htmlentities($_SERVER['SCRIPT_NAME'], ENT_QUOTES) . "?time=" . time());
637
+        exit;
638
+    } else {
639
+        if (preg_match('!\?!si', $arg)) {
640
+            $add = "&time=";
641
+        } else {
642
+            $add = "?time=";
643
+        }
644
+        header("Location: $arg$add" . time());
645
+        exit;
646
+    }
647
+}
648
+
649
+/** Validate email address string
650
+ *
651
+ * @param string $address email address string
652
+ *
653
+ * @return boolean true if valid, false otherwise
654
+ */
655
+function is_valid_email($address) {
656
+    $fields = preg_split("/@/", $address, 2);
657
+    if ((!preg_match("/^[0-9a-z]([-_.]?[0-9a-z])*$/i", $fields[0])) || (!isset($fields[1]) || $fields[1] == '' || !is_valid_hostname_fqdn($fields[1], 0))) {
658
+        return false;
659
+    }
660
+    return true;
661
+}
662
+
663
+/** Validate numeric string
664
+ *
665
+ * @param string $string number
666
+ *
667
+ * @return boolean true if number, false otherwise
668
+ */
669
+function v_num($string) {
670
+    if (!preg_match("/^[0-9]+$/i", $string)) {
671
+        return false;
672
+    } else {
673
+        return true;
674
+    }
675
+}
676
+
677
+/** Debug print
678
+ *
679
+ * @param string $var debug statement
680
+ *
681
+ * @return null
682
+ */
683
+function debug_print($var) {
684
+    echo "<pre style=\"border: 2px solid blue;\">\n";
685
+    if (is_array($var)) {
686
+        print_r($var);
687
+    } else {
688
+        echo $var;
689
+    }
690
+    echo "</pre>\n";
691
+}
692
+
693
+function do_log($syslog_message, $priority) {
694
+    global $syslog_use, $syslog_ident, $syslog_facility;
695
+    if ($syslog_use) {
696
+        openlog($syslog_ident, LOG_PERROR, $syslog_facility);
697
+        syslog($priority, $syslog_message);
698
+        closelog();
699
+    }
700
+}
701
+
702
+function log_error($syslog_message) {
703
+    do_log($syslog_message, LOG_ERR);
704
+}
705
+
706
+function log_warn($syslog_message) {
707
+    do_log($syslog_message, LOG_WARNING);
708
+}
709
+
710
+function log_notice($syslog_message) {
711
+    do_log($syslog_message, LOG_NOTICE);
712
+}
713
+
714
+function log_info($syslog_message) {
715
+    do_log($syslog_message, LOG_INFO);
716
+}
717
+
718
+/** Print the login form
719
+ *
720
+ * @param string $msg Error Message
721
+ * @param string $type Message type [default='success', 'error']
722
+ *
723
+ * @return null
724
+ */
725
+function auth($msg = "", $type = "success") {
726
+    include_once 'inc/header.inc.php';
727
+    include_once 'inc/config.inc.php';
728
+    global $iface_lang;
729
+
730
+    if ($msg) {
731
+        print "<div class=\"$type\">$msg</div>\n";
732
+    }
733
+    ?>
734
+    <h2><?php echo _('Log in'); ?></h2>
735
+    <form method="post" action="<?php echo htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES); ?>">
736
+        <input type="hidden" name="query_string" value="<?php echo htmlentities($_SERVER["QUERY_STRING"]); ?>">
737
+        <table border="0">
738
+            <tr>
739
+                <td class="n" width="100"><?php echo _('Username'); ?>:</td>
740
+                <td class="n"><input type="text" class="input" name="username" id="username"></td>
741
+            </tr>
742
+            <tr>
743
+                <td class="n"><?php echo _('Password'); ?>:</td>
744
+                <td class="n"><input type="password" class="input" name="password"></td>
745
+            </tr>
746
+            <tr>
747
+                <td class="n"><?php echo _('Language'); ?>:</td>
748
+                <td class="n">
749
+                    <select class="input" name="userlang">
750
+                        <?php
751
+                        // List available languages (sorted alphabetically)
752
+                        include_once 'inc/countrycodes.inc.php';
753
+                        $locales = scandir('locale/');
754
+                        foreach ($locales as $locale) {
755
+                            if (strlen($locale) == 5) {
756
+                                $locales_fullname[$locale] = $country_codes[substr($locale, 0, 2)];
757
+                            }
758
+                        }
759
+                        asort($locales_fullname);
760
+                        foreach ($locales_fullname as $locale => $language) {
761
+                            if (substr($locale, 0, 2) == substr($iface_lang, 0, 2)) {
762
+                                echo _('<option selected value="' . $locale . '">' . $language);
763
+                            } else {
764
+                                echo _('<option value="' . $locale . '">' . $language);
765
+                            }
766
+                        }
767
+                        ?>
768
+                    </select>
769
+                </td>
770
+            </tr>
771
+            <tr>
772
+                <td class="n">&nbsp;</td>
773
+                <td class="n">
774
+                    <input type="submit" name="authenticate" class="button" value=" <?php echo _('Go'); ?> ">
775
+                </td>
776
+            </tr>
777
+        </table>
778
+    </form>
779
+    <script type="text/javascript">
780
+        <!--
781
+      document.getElementById('username').focus();
782
+        //-->
783
+    </script>
784
+    <?php
785
+    include_once('inc/footer.inc.php');
786
+    exit;
787
+}
788
+
789
+/** Logout the user
790
+ *
791
+ * Logout the user and kickback to login form
792
+ *
793
+ * @param string $msg Error Message
794
+ * @param string $type Message type [default='']
795
+ *
796
+ * @return null
797
+ */
798
+function logout($msg = "", $type = "") {
799
+    session_unset();
800
+    session_destroy();
801
+    session_write_close();
802
+    auth($msg, $type);
803
+    exit;
804
+}
805
+
806
+/** Matches end of string
807
+ *
808
+ * Matches end of string (haystack) against another string (needle)
809
+ *
810
+ * @param string $needle
811
+ * @param string $haystack
812
+ *
813
+ * @return true if ends with specified string, otherwise false
814
+ */
815
+function endsWith($needle, $haystack) {
816
+    $length = strlen($haystack);
817
+    $nLength = strlen($needle);
818
+    return $nLength <= $length && strncmp(substr($haystack, -$nLength), $needle, $nLength) === 0;
819
+}

+ 251
- 0
poweradmin/poweradmin-2.1.8/inc/users.inc.php View File

@@ -0,0 +1,251 @@
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
+/**
24
+ *  User profile functions
25
+ *
26
+ * @package     Poweradmin
27
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
28
+ * @copyright   2010-2017  Poweradmin Development Team
29
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
30
+ */
31
+
32
+/*
33
+ * these are the standard listeners.
34
+ * if you want to use your own put them first or replace them
35
+ * first read gets used;
36
+ */
37
+
38
+/**
39
+ * Verify User has Permission Name
40
+ *
41
+ * Function to see if user has right to do something. It will check if
42
+ * user has "ueberuser" bit set. If it isn't, it will check if the user has
43
+ * the specific permission. It returns "false" if the user doesn't have the
44
+ * right, and "true" if the user has.
45
+ *
46
+ * @param array arg[0] Permission name
47
+ *
48
+ * @return boolean true if user has permission, false otherwise
49
+ *
50
+ */
51
+add_listener('verify_permission', 'verify_permission_local');
52
+
53
+/**
54
+ * Retrieve all users
55
+ *
56
+ * Its to show_users therefore the odd name. Has to be changed.
57
+ *
58
+ * @param int $id Exclude User ID
59
+ * @param int $rowstart Startring row number
60
+ * @param int $rowamount Number of rows to return this query
61
+ *
62
+ * @return mixed[] array with all users [id,username,fullname,email,description,active,numdomains]
63
+ */
64
+add_listener('show_users', 'show_users_local');
65
+
66
+/**
67
+ * Change User Password
68
+ *
69
+ * Change the pass of the user.
70
+ * The user is automatically logged out after the pass change.
71
+ *
72
+ * @param mixed[] $details User Details
73
+ *
74
+ * @return null
75
+ */
76
+add_listener('change_user_pass', 'change_user_pass_local');
77
+
78
+/**
79
+ * Get a list of all available permission templates
80
+ *
81
+ * @return mixed[] array of templates [id, name, descr]
82
+ */
83
+add_listener('list_permission_templates', 'list_permission_templates_local');
84
+
85
+/**
86
+ * Check if Valid User
87
+ *
88
+ * Check if the given $userid is connected to a valid user.
89
+ *
90
+ * @param int $id User ID
91
+ *
92
+ * @return boolean true if user exists, false if users doesnt exist
93
+ */
94
+add_listener('is_valid_user', 'is_valid_user_local');
95
+
96
+/**
97
+ * Delete User ID
98
+ *
99
+ * Delete a user from the system. Will also delete zones owned by user or
100
+ * re-assign those zones to a new specified owner.
101
+ * $zones is an array of zone 'zid's to delete or re-assign depending on
102
+ * 'target' value [delete,new_owner] and 'newowner' value
103
+ *
104
+ * @param int $uid User ID to delete
105
+ * @param mixed[] $zones Array of zones
106
+ *
107
+ * @return boolean true on success, false otherwise
108
+ */
109
+add_listener('delete_user', 'delete_user_local');
110
+
111
+/**
112
+ * Delete Permission Template ID
113
+ *
114
+ * @param int $ptid Permission template ID
115
+ *
116
+ * @return boolean true on success, false otherwise
117
+ */
118
+add_listener('delete_perm_templ', 'delete_perm_templ_local');
119
+
120
+/**
121
+ * Modify User Details
122
+ *
123
+ * Edit the information of an user.. sloppy implementation with too many queries.. (2) :)
124
+ *
125
+ * @param int $id User ID
126
+ * @param string $user Username
127
+ * @param string $fullname Full Name
128
+ * @param string $email Email address
129
+ * @param string $perm_templ Permission Template Name
130
+ * @param string $description Description
131
+ * @param int $active Active User
132
+ * @param string $password Password
133
+ *
134
+ * @return boolean true if succesful, false otherwise
135
+ */
136
+add_listener('edit_user', 'edit_user_local');
137
+
138
+/**
139
+ * Get User FullName from User ID
140
+ *
141
+ * Get a fullname when you have a userid.
142
+ *
143
+ * @param int $id
144
+ *        	User ID
145
+ *
146
+ * @return string Full Name
147
+ */
148
+add_listener('get_fullname_from_userid', 'get_fullname_from_userid_local');
149
+
150
+/**
151
+ * Get User FullName from User ID
152
+ * fixme: Duplicate function
153
+ *
154
+ * Get a fullname when you have a userid.
155
+ *
156
+ * @param int $id User ID
157
+ *
158
+ * @return string Full Name
159
+ */
160
+add_listener('get_owner_from_id', 'get_owner_from_id_local');
161
+
162
+/**
163
+ * Get Full Names of owners for a Domain ID
164
+ *
165
+ * @todo also fetch the subowners
166
+ *
167
+ * @param int $id Domain ID
168
+ *
169
+ * @return string[] array of owners for domain
170
+ */
171
+add_listener('get_fullnames_owners_from_domainid', 'get_fullnames_owners_from_domainid_local');
172
+
173
+/**
174
+ * Verify User is Zone ID owner
175
+ *
176
+ * @param int $zoneid Zone ID
177
+ *
178
+ * @return int 1 if owner, 0 if not owner
179
+ */
180
+add_listener('verify_user_is_owner_zoneid', 'verify_user_is_owner_zoneid_local');
181
+
182
+/**
183
+ * Get User Details
184
+ *
185
+ * Gets an array of all users and their details
186
+ *
187
+ * @param int $specific User ID (optional)
188
+ *
189
+ * @return mixed[] array of user details
190
+ */
191
+add_listener('get_user_detail_list', 'get_user_detail_list_local');
192
+
193
+/**
194
+ * Get List of Permissions
195
+ *
196
+ * Get a list of permissions that are available. If first argument is "0", it
197
+ * should return all available permissions. If the first argument is > "0", it
198
+ * should return the permissions assigned to that particular template only. If
199
+ * second argument is true, only the permission names are returned.
200
+ *
201
+ * @param int $templ_id Template ID (optional) [default=0]
202
+ * @param boolean $return_name_only Return name only or all details (optional) [default=false]
203
+ *
204
+ * @return mixed[] array of permissions [id,name,descr] or permission names [name]
205
+ */
206
+add_listener('get_permissions_by_template_id', 'get_permissions_by_template_id_local');
207
+
208
+/**
209
+ * Get name and description of template from Template ID
210
+ *
211
+ * @param int $templ_id Template ID
212
+ *
213
+ * @return mixed[] Template details
214
+ */
215
+add_listener('get_permission_template_details', 'get_permission_template_details_local');
216
+
217
+/**
218
+ * Add a Permission Template
219
+ *
220
+ * @param mixed[] $details Permission template details [templ_name,templ_descr,perm_id]
221
+ *
222
+ * @return boolean true on success, false otherwise
223
+ */
224
+add_listener('add_perm_templ', 'add_perm_templ_local');
225
+
226
+/**
227
+ * Update permission template details
228
+ *
229
+ * @param mixed[] $details Permission Template Details
230
+ *
231
+ * @return boolean true on success, false otherwise
232
+ */
233
+add_listener('update_perm_templ_details', 'update_perm_templ_details_local');
234
+
235
+/**
236
+ * Update User Details
237
+ *
238
+ * @param mixed[] $details User details
239
+ *
240
+ * @return boolean true on success, false otherise
241
+ */
242
+add_listener('update_user_details', 'update_user_details_local');
243
+
244
+/**
245
+ * Add a new user
246
+ *
247
+ * @param mixed[] $details Array of User details
248
+ *
249
+ * @return boolean true on success, false otherwise
250
+ */
251
+add_listener('add_new_user', 'add_new_user_local');

+ 75
- 0
poweradmin/poweradmin-2.1.8/index.php View File

@@ -0,0 +1,75 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script which displays available actions
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+echo "     <h3>" . _('Welcome') . " " . $_SESSION["name"] . "</h3>\n";
36
+
37
+do_hook('verify_permission', 'search') ? $perm_search = "1" : $perm_search = "0";
38
+do_hook('verify_permission', 'zone_content_view_own') ? $perm_view_zone_own = "1" : $perm_view_zone_own = "0";
39
+do_hook('verify_permission', 'zone_content_view_others') ? $perm_view_zone_other = "1" : $perm_view_zone_other = "0";
40
+do_hook('verify_permission', 'supermaster_view') ? $perm_supermaster_view = "1" : $perm_supermaster_view = "0";
41
+do_hook('verify_permission', 'zone_master_add') ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0";
42
+do_hook('verify_permission', 'zone_slave_add') ? $perm_zone_slave_add = "1" : $perm_zone_slave_add = "0";
43
+do_hook('verify_permission', 'supermaster_add') ? $perm_supermaster_add = "1" : $perm_supermaster_add = "0";
44
+
45
+echo "    <ul>\n";
46
+echo "    <li><a href=\"index.php\">" . _('Index') . "</a></li>\n";
47
+if ($perm_search == "1") {
48
+    echo "    <li><a href=\"search.php\">" . _('Search zones and records') . "</a></li>\n";
49
+}
50
+if ($perm_view_zone_own == "1" || $perm_view_zone_other == "1") {
51
+    echo "    <li><a href=\"list_zones.php\">" . _('List zones') . "</a></li>\n";
52
+}
53
+if ($perm_zone_master_add) {
54
+    echo "    <li><a href=\"list_zone_templ.php\">" . _('List zone templates') . "</a></li>\n";
55
+}
56
+if ($perm_supermaster_view) {
57
+    echo "    <li><a href=\"list_supermasters.php\">" . _('List supermasters') . "</a></li>\n";
58
+}
59
+if ($perm_zone_master_add) {
60
+    echo "    <li><a href=\"add_zone_master.php\">" . _('Add master zone') . "</a></li>\n";
61
+}
62
+if ($perm_zone_slave_add) {
63
+    echo "    <li><a href=\"add_zone_slave.php\">" . _('Add slave zone') . "</a></li>\n";
64
+}
65
+if ($perm_supermaster_add) {
66
+    echo "    <li><a href=\"add_supermaster.php\">" . _('Add supermaster') . "</a></li>\n";
67
+}
68
+if ($_SESSION["auth_used"] != "ldap") {
69
+    echo "    <li><a href=\"change_password.php\">" . _('Change password') . "</a></li>\n";
70
+}
71
+echo "    <li><a href=\"users.php\">" . _('User administration') . "</a></li>\n";
72
+echo "    <li><a href=\"index.php?logout\">" . _('Logout') . "</a></li>\n";
73
+echo "   </ul>\n";
74
+
75
+include_once("inc/footer.inc.php");

+ 74
- 0
poweradmin/poweradmin-2.1.8/list_perm_templ.php View File

@@ -0,0 +1,74 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that displays list of permission templates
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+do_hook('verify_permission', 'templ_perm_edit') ? $perm_templ_perm_edit = "1" : $perm_templ_perm_edit = "0";
35
+
36
+$permission_templates = do_hook('list_permission_templates');
37
+
38
+if ($perm_templ_perm_edit == "0") {
39
+    error(ERR_PERM_EDIT_PERM_TEMPL);
40
+} else {
41
+    echo "    <h2>" . _('Permission templates') . "</h2>\n";
42
+    echo "     <table>\n";
43
+    echo "      <tr>\n";
44
+    echo "       <th>&nbsp;</th>\n";
45
+    echo "       <th>" . _('Name') . "</th>\n";
46
+    echo "       <th>" . _('Description') . "</th>\n";
47
+    echo "      </tr>\n";
48
+
49
+    foreach ($permission_templates as $template) {
50
+
51
+        $perm_item_list = do_hook('get_permissions_by_template_id', $template['id'], true);
52
+        $perm_items = implode(', ', $perm_item_list);
53
+
54
+        echo "      <tr>\n";
55
+        if ($perm_templ_perm_edit == "1") {
56
+            echo "       <td>\n";
57
+            echo "        <a href=\"edit_perm_templ.php?id=" . $template["id"] . "\"><img src=\"images/edit.gif\" alt=\"[ " . _('Edit template') . " ]\"></a>\n";
58
+            echo "        <a href=\"delete_perm_templ.php?id=" . $template["id"] . "\"><img src=\"images/delete.gif\" alt=\"[ " . _('Delete template') . " ]\"></a>\n";
59
+            echo "       </td>\n";
60
+        } else {
61
+            echo "       <td>&nbsp;</td>\n";
62
+        }
63
+        echo "       <td class=\"y\">" . $template['name'] . "</td>\n";
64
+        echo "       <td class=\"y\">" . $template['descr'] . "</td>\n";
65
+        echo "      </tr>\n";
66
+    }
67
+
68
+    echo "     </table>\n";
69
+    echo "     <ul>\n";
70
+    echo "      <li><a href=\"add_perm_templ.php\">" . _('Add permission template') . "</a>.</li>\n";
71
+    echo "     </ul>\n";
72
+}
73
+
74
+include_once("inc/footer.inc.php");

+ 72
- 0
poweradmin/poweradmin-2.1.8/list_supermasters.php View File

@@ -0,0 +1,72 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that displays supermasters list
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+(do_hook('verify_permission', 'supermaster_view')) ? $perm_sm_view = "1" : $perm_sm_view = "0";
36
+(do_hook('verify_permission', 'supermaster_edit')) ? $perm_sm_edit = "1" : $perm_sm_edit = "0";
37
+
38
+$supermasters = get_supermasters();
39
+$num_supermasters = ($supermasters == -1) ? 0 : count($supermasters);
40
+
41
+echo "     <h2>" . _('List supermasters') . "</h2>\n";
42
+echo "     <table>\n";
43
+echo "      <tr>\n";
44
+echo "       <th>&nbsp;</th>\n";
45
+echo "       <th>" . _('IP address of supermaster') . "</th>\n";
46
+echo "       <th>" . _('Hostname in NS record') . "</th>\n";
47
+echo "       <th>" . _('Account') . "</th>\n";
48
+echo "      </tr>\n";
49
+if ($num_supermasters == "0") {
50
+    echo "      <tr>\n";
51
+    echo "       <td class=\"n\">&nbsp;</td>\n";
52
+    echo "       <td class=\"n\" colspan=\"3\">\n";
53
+    echo "        " . _('There are no zones to show in this listing.') . "\n";
54
+    echo "       </td>\n";
55
+    echo "      </tr>\n";
56
+} else {
57
+    foreach ($supermasters as $c) {
58
+        echo "      <tr>\n";
59
+        if ($perm_sm_edit == "1") {
60
+            echo "        <td class=\"n\"><a href=\"delete_supermaster.php?master_ip=" . $c['master_ip'] . "&amp;ns_name=" . $c['ns_name'] . "\"><img src=\"images/delete.gif\" title=\"" . _('Delete supermaster') . ' ' . $c['master_ip'] . "\" alt=\"[  " . _('Delete supermaster') . " ]\"></a></td>\n";
61
+        } else {
62
+            echo "<td>&nbsp;</td>\n";
63
+        }
64
+        echo "       <td class=\"y\">" . $c['master_ip'] . "</td>\n";
65
+        echo "       <td class=\"y\">" . $c['ns_name'] . "</td>\n";
66
+        echo "       <td class=\"y\">" . $c['account'] . "</td>\n";
67
+        echo "      </tr>\n";
68
+    }
69
+}
70
+echo "     </table>\n";
71
+
72
+include_once("inc/footer.inc.php");

+ 73
- 0
poweradmin/poweradmin-2.1.8/list_zone_templ.php View File

@@ -0,0 +1,73 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that displays list of zone templates
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+do_hook('verify_permission', 'zone_master_add') ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0";
36
+
37
+$zone_templates = get_list_zone_templ($_SESSION['userid']);
38
+$username = do_hook('get_fullname_from_userid', $_SESSION['userid']);
39
+
40
+if ($perm_zone_master_add == "0") {
41
+    error(ERR_PERM_EDIT_ZONE_TEMPL);
42
+} else {
43
+    echo "    <h2>" . _('Zone templates for') . " " . $username . "</h2>\n";
44
+    echo "     <table>\n";
45
+    echo "      <tr>\n";
46
+    echo "       <th>&nbsp;</th>\n";
47
+    echo "       <th>" . _('Name') . "</th>\n";
48
+    echo "       <th>" . _('Description') . "</th>\n";
49
+    echo "      </tr>\n";
50
+
51
+    foreach ($zone_templates as $template) {
52
+
53
+        echo "      <tr>\n";
54
+        if ($perm_zone_master_add == "1") {
55
+            echo "       <td>\n";
56
+            echo "        <a href=\"edit_zone_templ.php?id=" . $template["id"] . "\"><img src=\"images/edit.gif\" alt=\"[ " . _('Edit template') . " ]\"></a>\n";
57
+            echo "        <a href=\"delete_zone_templ.php?id=" . $template["id"] . "\"><img src=\"images/delete.gif\" alt=\"[ " . _('Delete template') . " ]\"></a>\n";
58
+            echo "       </td>\n";
59
+        } else {
60
+            echo "       <td>&nbsp;</td>\n";
61
+        }
62
+        echo "       <td class=\"y\">" . $template['name'] . "</td>\n";
63
+        echo "       <td class=\"y\">" . $template['descr'] . "</td>\n";
64
+        echo "      </tr>\n";
65
+    }
66
+
67
+    echo "     </table>\n";
68
+    echo "     <ul>\n";
69
+    echo "      <li><a href=\"add_zone_templ.php\">" . _('Add zone template') . "</a>.</li>\n";
70
+    echo "     </ul>\n";
71
+}
72
+
73
+include_once("inc/footer.inc.php");

+ 164
- 0
poweradmin/poweradmin-2.1.8/list_zones.php View File

@@ -0,0 +1,164 @@
1
+<?php
2
+
3
+/*  Poweradmin, a friendly web-based admin tool for PowerDNS.
4
+ *  See <http://www.poweradmin.org> for more details.
5
+ *
6
+ *  Copyright 2007-2010  Rejo Zenger <rejo@zenger.nl>
7
+ *  Copyright 2010-2017  Poweradmin Development Team
8
+ *      <http://www.poweradmin.org/credits.html>
9
+ *
10
+ *  This program is free software: you can redistribute it and/or modify
11
+ *  it under the terms of the GNU General Public License as published by
12
+ *  the Free Software Foundation, either version 3 of the License, or
13
+ *  (at your option) any later version.
14
+ *
15
+ *  This program is distributed in the hope that it will be useful,
16
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
+ *  GNU General Public License for more details.
19
+ *
20
+ *  You should have received a copy of the GNU General Public License
21
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
+ */
23
+
24
+/**
25
+ * Script that displays zone list
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2017  Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+require_once("inc/toolkit.inc.php");
33
+include_once("inc/header.inc.php");
34
+
35
+global $pdnssec_use;
36
+
37
+if (do_hook('verify_permission', 'zone_content_view_others')) {
38
+    $perm_view = "all";
39
+} elseif (do_hook('verify_permission', 'zone_content_view_own')) {
40
+    $perm_view = "own";
41
+} else {
42
+    $perm_view = "none";
43
+}
44
+
45
+if (do_hook('verify_permission', 'zone_content_edit_others')) {
46
+    $perm_edit = "all";
47
+} elseif (do_hook('verify_permission', 'zone_content_edit_own')) {
48
+    $perm_edit = "own";
49
+} else {
50
+    $perm_edit = "none";
51
+}
52
+
53
+$count_zones_all = zone_count_ng("all");
54
+$count_zones_all_letterstart = zone_count_ng($perm_view, LETTERSTART);
55
+$count_zones_view = zone_count_ng($perm_view);
56
+$count_zones_edit = zone_count_ng($perm_edit);
57
+
58
+# OUCH: Temporary workaround for nasty sorting issue.
59
+# The problem is that sorting order is saved as a session variable
60
+# and it's used in two different screens - zone list and search results.
61
+# Both have different queries for getting data, but same order field
62
+# that causes failure.
63
+
64
+$zone_sort_by = ZONE_SORT_BY;
65
+if (!in_array(ZONE_SORT_BY, array('name', 'type', 'count_records', 'owner'))) {
66
+    $zone_sort_by = 'name';
67
+}
68
+
69
+echo "    <h2>" . _('List zones') . "</h2>\n";
70
+
71
+if ($perm_view == "none") {
72
+    echo "     <p>" . _('You do not have the permission to see any zones.') . "</p>\n";
73
+} elseif (($count_zones_view > $iface_rowamount && $count_zones_all_letterstart == "0") || $count_zones_view == 0) {
74
+    if ($count_zones_view > $iface_rowamount) {
75
+        echo "<div class=\"showmax\">";
76
+        show_letters(LETTERSTART, $_SESSION["userid"]);
77
+        echo "</div>";
78
+    }
79
+    echo "     <p>" . _('There are no zones to show in this listing.') . "</p>\n";
80
+} else {
81
+    if (LETTERSTART != 'all') {
82
+        echo "     <div class=\"showmax\">\n";
83
+        show_pages($count_zones_all_letterstart, $iface_rowamount);
84
+        echo "     </div>\n";
85
+    }
86
+
87
+    if ($count_zones_view > $iface_rowamount) {
88
+        echo "<div class=\"showmax\">";
89
+        show_letters(LETTERSTART, $_SESSION["userid"]);
90
+        echo "</div>";
91
+    }
92
+    echo "     <form method=\"post\" action=\"delete_domains.php\">\n";
93
+    echo "     <table>\n";
94
+    echo "      <tr>\n";
95
+    echo "       <th>&nbsp;</th>\n";
96
+    echo "       <th>&nbsp;</th>\n";
97
+    echo "       <th><a href=\"list_zones.php?zone_sort_by=name\">" . _('Name') . "</a></th>\n";
98
+    echo "       <th><a href=\"list_zones.php?zone_sort_by=type\">" . _('Type') . "</a></th>\n";
99
+    echo "       <th><a href=\"list_zones.php?zone_sort_by=count_records\">" . _('Records') . "</a></th>\n";
100
+    echo "       <th><a href=\"list_zones.php?zone_sort_by=owner\">" . _('Owner') . "</a></th>\n";
101
+
102
+    if ($iface_zonelist_serial) {
103
+        echo "       <th>" . _('Serial') . "</th>\n";
104
+    }
105
+
106
+    if ($pdnssec_use) {
107
+        echo "       <th>" . _('DNSSEC') . "</th>\n";
108
+    }
109
+
110
+    echo "      </tr>\n";
111
+
112
+    if ($count_zones_view <= $iface_rowamount) {
113
+        $zones = get_zones($perm_view, $_SESSION['userid'], "all", ROWSTART, $iface_rowamount, $zone_sort_by);
114
+    } elseif (LETTERSTART == 'all') {
115
+        $zones = get_zones($perm_view, $_SESSION['userid'], "all", ROWSTART, 'all', $zone_sort_by);
116
+    } else {
117
+        $zones = get_zones($perm_view, $_SESSION['userid'], LETTERSTART, ROWSTART, $iface_rowamount, $zone_sort_by);
118
+        $count_zones_shown = ($zones == -1) ? 0 : count($zones);
119
+    }
120
+    foreach ($zones as $zone) {
121
+        if ($zone['count_records'] == NULL) {
122
+            $zone['count_records'] = 0;
123
+        }
124
+
125
+        if ($iface_zonelist_serial)
126
+            $serial = get_serial_by_zid($zone['id']);
127
+
128
+        if ($perm_edit != "all" || $perm_edit != "none") {
129
+            $user_is_zone_owner = do_hook('verify_user_is_owner_zoneid', $zone["id"]);
130
+        }
131
+        echo "         <tr>\n";
132
+        echo "          <td class=\"checkbox\">\n";
133
+        if ($count_zones_edit > 0 && ($perm_edit == "all" || ( $perm_edit == "own" && $user_is_zone_owner == "1"))) {
134
+            echo "       <input type=\"checkbox\" name=\"zone_id[]\" value=\"" . $zone['id'] . "\">";
135
+        }
136
+        echo "          </td>\n";
137
+        echo "          <td class=\"actions\">\n";
138
+        echo "           <a href=\"edit.php?name=" . $zone['name'] . "&id=" . $zone['id'] . "\"><img src=\"images/edit.gif\" title=\"" . _('View zone') . " " . $zone['name'] . "\" alt=\"[ " . _('View zone') . " " . $zone['name'] . " ]\"></a>\n";
139
+        if ($perm_edit == "all" || ( $perm_edit == "own" && $user_is_zone_owner == "1")) {
140
+            echo "           <a href=\"delete_domain.php?name=" . $zone['name'] . "&id=" . $zone["id"] . "\"><img src=\"images/delete.gif\" title=\"" . _('Delete zone') . " " . $zone['name'] . "\" alt=\"[ " . _('Delete zone') . " " . $zone['name'] . " ]\"></a>\n";
141
+        }
142
+        echo "          </td>\n";
143
+        echo "          <td class=\"name\">" . $zone["name"] . "</td>\n";
144
+        echo "          <td class=\"type\">" . strtolower($zone["type"]) . "</td>\n";
145
+        echo "          <td class=\"count\">" . $zone["count_records"] . "</td>\n";
146
+        echo "          <td class=\"owner\">" . $zone["owner"] . "</td>\n";
147
+        if ($iface_zonelist_serial) {
148
+            if ($serial != "") {
149
+                echo "          <td class=\"y\">" . $serial . "</td>\n";
150
+            } else {
151
+                echo "          <td class=\"n\">&nbsp;</td>\n";
152
+            }
153
+        }
154
+        if ($pdnssec_use) {
155
+            echo "          <td class=\"dnssec\"><input type=\"checkbox\" onclick=\"return false\" " . ($zone["secured"] ? 'checked' : '') . "></td>\n";
156
+        }
157
+        echo "           </tr>\n";
158
+    }
159
+    echo "          </table>\n";
160
+    echo "      <input type=\"submit\" name=\"commit\" value=\"" . _('Delete zone(s)') . "\" class=\"button\">\n";
161
+    echo "     </form>\n";
162
+}
163
+
164
+include_once("inc/footer.inc.php");

+ 1163
- 0
poweradmin/poweradmin-2.1.8/locale/cs_CZ/LC_MESSAGES/cs.po
File diff suppressed because it is too large
View File


+ 88
- 0
poweradmin/poweradmin-2.1.8/locale/cs_CZ/LC_MESSAGES/cs_db.po View File

@@ -0,0 +1,88 @@
1
+# Poweradmin translation.
2
+# Copyright (C) 2011 Poweradmin Development Team
3
+# This file is distributed under the same license as the Poweradmin package.
4
+# 
5
+# Translators:
6
+#   <quimi@quimi.cz>, 2011.
7
+msgid ""
8
+msgstr ""
9
+"Project-Id-Version: Poweradmin\n"
10
+"Report-Msgid-Bugs-To: https://github.com/poweradmin/poweradmin/issues\n"
11
+"POT-Creation-Date: 2011-07-08 23:45+0300\n"
12
+"PO-Revision-Date: 2011-11-03 12:59+0000\n"
13
+"Last-Translator: quimi <quimi@quimi.cz>\n"
14
+"Language-Team: Czech (http://www.transifex.net/projects/p/poweradmin/team/cs/)\n"
15
+"MIME-Version: 1.0\n"
16
+"Content-Type: text/plain; charset=UTF-8\n"
17
+"Content-Transfer-Encoding: 8bit\n"
18
+"Language: cs\n"
19
+"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2\n"
20
+
21
+msgid "User is allowed to add new master zones."
22
+msgstr "Uživatel má právo přidávat nové master zóny."
23
+
24
+msgid "User is allowed to add new slave zones."
25
+msgstr "Uživatel má právo přidávat nové slave zóny."
26
+
27
+msgid "User is allowed to see the content and meta data of zones he owns."
28
+msgstr "Uživatel má právo vidět obsah a meta data zón, které vlastní."
29
+
30
+msgid "User is allowed to edit the content of zones he owns."
31
+msgstr "Uživatel má právo upravit obsah zón, které vlastní."
32
+
33
+msgid "User is allowed to edit the meta data of zones he owns."
34
+msgstr "Uživatel má právo upravit meta data zón, které vlastní."
35
+
36
+msgid ""
37
+"User is allowed to see the content and meta data of zones he does not own."
38
+msgstr "Uživatel má právo vidět obsah a meta data zón, které nevlastní."
39
+
40
+msgid "User is allowed to edit the content of zones he does not own."
41
+msgstr "Uživatel má právo upravit obsah zón, které nevlastní."
42
+
43
+msgid "User is allowed to edit the meta data of zones he does not own."
44
+msgstr "Uživatel má právo upravit meta data zón, které nevlastní."
45
+
46
+msgid "User is allowed to perform searches."
47
+msgstr "Uživatel má právo vyhledávat."
48
+
49
+msgid "User is allowed to view supermasters."
50
+msgstr "Uživatel má právo prohlížet supermastery."
51
+
52
+msgid "User is allowed to add new supermasters."
53
+msgstr "Uživatel má právo přidávat nového supermastera."
54
+
55
+msgid "User is allowed to edit supermasters."
56
+msgstr "Uživatel má právo upravit supermastera."
57
+
58
+msgid "User has full access. God-like. Redeemer."
59
+msgstr "Uživatel má plný přístup. Jako bůh. Vykupitel."
60
+
61
+msgid "User is allowed to see other users and their details."
62
+msgstr "Uživatel má právo vidět ostatní uživatele a jejich detaily."
63
+
64
+msgid "User is allowed to add new users."
65
+msgstr "Uživatel má právo přidávat nové uživatele."
66
+
67
+msgid "User is allowed to edit their own details."
68
+msgstr "Uživatel má právo editovat jejich vlastní údaje."
69
+
70
+msgid "User is allowed to edit other users."
71
+msgstr "Uživatel má právo upravovat ostatní uživatele."
72
+
73
+msgid "User is allowed to edit the password of other users."
74
+msgstr "Uživatel má právo editovat hesla ostatních uživatelů."
75
+
76
+msgid ""
77
+"User is allowed to change the permission template that is assigned to a "
78
+"user."
79
+msgstr ""
80
+"Uživatel má právo změnit oprávnění šablonu, která je k němu přiřazena."
81
+
82
+msgid "User is allowed to add new permission templates."
83
+msgstr "Uživatel má právo přidávat novou šablonu oprávnění."
84
+
85
+msgid "User is allowed to edit existing permission templates."
86
+msgstr "Uživatel má právo upravit stávající šablony oprávnění."
87
+
88
+

BIN
poweradmin/poweradmin-2.1.8/locale/cs_CZ/LC_MESSAGES/messages.mo View File


+ 977
- 0
poweradmin/poweradmin-2.1.8/locale/de_DE/LC_MESSAGES/de.po View File

@@ -0,0 +1,977 @@
1
+# SOME DESCRIPTIVE TITLE.
2
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+# This file is distributed under the same license as the PACKAGE package.
4
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+#
6
+
7
+msgid ""
8
+msgstr ""
9
+"Project-Id-Version: poweradmin 2.0.3\n"
10
+"Report-Msgid-Bugs-To: Georg K&auml;fer <gkaefer@backbone.co.at>\n"
11
+"POT-Creation-Date: 2009-06-10 14:42+0200\n"
12
+"PO-Revision-Date: 2009-06-10 14:42+0200\n"
13
+"Last-Translator: Georg K&auml;fer <gkaefer@backbone.co.at>\n"
14
+"Language-Team: poweradmin german\n"
15
+"MIME-Version: 1.0\n"
16
+"Content-Type: text/plain; charset=UTF-8\n"
17
+"Content-Transfer-Encoding: 8bit\n"
18
+"Language: de\n"
19
+
20
+msgid "The install/ directory exists, you must remove it first before proceeding."
21
+msgstr "Das install/ Verzeichnis existiert, Sie m&uuml;ssen es zuerst entfernen um fortfahren zu k&ouml;nnen."
22
+
23
+msgid "There is no zone with this ID."
24
+msgstr "Es existiert keine Zone mit dieser ID"
25
+
26
+#: add_perm_templ.php:35 list_perm_templ.php:60
27
+msgid "Add permission template"
28
+msgstr "Berechtigungs-Vorlage hinzuf&uuml;gen"
29
+
30
+#: add_perm_templ.php:39 add_perm_templ.php:50 add_record.php:86
31
+#: edit_perm_templ.php:51 edit_perm_templ.php:63 edit.php:92
32
+#: edit_record.php:63 list_perm_templ.php:35 list_zones.php:57 search.php:52
33
+#: search.php:85
34
+msgid "Name"
35
+msgstr "Name"
36
+
37
+#: add_perm_templ.php:43 add_perm_templ.php:51 add_user.php:63
38
+#: edit_perm_templ.php:55 edit_perm_templ.php:64 edit_user.php:129
39
+#: list_perm_templ.php:36 users.php:46
40
+msgid "Description"
41
+msgstr "Beschreibung"
42
+
43
+#: add_perm_templ.php:59 edit_perm_templ.php:80 edit_user.php:151
44
+msgid "descr"
45
+msgstr "descr"
46
+
47
+#: add_perm_templ.php:63 add_user.php:72 delete_user.php:101
48
+#: edit_perm_templ.php:84 edit.php:135 edit_record.php:105 edit_user.php:138
49
+#: users.php:104
50
+msgid "Commit changes"
51
+msgstr "&Auml;nderungen durchf&uuml;hren"
52
+
53
+#: edit.php:104
54
+msgid "Reset changes"
55
+msgstr "&Auml;nderungen r&uuml;cksetzen"
56
+
57
+#: add_record.php:71
58
+msgid "The record was successfully added."
59
+msgstr "Der Eintrag wurde erfolgreich hinzugef&uuml;gt."
60
+
61
+#: add_record.php:77
62
+msgid "Add record to zone"
63
+msgstr "Eintrag zur Zone hinzuf&uuml;gen"
64
+
65
+#: add_record.php:88 add_zone_master.php:115 delete_domain.php:58 edit.php:93
66
+#: edit.php:199 edit_record.php:65 list_zones.php:58 search.php:53
67
+#: search.php:86
68
+msgid "Type"
69
+msgstr "Typ"
70
+
71
+#: add_record.php:89 edit.php:95 edit_record.php:66 search.php:87
72
+msgid "Priority"
73
+msgstr "Priorit&auml;t"
74
+
75
+#: add_record.php:90 edit.php:94 edit_record.php:67 search.php:88
76
+msgid "Content"
77
+msgstr "Inhalt"
78
+
79
+#: add_record.php:91 edit.php:96 edit_record.php:68 search.php:89
80
+msgid "TTL"
81
+msgstr "TTL"
82
+
83
+#: add_record.php:124 edit.php:141
84
+msgid "Add record"
85
+msgstr "Eintrag hinzuf&uuml;gen"
86
+
87
+#: add_supermaster.php:40 add_supermaster.php:80 index.php:54
88
+#: inc/header.inc.php:66
89
+msgid "Add supermaster"
90
+msgstr "Supermaster hinzuf&uuml;gen"
91
+
92
+#: add_supermaster.php:43
93
+msgid "You do not have the permission to add a new supermaster."
94
+msgstr "Sie haben nicht die Berechtigung einen Supermaster hinzuzuf&uuml;gen."
95
+
96
+#: add_supermaster.php:48 list_supermasters.php:34
97
+msgid "IP address of supermaster"
98
+msgstr "IP Adresse des Supermaster"
99
+
100
+#: add_supermaster.php:58 delete_supermaster.php:52 list_supermasters.php:35
101
+msgid "Hostname in NS record"
102
+msgstr "Hostname im NS Eintrag"
103
+
104
+#: add_supermaster.php:68 delete_supermaster.php:53 list_supermasters.php:36
105
+msgid "Account"
106
+msgstr "Benutzerkonto"
107
+
108
+#: add_user.php:33 users.php:114
109
+msgid "Add user"
110
+msgstr "Benutzer hinzuf&uuml;gen"
111
+
112
+#: add_user.php:37 edit_user.php:102 users.php:44
113
+msgid "Username"
114
+msgstr "Benutzername"
115
+
116
+#: add_user.php:41 edit_user.php:106 users.php:45
117
+msgid "Fullname"
118
+msgstr "Vollst&auml;ndiger Name"
119
+
120
+#: add_user.php:45 edit_user.php:110 inc/auth.inc.php:99
121
+msgid "Password"
122
+msgstr "Passwort"
123
+
124
+#: add_user.php:49 edit_user.php:114 users.php:47
125
+msgid "Emailaddress"
126
+msgstr "Email Adresse"
127
+
128
+#: add_user.php:53 edit_user.php:118
129
+msgid "Permission template"
130
+msgstr "Berechtigungs Template"
131
+
132
+#: add_user.php:67 edit_user.php:133 users.php:49
133
+msgid "Enabled"
134
+msgstr "Aktiviert"
135
+
136
+#: add_zone_master.php:53
137
+msgid "IP address of web- or mailserver is invalid."
138
+msgstr "IP Adresse des Web- oder Mailservers ist ung&uuml;ltig."
139
+
140
+#: add_zone_master.php:79 index.php:48 inc/header.inc.php:60
141
+msgid "Add master zone"
142
+msgstr "Master Zone hinzuf&uuml;gen"
143
+
144
+#: add_zone_master.php:87 add_zone_slave.php:60
145
+msgid "Zone name"
146
+msgstr "Name der Zone"
147
+
148
+#: add_zone_master.php:93
149
+msgid "IP address of webserver"
150
+msgstr "IP Adresse des Webservers"
151
+
152
+#: add_zone_master.php:99
153
+msgid "IP address of mailserver"
154
+msgstr "IP Adresse des Mailservers"
155
+
156
+#: add_zone_master.php:105 add_zone_slave.php:72 delete_domain.php:57
157
+#: list_zones.php:60
158
+msgid "Owner"
159
+msgstr "Besitzer"
160
+
161
+#: add_zone_master.php:125
162
+msgid "Create zone without applying records-template"
163
+msgstr "Erstelle Zone ohne Zuhilfenahme der Datensatzvorlage"
164
+
165
+#: add_zone_master.php:131 add_zone_slave.php:84
166
+msgid "Add zone"
167
+msgstr "Zone hinzuf&uuml;gen"
168
+
169
+#: add_zone_slave.php:54 index.php:51 inc/header.inc.php:63
170
+msgid "Add slave zone"
171
+msgstr "Slave Zone hinzuf&uuml;gen"
172
+
173
+#: add_zone_slave.php:66 edit.php:229
174
+msgid "IP address of master NS"
175
+msgstr "IP Adresse des Master NS"
176
+
177
+#: change_password.php:29 change_password.php:47 index.php:56
178
+#: inc/header.inc.php:68
179
+msgid "Change password"
180
+msgstr "Passwort &auml;ndern"
181
+
182
+#: change_password.php:33
183
+msgid "Current password"
184
+msgstr "Bestehendes Passwort"
185
+
186
+#: change_password.php:37 change_password.php:41
187
+msgid "New password"
188
+msgstr "Neues Passwort"
189
+
190
+#: delete_domain.php:49 edit.php:143 list_zones.php:81 search.php:65
191
+msgid "Delete zone"
192
+msgstr "Zone l&ouml;schen"
193
+
194
+#: delete_domain.php:63
195
+#, php-format
196
+msgid "You are about to delete a slave zone of which the master nameserver, %s, is a supermaster. Deleting the zone now, will result in temporary removal only. Whenever the supermaster sends a notification for this zone, it will be added again!"
197
+msgstr "Sie sind dabei die Slave Zone zu l&ouml;schen, von der der Master Nameserver, %s, der Supermaster ist. Das l&ouml;schen der Zone bewirkt nur ein tempor&auml;res L&uuml;schen. Wann immer der Supermaster eine Notification sended, wird die Zone wieder hinzugef&uuml;gt!"
198
+
199
+#: delete_domain.php:67 delete_perm_templ.php:48 delete_record.php:78
200
+#: delete_supermaster.php:55
201
+msgid "Are you sure?"
202
+msgstr "Sind Sie sicher?"
203
+
204
+#: delete_domain.php:69 delete_perm_templ.php:49 delete_record.php:79
205
+#: delete_supermaster.php:56
206
+msgid "Yes"
207
+msgstr "Ja"
208
+
209
+#: delete_domain.php:70 delete_record.php:80 delete_supermaster.php:57
210
+msgid "No"
211
+msgstr "Nein"
212
+
213
+#: delete_perm_templ.php:42
214
+msgid "Delete permission template"
215
+msgstr "Berechtigungsvorlage l&ouml;schen"
216
+
217
+#: delete_record.php:54 edit.php:109 search.php:101
218
+msgid "Delete record"
219
+msgstr "Eintrag l&ouml;schen"
220
+
221
+#: delete_record.php:76
222
+msgid "You are trying to delete a record that is needed for this zone to work."
223
+msgstr "Sie versuchen einen Eintrag zu l&ouml;schen, der f&uuml;r den einwandfreien Betrieb der Zone zwingend notwendig ist."
224
+
225
+#: delete_supermaster.php:44 list_supermasters.php:49
226
+msgid "Delete supermaster"
227
+msgstr "Supermaster l&ouml;schen"
228
+
229
+#: delete_user.php:50 users.php:65
230
+msgid "Delete user"
231
+msgstr "Benutzer l&ouml;schen"
232
+
233
+#: delete_user.php:61
234
+msgid "You are about to delete a user. This user is owner for a number of zones. Please decide what to do with these zones."
235
+msgstr "Sie sind dabei einen Benutzer zu l&ouml;schen. Dieser Benutzer ist Besitzer diverser Zonen. Bitte entscheiden Sie, wie mit diesen Zonen zu verfahren ist."
236
+
237
+#: delete_user.php:66
238
+msgid "Zone"
239
+msgstr "Zone"
240
+
241
+#: delete_user.php:67 edit.php:164
242
+msgid "Delete"
243
+msgstr "L&ouml;schen"
244
+
245
+#: delete_user.php:68
246
+msgid "Leave"
247
+msgstr "Belassen"
248
+
249
+#: delete_user.php:69
250
+msgid "Add new owner"
251
+msgstr "Neuen Besitzer hinzuf&uuml;gen"
252
+
253
+#: delete_user.php:70
254
+msgid "Owner to be added"
255
+msgstr "Eigent&uuml;mer hinzugef&uuml;gt werden"
256
+
257
+#: delete_user.php:96
258
+msgid "Really delete this user?"
259
+msgstr "Wirklich diesen Benutzer l&ouml;schen?"
260
+
261
+#: edit_perm_templ.php:45 users.php:110
262
+msgid "Edit permission template"
263
+msgstr "Berechtigungsvorlage bearbeiten"
264
+
265
+#: edit.php:75 search.php:60
266
+msgid "Edit zone"
267
+msgstr "Zone editieren"
268
+
269
+#: edit.php:86
270
+msgid "This zone does not have any records. Weird."
271
+msgstr "Diese Zone hat keine Eintr&auml;ge. Schr&auml;g."
272
+
273
+#: edit.php:107 search.php:96
274
+msgid "Edit record"
275
+msgstr "Datensatz editieren"
276
+
277
+#: edit.php:149
278
+msgid "Owner of zone"
279
+msgstr "Besitzer der Zone"
280
+
281
+#: edit.php:155
282
+msgid "No owner set for this zone."
283
+msgstr "F&uuml;r diese Zone ist kein Besitzer festgelegt."
284
+
285
+#: edit.php:193
286
+msgid "Add"
287
+msgstr "Hinzuf&uuml;gen"
288
+
289
+#: edit.php:218 edit.php:240
290
+msgid "Change"
291
+msgstr "&Auml;ndern"
292
+
293
+#: edit_record.php:54
294
+msgid "Edit record in zone"
295
+msgstr "Eintrag der Zone editieren"
296
+
297
+#: edit_user.php:97 users.php:64
298
+msgid "Edit user"
299
+msgstr "Benutzer editieren"
300
+
301
+#: edit_user.php:143
302
+#, php-format
303
+msgid "This user has been assigned the permission template \"%s\"."
304
+msgstr "Diesem Benutzer wurde die Berechtigungsvorlage \"%s\" zugewiesen."
305
+
306
+#: edit_user.php:145
307
+msgid "The description for this template is"
308
+msgstr "Die Beschreibung f&uuml;r diese Vorlage ist"
309
+
310
+#: edit_user.php:147
311
+msgid "Based on this template, this user has the following permissions"
312
+msgstr "Basierend auf dieser Vorlage hat der Benutzer folgende Berechtigungen"
313
+
314
+#: index.php:26
315
+msgid "Welcome"
316
+msgstr "Willkommen"
317
+
318
+#: index.php:37 inc/header.inc.php:49
319
+msgid "Index"
320
+msgstr "Index"
321
+
322
+#: index.php:39 search.php:31 inc/header.inc.php:51
323
+msgid "Search zones and records"
324
+msgstr "Zonen und Eintr&auml;ge suchen"
325
+
326
+#: index.php:42 list_zones.php:38 inc/header.inc.php:54
327
+msgid "List zones"
328
+msgstr "Zonen auflisten"
329
+
330
+#: index.php:45 list_supermasters.php:30 inc/header.inc.php:57
331
+msgid "List supermasters"
332
+msgstr "Supermaster auflisten"
333
+
334
+#: index.php:57 users.php:39 inc/header.inc.php:69
335
+msgid "User administration"
336
+msgstr "Benutzeradministration"
337
+
338
+#: index.php:58 inc/header.inc.php:70
339
+msgid "Logout"
340
+msgstr "Ausloggen"
341
+
342
+#: list_perm_templ.php:31
343
+msgid "Permission templates"
344
+msgstr "Berechtigungsvorlagen"
345
+
346
+#: list_perm_templ.php:47
347
+msgid "Edit template"
348
+msgstr "Vorlagen bearbeiten"
349
+
350
+#: list_perm_templ.php:48
351
+msgid "Delete template"
352
+msgstr "Vorlage l&ouml;schen"
353
+
354
+#: list_supermasters.php:42 list_zones.php:43
355
+msgid "There are no zones to show in this listing."
356
+msgstr "In dieser Auflistung gibt es keine Zonen zum Anzeigen"
357
+
358
+#: list_zones.php:41
359
+msgid "You do not have the permission to see any zones."
360
+msgstr "Sie haben nicht die Berechtigung zum Anzeigen von Zonen."
361
+
362
+#: list_zones.php:59
363
+msgid "Records"
364
+msgstr "Eintr&auml;ge"
365
+
366
+#: list_zones.php:76
367
+msgid "View zone"
368
+msgstr "Zone anzeigen"
369
+
370
+#: search.php:48
371
+msgid "Zones found"
372
+msgstr "Zonen gefunden"
373
+
374
+#: search.php:54
375
+msgid "Master"
376
+msgstr "Master"
377
+
378
+#: search.php:81
379
+msgid "Records found"
380
+msgstr "Eintr&auml;ge gefunden"
381
+
382
+#: search.php:120
383
+msgid "Query"
384
+msgstr "Abfrage"
385
+
386
+#: search.php:124
387
+msgid "Enter a hostname or IP address. SQL LIKE syntax supported: an underscore (_) in pattern matches any single character, a percent sign (%) matches any string of zero or more characters."
388
+msgstr "Tragen Sie einen Hostnamen oder IP Adresse ein. SQL like Syntax wird unterst&uuml;tzt: ein Unterstrich (_) im Suchbegriff steht f&uuml;r ein beliebiges einzelnes Zeichen, ein Prozentzeichen (%) steht f&uuml;r ein oder mehrere beliebige Zeichen."
389
+
390
+#: search.php:129
391
+msgid "Search"
392
+msgstr "Suche"
393
+
394
+#: users.php:48
395
+msgid "Template"
396
+msgstr "Vorlage"
397
+
398
+#: inc/auth.inc.php:41
399
+msgid "Session expired, please login again."
400
+msgstr "Session ist abgelaufen, bitte erneut einloggen."
401
+
402
+#: inc/auth.inc.php:67
403
+msgid "Authentication failed!"
404
+msgstr "Authentifizierung fehlgeschlagen!"
405
+
406
+#: inc/auth.inc.php:89
407
+msgid "Log in"
408
+msgstr "Anmeldung"
409
+
410
+#: inc/auth.inc.php:104
411
+msgid "Go"
412
+msgstr "OK"
413
+
414
+#: inc/auth.inc.php:129
415
+msgid "You have logged out."
416
+msgstr "Sie sind nun abgemeldet."
417
+
418
+#: inc/database.inc.php:29
419
+msgid "Oops! An error occured!"
420
+msgstr "Uups! Ein Fehler ist aufgetreten!"
421
+
422
+#: inc/database.inc.php:73
423
+msgid "Unknown database type in inc/config.inc.php."
424
+msgstr "Unbekannter Datenbank Typ in inc/config.inc.php."
425
+
426
+#: inc/dns.inc.php:174
427
+msgid "If you specify an MX record it must be a hostname."
428
+msgstr "Wenn Sie einen MX Eintrag definieren, dann muzlig; es ein Hostname sein."
429
+
430
+#: inc/error.inc.php:27
431
+msgid "You do not have the permission to perform searches."
432
+msgstr "Sie haben nicht die Berechtigung zum Suchen."
433
+
434
+#: inc/error.inc.php:28
435
+msgid "You do not have the permission to add a record to this zone."
436
+msgstr "Sie haben f&uuml;r diese Zone nicht die Berechtigung zum hinzuf&uuml;gen eines Eintrages."
437
+
438
+#: inc/error.inc.php:29
439
+msgid "You do not have the permission to edit this record."
440
+msgstr "Sie haben nicht die Berechtigung zum Editieren dieses Datensatzes."
441
+
442
+#: inc/error.inc.php:30
443
+msgid "You do not have the permission to view this record."
444
+msgstr "Sie haben nicht die Berechtigung zum Ansehen dieses Eintrages."
445
+
446
+#: inc/error.inc.php:31
447
+msgid "You do not have the permission to delete this record."
448
+msgstr "Sie haben nicht die Berechtigung diesen Eintrag l&ouml;schen zu k&ouml;nnen."
449
+
450
+#: inc/error.inc.php:32
451
+msgid "You do not have the permission to add a master zone."
452
+msgstr "Sie haben nicht die Berechtigung zum Hinzuf&uuml;gen einer Master Zone."
453
+
454
+#: inc/error.inc.php:33
455
+msgid "You do not have the permission to add a slave zone."
456
+msgstr "Sie haben nicht die Berechtigung zum Hinzuf&uuml;gen einer Slave Zone"
457
+
458
+#: inc/error.inc.php:34
459
+msgid "You do not have the permission to delete a zone."
460
+msgstr "Sie haben nicht die Berechtigung zum L&ouml;schen einer Zone."
461
+
462
+#: inc/error.inc.php:35
463
+msgid "You do not have the permission to delete a supermaster."
464
+msgstr "Sie haben nicht die Berechtigung zum L&ouml;schen eines Supermasters."
465
+
466
+#: inc/error.inc.php:36
467
+msgid "You do not have the permission to view this zone."
468
+msgstr "Sie haben nicht die Berechtigung zum Anzeigen dieser Zone."
469
+
470
+#: inc/error.inc.php:37
471
+msgid "You do not have the permission to edit this user."
472
+msgstr "Sie haben nicht die Berechtigung zur Bearbeitung dieses Benutzers."
473
+
474
+#: inc/error.inc.php:38
475
+msgid "You do not have the permission to edit permission templates."
476
+msgstr "Sie haben nicht die Berechtigung zum Editieren von Berechtigungsvorlagen."
477
+
478
+#: inc/error.inc.php:39
479
+msgid "You do not have the permission to delete permission templates."
480
+msgstr "Sie haben nicht die Berechtigung zum L&ouml;schen von Berechtigungsvorlagen."
481
+
482
+#: inc/error.inc.php:40
483
+msgid "You do not have the permission to add a new user."
484
+msgstr "Sie haben nicht die Berechtigung zum Hinzuf&uuml;gen eines neuen Benutzers."
485
+
486
+#: inc/error.inc.php:41
487
+msgid "You do not have the permission to delete this user."
488
+msgstr "Sie haben nicht die Berechtigung zum L&ouml;schen dieses Benutzers."
489
+
490
+#: inc/error.inc.php:44
491
+msgid "This is an invalid zone name."
492
+msgstr "Dies ist ein ung&uuml;ltiger Zonenname."
493
+
494
+#: inc/error.inc.php:45
495
+msgid "There is already a supermaster with this IP address."
496
+msgstr "Es existiert bereits ein Supermaster mit dieser IP Adresse."
497
+
498
+#: inc/error.inc.php:46
499
+msgid "There is already a zone with this name."
500
+msgstr "Es existiert bereits eine Zone mit diesem Namen."
501
+
502
+#: inc/error.inc.php:49
503
+msgid "Username exist already, please choose another one."
504
+msgstr "Benutzername existiert bereits, bitte w&auml;hlen Sie einen anderen..."
505
+
506
+#: inc/error.inc.php:50
507
+msgid "User does not exist."
508
+msgstr "Benutzer existiert nicht."
509
+
510
+#: inc/error.inc.php:51
511
+msgid "You did not enter the correct current password."
512
+msgstr "Sie haben nicht das korrekte Passwort eingegeben."
513
+
514
+#: inc/error.inc.php:52
515
+msgid "The two new password fields do not match."
516
+msgstr "Die zwei Passw&ouml;rter stimmen nicht &uuml;berein."
517
+
518
+#: inc/error.inc.php:53
519
+msgid "This template is assigned to at least one user."
520
+msgstr "Diese Vorlage ist zumindest einem Benutzer zugewiesen."
521
+
522
+#: inc/error.inc.php:56
523
+msgid "Invalid or unexpected input given."
524
+msgstr "Ung&uuml;ltiger bzw. unerwarteter Input."
525
+
526
+#: inc/error.inc.php:57
527
+#, php-format
528
+msgid "Invalid argument(s) given to function %s"
529
+msgstr "Ung&uuml;ltige(s) Argument(e) zur Funktion %s angegeben"
530
+
531
+#: inc/error.inc.php:58
532
+#, php-format
533
+msgid "Invalid argument(s) given to function %s %s"
534
+msgstr "Ung&uuml;ltige(s) Argument(e) zur Funktion %s %s angegeben"
535
+
536
+#: inc/error.inc.php:59
537
+msgid "Unknown error."
538
+msgstr "Unbekannter Fehler."
539
+
540
+#: inc/error.inc.php:60
541
+msgid "Enter a valid email address."
542
+msgstr "Geben Sie eine g&uuml;ltige Email-Adresse ein."
543
+
544
+#: inc/error.inc.php:63
545
+msgid "Your content field doesnt have a legit value."
546
+msgstr "Ihr Eingabefeld besitzt keinen g&uuml;ltigen Wert."
547
+
548
+#: inc/error.inc.php:64
549
+msgid "Invalid hostname."
550
+msgstr "Ung&uuml;ltiger Hostname."
551
+
552
+msgid "You have invalid characters in your hostname."
553
+msgstr "Sie verwenden ung&uuml;ltige Zeichen in Ihrem Hostnamen."
554
+
555
+msgid "A hostname can not start or end with a dash."
556
+msgstr "Ein Hostname kann nicht mit einem Bindestrich beginnen bzw. enden."
557
+
558
+msgid "Given hostname or one of the labels is too short or too long."
559
+msgstr "Der angegeben Hostname oder eines der Labels ist zu kurz bzw. zu lang."
560
+
561
+msgid "Given hostname has too many slashes."
562
+msgstr "Der angegebene Hostname beinhaltet zu viele Schr&auml;gstriche."
563
+
564
+msgid "Unknown record type."
565
+msgstr "Unbekannter Datensatz-Typ."
566
+
567
+#: inc/error.inc.php:66
568
+msgid "This is not a valid IPv4 or IPv6 address."
569
+msgstr "Dies ist keine g&uuml;ltige IPv4 bzw. IPv6 Adresse."
570
+
571
+#: inc/error.inc.php:67
572
+msgid "This is not a valid IPv6 address."
573
+msgstr "Dies ist keine g&uuml;ltige IPv6 Adresse."
574
+
575
+#: inc/error.inc.php:68
576
+msgid "This is not a valid IPv4 address."
577
+msgstr "Dies ist keine g&uuml;ltige IPv4 Adresse."
578
+
579
+#: inc/error.inc.php:69
580
+msgid "This is not a valid CNAME. Did you assign an MX or NS record to the record?"
581
+msgstr "Dies ist kein g&uuml;ltiger CNAME. Haben Sie diesem Eintrag einen MX oder NS Eintrag zugewiesen?"
582
+
583
+msgid "You can not point a NS or MX record to a CNAME record. Remove or rame the CNAME record first, or take another name."
584
+msgstr "Sie k&ouml;nnen keinen NS bzw. MX Eintrag auf einen CNAME Eintrag zeigen lassen. Entfernen Sie den CNAME Eintrag zuerst bzw. benennen Sie den CNAME Eintrag um oder w&auml;hlen Sie einen anderen Namen."
585
+
586
+msgid "Invalid value for name field of SOA record. It should be the name of the zone."
587
+msgstr "Ung&uuml;ltiger Wert f&uuml;r den Namen des SOA Eintrags. Es sollte der Name der Zone sein."
588
+
589
+msgid "Invalid value for content field of HINFO record."
590
+msgstr "Ung&uuml;ltiger Wert f&uuml;r das Inhalts-Feld des HINFO Eintrags."
591
+
592
+msgid "Invalid value for content field of TXT record."
593
+msgstr "Ung&uuml;ltiger Wert f&uuml;r das Inhalts-Feld des TXT Eintrags."
594
+
595
+msgid "Invalid value for TTL field. It should be numeric."
596
+msgstr "Ung&uuml;ltiger Wert f&uuml;r das TTL Feld. Es sollte ein numerischer Wert sein."
597
+
598
+msgid "Invalid value for prio field. It should be numeric."
599
+msgstr "Ung&uuml;ltiger Wert f&uuml;r das Priorit&auml;ts Feld. Es sollte ein numerischer Wert sein."
600
+
601
+#: inc/error.inc.php:71
602
+msgid "NS records must be a hostnames."
603
+msgstr "NS Eintr&auml;ge m&uuml;ssen Hostnamen sein."
604
+
605
+#: inc/error.inc.php:73
606
+msgid "A prio field should be numeric."
607
+msgstr "Ein Priorit&auml;ts Feld sollte numerisch sein."
608
+
609
+#: inc/error.inc.php:74
610
+msgid "At least one of the five last SOA data fields is not numeric."
611
+msgstr "Zumindest eines der f&uuml;nf letzten SOA Daten Felder ist nicht numerisch."
612
+
613
+#: inc/error.inc.php:75
614
+msgid "You can only have five numeric fields in the SOA record."
615
+msgstr "Ein SOA Eintrag kann nur f&uuml;nf numerische Felder beinhalten."
616
+
617
+#: inc/error.inc.php:76
618
+msgid "The first part of your SOA record does not contain a valid hostname for a DNS server."
619
+msgstr "Der erste Teil Ihres SOA Eintrags beinhaltet f&uuml;r einen DNS Server keinen g&uuml;ltigen Hostnamen."
620
+
621
+#: inc/error.inc.php:79
622
+msgid "Zone has been added successfully."
623
+msgstr "Die Zone wurde erfolgreich hinzugef&uuml;gt."
624
+
625
+#: inc/error.inc.php:80
626
+msgid "Zone has been deleted successfully."
627
+msgstr "Die Zone wurde erfolgreich gel&ouml;scht."
628
+
629
+#: inc/error.inc.php:81
630
+msgid "The user has been updated successfully."
631
+msgstr "Der Benutzer wurde erfolgreich ge&auml;ndert."
632
+
633
+#: inc/error.inc.php:82
634
+msgid "The user has been created successfully."
635
+msgstr "Der Benutzer wurde erfolgreich hinzugef&uuml;gt."
636
+
637
+#: inc/error.inc.php:83
638
+msgid "The user has been deleted successfully."
639
+msgstr "Der Benutzer wurde erfolgreich gel&ouml;scht."
640
+
641
+#: inc/error.inc.php:84
642
+msgid "The record has been updated successfully."
643
+msgstr "Der Eintrag wurde erfolgreich ge&auml;ndert."
644
+
645
+#: inc/error.inc.php:85
646
+msgid "The record has been deleted successfully."
647
+msgstr "Der Eintrag wurde erfolgreich gel&ouml;scht."
648
+
649
+#: inc/error.inc.php:85
650
+msgid "The supermaster has been deleted successfully."
651
+msgstr "Der Supermaster wurde erfolgreich gel&ouml;scht."
652
+
653
+#: inc/error.inc.php:87
654
+msgid "The supermaster has been added successfully."
655
+msgstr "Der Supermaster wurde erfolgreich hinzugef&uuml;gt."
656
+
657
+#: inc/error.inc.php:88
658
+msgid "The permission template has been deleted successfully."
659
+msgstr "Die Berechtigungsvorlage wurde erfolgreich gel&ouml;scht."
660
+
661
+#: inc/record.inc.php:270
662
+msgid "You are trying to delete the SOA record. You are not allowed to remove it, unless you remove the entire zone."
663
+msgstr "Sie versuchen den SOA Eintrag zu l&ouml;schen. Solange Sie nicht die gesamte Zone l&ouml;schen, sind Sie hierf&uuml;r nicht berechtigt."
664
+
665
+#: inc/record.inc.php:603
666
+msgid "Function returned an error (multiple zones matching this zone ID)."
667
+msgstr "Funktion gab einen Fehler zur&uuml;ck (mehrere Zonen sind mit dieser Zonen ID &uuml;bereinstimmend)."
668
+
669
+#: inc/toolkit.inc.php:27
670
+msgid "You have to create a config.inc.php!"
671
+msgstr "Sie m&uuml;ssen die Datei config.inc.php erstellen!"
672
+
673
+#: inc/toolkit.inc.php:87
674
+msgid "Show page"
675
+msgstr "Seite anzeigen"
676
+
677
+#: inc/toolkit.inc.php:106
678
+msgid "Show zones beginning with"
679
+msgstr "Domains anzeigen - beginnend mit"
680
+
681
+#: inc/toolkit.inc.php:172
682
+msgid "Something has been successfully performed. What exactly, however, will remain a mystery."
683
+msgstr "Etwas wurde erfolgreich ausgef&uuml;hrt. Was genau -  wie auch immer - bleibt ein R&auml;tsel."
684
+
685
+#: inc/toolkit.inc.php:184
686
+msgid "Success!"
687
+msgstr "Erfolg!"
688
+
689
+#: inc/toolkit.inc.php:195
690
+msgid "Successful!"
691
+msgstr "Erfolgreich!"
692
+
693
+#: inc/toolkit.inc.php:201
694
+msgid "back"
695
+msgstr "zur&uuml;ck"
696
+
697
+#: inc/toolkit.inc.php:240
698
+msgid "Inactive"
699
+msgstr "Inaktiv"
700
+
701
+#: inc/toolkit.inc.php:244
702
+msgid "Active"
703
+msgstr "Aktiv"
704
+
705
+#: inc/users.inc.php:368
706
+msgid "Password has been changed, please login."
707
+msgstr "Passwort wurde erfolgreoch ge&auml;ndert, bitte loggen Sie sich ein."
708
+
709
+msgid "No database name has been set in config.inc.php."
710
+msgstr "Kein Datenbankname wurde in der Datei config.inc.php definiert."
711
+
712
+msgid "No database host has been set in config.inc.php."
713
+msgstr "Kein Datenbankhost wurde in der Datei config.inc.php definiert."
714
+
715
+msgid "No database username has been set in config.inc.php."
716
+msgstr "Es wurde kein Benutzername f&uuml;r die Datenbank in der Datei config.inc.php definiert."
717
+
718
+msgid "No database password has been set in config.inc.php."
719
+msgstr "Kein Datenbankpasswort wurde in der Datei config.inc.php definiert."
720
+
721
+msgid "No or unknown database type has been set in config.inc.php."
722
+msgstr "Kein oder ein ubekannter Datenbank-Typ wurde in der Datei config.inc.php definiert."
723
+
724
+msgid "You have an error in the MNAME field of the SOA record."
725
+msgstr "Sie haben einen Fehler im MNAME Feld des SOA Eintrags."
726
+
727
+msgid "Too many characters in the hostname."
728
+msgstr "Der Hostname beinhaltet zu viele Zeichen."
729
+
730
+msgid "You are using an invalid top level domain."
731
+msgstr "Sie verwenden eine ung&uuml;ltige Toplevel Domain."
732
+
733
+#: index.php:20
734
+msgid "Installation step"
735
+msgstr "Installationsschritt"
736
+
737
+#: index.php:26
738
+msgid "This installer expects you to have a PowerDNS database accessable from this server. This installer also expects you to have never ran Poweradmin before, or that you want to overwrite the Poweradmin part of the database. If you have had Poweradmin running before, any data in the following tables will be destroyed: perm_items, perm_templ, perm_templ_items, users and zones. This installer will, of course, not touch the data in the PowerDNS tables of the database. However, it is recommended that you create a backup of your database before proceeding."
739
+msgstr "Dieser Installer geht davon aus, dass von diesem Server aus auf eine PowerDNS Datenbank zugegriffen werden kann. Es wird ebenfalls davon ausgegangen, dass Poweradmin noch nie zuvor ausgef&uuml;hrt wurde bzw. dass Sie keine bestehende Poweradmin Datenbank &uuml;berschreiben wollen. Falls Poweradmin zuvor schon installiert war, dann werden die Daten folgender Tabellen gel&ouml;scht: perm_items, perm_templ, perm_templ_items, users and zones. Dieser Installer wird selbstverst&auml;ndlich keine &Auml;nderungen an den PowerDNS Tabellen Ihrer Datenbank vornehmen. Jedoch wird dringend empfohlen, ein Backup Ihrer Datenbank anzufertigen, bevor Sie an dieser Stelle fortfahren."
740
+
741
+#: index.php:28
742
+msgid "The alternative for this installer is a manual installation. Refer to the poweradmin.org website if you want to go down that road."
743
+msgstr "Die Alternative zu diesem Installer ist die manuelle Installation. Folgen Sie in diesem Fall den entsprechenden Anweisungen auf der Webseite poweradmin.org."
744
+
745
+#: index.php:30
746
+msgid "Finally, if you see any errors during the installation process, a problem report would be appreciated. You can report problems (and ask for help) on the <a href=\"http://groups.google.com/group/poweradmin\" target=\"blank\">poweradmin</a> mailinglist."
747
+msgstr "Abschlie&szlig;end eine Bitte: Wenn Sie w&auml;hrend der Installation einen Fehler feststellen sollten, dann w&auml;re ein entsprechender Fehlerreport begr&uuml;&szlig;enswert. Sie k&ouml;nnen Problemberichte und Hilfe-Anfragen in der <a href=\"http://groups.google.com/group/poweradmin\" target=\"blank\">poweradmin</a> Mailingliste berichten bzw. stellen."
748
+
749
+#: index.php:33
750
+msgid "Do you want to proceed now?"
751
+msgstr "Wollen Sie jetzt fortfahren?"
752
+
753
+#: index.php:37 index.php:80 index.php:133 index.php:175 index.php:206
754
+msgid "Go to step"
755
+msgstr "Gehen Sie zu Schritt"
756
+
757
+#: index.php:43
758
+msgid "To prepare the database for using Poweradmin, the installer needs to modify the PowerDNS database. It will add a number of tables and it will fill these tables with some data. If the tables are already present, the installer will drop them first."
759
+msgstr "Um die Datenbank f&uuml;r Poweradmin vorbereiten zu k&ouml;nnen, muss der Installer die PowerDNS Datenbank anpassen. Es werden eine Reihe von Tabellen hinzugef&uuml;gt und diese mit Daten bef&uuml;llt. Wenn diese Tabellen bereits existieren sollten, dann wird der Installer diese Tabellen zuerst l&ouml;schen."
760
+
761
+#: index.php:45
762
+msgid "To do all of this, the installer needs to access the database with an account which has sufficient rights. If you trust the installer, you may give it the username and password of the database user root. Otherwise, make sure the user has enough rights, before actually proceeding."
763
+msgstr "Um dies alles durchf&uuml;hren zu k&ouml;nnen, ben&ouml;tigt der Installer Zugriff auf die Datenbank mit einem Account, der &uuml;ber ausreichend Rechte verf&uuml;gt. Wenn Sie dem Installer vertrauen, k&ouml;nnen Sie den Benutzernamen und das Passwort des Datenbank-Benutzers root verwenden. Andernfalls stellen Sie bevor Sie fortfahren sicher, dass der Benutzer &uuml;ber ausreichend Rechte verf&uuml;gt."
764
+
765
+#: index.php:52
766
+msgid "The username to use to connect to the database, make sure the username has sufficient rights to perform administrative task to the PowerDNS database (the installer wants to drop, create and fill tables to the database)."
767
+msgstr "Stellen Sie sicher, dass der f&uuml;r die Datenbankverbindung verwendete Benutzername &uuml;ber ausreichend Rechte verf&uuml;gt, um administrative Aufgaben an der PowerDNS Datenbank durchf&uuml;hren zu k&ouml;nnen (der Installer will Tabellen anlegen, l&ouml;schen und mit Daten bef&uuml;llen)."
768
+
769
+#: index.php:57 index.php:153
770
+msgid "The password for this username."
771
+msgstr "Das Passwort f&uuml;r diesen Benutzernamen."
772
+
773
+#: index.php:60
774
+msgid "Hostname"
775
+msgstr "Hostname"
776
+
777
+#: index.php:62
778
+msgid "The hostname on which the PowerDNS database resides. Frequently, this will be \"localhost\"."
779
+msgstr "Der Hostname jenes Servers mit der PowerDNS Datenbank. H&auml;ufig ist dies \"localhost\"."
780
+
781
+#: index.php:65
782
+msgid "Database"
783
+msgstr "Datenbank"
784
+
785
+#: index.php:67
786
+msgid "The name of the PowerDNS database."
787
+msgstr "Der Name der PowerDNS Datenbank."
788
+
789
+#: index.php:70
790
+msgid "Database type"
791
+msgstr "Datenbank-Typ"
792
+
793
+#: index.php:76
794
+msgid "The type of the PowerDNS database."
795
+msgstr "Der Typ der PowerDNS Datenbank."
796
+
797
+#: index.php:86
798
+msgid "Updating database..."
799
+msgstr "Datenbank wird aktualisiert..."
800
+
801
+#: index.php:109
802
+msgid "done!"
803
+msgstr "erledigt!"
804
+
805
+#: index.php:111
806
+msgid "You now want to give limited rights to Poweradmin so it can update the data in the tables. To do this, you should create a new user and give it rights to select, delete, insert and update records in the PowerDNS database."
807
+msgstr "Um Daten in den Tabellen aktualisieren zu k&ouml;nnen, vergeben Sie nun eingeschr&auml;nkte Rechte an Poweradmin. Um dies zu erreichen, sollten Sie einen neuen Benutzer anlegen und diesem in der PowerDNS Datenbank folgende Rechte zuweisen: select, delete, insert und update records."
808
+
809
+#: index.php:113
810
+msgid "In MySQL you should now perform the following command:"
811
+msgstr "In MySQL sollten Sie nun folgenden Befehl ausf&uuml;hren:"
812
+
813
+#: index.php:116
814
+msgid "On PgSQL you would use:"
815
+msgstr "Mit PgSQL sollten Sie verwenden:"
816
+
817
+#: index.php:127
818
+msgid "After you have added the new user, proceed with this installation procedure."
819
+msgstr "Fahren Sie mit dieser Installationsroutine fort, nachdem Sie einen neuen Benutzer hinzugef&uuml;gt haben."
820
+
821
+#: index.php:142
822
+msgid "Now we will gather all details for the configuration itself."
823
+msgstr "Nun sammeln wir alle Details f&uuml;r die Konfiguration."
824
+
825
+#: index.php:148
826
+msgid "The username for Poweradmin. This new user will have limited rights only."
827
+msgstr "Der Benutzername f&uuml;r Poweradmin. Dieser neue Benutzer wird nur eingeschr&auml;nkte Rechte besitzen."
828
+
829
+#: index.php:156
830
+msgid "Hostmaster"
831
+msgstr "Hostmaster"
832
+
833
+#: index.php:158
834
+msgid "When creating SOA records and no hostmaster is provided, this value here will be used. Should be in the form \"hostmaster.example.net\"."
835
+msgstr "Wenn SOA Eintr&auml;ge erstellt werden und kein Hostmaster angegeben wird, dann wird folgender Wert per default verwendet. In Form von \"hostmaster.example.net\"."
836
+
837
+#: index.php:161
838
+msgid "Primary nameserver"
839
+msgstr "Prim&auml;rer Nameserver"
840
+
841
+#: index.php:163
842
+msgid "When creating new zones using the template, this value will be used as primary nameserver. Should be like \"ns1.example.net\"."
843
+msgstr "Bei der Anlage neuer Zonen mit diesem Template wird dieser Wert als Prim&auml;rer Nameserver verwendet. Wie z.B. \"ns1.example.net\"."
844
+
845
+#: index.php:166
846
+msgid "Secondary nameserver"
847
+msgstr "Sekund&auml;rer Nameserver"
848
+
849
+#: index.php:168
850
+msgid "When creating new zones using the template, this value will be used as secondary nameserver. Should be like \"ns2.example.net\"."
851
+msgstr "Bei der Anlage neuer Zonen mit diesem Template wird dieser Wert als Sekund&auml;rer Nameserver verwendet. Wie z.B. \ns2.example.net\"."
852
+
853
+#: index.php:197
854
+msgid "The installer was able to write to the file \""
855
+msgstr "Der Installer konnte die Datei beschreiben \""
856
+
857
+#: index.php:197
858
+msgid "\". A basic configuration, based on the details you have given, has been created."
859
+msgstr "\". Ein Konfiguration basierend auf Ihren Angaben wurde erstellt."
860
+
861
+#: index.php:199
862
+msgid "The installer is unable to write to the file \""
863
+msgstr "Der Installer kann die Datei nicht beschreiben \""
864
+
865
+#: index.php:199
866
+msgid "\" (which is in itself good). The configuration is printed here. You should now create the file \""
867
+msgstr "\" (was ansich gut ist). Die Konfiguration wird hier angezeigt. Sie sollten nun die Datei \""
868
+
869
+#: index.php:199
870
+msgid "\" in the Poweradmin root directory yourself. It should contain the following few lines:"
871
+msgstr "\" im Poweradmin root Verzeichnis erstellen. Sie sollte folgende Zeilen beinhalten:"
872
+
873
+#: index.php:212
874
+msgid "Now we have finished the configuration, you should (must!) remove the directory \"install/\" from the Poweradmin root directory. You will not be able to use Poweradmin if it exists. Do it now."
875
+msgstr "Die Konfiguration ist nun beendet. Sie sollten (m&uuml;ssen!) das Verzeichnis \"install/\" aus dem Poweradmin root Verzeichnis l&ouml;schen. Wenn das Verzeichnis existiert, k&ouml;nnen Sie Poweradmin nicht verwenden. L&ouml;schen Sie das Verzeichnis jetzt."
876
+
877
+#: index.php:213
878
+msgid "After you have removed the directory, you can login to <a href=\"../index.php\">Poweradmin</a> with username \"admin\" and password \""
879
+msgstr "Nachdem Sie das Verzeichnis gel&ouml;scht haben, k&ouml;nnen sie sich einloggen unter: <a href=\"../index.php\">Poweradmin</a> Benutzername \"admin\" und Passwort \""
880
+
881
+msgid "Invalid value for name field of SRV record."
882
+msgstr "Ung&uuml;ltiger Wert im Namensfeld des SRV Eintrags."
883
+
884
+msgid "Invalid value for the weight field of the SRV record."
885
+msgstr "Ung&uuml;ltiger Wert im Weight field des SRV Eintrags."
886
+
887
+msgid "Invalid value for the port field of the SRV record."
888
+msgstr "Ung&uuml;ltige Port-Angabe im SRV Eintrag."
889
+
890
+msgid "Invalid SRV target."
891
+msgstr "Ung&uuml;ltiges SRV Ziel."
892
+
893
+msgid "Invalid characters have been used in this record."
894
+msgstr "Ung&uuml;ltige Zeichen wurden in diesem Eintrag verwendet."
895
+
896
+msgid "Poweradmin administrator password"
897
+msgstr "Poweradmin Administrator Passwort"
898
+
899
+msgid "The password of the Poweradmin administrator. This administrator has full rights to Poweradmin using the web interface."
900
+msgstr "Das Passwort des Poweradmin Administrators. Dieser Admin hat alle Rechte im Poweradmin Web Interface."
901
+
902
+
903
+
904
+
905
+# The following is a list of strings that are not hard-code in the PHP 
906
+# files, but which are listed in the poweradmin database. Because of 
907
+# this, tools like xgettext will not notice these strings.
908
+# 
909
+# See also <https://www.poweradmin.org/wiki/TranslationContribution>.
910
+#
911
+
912
+msgid "User is allowed to add new master zones."
913
+msgstr "Benutzer ist berechtigt neue Master Zonen hinzuzuf&uuml;gen."
914
+
915
+msgid "User is allowed to add new slave zones."
916
+msgstr "Benutzer ist berechtigt neue Slave Zonen hinzuzuf&uuml;gen."
917
+
918
+msgid "User is allowed to see the content and meta data of zones he owns."
919
+msgstr "Benutzer ist berechtigt den Inhalt und die Meta Daten seiner Zonen anzuzeigen."
920
+
921
+msgid "User is allowed to edit the content of zones he owns."
922
+msgstr "Benutzer ist berechtigt den Inhalt seiner Zonen zu editieren."
923
+
924
+msgid "User is allowed to edit the meta data of zones he owns."
925
+msgstr "Benutzer ist berechtigt die Meta Daten seiner Zonen zu editieren."
926
+
927
+msgid "User is allowed to see the content and meta data of zones he does not own."
928
+msgstr "Benutzer ist berechtigt den Inhalt und die Meta Daten jener Zonen anzuzeigen, die er nicht besitzt."
929
+
930
+msgid "User is allowed to edit the content of zones he does not own."
931
+msgstr "Benutzer ist berechtigt den Inhalt und die Meta Daten jener Zonen zu editieren, die er nicht besitzt."
932
+
933
+msgid "User is allowed to edit the meta data of zones he does not own."
934
+msgstr "Benutzer ist berechtigt die Meta Daten jener Zonen zu editieren, die er nicht besitzt."
935
+
936
+msgid "User is allowed to perform searches."
937
+msgstr "Benutzer ist berechtigt Suchanfragen zu stellen."
938
+
939
+msgid "User is allowed to view supermasters."
940
+msgstr "Benutzer ist berechtigt Supermasters anzuzeigen."
941
+
942
+msgid "User is allowed to add new supermasters."
943
+msgstr "Benutzer ist berechtigt neue Supermasters hinzuzuf&uuml;gen."
944
+
945
+msgid "User is allowed to edit new supermasters."
946
+msgstr "Benutzer ist berechtigt neue Supermasters zu editieren."
947
+
948
+msgid "User is allowed to edit supermasters."
949
+msgstr "Benutzer ist berechtigt Supermasters zu editieren."
950
+
951
+msgid "User has full access. God-like. Redeemer."
952
+msgstr "Benutzer hat uneingeschr&auml;nkten Zugriff. Gottgleich..."
953
+
954
+msgid "User is allowed to see other users and their details."
955
+msgstr "Benutzer ist berechtigt andere Benutzer und deren Details anzuzeigen."
956
+
957
+msgid "User is allowed to add new users."
958
+msgstr "Benutzer ist berechtigt neue Benutzer hinzuzuf&uuml;gen."
959
+
960
+msgid "User is allowed to edit their own details."
961
+msgstr "Benutzer ist berechtigt seine eigenen Details zu editieren."
962
+
963
+msgid "User is allowed to edit other users."
964
+msgstr "Benutzer ist berechtigt andere Benutzer zu editieren."
965
+
966
+msgid "User is allowed to edit the password of other users."
967
+msgstr "Benutzer ist berechtigt das Passwort anderer Benutzer zu editieren."
968
+
969
+msgid "User is allowed to change the permission template that is assigned to a user."
970
+msgstr "Benutzer ist berechtigt die einem Benutzer zugewiesene Berechtigungs-Vorlage zu wechseln."
971
+
972
+msgid "User is allowed to add new permission templates."
973
+msgstr "Benutzer ist berechtigt eine neue Berechtigungs-Vorlage hinzuzuf&uuml;gen."
974
+
975
+msgid "User is allowed to edit existing permission templates."
976
+msgstr "Benutzer ist berechtigt eine bestehende Berechtigungs-Vorlage zu editieren."
977
+

BIN
poweradmin/poweradmin-2.1.8/locale/de_DE/LC_MESSAGES/messages.mo View File


+ 1237
- 0
poweradmin/poweradmin-2.1.8/locale/en_EN/LC_MESSAGES/en.po
File diff suppressed because it is too large
View File


BIN
poweradmin/poweradmin-2.1.8/locale/en_EN/LC_MESSAGES/messages.mo View File


+ 887
- 0
poweradmin/poweradmin-2.1.8/locale/fr_FR/LC_MESSAGES/fr.po View File

@@ -0,0 +1,887 @@
1
+# SOME DESCRIPTIVE TITLE.
2
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+# This file is distributed under the same license as the PACKAGE package.
4
+# Emmanuel Seyman <eseyman@edd.fr>, 2010.
5
+#
6
+msgid ""
7
+msgstr ""
8
+"Project-Id-Version: poweradmin 2.1.5\n"
9
+"Report-Msgid-Bugs-To: eseyman@edd.fr\n"
10
+"POT-Creation-Date: 2010-09-28 17:02+0200\n"
11
+"PO-Revision-Date: 2010-10-07 18:28+0200\n"
12
+"Last-Translator: Emmanuel Seyman <eseyman@edd.fr>\n"
13
+"Language-Team: poweradmin french\n"
14
+"Language: fr_FR\n"
15
+"MIME-Version: 1.0\n"
16
+"Content-Type: text/plain; charset=UTF-8\n"
17
+"Content-Transfer-Encoding: 8bit\n"
18
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
19
+"X-Generator: Virtaal 0.6.1\n"
20
+
21
+#: add_perm_templ.php:39 list_perm_templ.php:60
22
+msgid "Add permission template"
23
+msgstr "Ajouter un gabarit de droits"
24
+
25
+#: add_perm_templ.php:43 add_perm_templ.php:54 add_record.php:119
26
+#: add_zone_templ.php:43 add_zone_templ_record.php:98 edit_perm_templ.php:51
27
+#: edit_perm_templ.php:63 edit.php:104 edit.php:192 edit_record.php:66
28
+#: edit_zone_templ.php:69 edit_zone_templ_record.php:60 list_perm_templ.php:35
29
+#: list_zones.php:62 list_zone_templ.php:36 search.php:64 search.php:118
30
+msgid "Name"
31
+msgstr "Nom"
32
+
33
+#: add_perm_templ.php:47 add_perm_templ.php:55 add_user.php:66
34
+#: add_zone_templ.php:47 edit_perm_templ.php:55 edit_perm_templ.php:64
35
+#: edit_user.php:131 list_perm_templ.php:36 list_zone_templ.php:37
36
+#: users.php:48
37
+msgid "Description"
38
+msgstr "Description"
39
+
40
+#: add_perm_templ.php:71 add_user.php:75 delete_user.php:101
41
+#: edit_comment.php:86 edit_perm_templ.php:84 edit.php:180 edit_record.php:108
42
+#: edit_user.php:140 edit_zone_templ.php:125 edit_zone_templ_record.php:90
43
+#: users.php:107
44
+msgid "Commit changes"
45
+msgstr "Appliquer les modifications"
46
+
47
+#: add_record.php:101 add_zone_templ_record.php:80
48
+msgid "The record was successfully added."
49
+msgstr "L'enregistrement a été ajouté."
50
+
51
+#: add_record.php:110
52
+msgid "Add record to zone"
53
+msgstr "Ajouter l'enregistrement à la zone"
54
+
55
+#: add_record.php:121 add_zone_master.php:96 add_zone_templ_record.php:100
56
+#: delete_domain.php:62 edit.php:105 edit.php:194 edit.php:301
57
+#: edit_record.php:68 edit_zone_templ.php:70 edit_zone_templ_record.php:62
58
+#: list_zones.php:63 search.php:65 search.php:119
59
+msgid "Type"
60
+msgstr "Type"
61
+
62
+#: add_record.php:122 add_zone_templ_record.php:101 edit.php:106 edit.php:195
63
+#: edit_record.php:70 edit_zone_templ.php:71 edit_zone_templ_record.php:64
64
+#: search.php:121
65
+msgid "Content"
66
+msgstr "Contenu"
67
+
68
+#: add_record.php:123 add_zone_templ_record.php:102 edit.php:107 edit.php:196
69
+#: edit_record.php:69 edit_zone_templ.php:72 edit_zone_templ_record.php:63
70
+#: search.php:120
71
+msgid "Priority"
72
+msgstr "Priorité"
73
+
74
+#: add_record.php:124 add_zone_templ_record.php:103 edit.php:108 edit.php:197
75
+#: edit_record.php:71 edit_zone_templ.php:73 edit_zone_templ_record.php:65
76
+#: search.php:122
77
+msgid "TTL"
78
+msgstr "TTL"
79
+
80
+#: add_record.php:157 add_zone_templ_record.php:146 edit.php:239
81
+#: edit_zone_templ.php:129
82
+msgid "Add record"
83
+msgstr "Ajouter un enregistrement"
84
+
85
+#: add_supermaster.php:52 add_supermaster.php:92 index.php:56
86
+#: inc/header.inc.php:74
87
+msgid "Add supermaster"
88
+msgstr "Ajouter un supermaître"
89
+
90
+#: add_supermaster.php:55
91
+msgid "You do not have the permission to add a new supermaster."
92
+msgstr "Vous n'avez pas les droits pour ajouter un supermaître"
93
+
94
+#: add_supermaster.php:60 list_supermasters.php:35
95
+msgid "IP address of supermaster"
96
+msgstr "Adresse IP du supermaître"
97
+
98
+#: add_supermaster.php:70 delete_supermaster.php:52 list_supermasters.php:36
99
+msgid "Hostname in NS record"
100
+msgstr "Nom de machine de l'enregistrement NS"
101
+
102
+#: add_supermaster.php:80 delete_supermaster.php:53 list_supermasters.php:37
103
+msgid "Account"
104
+msgstr "Compte"
105
+
106
+#: add_user.php:34 users.php:121
107
+msgid "Add user"
108
+msgstr "Ajouter un utilisateur"
109
+
110
+#: add_user.php:38 edit_user.php:102 users.php:46
111
+msgid "Username"
112
+msgstr "Nom d'utilisateur"
113
+
114
+#: add_user.php:42 edit_user.php:106 users.php:47
115
+msgid "Fullname"
116
+msgstr "Nom complet"
117
+
118
+#: add_user.php:46 edit_user.php:110 inc/auth.inc.php:98
119
+msgid "Password"
120
+msgstr "Mot de passe"
121
+
122
+#: add_user.php:50 edit_user.php:114 users.php:49
123
+msgid "Emailaddress"
124
+msgstr "Courrier électronique"
125
+
126
+#: add_user.php:55 edit_user.php:119
127
+msgid "Permission template"
128
+msgstr "Gabarit de droits"
129
+
130
+#: add_user.php:70 edit_user.php:135 users.php:51
131
+msgid "Enabled"
132
+msgstr "Actif"
133
+
134
+#: add_zone_master.php:63 index.php:50 inc/header.inc.php:68
135
+msgid "Add master zone"
136
+msgstr "Ajouter une zone maître"
137
+
138
+#: add_zone_master.php:72 add_zone_slave.php:72
139
+msgid "Zone name"
140
+msgstr "Nom de zone"
141
+
142
+#: add_zone_master.php:78 add_zone_slave.php:84 delete_domain.php:61
143
+#: list_zones.php:65 search.php:69
144
+msgid "Owner"
145
+msgstr "Propriétaire"
146
+
147
+#: add_zone_master.php:106 users.php:50
148
+msgid "Template"
149
+msgstr "Gaba"
150
+
151
+#: add_zone_master.php:119 add_zone_slave.php:105
152
+msgid "Add zone"
153
+msgstr "Ajouter une zone"
154
+
155
+#: add_zone_slave.php:66 index.php:53 inc/header.inc.php:71
156
+msgid "Add slave zone"
157
+msgstr "Ajouter une zone esclave"
158
+
159
+#: add_zone_slave.php:78 edit.php:331
160
+msgid "IP address of master NS"
161
+msgstr "Adresse IP du NS maître"
162
+
163
+#: add_zone_templ.php:39
164
+msgid "Add zone template for"
165
+msgstr "Ajouter un gabarit de zone pour"
166
+
167
+#: add_zone_templ.php:51 list_zone_templ.php:58
168
+msgid "Add zone template"
169
+msgstr "Ajouter un gabarit de zone"
170
+
171
+#: add_zone_templ_record.php:89
172
+msgid "Add record to zone template"
173
+msgstr "Ajouter un enregistrement au gabarit de zone"
174
+
175
+#: add_zone_templ_record.php:138 edit_zone_templ.php:118
176
+msgid "The following placeholders can be used in template records"
177
+msgstr ""
178
+"Les caractères de remplacement suivants peuvent être utilisés dans des "
179
+"gabarits d'enregistrement"
180
+
181
+#: add_zone_templ_record.php:141 edit_zone_templ.php:121
182
+msgid "substituted with current zone name"
183
+msgstr "remplacé avec le nom de la zone actuelle"
184
+
185
+#: add_zone_templ_record.php:142 edit_zone_templ.php:122
186
+msgid "substituted with current date and 2 numbers"
187
+msgstr "remplacé avec la date actuelle et 2 chiffres"
188
+
189
+#: change_password.php:30 change_password.php:48 index.php:58
190
+#: inc/header.inc.php:76
191
+msgid "Change password"
192
+msgstr "Modification du mot de passe"
193
+
194
+#: change_password.php:34
195
+msgid "Current password"
196
+msgstr "Mot de passe actuel"
197
+
198
+#: change_password.php:38 change_password.php:42
199
+msgid "New password"
200
+msgstr "Nouveau mot de passe"
201
+
202
+#: delete_domain.php:53 list_zones.php:87 search.php:83
203
+msgid "Delete zone"
204
+msgstr "Supprimer la zone"
205
+
206
+#: delete_domain.php:67
207
+#, php-format
208
+msgid "You are about to delete a slave zone of which the master nameserver, %s, is a supermaster. Deleting the zone now, will result in temporary removal only. Whenever the supermaster sends a notification for this zone, it will be added again!"
209
+msgstr ""
210
+"Vous allez supprimer une zone esclave dont la zone maître, %s, est un "
211
+"supermaître. Supprimer la zone n'aura qu'un effet provisoire. Lorsque le "
212
+"supermaître enverra une notification pour cette zone, elle sera a nouveau "
213
+"ajoutée !"
214
+
215
+#: delete_domain.php:71 delete_perm_templ.php:48 delete_record.php:93
216
+#: delete_supermaster.php:55 delete_zone_templ.php:49
217
+#: delete_zone_templ_record.php:73
218
+msgid "Are you sure?"
219
+msgstr "Êtes vous sur ?"
220
+
221
+#: delete_domain.php:72 delete_perm_templ.php:49 delete_record.php:94
222
+#: delete_supermaster.php:56 delete_zone_templ.php:50
223
+#: delete_zone_templ_record.php:74
224
+msgid "Yes"
225
+msgstr "Oui"
226
+
227
+#: delete_domain.php:73 delete_perm_templ.php:50 delete_record.php:95
228
+#: delete_supermaster.php:57 delete_zone_templ.php:51
229
+#: delete_zone_templ_record.php:75
230
+msgid "No"
231
+msgstr "Non"
232
+
233
+#: delete_perm_templ.php:42
234
+msgid "Delete permission template"
235
+msgstr "Supprimer un gabarit de droits"
236
+
237
+#: delete_record.php:65 delete_zone_templ_record.php:52 edit.php:124
238
+#: edit_zone_templ.php:82 search.php:135
239
+msgid "Delete record"
240
+msgstr "Supprimer un enregistrement"
241
+
242
+#: delete_record.php:91
243
+msgid "You are trying to delete a record that is needed for this zone to work."
244
+msgstr ""
245
+"Vous allez supprimer un enregistrement indispensable au fonctionnement de "
246
+"cette zone."
247
+
248
+#: delete_supermaster.php:44 list_supermasters.php:50
249
+msgid "Delete supermaster"
250
+msgstr "Supprimer le supermaître"
251
+
252
+#: delete_user.php:50 users.php:67
253
+msgid "Delete user"
254
+msgstr "Supprimer l'utilisateur"
255
+
256
+#: delete_user.php:61
257
+msgid "You are about to delete a user. This user is owner for a number of zones. Please decide what to do with these zones."
258
+msgstr ""
259
+"Vous allez supprimer un utilisateur. Cet utilisateur est le propriétaire de "
260
+"zones. Vous devez décider quoi faire avec ces zones."
261
+
262
+#: delete_user.php:66
263
+msgid "Zone"
264
+msgstr "Zone"
265
+
266
+#: delete_user.php:67 edit.php:262
267
+msgid "Delete"
268
+msgstr "Supprimer"
269
+
270
+#: delete_user.php:68
271
+msgid "Leave"
272
+msgstr "Laisser"
273
+
274
+#: delete_user.php:69
275
+msgid "Add new owner"
276
+msgstr "Ajouter un propriétaire"
277
+
278
+#: delete_user.php:70
279
+msgid "Owner to be added"
280
+msgstr "Propriétaire a ajouter"
281
+
282
+#: delete_user.php:96
283
+msgid "Really delete this user?"
284
+msgstr "Supprimer vriament cet utilisateur ?"
285
+
286
+#: delete_zone_templ.php:43 edit_zone_templ.php:130
287
+msgid "Delete zone template"
288
+msgstr "Supprimer un gabarit de zone"
289
+
290
+#: edit_comment.php:52
291
+msgid "Edit comment in zone"
292
+msgstr "Modifier le commentaire de la zone"
293
+
294
+#: edit_comment.php:87 edit.php:181 edit_record.php:109 edit_user.php:141
295
+#: edit_zone_templ.php:126 edit_zone_templ_record.php:91 users.php:108
296
+msgid "Reset changes"
297
+msgstr "Annuler les modifications"
298
+
299
+#: edit_perm_templ.php:45 users.php:117
300
+msgid "Edit permission template"
301
+msgstr "Modifier un gabarit de droits"
302
+
303
+#: edit.php:90 search.php:78
304
+msgid "Edit zone"
305
+msgstr "Modifier la zone"
306
+
307
+#: edit.php:98
308
+msgid "This zone does not have any records. Weird."
309
+msgstr "Cette zone n'a pas d'enregistrements. Bizarre."
310
+
311
+#: edit.php:122 edit_zone_templ.php:80 search.php:130
312
+msgid "Edit record"
313
+msgstr "Modifier un enregistrement"
314
+
315
+#: edit.php:174
316
+msgid "Edit comment"
317
+msgstr "Modifier le commentaire"
318
+
319
+#: edit.php:247
320
+msgid "Owner of zone"
321
+msgstr "Propriétaire de la zone"
322
+
323
+#: edit.php:253
324
+msgid "No owner set for this zone."
325
+msgstr "Cette zone n'a pas de propriétaire."
326
+
327
+#: edit.php:295
328
+msgid "Add"
329
+msgstr "Ajouter"
330
+
331
+#: edit.php:320 edit.php:342
332
+msgid "Change"
333
+msgstr "Modifier"
334
+
335
+#: edit_record.php:57
336
+msgid "Edit record in zone"
337
+msgstr "Modifier l'enregistrement de la zone"
338
+
339
+#: edit_user.php:97 users.php:66
340
+msgid "Edit user"
341
+msgstr "Modifier l'utilisateur"
342
+
343
+#: edit_user.php:146
344
+#, php-format
345
+msgid "This user has been assigned the permission template \"%s\"."
346
+msgstr "Cet utilisateur a été attribué le gabarit de droits \"%s\"."
347
+
348
+#: edit_user.php:148
349
+msgid "The description for this template is"
350
+msgstr "La description de ce gabarit est"
351
+
352
+#: edit_user.php:150
353
+msgid "Based on this template, this user has the following permissions"
354
+msgstr "En se basant sur ce gabarit, l'utilisateur a les permissions suivantes"
355
+
356
+#: edit_zone_templ.php:55
357
+msgid "Edit zone template"
358
+msgstr "Modifier le gabarit de zone"
359
+
360
+#: edit_zone_templ.php:63
361
+msgid "This template zone does not have any records yet."
362
+msgstr "Ce gabarit de zone n'a pas encore d'enregistrements."
363
+
364
+#: edit_zone_templ_record.php:51
365
+msgid "Edit record in zone template"
366
+msgstr "Modifier un enregistrement dans le gabarit de zone"
367
+
368
+#: index.php:25
369
+msgid "Welcome"
370
+msgstr "Bienvenue"
371
+
372
+#: index.php:36 inc/header.inc.php:54
373
+msgid "Index"
374
+msgstr "Accueil"
375
+
376
+#: index.php:38 search.php:31 inc/header.inc.php:56
377
+msgid "Search zones and records"
378
+msgstr "Rechercher une zone ou un enregistrement"
379
+
380
+#: index.php:41 list_zones.php:38 inc/header.inc.php:59
381
+msgid "List zones"
382
+msgstr "Liste des zones"
383
+
384
+#: index.php:44 inc/header.inc.php:62
385
+msgid "List zone templates"
386
+msgstr "Liste des gabarits de zone"
387
+
388
+#: index.php:47 list_supermasters.php:31 inc/header.inc.php:65
389
+msgid "List supermasters"
390
+msgstr "Liste des supermaîtres"
391
+
392
+#: index.php:59 users.php:41 inc/header.inc.php:77
393
+msgid "User administration"
394
+msgstr "Administration des utilisateurs"
395
+
396
+#: index.php:60 inc/header.inc.php:78
397
+msgid "Logout"
398
+msgstr "Déconnexion"
399
+
400
+#: list_perm_templ.php:31
401
+msgid "Permission templates"
402
+msgstr "Gabarit de droits"
403
+
404
+#: list_perm_templ.php:47 list_zone_templ.php:45
405
+msgid "Edit template"
406
+msgstr "Modifier le gabarit"
407
+
408
+#: list_perm_templ.php:48 list_zone_templ.php:46
409
+msgid "Delete template"
410
+msgstr "Supprimer le gabarit"
411
+
412
+#: list_supermasters.php:43 list_zones.php:48
413
+msgid "There are no zones to show in this listing."
414
+msgstr "Cette liste ne contient aucune zone."
415
+
416
+#: list_zones.php:41
417
+msgid "You do not have the permission to see any zones."
418
+msgstr "Vous n'avez pas les droits pour ajouter des zones."
419
+
420
+#: list_zones.php:64
421
+msgid "Records"
422
+msgstr "Enregistrements"
423
+
424
+#: list_zones.php:66
425
+msgid "Serial"
426
+msgstr "Numéro de série"
427
+
428
+#: list_zones.php:82
429
+msgid "View zone"
430
+msgstr "Voir la zone"
431
+
432
+#: list_zone_templ.php:32
433
+msgid "Zone templates for"
434
+msgstr "Gabarit de zones pour"
435
+
436
+#: search.php:60
437
+msgid "Zones found"
438
+msgstr "Zones trouvées"
439
+
440
+#: search.php:66
441
+msgid "Master"
442
+msgstr "Maître"
443
+
444
+#: search.php:114
445
+msgid "Records found"
446
+msgstr "Enregistrements trouvés"
447
+
448
+#: search.php:154
449
+msgid "Query"
450
+msgstr "Recherche"
451
+
452
+#: search.php:160
453
+msgid "Search"
454
+msgstr "Rechercher"
455
+
456
+#: search.php:165
457
+msgid "Enter a hostname or IP address. SQL LIKE syntax supported: an underscore (_) in pattern matches any single character, a percent sign (%) matches any string of zero or more characters."
458
+msgstr ""
459
+"Soumettez un nom de machine ou une adresse IP. La syntaxe SQL LIKE est "
460
+"supportée : un tiret bas (_) dans le motif correspond à n'importe quel "
461
+"caractère, un sigle pour-cent (%) correspond à toute chaîne de zéro ou "
462
+"plusieurs caractères."
463
+
464
+#: inc/auth.inc.php:26
465
+msgid "You have logged out."
466
+msgstr "Vous avez été déconnecté."
467
+
468
+#: inc/auth.inc.php:39
469
+msgid "Session expired, please login again."
470
+msgstr "La session a expirée. Vous devez vous reconnecter."
471
+
472
+#: inc/auth.inc.php:66
473
+msgid "Authentication failed!"
474
+msgstr "L'authentification a échouée !"
475
+
476
+#: inc/auth.inc.php:88
477
+msgid "Log in"
478
+msgstr "Connexion"
479
+
480
+#: inc/auth.inc.php:104
481
+msgid "Go"
482
+msgstr "Exécuter"
483
+
484
+#: inc/error.inc.php:23
485
+msgid "You do not have the permission to perform searches."
486
+msgstr "Vous n'avez pas les droits pour faire des recherches."
487
+
488
+#: inc/error.inc.php:24
489
+msgid "You do not have the permission to add a record to this zone."
490
+msgstr "Vous n'avez pas les droits pour ajouter un enregistrement à cette zone."
491
+
492
+#: inc/error.inc.php:25
493
+msgid "You do not have the permission to edit this record."
494
+msgstr "Vous n'avez pas les droits pour modifier cet enregistrement."
495
+
496
+#: inc/error.inc.php:26
497
+msgid "You do not have the permission to view this record."
498
+msgstr "Vous n'avez pas les droits pour voir cet enregistrement."
499
+
500
+#: inc/error.inc.php:27
501
+msgid "You do not have the permission to delete this record."
502
+msgstr "Vous n'avez pas les droits pour supprimer cet enregistrement."
503
+
504
+#: inc/error.inc.php:28
505
+msgid "You do not have the permission to add a master zone."
506
+msgstr "Vous n'avez pas les droits pour ajouter une zone maître."
507
+
508
+#: inc/error.inc.php:29
509
+msgid "You do not have the permission to add a slave zone."
510
+msgstr "Vous n'avez pas les droits pour ajouter une zone esclave."
511
+
512
+#: inc/error.inc.php:30
513
+msgid "You do not have the permission to delete a zone."
514
+msgstr "Vous n'avez pas les droits pour supprimer des zones."
515
+
516
+#: inc/error.inc.php:31
517
+msgid "You do not have the permission to view this comment."
518
+msgstr "Vous n'avez pas les droits pour voir ce commentaire."
519
+
520
+#: inc/error.inc.php:32
521
+msgid "You do not have the permission to edit this comment."
522
+msgstr "Vous n'avez pas les droits pour modifier ce commentaire."
523
+
524
+#: inc/error.inc.php:33
525
+msgid "You do not have the permission to delete a supermaster."
526
+msgstr "Vous n'avez pas les droits pour supprimer un supermaître."
527
+
528
+#: inc/error.inc.php:34
529
+msgid "You do not have the permission to view this zone."
530
+msgstr "Vous n'avez pas les droits pour voir cette zone."
531
+
532
+#: inc/error.inc.php:35
533
+msgid "You do not have the permission to edit this user."
534
+msgstr "Vous n'avez pas les droits pour modifier cet utilisateur."
535
+
536
+#: inc/error.inc.php:36
537
+msgid "You do not have the permission to edit permission templates."
538
+msgstr "Vous n'avez pas les droits pour modifier les droits de gabarit."
539
+
540
+#: inc/error.inc.php:37
541
+msgid "You do not have the permission to delete permission templates."
542
+msgstr "Vous n'avez pas les droits pour supprimer les droits de gabarit."
543
+
544
+#: inc/error.inc.php:38
545
+msgid "You do not have the permission to add a new user."
546
+msgstr "Vous n'avez pas les droits pour ajouter un utilisateur."
547
+
548
+#: inc/error.inc.php:39
549
+msgid "You do not have the permission to delete this user."
550
+msgstr "Vous n'avez pas les droits pour supprimer cet utilisateur."
551
+
552
+#: inc/error.inc.php:40
553
+msgid "You do not have the permission to edit zone templates."
554
+msgstr "Vous n'avez pas les droits pour modifier les gabarits de zone."
555
+
556
+#: inc/error.inc.php:41
557
+msgid "You do not have the permission to delete zone templates."
558
+msgstr "Vous n'avez pas les droits pour supprimer les gabarits de zone."
559
+
560
+#: inc/error.inc.php:42
561
+msgid "You do not have the permission to add a zone templates."
562
+msgstr "Vous n'avez pas les droits pour ajouter un gabarit de zone."
563
+
564
+#: inc/error.inc.php:45
565
+msgid "This is an invalid zone name."
566
+msgstr "Ceci ,n'est pas un nom de zone valide."
567
+
568
+#: inc/error.inc.php:46
569
+msgid "There is already a supermaster with this IP address."
570
+msgstr "Il existe déjà un supermaître avec cette adresse IP."
571
+
572
+#: inc/error.inc.php:47
573
+msgid "There is already a zone with this name."
574
+msgstr "Il existe déjà une zone portant ce nom."
575
+
576
+#: inc/error.inc.php:50
577
+msgid "Username exist already, please choose another one."
578
+msgstr "Cet utilisateur existe déjà. Choisissez en un autre."
579
+
580
+#: inc/error.inc.php:51
581
+msgid "User does not exist."
582
+msgstr "L'utilisateur n'existe pas."
583
+
584
+#: inc/error.inc.php:52
585
+msgid "You did not enter the correct current password."
586
+msgstr "Vous n'avez pas donné le bon mot de passe actuel."
587
+
588
+#: inc/error.inc.php:53
589
+msgid "The two new password fields do not match."
590
+msgstr "Les deux mots de passe sont différents."
591
+
592
+#: inc/error.inc.php:54
593
+msgid "This template is assigned to at least one user."
594
+msgstr "Ce gabarit est assigné a au moins une personne."
595
+
596
+#: inc/error.inc.php:57
597
+msgid "Invalid or unexpected input given."
598
+msgstr "Saisie invalide ou inattendu."
599
+
600
+#: inc/error.inc.php:58
601
+#, php-format
602
+msgid "Invalid argument(s) given to function %s"
603
+msgstr "Un argument invalide a été donné à la fonction %s"
604
+
605
+#: inc/error.inc.php:59
606
+#, php-format
607
+msgid "Invalid argument(s) given to function %s %s"
608
+msgstr "Un argument invalide a été donné à la fonction %s %s"
609
+
610
+#: inc/error.inc.php:60
611
+msgid "Unknown error."
612
+msgstr "Erreur inconnue."
613
+
614
+#: inc/error.inc.php:61
615
+msgid "Enter a valid email address."
616
+msgstr "Entrez une adresse de courrier électronique valable."
617
+
618
+#: inc/error.inc.php:62
619
+msgid "There is no zone with this ID."
620
+msgstr "Il n'y a aucune zone avec cet ID."
621
+
622
+#: inc/error.inc.php:63
623
+msgid "There is no zone template with this ID."
624
+msgstr "Il n'y a aucun gabarit de zone avec cet ID."
625
+
626
+#: inc/error.inc.php:64
627
+msgid "The <a href=\"install/\">install/</a> directory exists, you must remove it first before proceeding."
628
+msgstr ""
629
+"Le repertoire <a href=\"install/\">install/</a> existe, vous devez le retirer "
630
+"avant de continuer."
631
+
632
+#: inc/error.inc.php:67
633
+msgid "No database name has been set in config.inc.php."
634
+msgstr "Le nom de la base de données n'a pas été trouvé dans config.inc.php."
635
+
636
+#: inc/error.inc.php:68
637
+msgid "No database host has been set in config.inc.php."
638
+msgstr ""
639
+"Le serveur de la base de données n'a pas été trouvé dans config.inc.php."
640
+
641
+#: inc/error.inc.php:69
642
+msgid "No database username has been set in config.inc.php."
643
+msgstr ""
644
+"L'utilisateur de la base de données n'a pas été trouvé dans config.inc.php."
645
+
646
+#: inc/error.inc.php:70
647
+msgid "No database password has been set in config.inc.php."
648
+msgstr ""
649
+"Le mot de passe de la base de données n'a pas été trouvé dans "
650
+"config.inc.php."
651
+
652
+#: inc/error.inc.php:71
653
+msgid "No or unknown database type has been set in config.inc.php."
654
+msgstr "Le type de la base de données n'a pas été trouvé dans config.inc.php."
655
+
656
+#: inc/error.inc.php:74
657
+msgid "Your content field doesnt have a legit value."
658
+msgstr "La valeur du champ contenu n'est pas valable."
659
+
660
+#: inc/error.inc.php:75
661
+msgid "Invalid hostname."
662
+msgstr "Nom de machine invalide."
663
+
664
+#: inc/error.inc.php:76
665
+msgid "You have invalid characters in your hostname."
666
+msgstr "Il y a des caractères invalides dans votre nom de machine."
667
+
668
+#: inc/error.inc.php:77
669
+msgid "A hostname can not start or end with a dash."
670
+msgstr "Un nom de machine ne peut pas commencer ou finir avec un tiret."
671
+
672
+#: inc/error.inc.php:78
673
+msgid "Given hostname or one of the labels is too short or too long."
674
+msgstr ""
675
+"Le nom de machine donné ou l'une de ses étiquettes est trop long ou trop "
676
+"court."
677
+
678
+#: inc/error.inc.php:79
679
+msgid "Given hostname has too many slashes."
680
+msgstr "Le nom de machine donné contient trop de tirets."
681
+
682
+#: inc/error.inc.php:80
683
+msgid "Unknown record type."
684
+msgstr "Type d'enregistrement inconnu."
685
+
686
+#: inc/error.inc.php:81
687
+msgid "This is not a valid IPv4 or IPv6 address."
688
+msgstr "Ceci n'est pas une adresse IPv4 ou IPv6 valide."
689
+
690
+#: inc/error.inc.php:82
691
+msgid "This is not a valid IPv6 address."
692
+msgstr "Ceci n'est pas une adresse IPv6 valide."
693
+
694
+#: inc/error.inc.php:83
695
+msgid "This is not a valid IPv4 address."
696
+msgstr "Ceci n'est pas une adresse IPv4 valide."
697
+
698
+#: inc/error.inc.php:84
699
+msgid "This is not a valid CNAME. Did you assign an MX or NS record to the record?"
700
+msgstr ""
701
+"Ceci n'est pas un CNAME valide. Avez vous assigné un enregistrement MX ou NS "
702
+"à l'enregistrement ?"
703
+
704
+#: inc/error.inc.php:85
705
+msgid "This is not a valid record. There is already exists a CNAME with this name."
706
+msgstr ""
707
+"Ceci n'est pas un enregistrement valide. Il existe déjà un CNAME avec ce "
708
+"nom."
709
+
710
+#: inc/error.inc.php:86
711
+msgid "This is not a valid CNAME. There is already exists an A, AAAA or CNAME with this name."
712
+msgstr ""
713
+"Ceci n'est pas un CNAME valide. Il existe déjà un A, AAAA ou CNAME avec ce "
714
+"nom."
715
+
716
+#: inc/error.inc.php:87
717
+msgid "You can not point a NS or MX record to a CNAME record. Remove or rame the CNAME record first, or take another name."
718
+msgstr ""
719
+"Vous ne pouvez pas faire pointer un enregistrement NS ou MX vers un "
720
+"enregistrement CNAME. Retirez ou renommez l'enregistrement CNAME d'abord ou "
721
+"choisissez un autre nom."
722
+
723
+#: inc/error.inc.php:88
724
+msgid "NS records must be a hostnames."
725
+msgstr "Les enregistrements NS doivent être des noms de machines."
726
+
727
+#: inc/error.inc.php:89
728
+msgid "A prio field should be numeric."
729
+msgstr "Un champ de priorité doit être numérique."
730
+
731
+#: inc/error.inc.php:90
732
+msgid "Invalid value for name field of SOA record. It should be the name of the zone."
733
+msgstr ""
734
+"Valeur invalide pour le champ nom de l'enregistrement SOA. Il devrait être "
735
+"le nom de la zone."
736
+
737
+#: inc/error.inc.php:91
738
+msgid "You have an error in the MNAME field of the SOA record."
739
+msgstr "Vous avez une erreur dans le champ MNAME de l'enregistrement SOA."
740
+
741
+#: inc/error.inc.php:92
742
+msgid "Invalid value for content field of HINFO record."
743
+msgstr "La valeur du champ contenu pour l'enregistrement HINFO est invalide."
744
+
745
+#: inc/error.inc.php:93
746
+msgid "The hostname is too long."
747
+msgstr "Le nom de machine est trop long."
748
+
749
+#: inc/error.inc.php:94
750
+msgid "You are using an invalid top level domain."
751
+msgstr "Vous utilisez un nom de domaine racine invalide."
752
+
753
+#: inc/error.inc.php:95
754
+msgid "Invalid value for TTL field. It should be numeric."
755
+msgstr "La valeur du champ TTL est invalide. Il devrait être numérique."
756
+
757
+#: inc/error.inc.php:96
758
+msgid "Invalid value for prio field. It should be numeric."
759
+msgstr "La valeur du champ priorité est invalide. Il devrait être numérique."
760
+
761
+#: inc/error.inc.php:97
762
+msgid "Invalid value for name field of SRV record."
763
+msgstr "La valeur du champ nom pour l'enregistrement SRV est invalide."
764
+
765
+#: inc/error.inc.php:98
766
+msgid "Invalid value for the priority field of the SRV record."
767
+msgstr "La valeur du champ priorité pour l'enregistrement SRV est invalide."
768
+
769
+#: inc/error.inc.php:99
770
+msgid "Invalid value for the weight field of the SRV record."
771
+msgstr "La valeur du champ poids pour l'enregistrement SRV est invalide."
772
+
773
+#: inc/error.inc.php:100
774
+msgid "Invalid SRV target."
775
+msgstr "Cible SRV invalide."
776
+
777
+#: inc/error.inc.php:101
778
+msgid "Invalid characters have been used in this record."
779
+msgstr "Des caractères invalides ont été utilisés dans cet enregistrement."
780
+
781
+#: inc/error.inc.php:104
782
+msgid "Zone has been added successfully."
783
+msgstr "La zone a été ajouté avec succès."
784
+
785
+#: inc/error.inc.php:105
786
+msgid "Zone has been deleted successfully."
787
+msgstr "La zone a été supprimé avec succès."
788
+
789
+#: inc/error.inc.php:106
790
+msgid "The user has been updated successfully."
791
+msgstr "L'utilisateur a été mis à jour avec succès."
792
+
793
+#: inc/error.inc.php:107
794
+msgid "The user has been created successfully."
795
+msgstr "L'utilisateur a été ajouté avec succès."
796
+
797
+#: inc/error.inc.php:108
798
+msgid "The user has been deleted successfully."
799
+msgstr "L'utilisateur a été supprimé avec succès."
800
+
801
+#: inc/error.inc.php:109
802
+msgid "The record has been updated successfully."
803
+msgstr "L'enregistrement a été mis à jour avec succès."
804
+
805
+#: inc/error.inc.php:110
806
+msgid "The record has been deleted successfully."
807
+msgstr "L'enregistrement a été supprimé avec succès."
808
+
809
+#: inc/error.inc.php:111
810
+msgid "The comment has been updated successfully."
811
+msgstr "Le commentaire a été mis à jour avec succès."
812
+
813
+#: inc/error.inc.php:112
814
+msgid "The supermaster has been deleted successfully."
815
+msgstr "Le supermaître a été supprimé avec succès."
816
+
817
+#: inc/error.inc.php:113
818
+msgid "The supermaster has been added successfully."
819
+msgstr "Le supermaître a été ajouté avec succès."
820
+
821
+#: inc/error.inc.php:114
822
+msgid "The permission template has been deleted successfully."
823
+msgstr "Le gabarit de droits a été supprimé avec succès."
824
+
825
+#: inc/error.inc.php:115
826
+msgid "Zone template has been added successfully."
827
+msgstr "Le gabarit de zone a été ajouté avec succès."
828
+
829
+#: inc/error.inc.php:116
830
+msgid "Zone template has been updated successfully."
831
+msgstr "Le gabarit de zone a été mis à jour avec succès."
832
+
833
+#: inc/error.inc.php:117
834
+msgid "Zone template has been deleted successfully."
835
+msgstr "Le gabarit de zone a été supprimé avec succès."
836
+
837
+#: inc/record.inc.php:331
838
+msgid "You are trying to delete the SOA record. You are not allowed to remove it, unless you remove the entire zone."
839
+msgstr ""
840
+"Vous essayez de supprimer l'enregistrement SOA. Vous ne pouvez pas le "
841
+"retirer sauf en retirant toute la zone."
842
+
843
+#: inc/record.inc.php:695
844
+msgid "Function returned an error (multiple zones matching this zone ID)."
845
+msgstr "La fonction a renvoyée une erreur (plusieurs zones ont cet ID)."
846
+
847
+#: inc/toolkit.inc.php:31
848
+msgid "You have to create a config.inc.php!"
849
+msgstr "Vous devez créer un config.inc.php !"
850
+
851
+#: inc/toolkit.inc.php:151
852
+msgid "Show page"
853
+msgstr "Voir la page"
854
+
855
+#: inc/toolkit.inc.php:170
856
+msgid "Show zones beginning with"
857
+msgstr "Voir les zones commençant avec"
858
+
859
+#: inc/toolkit.inc.php:236
860
+msgid "Something has been successfully performed. What exactly, however, will remain a mystery."
861
+msgstr ""
862
+"Quelque chose s'est bien passé. Par contre, on ne saura jamais quoi, "
863
+"exactement."
864
+
865
+#: inc/toolkit.inc.php:248
866
+msgid "Success!"
867
+msgstr "Succès !"
868
+
869
+#: inc/toolkit.inc.php:259
870
+msgid "Successful!"
871
+msgstr "Avec succès !"
872
+
873
+#: inc/toolkit.inc.php:265
874
+msgid "back"
875
+msgstr "retour"
876
+
877
+#: inc/toolkit.inc.php:304
878
+msgid "Inactive"
879
+msgstr "Inactif"
880
+
881
+#: inc/toolkit.inc.php:308
882
+msgid "Active"
883
+msgstr "Actif"
884
+
885
+#: inc/users.inc.php:364
886
+msgid "Password has been changed, please login."
887
+msgstr "Votre mot de passe a été modifié. Veuillez vous reconnecter."

+ 79
- 0
poweradmin/poweradmin-2.1.8/locale/fr_FR/LC_MESSAGES/fr_db.po View File

@@ -0,0 +1,79 @@
1
+# Emmanuel Seyman <eseyman@edd.fr>, 2010.
2
+#
3
+msgid ""
4
+msgstr ""
5
+"Project-Id-Version: poweradmin 2.1.5\n"
6
+"Report-Msgid-Bugs-To: eseyman@edd.fr\n"
7
+"POT-Creation-Date: 2010-10-20 17:58+0200\n"
8
+"PO-Revision-Date: 2010-10-20 18:00+0200\n"
9
+"Last-Translator: Emmanuel Seyman <eseyman@edd.fr>\n"
10
+"Language-Team: poweradmin french\n"
11
+"Language: fr\n"
12
+"MIME-Version: 1.0\n"
13
+"Content-Type: text/plain; charset=UTF-8\n"
14
+"Content-Transfer-Encoding: 8bit\n"
15
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
16
+"X-Generator: Virtaal 0.6.1\n"
17
+
18
+msgid "User is allowed to add new master zones."
19
+msgstr "L'utilisateur peut ajouter des zones maîtres."
20
+
21
+msgid "User is allowed to add new slave zones."
22
+msgstr "L'utilisateur peut ajouter des zones esclaves."
23
+
24
+msgid "User is allowed to see the content and meta data of zones he owns."
25
+msgstr "L'utilisateur peut voir le contenu et les méta-données de ses zones."
26
+
27
+msgid "User is allowed to edit the content of zones he owns."
28
+msgstr "L'utilisateur peut modifier le contenu et les méta-données de ses zones."
29
+
30
+msgid "User is allowed to edit the meta data of zones he owns."
31
+msgstr "L'utilisateur peut voir les méta-données de ses zones."
32
+
33
+msgid "User is allowed to see the content and meta data of zones he does not own."
34
+msgstr "L'utilisateur peut voir le contenu et les méta-données des zones dont il n'est pas le propriétaire."
35
+
36
+msgid "User is allowed to edit the content of zones he does not own."
37
+msgstr "L'utilisateur peut modifier le contenu et les méta-données des zones dont il n'est pas le propriétaire."
38
+
39
+msgid "User is allowed to edit the meta data of zones he does not own."
40
+msgstr "L'utilisateur peut modifier les méta-données des zones dont il n'est pas le propriétaire."
41
+
42
+msgid "User is allowed to perform searches."
43
+msgstr "L'utilisateur peut faire des recherches."
44
+
45
+msgid "User is allowed to view supermasters."
46
+msgstr "L'utilisateur peut voir les super-maîtres."
47
+
48
+msgid "User is allowed to add new supermasters."
49
+msgstr "L'utilisateur peut ajouter des super-maîtres."
50
+
51
+msgid "User is allowed to edit new supermasters."
52
+msgstr "L'utilisateur peut modifier les super-maîtres."
53
+
54
+msgid "User has full access. God-like. Redeemer."
55
+msgstr "L'utilisateur a tous les droits. Il est comme Dieu."
56
+
57
+msgid "User is allowed to see other users and their details."
58
+msgstr "L'utilisateur peut voir les autres utilisateurs et leurs infos."
59
+
60
+msgid "User is allowed to add new users."
61
+msgstr "L'utilisateur peut ajouter des utilisateurs."
62
+
63
+msgid "User is allowed to edit their own details."
64
+msgstr "L'utilisateur peut modifier ses propres infos."
65
+
66
+msgid "User is allowed to edit other users."
67
+msgstr "L'utilisateur peut modifier les autres utilisateurs."
68
+
69
+msgid "User is allowed to edit the password of other users."
70
+msgstr "L'utilisateur peut modifier le mot de passe d'autres utilisateurs."
71
+
72
+msgid "User is allowed to change the permission template that is assigned to a user."
73
+msgstr "L'utilisateur peut modifier le gabarit assigné à un utilisateur."
74
+
75
+msgid "User is allowed to add new permission templates."
76
+msgstr "L'utilisateur peut ajouter des gabarits de permissions."
77
+
78
+msgid "User is allowed to edit existing permission templates."
79
+msgstr "L'utilisateur peut modif des gabarits de permissions."

BIN
poweradmin/poweradmin-2.1.8/locale/fr_FR/LC_MESSAGES/messages.mo View File


+ 82
- 0
poweradmin/poweradmin-2.1.8/locale/i18n-template-db.pot View File

@@ -0,0 +1,82 @@
1
+# Poweradmin translation.
2
+# Copyright (C) 2011 Poweradmin Development Team
3
+# This file is distributed under the same license as the Poweradmin package.
4
+# Rejo Zenger <rejo@poweradmin.org>, 2008.
5
+#
6
+#, fuzzy
7
+msgid ""
8
+msgstr ""
9
+"Project-Id-Version: Poweradmin 2.1.6\n"
10
+"Report-Msgid-Bugs-To: edmondas@poweradmin.org\n"
11
+"POT-Creation-Date: 2011-07-08 23:45+0300\n"
12
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+"Language-Team: LANGUAGE <LL@li.org>\n"
15
+"Language: en_EN\n"
16
+"MIME-Version: 1.0\n"
17
+"Content-Type: text/plain; charset=UTF-8\n"
18
+"Content-Transfer-Encoding: 8bit\n"
19
+
20
+msgid "User is allowed to add new master zones."
21
+msgstr ""
22
+
23
+msgid "User is allowed to add new slave zones."
24
+msgstr ""
25
+
26
+msgid "User is allowed to see the content and meta data of zones he owns."
27
+msgstr ""
28
+
29
+msgid "User is allowed to edit the content of zones he owns."
30
+msgstr ""
31
+
32
+msgid "User is allowed to edit the meta data of zones he owns."
33
+msgstr ""
34
+
35
+msgid "User is allowed to see the content and meta data of zones he does not own."
36
+msgstr ""
37
+
38
+msgid "User is allowed to edit the content of zones he does not own."
39
+msgstr ""
40
+
41
+msgid "User is allowed to edit the meta data of zones he does not own."
42
+msgstr ""
43
+
44
+msgid "User is allowed to perform searches."
45
+msgstr ""
46
+
47
+msgid "User is allowed to view supermasters."
48
+msgstr ""
49
+
50
+msgid "User is allowed to add new supermasters."
51
+msgstr ""
52
+
53
+msgid "User is allowed to edit supermasters."
54
+msgstr ""
55
+
56
+msgid "User has full access. God-like. Redeemer."
57
+msgstr ""
58
+
59
+msgid "User is allowed to see other users and their details."
60
+msgstr ""
61
+
62
+msgid "User is allowed to add new users."
63
+msgstr ""
64
+
65
+msgid "User is allowed to edit their own details."
66
+msgstr ""
67
+
68
+msgid "User is allowed to edit other users."
69
+msgstr ""
70
+
71
+msgid "User is allowed to edit the password of other users."
72
+msgstr ""
73
+
74
+msgid "User is allowed to change the permission template that is assigned to a user."
75
+msgstr ""
76
+
77
+msgid "User is allowed to add new permission templates."
78
+msgstr ""
79
+
80
+msgid "User is allowed to edit existing permission templates."
81
+msgstr ""
82
+

+ 1081
- 0
poweradmin/poweradmin-2.1.8/locale/i18n-template-php.pot
File diff suppressed because it is too large
View File


+ 1256
- 0
poweradmin/poweradmin-2.1.8/locale/ja_JP/LC_MESSAGES/ja.po
File diff suppressed because it is too large
View File


BIN
poweradmin/poweradmin-2.1.8/locale/ja_JP/LC_MESSAGES/messages.mo View File


+ 1163
- 0
poweradmin/poweradmin-2.1.8/locale/lt_LT/LC_MESSAGES/lt.po
File diff suppressed because it is too large
View File


+ 88
- 0
poweradmin/poweradmin-2.1.8/locale/lt_LT/LC_MESSAGES/lt_db.po View File

@@ -0,0 +1,88 @@
1
+# Poweradmin translation.
2
+# Copyright (C) 2011 Poweradmin Development Team
3
+# This file is distributed under the same license as the Poweradmin package.
4
+# 
5
+# Translators:
6
+#   <eg@fbsd.lt>, 2011.
7
+msgid ""
8
+msgstr ""
9
+"Project-Id-Version: Poweradmin\n"
10
+"Report-Msgid-Bugs-To: https://github.com/poweradmin/poweradmin/issues\n"
11
+"POT-Creation-Date: 2011-07-08 23:45+0300\n"
12
+"PO-Revision-Date: 2011-11-05 13:33+0000\n"
13
+"Last-Translator: edmondas <eg@fbsd.lt>\n"
14
+"Language-Team: Lithuanian (http://www.transifex.net/projects/p/poweradmin/team/lt/)\n"
15
+"MIME-Version: 1.0\n"
16
+"Content-Type: text/plain; charset=UTF-8\n"
17
+"Content-Transfer-Encoding: 8bit\n"
18
+"Language: lt\n"
19
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
20
+
21
+msgid "User is allowed to add new master zones."
22
+msgstr "Naudotojui leidžiama sukurti pagrindines zonas."
23
+
24
+msgid "User is allowed to add new slave zones."
25
+msgstr "Naudotojui leidžiama sukurti pavaldžias zonas. "
26
+
27
+msgid "User is allowed to see the content and meta data of zones he owns."
28
+msgstr "Naudotojui leidžiama matyti valdomų zonų turinį bei metaduomenis."
29
+
30
+msgid "User is allowed to edit the content of zones he owns."
31
+msgstr "Naudotojui yra leidžiama taisyti jam priklausančias zonas."
32
+
33
+msgid "User is allowed to edit the meta data of zones he owns."
34
+msgstr "Naudotojui yra leidžiama taisyti jam priklausančių zonų metaduomenis."
35
+
36
+msgid ""
37
+"User is allowed to see the content and meta data of zones he does not own."
38
+msgstr "Naudotojui leidžiama matyti jam nepavaldžias zonas bei metaduomenis."
39
+
40
+msgid "User is allowed to edit the content of zones he does not own."
41
+msgstr "Naudotojui leidžiama taisyti jam nepavaldžias zonas."
42
+
43
+msgid "User is allowed to edit the meta data of zones he does not own."
44
+msgstr "Naudotojui leidžiama taisyti jam nepavaldžių zonų metaduomenis."
45
+
46
+msgid "User is allowed to perform searches."
47
+msgstr "Naudotojas gali atlikti paiešką."
48
+
49
+msgid "User is allowed to view supermasters."
50
+msgstr "Naudotojui leidžiama peržiūrėti superpagrindinių serverių sąrašą."
51
+
52
+msgid "User is allowed to add new supermasters."
53
+msgstr "Naudotojui leidžiama kurti superpagrindinius serverius."
54
+
55
+msgid "User is allowed to edit supermasters."
56
+msgstr "Naudotojui leidžiama taisyti superpagrindinius serverius."
57
+
58
+msgid "User has full access. God-like. Redeemer."
59
+msgstr "Naudotojas turi visas teises."
60
+
61
+msgid "User is allowed to see other users and their details."
62
+msgstr ""
63
+"Naudotojui leidžiama matyti kituts vartotojus bei jų asmeninius duomenis."
64
+
65
+msgid "User is allowed to add new users."
66
+msgstr "Naudotojas gali kurti naujus vartotojus."
67
+
68
+msgid "User is allowed to edit their own details."
69
+msgstr "Naudotojui leidžiama taisyti savo asmeninius duomenis."
70
+
71
+msgid "User is allowed to edit other users."
72
+msgstr "Naudotojui leidžiama taisyti kitų naudotojų duomenis."
73
+
74
+msgid "User is allowed to edit the password of other users."
75
+msgstr "Naudotojui leidžiama taisyti kitų naudotojų slaptažodžius."
76
+
77
+msgid ""
78
+"User is allowed to change the permission template that is assigned to a "
79
+"user."
80
+msgstr "Naudotojui leidžiama taisyti savus teisių šablonus. "
81
+
82
+msgid "User is allowed to add new permission templates."
83
+msgstr "Naudotojui leidžiama kurti naujus teisių šablonus."
84
+
85
+msgid "User is allowed to edit existing permission templates."
86
+msgstr "Naudotojui leidžiama taisyti egzistuojančius teisių šablonus."
87
+
88
+

BIN
poweradmin/poweradmin-2.1.8/locale/lt_LT/LC_MESSAGES/messages.mo View File


BIN
poweradmin/poweradmin-2.1.8/locale/nb_NO/LC_MESSAGES/messages.mo View File


+ 1162
- 0
poweradmin/poweradmin-2.1.8/locale/nb_NO/LC_MESSAGES/nb.po
File diff suppressed because it is too large
View File


+ 85
- 0
poweradmin/poweradmin-2.1.8/locale/nb_NO/LC_MESSAGES/nb_db.po View File

@@ -0,0 +1,85 @@
1
+# Poweradmin translation.
2
+# Copyright (C) 2011 Poweradmin Development Team
3
+# This file is distributed under the same license as the Poweradmin package.
4
+# 
5
+# Translators:
6
+#   <pmknutsen@gmail.com>, 2012.
7
+msgid ""
8
+msgstr ""
9
+"Project-Id-Version: Poweradmin\n"
10
+"Report-Msgid-Bugs-To: https://github.com/poweradmin/poweradmin/issues\n"
11
+"POT-Creation-Date: 2011-07-08 23:45+0300\n"
12
+"PO-Revision-Date: 2012-05-15 19:09+0000\n"
13
+"Last-Translator: Per M Knutsen <pmknutsen@gmail.com>\n"
14
+"Language-Team: Norwegian Bokmål (http://www.transifex.com/projects/p/poweradmin/language/nb/)\n"
15
+"MIME-Version: 1.0\n"
16
+"Content-Type: text/plain; charset=UTF-8\n"
17
+"Content-Transfer-Encoding: 8bit\n"
18
+"Language: nb\n"
19
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
+
21
+msgid "User is allowed to add new master zones."
22
+msgstr "Bruker kan lage nye master soner."
23
+
24
+msgid "User is allowed to add new slave zones."
25
+msgstr "Bruker kan lage nye slave soner."
26
+
27
+msgid "User is allowed to see the content and meta data of zones he owns."
28
+msgstr "Bruker kan se innhold og meta data i soner han/hun eier."
29
+
30
+msgid "User is allowed to edit the content of zones he owns."
31
+msgstr "Bruker kan redigere innholdet i soner han/hun eier."
32
+
33
+msgid "User is allowed to edit the meta data of zones he owns."
34
+msgstr "Bruker kan redigere meta data i soner han/hun eier."
35
+
36
+msgid ""
37
+"User is allowed to see the content and meta data of zones he does not own."
38
+msgstr "Bruker kan se innhold og meta data i soner han/hun ikke eier."
39
+
40
+msgid "User is allowed to edit the content of zones he does not own."
41
+msgstr "Bruker kan redigere innholdet i soner han/hun ikke eier."
42
+
43
+msgid "User is allowed to edit the meta data of zones he does not own."
44
+msgstr "Bruker kan redigere meta data i soner han/hun ikke eier."
45
+
46
+msgid "User is allowed to perform searches."
47
+msgstr "Bruker kan søke."
48
+
49
+msgid "User is allowed to view supermasters."
50
+msgstr "Bruker kan se supermastere."
51
+
52
+msgid "User is allowed to add new supermasters."
53
+msgstr "Bruker kan legge til nye supermastere."
54
+
55
+msgid "User is allowed to edit supermasters."
56
+msgstr "Bruker kan redigere supermastere."
57
+
58
+msgid "User has full access. God-like. Redeemer."
59
+msgstr "Bruker har alle rettigheter."
60
+
61
+msgid "User is allowed to see other users and their details."
62
+msgstr "Bruker kan se andre brukere og deres detaljer."
63
+
64
+msgid "User is allowed to add new users."
65
+msgstr "Bruker kan lage nye brukere."
66
+
67
+msgid "User is allowed to edit their own details."
68
+msgstr "Bruker kan redigere hans/hennes egne detaljer."
69
+
70
+msgid "User is allowed to edit other users."
71
+msgstr "Bruker kan redigere andre brukere."
72
+
73
+msgid "User is allowed to edit the password of other users."
74
+msgstr "Bruker kan endre passordet til andre brukere."
75
+
76
+msgid ""
77
+"User is allowed to change the permission template that is assigned to a "
78
+"user."
79
+msgstr "Bruker kan endre rettighets maler tildelt andre brukere."
80
+
81
+msgid "User is allowed to add new permission templates."
82
+msgstr "Bruker kan lage nye rettighets maler."
83
+
84
+msgid "User is allowed to edit existing permission templates."
85
+msgstr "Bruker kan redigere eksisterende rettighets maler."

BIN
poweradmin/poweradmin-2.1.8/locale/nl_NL/LC_MESSAGES/messages.mo View File


+ 1161
- 0
poweradmin/poweradmin-2.1.8/locale/nl_NL/LC_MESSAGES/nl.po
File diff suppressed because it is too large
View File


+ 85
- 0
poweradmin/poweradmin-2.1.8/locale/nl_NL/LC_MESSAGES/nl_db.po View File

@@ -0,0 +1,85 @@
1
+# Poweradmin translation.
2
+# Copyright (C) 2011 Poweradmin Development Team
3
+# This file is distributed under the same license as the Poweradmin package.
4
+# 
5
+# Translators:
6
+#   <fabian@dammekens.be>, 2011.
7
+msgid ""
8
+msgstr ""
9
+"Project-Id-Version: Poweradmin\n"
10
+"Report-Msgid-Bugs-To: https://github.com/poweradmin/poweradmin/issues\n"
11
+"POT-Creation-Date: 2011-07-08 23:45+0300\n"
12
+"PO-Revision-Date: 2012-02-14 09:00+0000\n"
13
+"Last-Translator: fdammeke <fabian@dammekens.be>\n"
14
+"Language-Team: Dutch (http://www.transifex.com/projects/p/poweradmin/language/nl/)\n"
15
+"MIME-Version: 1.0\n"
16
+"Content-Type: text/plain; charset=UTF-8\n"
17
+"Content-Transfer-Encoding: 8bit\n"
18
+"Language: nl\n"
19
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
+
21
+msgid "User is allowed to add new master zones."
22
+msgstr "Gebruiker kan een master zone toevoegen."
23
+
24
+msgid "User is allowed to add new slave zones."
25
+msgstr "Gebruiker kan een nieuwe slave zone toevoegen."
26
+
27
+msgid "User is allowed to see the content and meta data of zones he owns."
28
+msgstr "Gebruiker kan de inhoud en metadata zien van de zones waartoe hij rechten heeft."
29
+
30
+msgid "User is allowed to edit the content of zones he owns."
31
+msgstr "Gebruiker kan de inhoud van de zones waartoe hij rechten heeft aanpassen."
32
+
33
+msgid "User is allowed to edit the meta data of zones he owns."
34
+msgstr "Gebruiker kan de metadata van de zones waartoe hij rechten heeft aanpassen."
35
+
36
+msgid ""
37
+"User is allowed to see the content and meta data of zones he does not own."
38
+msgstr "Gebruiker kan de inhoud en metadata zien van alle zones."
39
+
40
+msgid "User is allowed to edit the content of zones he does not own."
41
+msgstr "Gebruiker kan de inhoud van alle zones aanpassen."
42
+
43
+msgid "User is allowed to edit the meta data of zones he does not own."
44
+msgstr "Gebruiker kan de metadata van alle zones aanpassen."
45
+
46
+msgid "User is allowed to perform searches."
47
+msgstr "Gebruiker kan opzoekingen maken."
48
+
49
+msgid "User is allowed to view supermasters."
50
+msgstr "Gebruiker kan de supermasters oplijsten."
51
+
52
+msgid "User is allowed to add new supermasters."
53
+msgstr "Gebruiker kan supermasters toevoegen."
54
+
55
+msgid "User is allowed to edit supermasters."
56
+msgstr "Gebruiker kan supermasters aanpassen."
57
+
58
+msgid "User has full access. God-like. Redeemer."
59
+msgstr "Gebruiker heeft volledige toegang. Übermensch."
60
+
61
+msgid "User is allowed to see other users and their details."
62
+msgstr "Gebruiker kan andere gebruikers oplijsten en weergeven."
63
+
64
+msgid "User is allowed to add new users."
65
+msgstr "Gebruiker kan nieuwe gebruikers toevoegen."
66
+
67
+msgid "User is allowed to edit their own details."
68
+msgstr "Gebruiker kan zijn eigen details aanpassen."
69
+
70
+msgid "User is allowed to edit other users."
71
+msgstr "Gebruiker kan andere gebruikers aanpassen."
72
+
73
+msgid "User is allowed to edit the password of other users."
74
+msgstr "Gebruiker kan wachtwoorden van andere gebruikers aanpassen."
75
+
76
+msgid ""
77
+"User is allowed to change the permission template that is assigned to a "
78
+"user."
79
+msgstr "Gebruiker kan permissies toekennen aan andere gebruikers."
80
+
81
+msgid "User is allowed to add new permission templates."
82
+msgstr "Gebruiker kan nieuwe permissies aanmaken."
83
+
84
+msgid "User is allowed to edit existing permission templates."
85
+msgstr "Gebruiker kan bestaande permissies aanpassen."

+ 0
- 0
poweradmin/poweradmin-2.1.8/locale/pl_PL/LC_MESSAGES/messages.mo View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save