Browse Source

pgsql; poweradmin

tags/v1.0.0
Robin Thoni 7 years ago
parent
commit
a628060c97
100 changed files with 23428 additions and 0 deletions
  1. 95
    0
      01_init.sql
  2. 2
    0
      README.md
  3. 54
    0
      docker-compose.yml
  4. 12
    0
      env
  5. 12
    0
      pdns/vars-vars
  6. 5
    0
      postgresql/Dockerfile
  7. 1054
    0
      postgresql/docker-entrypoint-initdb.d/01_init.sql
  8. 41
    0
      poweradmin/Dockerfile
  9. 59
    0
      poweradmin/apache2.conf
  10. 7
    0
      poweradmin/poweradmin-2.1.7/.gitignore
  11. 622
    0
      poweradmin/poweradmin-2.1.7/LICENSE
  12. 3
    0
      poweradmin/poweradmin-2.1.7/README.md
  13. 525
    0
      poweradmin/poweradmin-2.1.7/_install/database-structure.inc.php
  14. 5
    0
      poweradmin/poweradmin-2.1.7/_install/htaccess.dist
  15. 372
    0
      poweradmin/poweradmin-2.1.7/_install/index.php
  16. 87
    0
      poweradmin/poweradmin-2.1.7/add_perm_templ.php
  17. 220
    0
      poweradmin/poweradmin-2.1.7/add_record.php
  18. 120
    0
      poweradmin/poweradmin-2.1.7/add_supermaster.php
  19. 90
    0
      poweradmin/poweradmin-2.1.7/add_user.php
  20. 192
    0
      poweradmin/poweradmin-2.1.7/add_zone_master.php
  21. 129
    0
      poweradmin/poweradmin-2.1.7/add_zone_slave.php
  22. 66
    0
      poweradmin/poweradmin-2.1.7/add_zone_templ.php
  23. 165
    0
      poweradmin/poweradmin-2.1.7/add_zone_templ_record.php
  24. 9
    0
      poweradmin/poweradmin-2.1.7/addons/clientip.php
  25. 43
    0
      poweradmin/poweradmin-2.1.7/addons/dynamic_dns_client.pl
  26. 164
    0
      poweradmin/poweradmin-2.1.7/bulk_registration.php
  27. 64
    0
      poweradmin/poweradmin-2.1.7/change_password.php
  28. 103
    0
      poweradmin/poweradmin-2.1.7/delete_domain.php
  29. 103
    0
      poweradmin/poweradmin-2.1.7/delete_domains.php
  30. 67
    0
      poweradmin/poweradmin-2.1.7/delete_perm_templ.php
  31. 134
    0
      poweradmin/poweradmin-2.1.7/delete_record.php
  32. 82
    0
      poweradmin/poweradmin-2.1.7/delete_supermaster.php
  33. 127
    0
      poweradmin/poweradmin-2.1.7/delete_user.php
  34. 66
    0
      poweradmin/poweradmin-2.1.7/delete_zone_templ.php
  35. 89
    0
      poweradmin/poweradmin-2.1.7/delete_zone_templ_record.php
  36. 113
    0
      poweradmin/poweradmin-2.1.7/dnssec.php
  37. 150
    0
      poweradmin/poweradmin-2.1.7/dnssec_add_key.php
  38. 98
    0
      poweradmin/poweradmin-2.1.7/dnssec_delete_key.php
  39. 95
    0
      poweradmin/poweradmin-2.1.7/dnssec_ds_dnskey.php
  40. 108
    0
      poweradmin/poweradmin-2.1.7/dnssec_edit_key.php
  41. 182
    0
      poweradmin/poweradmin-2.1.7/dynamic_update.php
  42. 516
    0
      poweradmin/poweradmin-2.1.7/edit.php
  43. 115
    0
      poweradmin/poweradmin-2.1.7/edit_comment.php
  44. 99
    0
      poweradmin/poweradmin-2.1.7/edit_perm_templ.php
  45. 164
    0
      poweradmin/poweradmin-2.1.7/edit_record.php
  46. 172
    0
      poweradmin/poweradmin-2.1.7/edit_user.php
  47. 201
    0
      poweradmin/poweradmin-2.1.7/edit_zone_templ.php
  48. 118
    0
      poweradmin/poweradmin-2.1.7/edit_zone_templ_record.php
  49. BIN
      poweradmin/poweradmin-2.1.7/favicon.ico
  50. BIN
      poweradmin/poweradmin-2.1.7/images/arrow.png
  51. BIN
      poweradmin/poweradmin-2.1.7/images/background.jpg
  52. BIN
      poweradmin/poweradmin-2.1.7/images/delete.gif
  53. BIN
      poweradmin/poweradmin-2.1.7/images/edit.gif
  54. BIN
      poweradmin/poweradmin-2.1.7/images/logo.png
  55. BIN
      poweradmin/poweradmin-2.1.7/images/switch_user.png
  56. 249
    0
      poweradmin/poweradmin-2.1.7/inc/PDOCommon.class.php
  57. 242
    0
      poweradmin/poweradmin-2.1.7/inc/PDOLayer.php
  58. 313
    0
      poweradmin/poweradmin-2.1.7/inc/auth.inc.php
  59. 44
    0
      poweradmin/poweradmin-2.1.7/inc/benchmark.php
  60. 75
    0
      poweradmin/poweradmin-2.1.7/inc/config-me.inc.php
  61. 188
    0
      poweradmin/poweradmin-2.1.7/inc/countrycodes.inc.php
  62. 228
    0
      poweradmin/poweradmin-2.1.7/inc/database.inc.php
  63. 882
    0
      poweradmin/poweradmin-2.1.7/inc/dns.inc.php
  64. 580
    0
      poweradmin/poweradmin-2.1.7/inc/dnssec.inc.php
  65. 160
    0
      poweradmin/poweradmin-2.1.7/inc/error.inc.php
  66. 35
    0
      poweradmin/poweradmin-2.1.7/inc/file.inc.php
  67. 69
    0
      poweradmin/poweradmin-2.1.7/inc/footer.inc.php
  68. 108
    0
      poweradmin/poweradmin-2.1.7/inc/header.inc.php
  69. 149
    0
      poweradmin/poweradmin-2.1.7/inc/helper.js
  70. 50
    0
      poweradmin/poweradmin-2.1.7/inc/i18n.inc.php
  71. 80
    0
      poweradmin/poweradmin-2.1.7/inc/migrations.inc.php
  72. 2122
    0
      poweradmin/poweradmin-2.1.7/inc/record.inc.php
  73. 653
    0
      poweradmin/poweradmin-2.1.7/inc/templates.inc.php
  74. 626
    0
      poweradmin/poweradmin-2.1.7/inc/toolkit.inc.php
  75. 932
    0
      poweradmin/poweradmin-2.1.7/inc/users.inc.php
  76. 32
    0
      poweradmin/poweradmin-2.1.7/inc/version.inc.php
  77. 75
    0
      poweradmin/poweradmin-2.1.7/index.php
  78. 74
    0
      poweradmin/poweradmin-2.1.7/list_perm_templ.php
  79. 72
    0
      poweradmin/poweradmin-2.1.7/list_supermasters.php
  80. 72
    0
      poweradmin/poweradmin-2.1.7/list_zone_templ.php
  81. 165
    0
      poweradmin/poweradmin-2.1.7/list_zones.php
  82. 1168
    0
      poweradmin/poweradmin-2.1.7/locale/cs_CZ/LC_MESSAGES/cs.po
  83. 88
    0
      poweradmin/poweradmin-2.1.7/locale/cs_CZ/LC_MESSAGES/cs_db.po
  84. BIN
      poweradmin/poweradmin-2.1.7/locale/cs_CZ/LC_MESSAGES/messages.mo
  85. 979
    0
      poweradmin/poweradmin-2.1.7/locale/de_DE/LC_MESSAGES/de.po
  86. BIN
      poweradmin/poweradmin-2.1.7/locale/de_DE/LC_MESSAGES/messages.mo
  87. 1243
    0
      poweradmin/poweradmin-2.1.7/locale/en_EN/LC_MESSAGES/en.po
  88. BIN
      poweradmin/poweradmin-2.1.7/locale/en_EN/LC_MESSAGES/messages.mo
  89. 887
    0
      poweradmin/poweradmin-2.1.7/locale/fr_FR/LC_MESSAGES/fr.po
  90. 79
    0
      poweradmin/poweradmin-2.1.7/locale/fr_FR/LC_MESSAGES/fr_db.po
  91. BIN
      poweradmin/poweradmin-2.1.7/locale/fr_FR/LC_MESSAGES/messages.mo
  92. 82
    0
      poweradmin/poweradmin-2.1.7/locale/i18n-template-db.pot
  93. 1085
    0
      poweradmin/poweradmin-2.1.7/locale/i18n-template-php.pot
  94. 1167
    0
      poweradmin/poweradmin-2.1.7/locale/ja_JP/LC_MESSAGES/ja.po
  95. BIN
      poweradmin/poweradmin-2.1.7/locale/ja_JP/LC_MESSAGES/messages.mo
  96. 1168
    0
      poweradmin/poweradmin-2.1.7/locale/lt_LT/LC_MESSAGES/lt.po
  97. 88
    0
      poweradmin/poweradmin-2.1.7/locale/lt_LT/LC_MESSAGES/lt_db.po
  98. BIN
      poweradmin/poweradmin-2.1.7/locale/lt_LT/LC_MESSAGES/messages.mo
  99. BIN
      poweradmin/poweradmin-2.1.7/locale/nb_NO/LC_MESSAGES/messages.mo
  100. 0
    0
      poweradmin/poweradmin-2.1.7/locale/nb_NO/LC_MESSAGES/nb.po

+ 95
- 0
01_init.sql View File

@@ -0,0 +1,95 @@
1
+CREATE TABLE domains (
2
+  id                    SERIAL PRIMARY KEY,
3
+  name                  VARCHAR(255) NOT NULL,
4
+  master                VARCHAR(128) DEFAULT NULL,
5
+  last_check            INT DEFAULT NULL,
6
+  type                  VARCHAR(6) NOT NULL,
7
+  notified_serial       INT DEFAULT NULL,
8
+  account               VARCHAR(40) DEFAULT NULL,
9
+  CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT)))
10
+);
11
+
12
+CREATE UNIQUE INDEX name_index ON domains(name);
13
+
14
+
15
+CREATE TABLE records (
16
+  id                    SERIAL PRIMARY KEY,
17
+  domain_id             INT DEFAULT NULL,
18
+  name                  VARCHAR(255) DEFAULT NULL,
19
+  type                  VARCHAR(10) DEFAULT NULL,
20
+  content               VARCHAR(65535) DEFAULT NULL,
21
+  ttl                   INT DEFAULT NULL,
22
+  prio                  INT DEFAULT NULL,
23
+  change_date           INT DEFAULT NULL,
24
+  disabled              BOOL DEFAULT 'f',
25
+  ordername             VARCHAR(255),
26
+  auth                  BOOL DEFAULT 't',
27
+  CONSTRAINT domain_exists
28
+  FOREIGN KEY(domain_id) REFERENCES domains(id)
29
+  ON DELETE CASCADE,
30
+  CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT)))
31
+);
32
+
33
+CREATE INDEX rec_name_index ON records(name);
34
+CREATE INDEX nametype_index ON records(name,type);
35
+CREATE INDEX domain_id ON records(domain_id);
36
+CREATE INDEX recordorder ON records (domain_id, ordername text_pattern_ops);
37
+
38
+
39
+CREATE TABLE supermasters (
40
+  ip                    INET NOT NULL,
41
+  nameserver            VARCHAR(255) NOT NULL,
42
+  account               VARCHAR(40) NOT NULL,
43
+  PRIMARY KEY(ip, nameserver)
44
+);
45
+
46
+
47
+CREATE TABLE comments (
48
+  id                    SERIAL PRIMARY KEY,
49
+  domain_id             INT NOT NULL,
50
+  name                  VARCHAR(255) NOT NULL,
51
+  type                  VARCHAR(10) NOT NULL,
52
+  modified_at           INT NOT NULL,
53
+  account               VARCHAR(40) DEFAULT NULL,
54
+  comment               VARCHAR(65535) NOT NULL,
55
+  CONSTRAINT domain_exists
56
+  FOREIGN KEY(domain_id) REFERENCES domains(id)
57
+  ON DELETE CASCADE,
58
+  CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT)))
59
+);
60
+
61
+CREATE INDEX comments_domain_id_idx ON comments (domain_id);
62
+CREATE INDEX comments_name_type_idx ON comments (name, type);
63
+CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);
64
+
65
+
66
+CREATE TABLE domainmetadata (
67
+  id                    SERIAL PRIMARY KEY,
68
+  domain_id             INT REFERENCES domains(id) ON DELETE CASCADE,
69
+  kind                  VARCHAR(32),
70
+  content               TEXT
71
+);
72
+
73
+CREATE INDEX domainidmetaindex ON domainmetadata(domain_id);
74
+
75
+
76
+CREATE TABLE cryptokeys (
77
+  id                    SERIAL PRIMARY KEY,
78
+  domain_id             INT REFERENCES domains(id) ON DELETE CASCADE,
79
+  flags                 INT NOT NULL,
80
+  active                BOOL,
81
+  content               TEXT
82
+);
83
+
84
+CREATE INDEX domainidindex ON cryptokeys(domain_id);
85
+
86
+
87
+CREATE TABLE tsigkeys (
88
+  id                    SERIAL PRIMARY KEY,
89
+  name                  VARCHAR(255),
90
+  algorithm             VARCHAR(50),
91
+  secret                VARCHAR(255),
92
+  CONSTRAINT c_lowercase_name CHECK (((name)::TEXT = LOWER((name)::TEXT)))
93
+);
94
+
95
+CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);

+ 2
- 0
README.md View File

@@ -0,0 +1,2 @@
1
+poweradmin default admin:
2
+admin:toor42

+ 54
- 0
docker-compose.yml View File

@@ -0,0 +1,54 @@
1
+version: '2'
2
+
3
+services:
4
+    postgresql:
5
+        build: ./postgresql
6
+        container_name: pdns-postgresql
7
+        networks:
8
+            pdns.internal.docker:
9
+                aliases:
10
+                    - postgresql.pdns.internal.docker
11
+        volumes:
12
+            - ./data/postgresql/data:/var/lib/postgresql/data
13
+        ports:
14
+            - "127.0.0.1:34020:5432"
15
+        env_file:
16
+            - env
17
+
18
+    poweradmin:
19
+        build: ./poweradmin
20
+        container_name: pdns-poweradmin
21
+        networks:
22
+            pdns.internal.docker:
23
+                aliases:
24
+                    - poweradmin.pdns.internal.docker
25
+        ports:
26
+            - "127.0.0.1:34021:80"
27
+        env_file:
28
+            - env
29
+
30
+#    pdns:
31
+#        build: ./pdns
32
+#        container_name: pdns-pdns
33
+#        networks:
34
+#            pdns.internal.docker:
35
+#                aliases:
36
+#                    - pdns.pdns.internal.docker
37
+#        ports:
38
+#            - "0.0.0.0:53:53/udp"
39
+#        env_file:
40
+#            - env
41
+#
42
+#    pdns-recursor:
43
+#      build: ./pdns-recursor
44
+#      container_name: pdns-pdns-recursor
45
+#        networks:
46
+#            pdns.internal.docker:
47
+#                aliases:
48
+#                  - pdns-recursor.pdns.internal.docker
49
+#        env_file:
50
+#            - env
51
+
52
+
53
+networks:
54
+    pdns.internal.docker:

+ 12
- 0
env View File

@@ -0,0 +1,12 @@
1
+POSTGRES_HOST=postgresql.pdns.internal.docker
2
+POSTGRES_USER=poweradmin
3
+POSTGRES_PASSWORD=pg_password
4
+POSTGRES_DB=poweradmin
5
+
6
+PDNS_RECURSOR_HOST=pdns-recursor.pdns.internal.docker
7
+
8
+SESSION_KEY=change_it
9
+
10
+DNS_HOSTMASTER=hostmaster.rthoni.com
11
+DNS_NS1=ns1.rthoni.com
12
+DNS_NS2=ns2.rthoni.com

+ 12
- 0
pdns/vars-vars View File

@@ -0,0 +1,12 @@
1
+POSTGRES_HOST
2
+POSTGRES_USER
3
+POSTGRES_PASSWORD
4
+POSTGRES_DB
5
+
6
+PDNS_RECURSOR_HOST
7
+
8
+SESSION_KEY
9
+
10
+DNS_HOSTMASTER
11
+DNS_NS1
12
+DNS_NS2

+ 5
- 0
postgresql/Dockerfile View File

@@ -0,0 +1,5 @@
1
+FROM postgres:9.6
2
+
3
+RUN rm -rf /var/log/*
4
+
5
+COPY ./docker-entrypoint-initdb.d/ /docker-entrypoint-initdb.d

+ 1054
- 0
postgresql/docker-entrypoint-initdb.d/01_init.sql
File diff suppressed because it is too large
View File


+ 41
- 0
poweradmin/Dockerfile View File

@@ -0,0 +1,41 @@
1
+FROM debian:jessie
2
+
3
+# FROM https://github.com/ZHAJOR/Docker-Apache-2.4-Php-5.6-for-Laravel
4
+MAINTAINER Robin Thoni <robin@rthoni.com>
5
+
6
+RUN apt-get update && apt-get -y install\
7
+        apache2=2.4.*\
8
+        libapache2-mod-php5\
9
+        php5\
10
+        php5-mcrypt\
11
+        php5-pgsql\
12
+        php5-mysql\
13
+        php5-gd\
14
+        php5-curl\
15
+        php5-imap &&\
16
+        apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
17
+
18
+RUN /usr/sbin/a2enmod rewrite &&\
19
+    rm -rf /var/www/html &&\
20
+    mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html &&\
21
+    chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html
22
+
23
+RUN rm -rf /var/log/* &&\
24
+    mkdir -p /var/log/apache2 &&\
25
+    ln -s /dev/stderr /var/log/apache2/error.log &&\
26
+    ln -s /dev/stdout /var/log/apache2/access.log &&\
27
+    ln -s /dev/stdout /var/log/apache2/other_vhosts_access.log
28
+
29
+COPY apache2.conf /etc/apache2/apache2.conf
30
+
31
+COPY ./poweradmin-2.1.7/ /var/www/html/
32
+
33
+COPY ./vars-vars /etc/vars-vars
34
+
35
+COPY ./vars-files /etc/vars-files
36
+
37
+COPY ./run.sh /run.sh
38
+
39
+EXPOSE 80
40
+
41
+CMD ["/run.sh"]

+ 59
- 0
poweradmin/apache2.conf View File

@@ -0,0 +1,59 @@
1
+# see http://sources.debian.net/src/apache2/2.4.10-1/debian/config-dir/apache2.conf
2
+
3
+Mutex file:/var/lock/apache2 default
4
+PidFile /var/run/apache2/apache2.pid
5
+Timeout 300
6
+KeepAlive On
7
+MaxKeepAliveRequests 100
8
+KeepAliveTimeout 5
9
+User www-data
10
+Group www-data
11
+HostnameLookups Off
12
+ErrorLog /var/log/apache2/error.log
13
+LogLevel warn
14
+
15
+IncludeOptional mods-enabled/*.load
16
+IncludeOptional mods-enabled/*.conf
17
+
18
+# ports.conf
19
+Listen 80
20
+<IfModule ssl_module>
21
+    Listen 443
22
+</IfModule>
23
+<IfModule mod_gnutls.c>
24
+    Listen 443
25
+</IfModule>
26
+
27
+DocumentRoot "/var/www/html/"
28
+
29
+<Directory />
30
+    Options FollowSymLinks
31
+    AllowOverride None
32
+    Require all denied
33
+</Directory>
34
+
35
+<Directory /var/www/html/>
36
+    Options FollowSymLinks
37
+    AllowOverride All
38
+    Require all granted
39
+</Directory>
40
+
41
+
42
+
43
+LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
44
+LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
45
+LogFormat "%h %l %u %t \"%r\" %>s %O" common
46
+LogFormat "%{Referer}i -> %U" referer
47
+LogFormat "%{User-agent}i" agent
48
+
49
+CustomLog /var/log/apache2/access.log combined
50
+
51
+<FilesMatch \.php$>
52
+    SetHandler application/x-httpd-php
53
+</FilesMatch>
54
+
55
+# Multiple DirectoryIndex directives within the same context will add
56
+# to the list of resources to look for rather than replace
57
+# https://httpd.apache.org/docs/current/mod/mod_dir.html#directoryindex
58
+DirectoryIndex disabled
59
+DirectoryIndex index.php index.html

+ 7
- 0
poweradmin/poweradmin-2.1.7/.gitignore View File

@@ -0,0 +1,7 @@
1
+inc/config.inc.php
2
+.DS_Store
3
+/nbproject
4
+/scripts
5
+/tests
6
+/.idea
7
+/docs

+ 622
- 0
poweradmin/poweradmin-2.1.7/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.7/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.

+ 525
- 0
poweradmin/poweradmin-2.1.7/_install/database-structure.inc.php View File

@@ -0,0 +1,525 @@
1
+<?php
2
+
3
+$def_tables = array(
4
+    array(
5
+        'table_name' => 'perm_items',
6
+        'options' => array('type' => 'innodb'),
7
+        'fields' => array(
8
+            'id' => array(
9
+                'type' => 'integer',
10
+                'notnull' => 1,
11
+                'unsigned' => 0,
12
+                'autoincrement' => 1,
13
+                'name' => 'id',
14
+                'table' => 'perm_items',
15
+                'flags' => 'primary_keynot_null'
16
+            ),
17
+            'name' => array(
18
+                'type' => 'text',
19
+                'notnull' => 1,
20
+                'length' => 64,
21
+                'fixed' => 0,
22
+                'default' => 0,
23
+                'name' => 'name',
24
+                'table' => 'perm_items',
25
+                'flags' => 'not_null'
26
+            ),
27
+            'descr' => array(
28
+                'type' => 'text',
29
+                'length' => 1024,
30
+                'notnull' => 1,
31
+                'fixed' => 0,
32
+                'default' => 0,
33
+                'name' => 'descr',
34
+                'table' => 'perm_items',
35
+                'flags' => 'not_null'
36
+            )
37
+        )
38
+    ),
39
+    array(
40
+        'table_name' => 'perm_templ',
41
+        'options' => array('type' => 'innodb'),
42
+        'fields' => array(
43
+            'id' => array(
44
+                'type' => 'integer',
45
+                'notnull' => 1,
46
+                'unsigned' => 0,
47
+                'default' => 0,
48
+                'autoincrement' => 1,
49
+                'name' => 'id',
50
+                'table' => 'perm_templ',
51
+                'flags' => 'primary_keynot_null'
52
+            ),
53
+            'name' => array(
54
+                'type' => 'text',
55
+                'notnull' => 1,
56
+                'length' => 128,
57
+                'fixed' => 0,
58
+                'default' => 0,
59
+                'name' => 'name',
60
+                'table' => 'perm_templ',
61
+                'flags' => 'not_null'
62
+            ),
63
+            'descr' => array(
64
+                'notnull' => 1,
65
+                'fixed' => 0,
66
+                'default' => 0,
67
+                'type' => 'text',
68
+                'length' => 1024,
69
+                'name' => 'descr',
70
+                'table' => 'perm_templ',
71
+                'flags' => 'not_null'
72
+            )
73
+        )
74
+    ),
75
+    array(
76
+        'table_name' => 'perm_templ_items',
77
+        'options' => array('type' => 'innodb'),
78
+        'fields' => array(
79
+            'id' => array(
80
+                'notnull' => 1,
81
+                'unsigned' => 0,
82
+                'default' => 0,
83
+                'autoincrement' => 1,
84
+                'type' => 'integer',
85
+                'name' => 'id',
86
+                'table' => 'perm_templ_items',
87
+                'flags' => 'primary_keynot_null'
88
+            ),
89
+            'templ_id' => array(
90
+                'notnull' => 1,
91
+                'length' => 4,
92
+                'unsigned' => 0,
93
+                'default' => 0,
94
+                'type' => 'integer',
95
+                'name' => 'templ_id',
96
+                'table' => 'perm_templ_items',
97
+                'flags' => 'not_null'
98
+            ),
99
+            'perm_id' => array(
100
+                'notnull' => 1,
101
+                'length' => 4,
102
+                'unsigned' => 0,
103
+                'default' => 0,
104
+                'type' => 'integer',
105
+                'name' => 'perm_id',
106
+                'table' => 'perm_templ_items',
107
+                'flags' => 'not_null'
108
+            )
109
+        )
110
+    ),
111
+    array(
112
+        'table_name' => 'users',
113
+        'options' => array('type' => 'innodb'),
114
+        'fields' => array(
115
+            'id' => array
116
+                (
117
+                'notnull' => 1,
118
+                'unsigned' => 0,
119
+                'default' => 0,
120
+                'autoincrement' => 1,
121
+                'type' => 'integer',
122
+                'name' => 'id',
123
+                'table' => 'users',
124
+                'flags' => 'primary_keynot_null'
125
+            ),
126
+            'username' => array
127
+                (
128
+                'notnull' => 1,
129
+                'length' => 64,
130
+                'fixed' => 0,
131
+                'default' => 0,
132
+                'type' => 'text',
133
+                'name' => 'username',
134
+                'table' => 'users',
135
+                'flags' => 'not_null'
136
+            ),
137
+            'password' => array
138
+                (
139
+                'notnull' => 1,
140
+                'length' => 128,
141
+                'fixed' => 0,
142
+                'default' => 0,
143
+                'type' => 'text',
144
+                'name' => 'password',
145
+                'table' => 'users',
146
+                'flags' => 'not_null'
147
+            ),
148
+            'fullname' => array
149
+                (
150
+                'notnull' => 1,
151
+                'length' => 255,
152
+                'fixed' => 0,
153
+                'default' => 0,
154
+                'type' => 'text',
155
+                'name' => 'fullname',
156
+                'table' => 'users',
157
+                'flags' => 'not_null'
158
+            ),
159
+            'email' => array
160
+                (
161
+                'notnull' => 1,
162
+                'length' => 255,
163
+                'fixed' => 0,
164
+                'default' => 0,
165
+                'type' => 'text',
166
+                'name' => 'email',
167
+                'table' => 'users',
168
+                'flags' => 'not_null'
169
+            ),
170
+            'description' => array
171
+                (
172
+                'notnull' => 1,
173
+                'fixed' => 0,
174
+                'default' => 0,
175
+                'type' => 'text',
176
+                'length' => 1024,
177
+                'name' => 'description',
178
+                'table' => 'users',
179
+                'flags' => 'not_null'
180
+            ),
181
+            'perm_templ' => array
182
+                (
183
+                'notnull' => 1,
184
+                'length' => 1,
185
+                'unsigned' => 0,
186
+                'default' => 0,
187
+                'type' => 'integer',
188
+                'name' => 'perm_templ',
189
+                'table' => 'users',
190
+                'flags' => 'not_null'
191
+            ),
192
+            'active' => array
193
+                (
194
+                'notnull' => 1,
195
+                'length' => 1,
196
+                'unsigned' => 0,
197
+                'default' => 0,
198
+                'type' => 'integer',
199
+                'name' => 'active',
200
+                'table' => 'users',
201
+                'flags' => 'not_null'
202
+            ),
203
+            'use_ldap' => array
204
+                (
205
+                'notnull' => 1,
206
+                'length' => 1,
207
+                'unsigned' => 0,
208
+                'default' => 0,
209
+                'type' => 'integer',
210
+                'name' => 'use_ldap',
211
+                'table' => 'users',
212
+                'flags' => 'not_null'
213
+            )
214
+        )
215
+    ),
216
+    array(
217
+        'table_name' => 'zones',
218
+        'options' => array('type' => 'innodb'),
219
+        'fields' => array(
220
+            'id' => array
221
+                (
222
+                'notnull' => 1,
223
+                'length' => 4,
224
+                'unsigned' => 0,
225
+                'default' => 0,
226
+                'autoincrement' => 1,
227
+                'type' => 'integer',
228
+                'name' => 'id',
229
+                'table' => 'zones',
230
+                'flags' => 'primary_keynot_null'
231
+            ),
232
+            'domain_id' => array
233
+                (
234
+                'notnull' => 1,
235
+                'length' => 4,
236
+                'unsigned' => 0,
237
+                'default' => 0,
238
+                'type' => 'integer',
239
+                'name' => 'domain_id',
240
+                'table' => 'zones',
241
+                'flags' => 'not_null'
242
+            ),
243
+            'owner' => array
244
+                (
245
+                'notnull' => 1,
246
+                'length' => 4,
247
+                'unsigned' => 0,
248
+                'default' => 0,
249
+                'type' => 'integer',
250
+                'name' => 'owner',
251
+                'table' => 'zones',
252
+                'flags' => 'not_null'
253
+            ),
254
+            'comment' => array
255
+                (
256
+                'notnull' => 0,
257
+                'length' => 1024,
258
+                'fixed' => 0,
259
+                'default' => 0,
260
+                'type' => 'text',
261
+                'name' => 'comment',
262
+                'table' => 'zones',
263
+                'flags' => ''
264
+            ),
265
+            'zone_templ_id' => array
266
+                (
267
+                'notnull' => 1,
268
+                'length' => 4,
269
+                'unsigned' => 0,
270
+                'type' => 'integer',
271
+                'name' => 'zone_templ_id',
272
+                'table' => 'zones',
273
+                'flags' => ''
274
+            ),
275
+        )
276
+    ),
277
+    array(
278
+        'table_name' => 'zone_templ',
279
+        'options' => array('type' => 'innodb'),
280
+        'fields' => array(
281
+            'id' => array
282
+                (
283
+                'notnull' => 1,
284
+                'length' => 11,
285
+                'unsigned' => 0,
286
+                'default' => 0,
287
+                'autoincrement' => 1,
288
+                'type' => 'integer',
289
+                'name' => 'id',
290
+                'table' => 'zone_templ',
291
+                'flags' => 'primary_keynot_null'
292
+            ),
293
+            'name' => array
294
+                (
295
+                'notnull' => 1,
296
+                'length' => 128,
297
+                'fixed' => 0,
298
+                'default' => 0,
299
+                'type' => 'text',
300
+                'name' => 'name',
301
+                'table' => 'zone_templ',
302
+                'flags' => 'not_null'
303
+            ),
304
+            'descr' => array
305
+                (
306
+                'notnull' => 1,
307
+                'length' => 1024,
308
+                'fixed' => 0,
309
+                'default' => 0,
310
+                'type' => 'text',
311
+                'name' => 'descr',
312
+                'table' => 'zone_templ',
313
+                'flags' => 'not_null'
314
+            ),
315
+            'owner' => array
316
+                (
317
+                'notnull' => 1,
318
+                'length' => 11,
319
+                'fixed' => 0,
320
+                'default' => 0,
321
+                'type' => 'integer',
322
+                'name' => 'owner',
323
+                'table' => 'zone_templ',
324
+                'flags' => 'not_null'
325
+            )
326
+        )
327
+    ),
328
+    array(
329
+        'table_name' => 'zone_templ_records',
330
+        'options' => array('type' => 'innodb'),
331
+        'fields' => array(
332
+            'id' => array
333
+                (
334
+                'notnull' => 1,
335
+                'length' => 11,
336
+                'unsigned' => 0,
337
+                'default' => 0,
338
+                'autoincrement' => 1,
339
+                'type' => 'integer',
340
+                'name' => 'id',
341
+                'table' => 'zone_templ_records',
342
+                'flags' => 'primary_keynot_null'
343
+            ),
344
+            'zone_templ_id' => array
345
+                (
346
+                'notnull' => 1,
347
+                'length' => 11,
348
+                'fixed' => 0,
349
+                'default' => 0,
350
+                'type' => 'integer',
351
+                'name' => 'zone_templ_id',
352
+                'table' => 'zone_templ_records',
353
+                'flags' => 'not_null'
354
+            ),
355
+            'name' => array
356
+                (
357
+                'notnull' => 1,
358
+                'length' => 255,
359
+                'fixed' => 0,
360
+                'default' => 0,
361
+                'type' => 'text',
362
+                'name' => 'name',
363
+                'table' => 'zone_templ_records',
364
+                'flags' => ''
365
+            ),
366
+            'type' => array
367
+                (
368
+                'notnull' => 1,
369
+                'length' => 6,
370
+                'fixed' => 0,
371
+                'default' => 0,
372
+                'type' => 'text',
373
+                'name' => 'type',
374
+                'table' => 'zone_templ_records',
375
+                'flags' => ''
376
+            ),
377
+            'content' => array
378
+                (
379
+                'notnull' => 1,
380
+                'length' => 255,
381
+                'fixed' => 0,
382
+                'default' => 0,
383
+                'type' => 'text',
384
+                'name' => 'content',
385
+                'table' => 'zone_templ_records',
386
+                'flags' => ''
387
+            ),
388
+            'ttl' => array
389
+                (
390
+                'notnull' => 1,
391
+                'length' => 11,
392
+                'fixed' => 0,
393
+                'default' => 0,
394
+                'type' => 'integer',
395
+                'name' => 'ttl',
396
+                'table' => 'zone_templ_records',
397
+                'flags' => ''
398
+            ),
399
+            'prio' => array
400
+                (
401
+                'notnull' => 1,
402
+                'length' => 11,
403
+                'fixed' => 0,
404
+                'default' => 0,
405
+                'type' => 'integer',
406
+                'name' => 'prio',
407
+                'table' => 'zone_templ_records',
408
+                'flags' => ''
409
+            )
410
+        )
411
+    ),
412
+    array(
413
+        'table_name' => 'records_zone_templ',
414
+        'options' => array('type' => 'innodb'),
415
+        'fields' => array(
416
+            'domain_id' => array
417
+                (
418
+                'notnull' => 1,
419
+                'length' => 11,
420
+                'fixed' => 0,
421
+                'default' => 0,
422
+                'type' => 'integer',
423
+                'name' => 'domain_id',
424
+                'table' => 'records_zone_templ',
425
+                'flags' => 'not_null'
426
+            ),
427
+            'record_id' => array
428
+                (
429
+                'notnull' => 1,
430
+                'length' => 11,
431
+                'fixed' => 0,
432
+                'default' => 0,
433
+                'type' => 'integer',
434
+                'name' => 'record_id',
435
+                'table' => 'records_zone_templ',
436
+                'flags' => 'not_null'
437
+            ),
438
+            'zone_templ_id' => array
439
+                (
440
+                'notnull' => 1,
441
+                'length' => 11,
442
+                'fixed' => 0,
443
+                'default' => 0,
444
+                'type' => 'integer',
445
+                'name' => 'zone_templ_id',
446
+                'table' => 'records_zone_templ',
447
+                'flags' => 'not_null'
448
+            )
449
+        )
450
+    ),
451
+    array(
452
+        'table_name' => 'migrations',
453
+        'options' => array('type' => 'innodb'),
454
+        'fields' => array(
455
+            'domain_id' => array
456
+                (
457
+                'notnull' => 1,
458
+                'length' => 255,
459
+                'fixed' => 0,
460
+                'default' => 0,
461
+                'type' => 'text',
462
+                'name' => 'version',
463
+                'table' => 'migrations',
464
+                'flags' => 'not_null'
465
+            ),
466
+            'record_id' => array
467
+                (
468
+                'notnull' => 1,
469
+                'length' => 11,
470
+                'fixed' => 0,
471
+                'default' => 0,
472
+                'type' => 'integer',
473
+                'name' => 'apply_time',
474
+                'table' => 'migrations',
475
+                'flags' => 'not_null'
476
+            )
477
+        )
478
+    )
479
+);
480
+
481
+// Tables from PowerDNS
482
+$grantTables = array('supermasters', 'domains', 'records');
483
+// Include PowerAdmin tables
484
+foreach ($def_tables as $table) {
485
+    $grantTables[] = $table['table_name'];
486
+}
487
+
488
+// For PostgreSQL you need to grant access to sequences
489
+$grantSequences = array('domains_id_seq', 'records_id_seq');
490
+foreach ($def_tables as $table) {
491
+    // ignore tables without primary key
492
+    if ($table['table_name'] == 'migrations') { continue; }
493
+    if ($table['table_name'] == 'records_zone_templ') { continue; }
494
+    $grantSequences[] = $table['table_name'] . '_id_seq';
495
+}
496
+
497
+$def_permissions = array(
498
+    array(41, 'zone_master_add', 'User is allowed to add new master zones.'),
499
+    array(42, 'zone_slave_add', 'User is allowed to add new slave zones.'),
500
+    array(43, 'zone_content_view_own', 'User is allowed to see the content and meta data of zones he owns.'),
501
+    array(44, 'zone_content_edit_own', 'User is allowed to edit the content of zones he owns.'),
502
+    array(45, 'zone_meta_edit_own', 'User is allowed to edit the meta data of zones he owns.'),
503
+    array(46, 'zone_content_view_others', 'User is allowed to see the content and meta data of zones he does not own.'),
504
+    array(47, 'zone_content_edit_others', 'User is allowed to edit the content of zones he does not own.'),
505
+    array(48, 'zone_meta_edit_others', 'User is allowed to edit the meta data of zones he does not own.'),
506
+    array(49, 'search', 'User is allowed to perform searches.'),
507
+    array(50, 'supermaster_view', 'User is allowed to view supermasters.'),
508
+    array(51, 'supermaster_add', 'User is allowed to add new supermasters.'),
509
+    array(52, 'supermaster_edit', 'User is allowed to edit supermasters.'),
510
+    array(53, 'user_is_ueberuser', 'User has full access. God-like. Redeemer.'),
511
+    array(54, 'user_view_others', 'User is allowed to see other users and their details.'),
512
+    array(55, 'user_add_new', 'User is allowed to add new users.'),
513
+    array(56, 'user_edit_own', 'User is allowed to edit their own details.'),
514
+    array(57, 'user_edit_others', 'User is allowed to edit other users.'),
515
+    array(58, 'user_passwd_edit_others', 'User is allowed to edit the password of other users.'), // not used
516
+    array(59, 'user_edit_templ_perm', 'User is allowed to change the permission template that is assigned to a user.'),
517
+    array(60, 'templ_perm_add', 'User is allowed to add new permission templates.'),
518
+    array(61, 'templ_perm_edit', 'User is allowed to edit existing permission templates.')
519
+);
520
+
521
+$def_remaining_queries = array(
522
+    "INSERT INTO users (username, password, fullname, email, description, perm_templ, active, use_ldap) VALUES ('admin'," . $db->quote(md5($pa_pass), 'text') . ",'Administrator','admin@example.net','Administrator with full rights.',1,1,0)",
523
+    "INSERT INTO perm_templ (name, descr) VALUES ('Administrator','Administrator template with full rights.')",
524
+    "INSERT INTO perm_templ_items (templ_id, perm_id) VALUES (1,53)"
525
+);

+ 5
- 0
poweradmin/poweradmin-2.1.7/_install/htaccess.dist View File

@@ -0,0 +1,5 @@
1
+<IfModule mod_rewrite.c>
2
+	RewriteEngine On
3
+	RewriteRule ^update$ /dynamic_update.php
4
+	RewriteRule ^nic/update$ /dynamic_update.php
5
+</IfModule>

+ 372
- 0
poweradmin/poweradmin-2.1.7/_install/index.php View File

@@ -0,0 +1,372 @@
1
+<?php
2
+
3
+require_once('../inc/error.inc.php');
4
+require_once('../inc/i18n.inc.php');
5
+
6
+if (isset($_POST['language'])) {
7
+    $language = $_POST['language'];
8
+} else {
9
+    $language = "en_EN";
10
+}
11
+
12
+# FIXME: setlocale can fail if locale package is not installed ion the systme for that language
13
+setlocale(LC_ALL, $language, $language . '.UTF-8');
14
+$gettext_domain = 'messages';
15
+if (!function_exists('bindtextdomain')) {
16
+    die(error('You have to install PHP gettext extension!'));
17
+}
18
+bindtextdomain($gettext_domain, "./../locale");
19
+textdomain($gettext_domain);
20
+@putenv('LANG=' . $language);
21
+@putenv('LANGUAGE=' . $language);
22
+
23
+$local_config_file = "../inc/config.inc.php";
24
+
25
+function get_random_key() {
26
+    $key = '';
27
+
28
+    $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#$%^&*()_+=-][{}';
29
+    $length = 46;
30
+
31
+    $size = strlen($chars);
32
+    for ($i = 0; $i < $length; $i++) {
33
+        $key .= $chars[mt_rand(0, $size - 1)];
34
+    }
35
+
36
+    return $key;
37
+}
38
+
39
+echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n";
40
+echo "<html>\n";
41
+echo " <head>\n";
42
+echo "  <title>Poweradmin</title>\n";
43
+echo "  <link rel=stylesheet href=\"../style/example.css\" type=\"text/css\">\n";
44
+echo "  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n";
45
+echo "  <script type=\"text/javascript\" src=\"../inc/helper.js\"></script>";
46
+echo " </head>\n";
47
+echo " <body>\n";
48
+
49
+if (!isset($_POST['step']) || !is_numeric($_POST['step'])) {
50
+    $step = 1;
51
+} else {
52
+    $step = $_POST['step'];
53
+}
54
+
55
+echo "  <h1>Poweradmin</h1>\n";
56
+echo "  <h2>" . _('Installation step') . " " . $step . "</h2>\n";
57
+
58
+switch ($step) {
59
+
60
+    case 1:
61
+        $step++;
62
+
63
+        echo " <form method=\"post\" action=\"\">\n";
64
+        echo "  <input type=\"radio\" name=\"language\" value=\"en_EN\" checked> I prefer to proceed in english.<br>\n";
65
+        echo "  <input type=\"radio\" name=\"language\" value=\"nl_NL\"> Ik ga graag verder in het Nederlands.<br>\n";
66
+        echo "	<input type=\"radio\" name=\"language\" value=\"de_DE\"> Ich mache in Deutsch weiter.<br>\n";
67
+        echo "  <input type=\"radio\" name=\"language\" value=\"ja_JP\"> 日本語で続ける<br>\n";
68
+        echo "  <input type=\"radio\" name=\"language\" value=\"pl_PL\"> Chcę kontynuować po polsku.<br>\n";
69
+        echo "  <input type=\"radio\" name=\"language\" value=\"fr_FR\"> Je préfère continuer en français.<br>\n";
70
+        echo "  <input type=\"radio\" name=\"language\" value=\"nb_NO\"> Jeg ønsker å forsette på norsk.<br>\n";
71
+        echo "  <input type=\"hidden\" name=\"step\" value=\"" . $step . "\">";
72
+        echo "  <input type=\"submit\" name=\"submit\" value=\"" . _('Go to step') . " " . $step . "\">";
73
+        echo " </form>\n";
74
+        break;
75
+
76
+    case 2:
77
+        $step++;
78
+
79
+        echo "<p>" . _('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.') . "</p>\n";
80
+
81
+        echo "<p>" . _('The alternative for this installer is a manual installation. Refer to the poweradmin.org website if you want to go down that road.') . "</p>\n";
82
+
83
+        echo "<p>" . _('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.') . "</p>";
84
+
85
+        echo "<p>" . _('Do you want to proceed now?') . "</p>\n";
86
+
87
+        echo "<form method=\"post\">";
88
+        echo "<input type=\"hidden\" name=\"language\" value=\"" . $language . "\">";
89
+        echo "<input type=\"hidden\" name=\"step\" value=\"" . $step . "\">";
90
+        echo "<input type=\"submit\" name=\"submit\" value=\"" . _('Go to step') . " " . $step . "\">";
91
+        echo "</form>";
92
+        break;
93
+
94
+    case 3:
95
+        $step++;
96
+        echo "<p>" . _('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.') . "</p>";
97
+
98
+        echo "<p>" . _('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.') . "</p>";
99
+
100
+        echo "<form method=\"post\">";
101
+        echo " <table>\n";
102
+        echo "  <tr id=\"username_row\">\n";
103
+        echo "   <td>" . _('Username') . "</td>\n";
104
+        echo "   <td><input type=\"text\" name=\"user\" value=\"\"></td>\n";
105
+        echo "   <td>" . _('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).') . "</td>\n";
106
+        echo "  </tr>\n";
107
+        echo " <tr id=\"password_row\">\n";
108
+        echo "  <td>" . _('Password') . "</td>\n";
109
+        echo "  <td><input type=\"password\" name=\"pass\" value=\"\" autocomplete=\"off\"></td>\n";
110
+        echo "  <td>" . _('The password for this username.') . "</td>\n";
111
+        echo " </tr>\n";
112
+        echo " <tr>\n";
113
+        echo "  <td width=\"210\">" . _('Database type') . "</td>\n";
114
+        echo "  <td>" .
115
+        "<select name=\"type\" onChange=\"changePort(this.value)\">" .
116
+        "<option value=\"mysql\">MySQL</option>" .
117
+        "<option value=\"pgsql\">PostgreSQL</option>" .
118
+        "<option value=\"sqlite\">SQLite</option>" .
119
+        "</td>\n";
120
+        echo "  <td>" . _('The type of the PowerDNS database.') . "</td>\n";
121
+        echo " </tr>\n";
122
+        echo " <tr id=\"hostname_row\">\n";
123
+        echo "  <td>" . _('Hostname') . "</td>\n";
124
+        echo "  <td><input type=\"text\" id=\"host\" name=\"host\" value=\"localhost\"></td>\n";
125
+        echo "  <td>" . _('The hostname on which the PowerDNS database resides. Frequently, this will be "localhost".') . "</td>\n";
126
+        echo " </tr>\n";
127
+        echo " <tr id=\"dbport_row\">\n";
128
+        echo "  <td>" . _('DB Port') . "</td>\n";
129
+        echo "  <td><input type=\"text\" id=\"dbport\" name=\"dbport\" value=\"3306\"></td>\n";
130
+        echo "  <td>" . _('The port the database server is listening on.') . "</td>\n";
131
+        echo " </tr>\n";
132
+        echo " <tr>\n";
133
+        echo "  <td>" . _('Database') . "</td>\n";
134
+        echo "  <td><input type=\"text\" name=\"name\" value=\"\"></td>\n";
135
+        echo "  <td><span id=\"db_name_title\">" . _('The name of the PowerDNS database.') . "</span>"
136
+                . "<span id=\"db_path_title\" style=\"display: none;\">" . _('The path and filename to the PowerDNS SQLite database.') . "</span></td>\n";
137
+        echo " </tr>\n";
138
+        echo "  <tr>\n";
139
+        echo "   <td>" . _('Poweradmin administrator password') . "</td>\n";
140
+        echo "   <td><input type=\"text\" name=\"pa_pass\" value=\"\" autocomplete=\"off\"></td>\n";
141
+        echo "   <td>" . _('The password of the Poweradmin administrator. This administrator has full rights to Poweradmin using the web interface.') . "</td>\n";
142
+        echo "  </tr>\n";
143
+        echo "</table>\n";
144
+        echo "<br>\n";
145
+        echo "<input type=\"hidden\" name=\"step\" value=\"" . $step . "\">";
146
+        echo "<input type=\"hidden\" name=\"language\" value=\"" . $language . "\">";
147
+        echo "<input type=\"submit\" name=\"submit\" value=\"" . _('Go to step') . " " . $step . "\">";
148
+        echo "</form>";
149
+        break;
150
+
151
+    case 4:
152
+        $step++;
153
+        echo "<p>" . _('Updating database...') . " ";
154
+        include_once("../inc/config-me.inc.php");
155
+        $db_user = $_POST['user'];
156
+        $db_pass = $_POST['pass'];
157
+        $db_host = $_POST['host'];
158
+        $db_port = $_POST['dbport'];
159
+        $db_name = $_POST['name'];
160
+        $db_type = $_POST['type'];
161
+        if ($db_type == 'sqlite') {
162
+            $db_file = $db_name;
163
+        }
164
+        $pa_pass = $_POST['pa_pass'];
165
+        require_once("../inc/database.inc.php");
166
+        $db = dbConnect();
167
+        $db->loadModule('Manager');
168
+        $db->loadModule('Extended');
169
+        include_once("database-structure.inc.php");
170
+        $current_tables = $db->listTables();
171
+        foreach ($def_tables as $table) {
172
+            if (in_array($table['table_name'], $current_tables))
173
+                $db->dropTable($table['table_name']);
174
+            $db->createTable($table['table_name'], $table['fields'], $table['options']);
175
+        }
176
+        $fill_perm_items = $db->prepare('INSERT INTO perm_items VALUES (?, ?, ?)');
177
+        $db->extended->executeMultiple($fill_perm_items, $def_permissions);
178
+        if (method_exists($fill_perm_items, 'free')) {
179
+            $fill_perm_items->free();
180
+        }
181
+        foreach ($def_remaining_queries as $user_query) {
182
+            $db->query($user_query);
183
+        }
184
+        echo _('done!') . "</p>";
185
+
186
+        echo "<p>" . _('Now we will gather all details for the configuration itself.') . "</p>\n";
187
+        echo "<form method=\"post\">";
188
+        echo " <table>";
189
+        echo "  <tr>";
190
+        if ($db_type != 'sqlite') {
191
+            echo "   <td>" . _('Username') . "</td>\n";
192
+            echo "   <td><input type=\"text\" name=\"pa_db_user\" value=\"\"></td>\n";
193
+            echo "   <td>" . _('The username for Poweradmin. This new user will have limited rights only.') . "</td>\n";
194
+            echo "  </tr>\n";
195
+            echo "  <tr>\n";
196
+            echo "   <td>" . _('Password') . "</td>\n";
197
+            echo "   <td><input type=\"text\" name=\"pa_db_pass\" value=\"\" autocomplete=\"off\"></td>\n";
198
+            echo "   <td>" . _('The password for this username.') . "</td>\n";
199
+            echo "  </tr>\n";
200
+        }
201
+        echo "  <tr>\n";
202
+        echo "   <td>" . _('Hostmaster') . "</td>\n";
203
+        echo "   <td><input type=\"text\" name=\"dns_hostmaster\" value=\"\"></td>\n";
204
+        echo "   <td>" . _('When creating SOA records and no hostmaster is provided, this value here will be used. Should be in the form "hostmaster.example.net".') . "</td>\n";
205
+        echo "  </tr>\n";
206
+        echo "  <tr>\n";
207
+        echo "   <td>" . _('Primary nameserver') . "</td>\n";
208
+        echo "   <td><input type=\"text\" name=\"dns_ns1\" value=\"\"></td>\n";
209
+        echo "   <td>" . _('When creating new zones using the template, this value will be used as primary nameserver. Should be like "ns1.example.net".') . "</td>\n";
210
+        echo "  </tr>\n";
211
+        echo "  <tr>\n";
212
+        echo "   <td>" . _('Secondary nameserver') . "</td>\n";
213
+        ;
214
+        echo "   <td><input type=\"text\" name=\"dns_ns2\" value=\"\"></td>\n";
215
+        echo "   <td>" . _('When creating new zones using the template, this value will be used as secondary nameserver. Should be like "ns2.example.net".') . "</td>\n";
216
+        echo "  </tr>\n";
217
+        echo "</table>";
218
+        echo "<br>\n";
219
+        echo "<input type=\"hidden\" name=\"db_user\" value=\"" . $db_user . "\">";
220
+        echo "<input type=\"hidden\" name=\"db_pass\" value=\"" . $db_pass . "\">";
221
+        echo "<input type=\"hidden\" name=\"db_host\" value=\"" . $db_host . "\">";
222
+        echo "<input type=\"hidden\" name=\"db_port\" value=\"" . $db_port . "\">";
223
+        echo "<input type=\"hidden\" name=\"db_name\" value=\"" . $db_name . "\">";
224
+        echo "<input type=\"hidden\" name=\"db_type\" value=\"" . $db_type . "\">";
225
+        echo "<input type=\"hidden\" name=\"pa_pass\" value=\"" . $pa_pass . "\">";
226
+        echo "<input type=\"hidden\" name=\"step\" value=\"" . $step . "\">";
227
+        echo "<input type=\"hidden\" name=\"language\" value=\"" . $language . "\">";
228
+        echo "<input type=\"submit\" name=\"submit\" value=\"" . _('Go to step') . " " . $step . "\">";
229
+        echo "</form>";
230
+        break;
231
+
232
+    case 5:
233
+        $step++;
234
+        $db_user = $_POST['db_user'];
235
+        $db_pass = $_POST['db_pass'];
236
+        $db_host = $_POST['db_host'];
237
+        $db_port = $_POST['db_port'];
238
+        $db_name = $_POST['db_name'];
239
+        $db_type = $_POST['db_type'];
240
+        if ($db_type == 'sqlite') {
241
+            $db_file = $db_name;
242
+        } else {
243
+            $pa_db_user = $_POST['pa_db_user'];
244
+            $pa_db_pass = $_POST['pa_db_pass'];
245
+        }
246
+        $pa_pass = $_POST['pa_pass'];
247
+        $dns_hostmaster = $_POST['dns_hostmaster'];
248
+        $dns_ns1 = $_POST['dns_ns1'];
249
+        $dns_ns2 = $_POST['dns_ns2'];
250
+
251
+        $db_layer = 'PDO';
252
+        require_once("../inc/database.inc.php");
253
+        $db = dbConnect();
254
+        include_once("database-structure.inc.php");
255
+
256
+        echo "<p>" . _('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.') . " ";
257
+        if ($db_type == 'mysql') {
258
+            $pa_db_host = $db_host;
259
+
260
+            $sql = 'SELECT USER()';
261
+            $result = $db->queryRow($sql);
262
+            if (isset($result['user()'])) {
263
+                $current_db_user = $result['user()'];
264
+                $pa_db_host = substr($current_db_user, strpos($current_db_user, '@') + 1);
265
+            }
266
+
267
+            echo _('In MySQL you should now perform the following command:') . "</p>";
268
+            echo "<p><tt>GRANT SELECT, INSERT, UPDATE, DELETE<BR>ON " . $db_name . ".*<br>TO '" . $pa_db_user . "'@'" . $pa_db_host . "'<br>IDENTIFIED BY '" . $pa_db_pass . "';</tt></p>";
269
+        } elseif ($db_type == 'pgsql') {
270
+            echo _('On PgSQL you would use:') . "</p>";
271
+            echo "<p><tt>$ createuser -E -P " . $pa_db_user . "<br>" .
272
+            "Enter password for new role: " . $pa_db_pass . "<br>" .
273
+            "Enter it again: " . $pa_db_pass . "<br>" .
274
+            "Shall the new role be a superuser? (y/n) n<br>" .
275
+            "Shall the new user be allowed to create databases? (y/n) n<br>" .
276
+            "Shall the new user be allowed to create more new users? (y/n) n<br>" .
277
+            "CREATE USER<br>" .
278
+            "$ psql " . $db_name . "<br>";
279
+            echo "psql> ";
280
+            foreach ($grantTables as $tableName) {
281
+                echo "GRANT SELECT, INSERT, DELETE, UPDATE ON " . $tableName . " TO " . $pa_db_user . ";<br />";
282
+            }
283
+            foreach ($grantSequences as $sequenceName) {
284
+                echo "GRANT USAGE, SELECT ON SEQUENCE " . $sequenceName . " TO " . $pa_db_user . ";<br />";
285
+            }
286
+            echo "</tt></p>\n";
287
+        }
288
+        echo "<p>" . _('After you have added the new user, proceed with this installation procedure.') . "</p>\n";
289
+        echo "<form method=\"post\">";
290
+        echo "<input type=\"hidden\" name=\"db_host\" value=\"" . $db_host . "\">";
291
+        echo "<input type=\"hidden\" name=\"db_name\" value=\"" . $db_name . "\">";
292
+        echo "<input type=\"hidden\" name=\"db_port\" value=\"" . $db_port . "\">";
293
+        echo "<input type=\"hidden\" name=\"db_type\" value=\"" . $db_type . "\">";
294
+        echo "<input type=\"hidden\" name=\"db_user\" value=\"" . $db_user . "\">";
295
+        echo "<input type=\"hidden\" name=\"db_pass\" value=\"" . $db_pass . "\">";
296
+        if ($db_type != 'sqlite') {
297
+            echo "<input type=\"hidden\" name=\"pa_db_user\" value=\"" . $pa_db_user . "\">";
298
+            echo "<input type=\"hidden\" name=\"pa_db_pass\" value=\"" . $pa_db_pass . "\">";
299
+        }
300
+        echo "<input type=\"hidden\" name=\"pa_pass\" value=\"" . $pa_pass . "\">";
301
+        echo "<input type=\"hidden\" name=\"dns_hostmaster\" value=\"" . $dns_hostmaster . "\">";
302
+        echo "<input type=\"hidden\" name=\"dns_ns1\" value=\"" . $dns_ns1 . "\">";
303
+        echo "<input type=\"hidden\" name=\"dns_ns2\" value=\"" . $dns_ns2 . "\">";
304
+        echo "<input type=\"hidden\" name=\"step\" value=\"" . $step . "\">";
305
+        echo "<input type=\"hidden\" name=\"language\" value=\"" . $language . "\">";
306
+        echo "<input type=\"submit\" name=\"submit\" value=\"" . _('Go to step') . " " . $step . "\">";
307
+        echo "</form>";
308
+        break;
309
+
310
+    case 6:
311
+        $step++;
312
+
313
+        require_once("../inc/database.inc.php");
314
+        global $db_layer;
315
+
316
+        $db_type = $_POST['db_type'];
317
+        $pa_pass = $_POST['pa_pass'];
318
+        $db_port = $_POST['db_port'];
319
+
320
+        $config = "<?php\n\n" .
321
+                ( $db_type == 'sqlite' ? "\$db_file\t\t= '" . $_POST['db_name'] . "';\n" :
322
+                "\$db_host\t\t= '" . $_POST['db_host'] . "';\n" .
323
+                "\$db_user\t\t= '" . $_POST['pa_db_user'] . "';\n" .
324
+                "\$db_pass\t\t= '" . $_POST['pa_db_pass'] . "';\n" .
325
+                "\$db_name\t\t= '" . $_POST['db_name'] . "';\n" .
326
+                (($db_type == 'mysql' && $db_port != 3306) || ($db_type == 'pgsql' && $db_port != 5432) ? "\$db_port\t\t= '" . $db_port . "';\n" : '')) .
327
+                "\$db_type\t\t= '" . $_POST['db_type'] . "';\n" .
328
+                "\$db_layer\t\t= 'PDO';\n" .
329
+                "\n" .
330
+                "\$session_key\t\t= '" . get_random_key() . "';\n" .
331
+                "\n" .
332
+                "\$iface_lang\t\t= '" . $_POST['language'] . "';\n" .
333
+                "\n" .
334
+                "\$dns_hostmaster\t\t= '" . $_POST['dns_hostmaster'] . "';\n" .
335
+                "\$dns_ns1\t\t= '" . $_POST['dns_ns1'] . "';\n" .
336
+                "\$dns_ns2\t\t= '" . $_POST['dns_ns2'] . "';\n";
337
+
338
+        if (is_writeable($local_config_file)) {
339
+            $h_config = fopen($local_config_file, "w");
340
+            fwrite($h_config, $config);
341
+            fclose($h_config);
342
+            echo "<p>" . _('The installer was able to write to the file "') . $local_config_file . _('". A basic configuration, based on the details you have given, has been created.') . "</p>\n";
343
+        } else {
344
+            echo "<p>" . _('The installer is unable to write to the file "') . $local_config_file . _('" (which is in itself good). The configuration is printed here. You should now create the file "') . $local_config_file . _('" in the Poweradmin root directory yourself. It should contain the following few lines:') . "</p>\n";
345
+            echo "<pre>";
346
+            echo htmlentities($config);
347
+            echo "</pre>";
348
+        }
349
+        echo "<form method=\"post\">";
350
+        echo "<input type=\"hidden\" name=\"pa_pass\" value=\"" . $pa_pass . "\">";
351
+        echo "<input type=\"hidden\" name=\"step\" value=\"" . $step . "\">";
352
+        echo "<input type=\"hidden\" name=\"language\" value=\"" . $language . "\">";
353
+        echo "<input type=\"submit\" name=\"submit\" value=\"" . _('Go to step') . " " . $step . "\">";
354
+        echo "</form>";
355
+        break;
356
+
357
+    case 7:
358
+        $step++;
359
+        echo "<p>" . _('Now we have finished the configuration.') . "</p>";
360
+        echo "<p>" . _('If you want support for the URLs used by other dynamic DNS providers, run "cp install/htaccess.dist .htaccess" and enable mod_rewrite in Apache.') . "</p>";
361
+        echo "<p>" . _('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.') . "</p>";
362
+        echo "<p>" . _('After you have removed the directory, you can login to <a href="../index.php">Poweradmin</a> with username "admin" and password "') . $_POST['pa_pass'] . _('". You are highly encouraged to change these as soon as you are logged in.') . "</p>";
363
+        break;
364
+
365
+    default:
366
+        break;
367
+}
368
+
369
+include_once('../inc/version.inc.php');
370
+echo "<div class=\"footer\">";
371
+echo "<a href=\"http://www.poweradmin.org/\">a complete(r) <strong>poweradmin</strong> v$VERSION</a> - <a href=\"http://www.poweradmin.org/credits.html\">credits</a>";
372
+echo "</div></body></html>";

+ 87
- 0
poweradmin/poweradmin-2.1.7/add_perm_templ.php View File

@@ -0,0 +1,87 @@
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-2014  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-2014 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 (!verify_permission('templ_perm_edit')) {
36
+    error(ERR_PERM_EDIT_PERM_TEMPL);
37
+} else {
38
+
39
+    if (isset($_POST['commit'])) {
40
+        if (add_perm_templ($_POST)) {
41
+            success(SUC_PERM_TEMPL_ADD);
42
+        }
43
+    }
44
+
45
+    $perms_avail = get_permissions_by_template_id();
46
+
47
+    /*
48
+      Display new permission form
49
+     */
50
+
51
+    echo "    <h2>" . _('Add permission template') . "</h2>\n";
52
+    echo "    <form method=\"post\" action=\"\">\n";
53
+    echo "     <table>\n";
54
+    echo "      <tr>\n";
55
+    echo "       <th>" . _('Name') . "</th>\n";
56
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"\"></td>\n";
57
+    echo "      </tr>\n";
58
+    echo "      <tr>\n";
59
+    echo "       <th>" . _('Description') . "</th>\n";
60
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"\"></td>\n";
61
+    echo "      </tr>\n";
62
+    echo "     </table>\n";
63
+    echo "     <table>\n";
64
+    echo "      <tr>\n";
65
+    echo "       <th>&nbsp;</th>\n";
66
+    echo "       <th>" . _('Name') . "</th>\n";
67
+    echo "       <th>" . _('Description') . "</th>\n";
68
+    echo "      </tr>\n";
69
+
70
+    /*
71
+      Display available permissions settings for inclusion
72
+      in the new permission
73
+     */
74
+    foreach ($perms_avail as $perm_a) {
75
+
76
+        echo "      <tr>\n";
77
+        echo "       <td><input type=\"checkbox\" name=\"perm_id[]\" value=\"" . $perm_a['id'] . "\"></td>\n";
78
+        echo "       <td>" . $perm_a['name'] . "</td>\n";
79
+        echo "       <td>" . _($perm_a['descr']) . "</td>\n";
80
+        echo "      </tr>\n";
81
+    }
82
+    echo "     </table>\n";
83
+    echo "     <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
84
+    echo "     </form>\n";
85
+}
86
+
87
+include_once("inc/footer.inc.php");

+ 220
- 0
poweradmin/poweradmin-2.1.7/add_record.php View File

@@ -0,0 +1,220 @@
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-2014  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-2014 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
+  Get permissions
37
+ */
38
+if (verify_permission('zone_content_view_others')) {
39
+    $perm_view = "all";
40
+} elseif (verify_permission('zone_content_view_own')) {
41
+    $perm_view = "own";
42
+} else {
43
+    $perm_view = "none";
44
+}
45
+
46
+if (verify_permission('zone_content_edit_others')) {
47
+    $perm_content_edit = "all";
48
+} elseif (verify_permission('zone_content_edit_own')) {
49
+    $perm_content_edit = "own";
50
+} else {
51
+    $perm_content_edit = "none";
52
+}
53
+
54
+if (verify_permission('zone_meta_edit_others')) {
55
+    $perm_meta_edit = "all";
56
+} elseif (verify_permission('zone_meta_edit_own')) {
57
+    $perm_meta_edit = "own";
58
+} else {
59
+    $perm_meta_edit = "none";
60
+}
61
+
62
+
63
+/*
64
+  Check and make sure all post values have made it through
65
+  if not set them.
66
+ */
67
+$zone_id = "-1";
68
+if ((isset($_GET['id'])) && (v_num($_GET['id']))) {
69
+    $zone_id = $_GET['id'];
70
+}
71
+
72
+$ttl = $dns_ttl;
73
+if ((isset($_POST['ttl'])) && (v_num($_POST['ttl']))) {
74
+    $ttl = $_POST['ttl'];
75
+}
76
+
77
+$prio = "10";
78
+if ((isset($_POST['prio'])) && (v_num($_POST['prio']))) {
79
+    $prio = $_POST['prio'];
80
+}
81
+
82
+if (isset($_POST['name'])) {
83
+    $name = $_POST['name'];
84
+} else {
85
+    $name = "";
86
+}
87
+
88
+if (isset($_POST['type'])) {
89
+    $type = $_POST['type'];
90
+} else {
91
+    $type = "";
92
+}
93
+
94
+if (isset($_POST['content'])) {
95
+    $content = $_POST['content'];
96
+} else {
97
+    $content = "";
98
+}
99
+
100
+if ($zone_id == "-1") {
101
+    error(ERR_INV_INPUT);
102
+    include_once("inc/footer.inc.php");
103
+    exit;
104
+}
105
+
106
+/*
107
+  Check and see if the user is the zone owner
108
+  Check the sone type and get the zone name
109
+ */
110
+$user_is_zone_owner = verify_user_is_owner_zoneid($zone_id);
111
+$zone_type = get_domain_type($zone_id);
112
+$zone_name = get_zone_name_from_id($zone_id);
113
+
114
+/*
115
+  If the form as been submitted
116
+  process it!
117
+ */
118
+if (isset($_POST["commit"])) {
119
+    if ($zone_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0") {
120
+        error(ERR_PERM_ADD_RECORD);
121
+    } else {
122
+        // a PTR-record is added if an A or an AAAA-record are created
123
+        // and checkbox is checked
124
+
125
+        if ((isset($_POST["reverse"])) && $iface_add_reverse_record ) {
126
+            if ($type === 'A') {
127
+                $content_array = preg_split("/\./", $content);
128
+                $content_rev = sprintf("%d.%d.%d.%d.in-addr.arpa", $content_array[3], $content_array[2], $content_array[1], $content_array[0]);
129
+                $zone_rev_id = get_best_matching_zone_id_from_name($content_rev);
130
+            } elseif ($type === 'AAAA') {
131
+                $content_rev = convert_ipv6addr_to_ptrrec($content);
132
+                $zone_rev_id = get_best_matching_zone_id_from_name($content_rev);
133
+            }
134
+            if (isset($zone_rev_id) && $zone_rev_id != -1) {
135
+                $zone_name = get_zone_name_from_id($zone_id);
136
+                $fqdn_name = sprintf("%s.%s", $name, $zone_name);
137
+                if (add_record($zone_rev_id, $content_rev, 'PTR', $fqdn_name, $ttl, $prio)) {
138
+                    success(" <a href=\"edit.php?id=" . $zone_rev_id . "\"> " . _('The PTR-record was successfully added.') . "</a>");
139
+                    log_info(sprintf('client_ip:%s user:%s operation:add_record record_type:PTR record:%s content:%s ttl:%s priority:%s',
140
+                                      $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
141
+                                      $content_rev, $fqdn_name, $ttl, $prio));
142
+                }
143
+            } elseif (isset($content_rev)) {
144
+                error(sprintf(ERR_REVERS_ZONE_NOT_EXIST, $content_rev));
145
+            }
146
+        }
147
+        if (add_record($zone_id, $name, $type, $content, $ttl, $prio)) {
148
+            success(" <a href=\"edit.php?id=" . $zone_id . "\"> " . _('The record was successfully added.') . "</a>");
149
+            log_info(sprintf('client_ip:%s user:%s operation:add_record record_type:%s record:%s.%s content:%s ttl:%s priority:%s',
150
+                              $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
151
+                              $type, $name, $zone_name, $content, $ttl, $prio));
152
+            $name = $type = $content = $ttl = $prio = "";
153
+        }
154
+    }
155
+}
156
+
157
+/*
158
+  Display form to add a record
159
+ */
160
+echo "    <h2>" . _('Add record to zone') . " <a href=\"edit.php?id=" . $zone_id . "\"> " . $zone_name . "</a></h2>\n";
161
+
162
+if ($zone_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0") {
163
+    error(ERR_PERM_ADD_RECORD);
164
+} else {
165
+    echo "     <form method=\"post\">\n";
166
+    echo "      <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
167
+    echo "      <table border=\"0\" cellspacing=\"4\">\n";
168
+    echo "       <tr>\n";
169
+    echo "        <td class=\"n\">" . _('Name') . "</td>\n";
170
+    echo "        <td class=\"n\">&nbsp;</td>\n";
171
+    echo "        <td class=\"n\">" . _('Type') . "</td>\n";
172
+    echo "        <td class=\"n\">" . _('Content') . "</td>\n";
173
+    echo "        <td class=\"n\">" . _('Priority') . "</td>\n";
174
+    echo "        <td class=\"n\">" . _('TTL') . "</td>\n";
175
+    echo "       </tr>\n";
176
+    echo "       <tr>\n";
177
+    echo "        <td class=\"n\"><input type=\"text\" name=\"name\" class=\"input\" value=\"" . htmlspecialchars($name) . "\">." . $zone_name . "</td>\n";
178
+    echo "        <td class=\"n\">IN</td>\n";
179
+    echo "        <td class=\"n\">\n";
180
+    echo "         <select name=\"type\">\n";
181
+    $found_selected_type = !(isset($type) && $type);
182
+    foreach (get_record_types() as $record_type) {
183
+        if (isset($type) && $type) {
184
+            if ($type == $record_type) {
185
+                $found_selected_type = true;
186
+                $add = " SELECTED";
187
+            } else {
188
+                $add = "";
189
+            }
190
+        } else {
191
+            if (preg_match('/i(p6|n-addr).arpa/i', $zone_name) && strtoupper($record_type) == 'PTR') {
192
+                $add = " SELECTED";
193
+                $rev = "";
194
+            } elseif ((strtoupper($record_type) == 'A') && $iface_add_reverse_record) {
195
+                $add = " SELECTED";
196
+                $rev = "<input type=\"checkbox\" name=\"reverse\"><span class=\"normaltext\">" . _('Add also reverse record') . "</span>\n";
197
+            } else {
198
+                $add = "";
199
+            }
200
+        }
201
+        echo "          <option" . $add . " value=\"" . htmlspecialchars($record_type) . "\">" . $record_type . "</option>\n";
202
+    }
203
+    if (!$found_selected_type)
204
+        echo "          <option SELECTED value=\"" . htmlspecialchars($type) . "\"><i>" . htmlspecialchars($type) . "</i></option>\n";
205
+    echo "         </select>\n";
206
+    echo "        </td>\n";
207
+    echo "        <td class=\"n\"><input type=\"text\" name=\"content\" class=\"input\" value=\"" . htmlspecialchars($content) . "\"></td>\n";
208
+    echo "        <td class=\"n\"><input type=\"text\" name=\"prio\" class=\"sinput\" value=\"" . htmlspecialchars($prio) . "\"></td>\n";
209
+    echo "        <td class=\"n\"><input type=\"text\" name=\"ttl\" class=\"sinput\" value=\"" . htmlspecialchars($ttl) . "\"</td>\n";
210
+    echo "       </tr>\n";
211
+    echo "      </table>\n";
212
+    echo "      <br>\n";
213
+    echo "      <input type=\"submit\" name=\"commit\" value=\"" . _('Add record') . "\" class=\"button\">\n";
214
+    if (isset($rev)) {
215
+        echo "      $rev";
216
+    }
217
+    echo "     </form>\n";
218
+}
219
+
220
+include_once("inc/footer.inc.php");

+ 120
- 0
poweradmin/poweradmin-2.1.7/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-2014  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-2014 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
+(verify_permission('supermaster_add')) ? $supermasters_add = "1" : $supermasters_add = "0";
51
+(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 = 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.7/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-2014  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-2014 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 (!verify_permission('user_add_new')) {
36
+    error(ERR_PERM_ADD_USER);
37
+} else {
38
+    if (isset($_POST["commit"])) {
39
+        if (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 (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 (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.7/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-2014  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-2014 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
+(verify_permission('zone_master_add')) ? $zone_master_add = "1" : $zone_master_add = "0";
77
+(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 = 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.7/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-2014  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-2014 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
+(verify_permission('zone_slave_add')) ? $zone_slave_add = "1" : $zone_slave_add = "0";
58
+(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 (!is_valid_ipv4($master, false) && !is_valid_ipv6($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, $zone_template));
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 = 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.7/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-2014  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-2014 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 (!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 = 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.7/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-2014  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-2014 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 (!(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 (!(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.7/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.7/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.7/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-2014  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-2014 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
+(verify_permission('zone_master_add')) ? $zone_master_add = "1" : $zone_master_add = "0";
69
+(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 = 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.7/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-2014  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-2014 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
+    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");

+ 103
- 0
poweradmin/poweradmin-2.1.7/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-2014  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-2014 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 (verify_permission('zone_content_edit_others')) {
38
+    $perm_edit = "all";
39
+} elseif (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 = get_fullnames_owners_from_domainid($zone_id);
61
+$user_is_zone_owner = 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 ($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.7/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-2014  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-2014 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 (verify_permission('zone_content_edit_others')) {
36
+    $perm_edit = "all";
37
+} elseif (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 = get_fullnames_owners_from_domainid($zone);
77
+        $user_is_zone_owner = 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.7/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-2014  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-2014 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 (!(verify_permission('user_edit_templ_perm'))) {
49
+        error(ERR_PERM_DEL_PERM_TEMPL);
50
+    } else {
51
+        $templ_details = 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
+

+ 134
- 0
poweradmin/poweradmin-2.1.7/delete_record.php View File

@@ -0,0 +1,134 @@
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-2014  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-2014 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 (verify_permission('zone_content_edit_others')) {
48
+    $perm_content_edit = "all";
49
+} elseif (verify_permission('zone_content_edit_own')) {
50
+    $perm_content_edit = "own";
51
+} else {
52
+    $perm_content_edit = "none";
53
+}
54
+
55
+$zid = get_zone_id_from_record_id($_GET['id']);
56
+if ($zid == NULL) {
57
+    header("Location: list_zones.php");
58
+    exit;
59
+}
60
+$user_is_zone_owner = verify_user_is_owner_zoneid($zid);
61
+
62
+$zone_info = get_zone_info_from_id($zid);
63
+
64
+if ($record_id == "-1") {
65
+    error(ERR_INV_INPUT);
66
+} else {
67
+    if ($confirm == '1') {
68
+        $record_info = get_record_from_id($record_id);
69
+        if (delete_record($record_id)) {
70
+            success("<a href=\"edit.php?id=" . $zid . "\">" . SUC_RECORD_DEL . "</a>");
71
+            if (isset($record_info['prio'])) {
72
+                log_info(sprintf('client_ip:%s user:%s operation:delete_record record_type:%s record:%s content:%s ttl:%s priority:%s',
73
+                     $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
74
+                     $record_info['type'], $record_info['name'], $record_info['content'], $record_info['ttl'], $record_info['prio'] ));
75
+            } else {
76
+                log_info(sprintf('client_ip:%s user:%s operation:delete_record record_type:%s record:%s content:%s ttl:%s',
77
+                     $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
78
+                     $record_info['type'], $record_info['name'], $record_info['content'], $record_info['ttl'] ));
79
+
80
+            }
81
+
82
+            delete_record_zone_templ($record_id);
83
+
84
+            // update serial after record deletion
85
+            update_soa_serial($zid);
86
+
87
+            if ($pdnssec_use) {
88
+                // do also rectify-zone
89
+                if (dnssec_rectify_zone($zid)) {
90
+                    success(SUC_EXEC_PDNSSEC_RECTIFY_ZONE);
91
+                }
92
+            }
93
+        }
94
+    } else {
95
+        $zone_id = recid_to_domid($record_id);
96
+        $zone_name = get_zone_name_from_id($zone_id);
97
+        $user_is_zone_owner = verify_user_is_owner_zoneid($zone_id);
98
+        $record_info = get_record_from_id($record_id);
99
+
100
+        echo "     <h2>" . _('Delete record in zone') . " \"<a href=\"edit.php?id=" . $zid . "\">" . $zone_name . "</a>\"</h2>\n";
101
+
102
+        if ($zone_info['type'] == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0") {
103
+            error(ERR_PERM_EDIT_RECORD);
104
+        } else {
105
+            echo "     <table>\n";
106
+            echo "      <tr>\n";
107
+            echo "       <th>Name</th>\n";
108
+            echo "       <th>Type</th>\n";
109
+            echo "       <th>Content</th>\n";
110
+            if (isset($record_info['prio'])) {
111
+                echo "       <th>Priority</th>\n";
112
+            }
113
+            echo "       <th>TTL</th>\n";
114
+            echo "      </tr>\n";
115
+            echo "      <tr>\n";
116
+            echo "       <td>" . $record_info['name'] . "</td>\n";
117
+            echo "       <td>" . $record_info['type'] . "</td>\n";
118
+            echo "       <td>" . $record_info['content'] . "</td>\n";
119
+            if (isset($record_info['prio'])) {
120
+                echo "       <td>" . $record_info['prio'] . "</td>\n";
121
+            }
122
+            echo "       <td>" . $record_info['ttl'] . "</td>\n";
123
+            echo "      </tr>\n";
124
+            echo "     </table>\n";
125
+            if (($record_info['type'] == 'NS' && $record_info['name'] == $zone_name) || $record_info['type'] == 'SOA') {
126
+                echo "     <p>" . _('You are trying to delete a record that is needed for this zone to work.') . "</p>\n";
127
+            }
128
+            echo "     <p>" . _('Are you sure?') . "</p>\n";
129
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_record.php?id=" . $record_id . "&amp;confirm=1'\" value=\"" . _('Yes') . "\">\n";
130
+            echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='edit.php?id=" . $zid . "'\" value=\"" . _('No') . "\">\n";
131
+        }
132
+    }
133
+}
134
+include_once("inc/footer.inc.php");

+ 82
- 0
poweradmin/poweradmin-2.1.7/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-2014  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-2014 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
+    (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.7/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-2014  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-2014 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
+verify_permission('user_edit_own') ? $perm_edit_own = "1" : $perm_edit_own = "0";
36
+verify_permission('user_edit_others') ? $perm_edit_others = "1" : $perm_edit_others = "0";
37
+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 (is_valid_user($uid)) {
50
+        $zones = array();
51
+        if (isset($_POST['zone'])) {
52
+            $zones = $_POST['zone'];
53
+        }
54
+
55
+        if (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 = 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 = 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.7/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-2014  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-2014 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 (!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.7/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-2014  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-2014 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 (!(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.7/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-2014  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-2014 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 = 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
+(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.7/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-2014  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-2014 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 = 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.7/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-2014  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-2014 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 = 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.7/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-2014  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-2014 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 = 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
+(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_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_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.7/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-2014  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-2014 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 = 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");

+ 182
- 0
poweradmin/poweradmin-2.1.7/dynamic_update.php View File

@@ -0,0 +1,182 @@
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-2014  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-2014 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
+
36
+$db = dbConnect();
37
+
38
+/** Make sql query safe
39
+ *
40
+ * @param mixed $value Unsafe Value
41
+ *
42
+ * @return mixed $value Safe Value
43
+ */
44
+function safe($value) {
45
+    global $db, $db_type, $db_layer;
46
+
47
+    if ($db_type == 'mysql') {
48
+        if ($db_layer == 'MDB2') {
49
+            $value = mysql_real_escape_string($value);
50
+        } elseif ($db_layer == 'PDO') {
51
+            $value = $db->quote($value, 'text');
52
+            $value = substr($value, 1, -1); // remove quotes
53
+        }
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
+    $verbose_codes = array(
71
+        'badagent' => 'Your user agent is not valid.',
72
+        'badauth' => 'Invalid username or password.  Authentication failed.',
73
+        'notfqdn' => 'The hostname you specified was not valid.',
74
+        'dnserr' => 'A DNS error has occurred on our end.  We apologize for any inconvenience.',
75
+        '!yours' => 'The specified hostname does not belong to you.',
76
+        'nohost' => 'The specified hostname does not exist.',
77
+        'good' => 'Your hostname has been updated.',
78
+        '911' => 'A critical error has occurred on our end.  We apologize for any inconvenience.',
79
+        'nochg' => 'This update was identical to your last update, so no changes were made to your hostname configuration.',
80
+        'baddbtype' => 'Unsupported database type',
81
+    );
82
+
83
+    if (isset($_REQUEST['verbose'])) {
84
+        $pieces = preg_split('/\s/', $status);
85
+        $status = $verbose_codes[$pieces[0]];
86
+    }
87
+    echo "$status\n";
88
+    return false;
89
+}
90
+
91
+if (!(isset($_SERVER)) && !$_SERVER['HTTP_USER_AGENT']) {
92
+    return status_exit('badagent');
93
+}
94
+
95
+// Grab username & password based on HTTP auth, alternatively the query string
96
+if (isset($_SERVER['PHP_AUTH_USER'])) {
97
+	$auth_username = $_SERVER['PHP_AUTH_USER'];
98
+} elseif (isset($_REQUEST['username'])) {
99
+	$auth_username = $_REQUEST['username'];
100
+}
101
+if (isset($_SERVER['PHP_AUTH_PW'])) {
102
+	$auth_password = $_SERVER['PHP_AUTH_PW'];
103
+} elseif (isset($_REQUEST['password'])) {
104
+	$auth_password = $_REQUEST['password'];
105
+}
106
+
107
+// If we still don't have a username, throw up
108
+if (!isset($auth_username)) {
109
+    header('WWW-Authenticate: Basic realm="DNS Update"');
110
+    header('HTTP/1.0 401 Unauthorized');
111
+    return status_exit('badauth');
112
+}
113
+
114
+$username = safe($auth_username);
115
+// FIXME: supports only md5 hashes
116
+$password = md5(safe($auth_password));
117
+$hostname = safe($_REQUEST['hostname']);
118
+
119
+// Grab IP to use
120
+$given_ip = "";
121
+if (!empty($_REQUEST['myip'])) {
122
+	$given_ip = $_REQUEST['myip'];
123
+
124
+} elseif (!empty($_REQUEST['ip'])) {
125
+	$given_ip = $_REQUEST['ip'];
126
+
127
+}
128
+// Look for tag tograb the IP we coming from
129
+if ($given_ip == "whatismyip") {
130
+	$given_ip = $_SERVER['REMOTE_ADDR'];
131
+}
132
+// Finally get save version of the IP
133
+$ip = safe($given_ip);
134
+// Check its ok...
135
+if (!preg_match('/^((?: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]?)$/i', $ip)) {
136
+    return status_exit('dnserr');
137
+}
138
+
139
+if (!strlen($hostname)) {
140
+    return status_exit('notfqdn');
141
+}
142
+
143
+$user_query = "
144
+	SELECT
145
+		users.id
146
+	FROM
147
+		users, perm_templ, perm_templ_items, perm_items
148
+	WHERE
149
+		users.username = '$username'
150
+		AND users.password = '$password'
151
+		AND users.active = 1
152
+		AND perm_templ.id = users.perm_templ
153
+		AND perm_templ_items.templ_id = perm_templ.id
154
+		AND perm_items.id = perm_templ_items.perm_id
155
+		AND (
156
+				perm_items.name = 'zone_content_edit_own'
157
+				OR perm_items.name = 'zone_content_edit_others'
158
+		)
159
+";
160
+$user = $db->queryRow($user_query);
161
+if (!$user) {
162
+    return status_exit('badauth');
163
+}
164
+
165
+$zones_query = "SELECT domain_id FROM zones WHERE owner='{$user["id"]}'";
166
+$zones_result = $db->query($zones_query);
167
+$was_updated = false;
168
+
169
+while ($zone = $zones_result->fetchRow()) {
170
+    $name_query = "SELECT name FROM records WHERE domain_id='{$zone["domain_id"]}' and type = 'A'";
171
+    $result = $db->query($name_query);
172
+
173
+    while ($record = $result->fetchRow()) {
174
+        if ($hostname == $record['name']) {
175
+            $update_query = "UPDATE records SET content ='{$ip}' where name='{$record["name"]}' and type='A'";
176
+            $update_result = $db->query($update_query);
177
+            $was_updated = true;
178
+        }
179
+    }
180
+}
181
+
182
+return ($was_updated ? status_exit('good') : status_exit('!yours'));

+ 516
- 0
poweradmin/poweradmin-2.1.7/edit.php View File

@@ -0,0 +1,516 @@
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-2014  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-2014 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
+if (isset($_POST['commit'])) {
50
+    $error = false;
51
+    if (isset($_POST['record'])) {
52
+        foreach ($_POST['record'] as $record) {
53
+            $old_record_info = get_record_from_id($record['rid']);
54
+            $edit_record = edit_record($record);
55
+            if (false === $edit_record) {
56
+                $error = true;
57
+            } else {
58
+               $new_record_info = get_record_from_id($record["rid"]);
59
+               //Figure out if record was updated
60
+               unset($new_record_info["change_date"]);
61
+               unset($old_record_info["change_date"]);
62
+               if ($new_record_info != $old_record_info){
63
+                 //The record was changed, so log the edit_record operation
64
+                 log_info(sprintf('client_ip:%s user:%s operation:edit_record'
65
+                                  .' old_record_type:%s old_record:%s old_content:%s old_ttl:%s old_priority:%s'
66
+                                  .' record_type:%s record:%s content:%s ttl:%s priority:%s',
67
+                                  $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
68
+                              $old_record_info['type'], $old_record_info['name'],
69
+                              $old_record_info['content'], $old_record_info['ttl'], $old_record_info['prio'],
70
+                              $new_record_info['type'], $new_record_info['name'],
71
+                              $new_record_info['content'], $new_record_info['ttl'], $new_record_info['prio']));
72
+               }
73
+            }
74
+        }
75
+    }
76
+
77
+    edit_zone_comment($_GET['id'], $_POST['comment']);
78
+
79
+    if (false === $error) {
80
+        update_soa_serial($_GET['id']);
81
+        success(SUC_ZONE_UPD);
82
+
83
+        if ($pdnssec_use) {
84
+            if (dnssec_rectify_zone($_GET['id'])) {
85
+                success(SUC_EXEC_PDNSSEC_RECTIFY_ZONE);
86
+            }
87
+        }
88
+    } else {
89
+        error(ERR_ZONE_UPD);
90
+    }
91
+}
92
+
93
+if (isset($_POST['save_as'])) {
94
+    if (zone_templ_name_exists($_POST['templ_name'])) {
95
+        error(ERR_ZONE_TEMPL_EXIST);
96
+    } elseif ($_POST['templ_name'] == '') {
97
+        error(ERR_ZONE_TEMPL_IS_EMPTY);
98
+    } else {
99
+        success(SUC_ZONE_TEMPL_ADD);
100
+        $records = get_records_from_domain_id($zone_id);
101
+        add_zone_templ_save_as($_POST['templ_name'], $_POST['templ_descr'], $_SESSION['userid'], $records, get_zone_name_from_id($zone_id));
102
+    }
103
+}
104
+
105
+/*
106
+  Check permissions
107
+ */
108
+if (verify_permission('zone_content_view_others')) {
109
+    $perm_view = "all";
110
+} elseif (verify_permission('zone_content_view_own')) {
111
+    $perm_view = "own";
112
+} else {
113
+    $perm_view = "none";
114
+}
115
+
116
+if (verify_permission('zone_content_edit_others')) {
117
+    $perm_content_edit = "all";
118
+} elseif (verify_permission('zone_content_edit_own')) {
119
+    $perm_content_edit = "own";
120
+} else {
121
+    $perm_content_edit = "none";
122
+}
123
+
124
+if (verify_permission('zone_meta_edit_others')) {
125
+    $perm_meta_edit = "all";
126
+} elseif (verify_permission('zone_meta_edit_own')) {
127
+    $perm_meta_edit = "own";
128
+} else {
129
+    $perm_meta_edit = "none";
130
+}
131
+
132
+verify_permission('zone_master_add') ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0";
133
+verify_permission('zone_slave_add') ? $perm_zone_slave_add = "1" : $perm_zone_slave_add = "0";
134
+
135
+$user_is_zone_owner = verify_user_is_owner_zoneid($zone_id);
136
+if ($perm_meta_edit == "all" || ( $perm_meta_edit == "own" && $user_is_zone_owner == "1")) {
137
+    $meta_edit = "1";
138
+} else {
139
+    $meta_edit = "0";
140
+}
141
+
142
+(verify_permission('user_view_others')) ? $perm_view_others = "1" : $perm_view_others = "0";
143
+
144
+if (isset($_POST['slave_master_change']) && is_numeric($_POST["domain"])) {
145
+    change_zone_slave_master($_POST['domain'], $_POST['new_master']);
146
+}
147
+if (isset($_POST['type_change']) && in_array($_POST['newtype'], $server_types)) {
148
+    change_zone_type($_POST['newtype'], $zone_id);
149
+}
150
+if (isset($_POST["newowner"]) && is_numeric($_POST["domain"]) && is_numeric($_POST["newowner"])) {
151
+    add_owner_to_zone($_POST["domain"], $_POST["newowner"]);
152
+}
153
+if (isset($_POST["delete_owner"]) && is_numeric($_POST["delete_owner"])) {
154
+    delete_owner_from_zone($zone_id, $_POST["delete_owner"]);
155
+}
156
+if (isset($_POST["template_change"])) {
157
+    if (!isset($_POST['zone_template']) || "none" == $_POST['zone_template']) {
158
+        $new_zone_template = 0;
159
+    } else {
160
+        $new_zone_template = $_POST['zone_template'];
161
+    }
162
+    if ($_POST['current_zone_template'] != $new_zone_template) {
163
+        update_zone_records($zone_id, $new_zone_template);
164
+    }
165
+}
166
+
167
+if ($perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0") {
168
+    error(ERR_PERM_VIEW_ZONE);
169
+    include_once("inc/footer.inc.php");
170
+    exit();
171
+}
172
+
173
+if (zone_id_exists($zone_id) == "0") {
174
+    error(ERR_ZONE_NOT_EXIST);
175
+    include_once("inc/footer.inc.php");
176
+    exit();
177
+}
178
+
179
+if (isset($_POST['sign_zone'])) {
180
+    $zone_name = get_zone_name_from_id($zone_id);
181
+    update_soa_serial($zone_id);
182
+    dnssec_secure_zone($zone_name);
183
+    dnssec_rectify_zone($zone_id);
184
+}
185
+
186
+if (isset($_POST['unsign_zone'])) {
187
+    $zone_name = get_zone_name_from_id($zone_id);
188
+    dnssec_unsecure_zone($zone_name);
189
+    update_soa_serial($zone_id);
190
+}
191
+
192
+$domain_type = get_domain_type($zone_id);
193
+$record_count = count_zone_records($zone_id);
194
+$zone_templates = get_list_zone_templ($_SESSION['userid']);
195
+$zone_template_id = get_zone_template($zone_id);
196
+
197
+echo "   <h2>" . _('Edit zone') . " \"" . get_zone_name_from_id($zone_id) . "\"</h2>\n";
198
+
199
+echo "   <div class=\"showmax\">\n";
200
+show_pages($record_count, $iface_rowamount, $zone_id);
201
+echo "   </div>\n";
202
+
203
+$records = get_records_from_domain_id($zone_id, ROWSTART, $iface_rowamount, RECORD_SORT_BY);
204
+if ($records == "-1") {
205
+    echo " <p>" . _("This zone does not have any records. Weird.") . "</p>\n";
206
+} else {
207
+    echo "   <form method=\"post\" action=\"\">\n";
208
+    echo "   <table>\n";
209
+    echo "    <tr>\n";
210
+    echo "     <th>&nbsp;</th>\n";
211
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=id\">" . _('Id') . "</a></th>\n";
212
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=name\">" . _('Name') . "</a></th>\n";
213
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=type\">" . _('Type') . "</a></th>\n";
214
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=content\">" . _('Content') . "</a></th>\n";
215
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=prio\">" . _('Priority') . "</a></th>\n";
216
+    echo "     <th><a href=\"edit.php?id=" . $zone_id . "&amp;record_sort_by=ttl\">" . _('TTL') . "</a></th>\n";
217
+    echo "    </tr>\n";
218
+    foreach ($records as $r) {
219
+        if ($r['type'] != "SOA") {
220
+            echo "    <input type=\"hidden\" name=\"record[" . $r['id'] . "][rid]\" value=\"" . $r['id'] . "\">\n";
221
+            echo "    <input type=\"hidden\" name=\"record[" . $r['id'] . "][zid]\" value=\"" . $zone_id . "\">\n";
222
+        }
223
+        echo "    <tr>\n";
224
+
225
+        if ($domain_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0") {
226
+            echo "     <td class=\"n\">&nbsp;</td>\n";
227
+        } else {
228
+            echo "     <td class=\"n\">\n";
229
+            echo "      <a href=\"edit_record.php?id=" . $r['id'] . "&amp;domain=" . $zone_id . "\">
230
+                                                <img src=\"images/edit.gif\" alt=\"[ " . _('Edit record') . " ]\"></a>\n";
231
+            echo "      <a href=\"delete_record.php?id=" . $r['id'] . "&amp;domain=" . $zone_id . "\">
232
+                                                <img src=\"images/delete.gif\" ALT=\"[ " . _('Delete record') . " ]\" BORDER=\"0\"></a>\n";
233
+            echo "     </td>\n";
234
+        }
235
+        echo "     <td class=\"n\">{$r['id']}</td>\n";
236
+        if ($r['type'] == "SOA") {
237
+            echo "     <td class=\"n\">" . $r['name'] . "</td>\n";
238
+            echo "     <td class=\"n\">" . $r['type'] . "</td>\n";
239
+            echo "     <td class=\"n\">" . $r['content'] . "</td>\n";
240
+            echo "     <td class=\"n\">&nbsp;</td>\n";
241
+            echo "     <td class=\"n\">" . $r['ttl'] . "</td>\n";
242
+        } else {
243
+            echo "      <td class=\"u\"><input class=\"wide\" name=\"record[" . $r['id'] . "][name]\" value=\"" . htmlspecialchars($r['name']) . "\"></td>\n";
244
+            echo "      <td class=\"u\">\n";
245
+            echo "       <select name=\"record[" . $r['id'] . "][type]\">\n";
246
+            $found_selected_type = false;
247
+            foreach (get_record_types() as $type_available) {
248
+                if ($type_available == $r['type']) {
249
+                    $add = " SELECTED";
250
+                    $found_selected_type = true;
251
+                } else {
252
+                    $add = "";
253
+                }
254
+                echo "         <option" . $add . " value=\"" . htmlspecialchars($type_available) . "\" >" . $type_available . "</option>\n";
255
+            }
256
+            if (!$found_selected_type)
257
+                echo "         <option SELECTED value=\"" . htmlspecialchars($r['type']) . "\"><i>" . $r['type'] . "</i></option>\n";
258
+            /*
259
+              Sanitize content due to SPF record quoting in PowerDNS
260
+             */
261
+            if ($r['type'] == "SRV" || $r['type'] == "SPF" || $r['type'] == "TXT") {
262
+                $clean_content = trim($r['content'], "\x22\x27");
263
+            } else {
264
+                $clean_content = $r['content'];
265
+            }
266
+            echo "       </select>\n";
267
+            echo "      </td>\n";
268
+            echo "      <td class=\"u\"><input class=\"wide\" name=\"record[" . $r['id'] . "][content]\" value=\"" . htmlspecialchars($clean_content) . "\"></td>\n";
269
+            echo "      <td class=\"u\"><input size=\"4\" id=\"priority_field_" . $r['id'] . "\" name=\"record[" . $r['id'] . "][prio]\" value=\"" . htmlspecialchars($r['prio']) . "\"></td>\n";
270
+            echo "      <td class=\"u\"><input size=\"4\" name=\"record[" . $r['id'] . "][ttl]\" value=\"" . htmlspecialchars($r['ttl']) . "\"></td>\n";
271
+        }
272
+        echo "     </tr>\n";
273
+    }
274
+    echo "    <tr>\n";
275
+    echo "     <td colspan=\"6\">&nbsp;</td>\n";
276
+    echo "    </tr>\n";
277
+    echo "    <tr>\n";
278
+    echo "     <td>&nbsp;</td><td colspan=\"5\">Comments:</td>\n";
279
+    echo "    </tr>\n";
280
+    echo "    <tr>\n";
281
+    echo "     <td class=\"n\">\n";
282
+    echo "      <a href=\"edit_comment.php?domain=" . $zone_id . "\">
283
+                            <img src=\"images/edit.gif\" alt=\"[ " . _('Edit comment') . " ]\"></a>\n";
284
+    echo "     </td>\n";
285
+    echo "     <td colspan=\"4\"><textarea rows=\"5\" cols=\"80\" name=\"comment\">" . htmlspecialchars(get_zone_comment($zone_id)) . "</textarea></td>\n";
286
+    echo "     <td>&nbsp;</td>\n";
287
+
288
+    echo "     <tr>\n";
289
+    echo "      <th colspan=\"6\"><br>Save as new template:</th>\n";
290
+    echo "     </tr>\n";
291
+    echo "     <tr>\n";
292
+    echo "       <td colspan=\"2\">" . _('Template Name') . "</td>\n";
293
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"\"></td>\n";
294
+    echo "      </tr>\n";
295
+    echo "      <tr>\n";
296
+    echo "       <td colspan=\"2\">" . _('Template Description') . "</td>\n";
297
+    echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"\"></td>\n";
298
+    echo "      </tr>\n";
299
+    echo "    </table>\n";
300
+    echo "     <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
301
+    echo "     <input type=\"reset\" class=\"button\" name=\"reset\" value=\"" . _('Reset changes') . "\">\n";
302
+    echo "     <input type=\"submit\" class=\"button\" name=\"save_as\" value=\"" . _('Save as template') . "\">\n";
303
+
304
+    if ($pdnssec_use) {
305
+        $zone_name = get_zone_name_from_id($zone_id);
306
+
307
+        if (dnssec_is_zone_secured($zone_name)) {
308
+            echo "     <input type=\"button\" class=\"button\" name=\"dnssec\" onclick=\"location.href = 'dnssec.php?id=".$zone_id."';\" value=\"" . _('DNSSEC') . "\">\n";
309
+            echo "     <input type=\"submit\" class=\"button\" name=\"unsign_zone\" value=\"" . _('Unsign this zone') . "\">\n";
310
+        } else {
311
+            echo "     <input type=\"submit\" class=\"button\" name=\"sign_zone\" value=\"" . _('Sign this zone') . "\">\n";
312
+        }
313
+    }
314
+
315
+    echo "    </form>\n";
316
+}
317
+
318
+if ($perm_content_edit == "all" || $perm_content_edit == "own" && $user_is_zone_owner == "1") {
319
+    if ($domain_type != "SLAVE") {
320
+        $zone_name = get_zone_name_from_id($zone_id);
321
+        echo "     <form method=\"post\" action=\"add_record.php?id=" . $zone_id . "\">\n";
322
+        echo "      <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
323
+        echo "      <table border=\"0\" cellspacing=\"4\">\n";
324
+        echo "       <tr>\n";
325
+        echo "        <td class=\"n\">" . _('Name') . "</td>\n";
326
+        echo "        <td class=\"n\">&nbsp;</td>\n";
327
+        echo "        <td class=\"n\">" . _('Type') . "</td>\n";
328
+        echo "        <td class=\"n\">" . _('Content') . "</td>\n";
329
+        echo "        <td class=\"n\">" . _('Priority') . "</td>\n";
330
+        echo "        <td class=\"n\">" . _('TTL') . "</td>\n";
331
+        echo "       </tr>\n";
332
+        echo "       <tr>\n";
333
+        echo "        <td class=\"n\"><input type=\"text\" name=\"name\" class=\"input\" value=\"\">." . $zone_name . "</td>\n";
334
+        echo "        <td class=\"n\">IN</td>\n";
335
+        echo "        <td class=\"n\">\n";
336
+        echo "         <select name=\"type\">\n";
337
+        $found_selected_type = !(isset($type) && $type);
338
+        foreach (get_record_types() as $record_type) {
339
+            if (isset($type) && $type) {
340
+                if ($type == $record_type) {
341
+                    $add = " SELECTED";
342
+                    $found_selected_type = true;
343
+                } else {
344
+                    $add = "";
345
+                }
346
+            } else {
347
+                if (preg_match('/i(p6|n-addr).arpa/i', $zone_name) && strtoupper($record_type) == 'PTR') {
348
+                    $add = " SELECTED";
349
+                    $rev = "";
350
+                } else if ((strtoupper($record_type) == 'A') && $iface_add_reverse_record) {
351
+                    $add = " SELECTED";
352
+                    $rev = "<input type=\"checkbox\" name=\"reverse\"><span class=\"normaltext\">" . _('Add also reverse record') . "</span>\n";
353
+                } else {
354
+                    $add = "";
355
+                }
356
+            }
357
+            echo "          <option" . $add . " value=\"" . htmlspecialchars($record_type) . "\">" . $record_type . "</option>\n";
358
+        }
359
+        if (!$found_selected_type)
360
+            echo "         <option SELECTED value=\"" . htmlspecialchars($type) . "\"><i>" . htmlspecialchars($type) . "</i></option>\n";
361
+        echo "         </select>\n";
362
+        echo "        </td>\n";
363
+        echo "        <td class=\"n\"><input type=\"text\" name=\"content\" class=\"input\" value=\"\"></td>\n";
364
+        echo "        <td class=\"n\"><input type=\"text\" name=\"prio\" class=\"sinput\" value=\"\"></td>\n";
365
+        echo "        <td class=\"n\"><input type=\"text\" name=\"ttl\" class=\"sinput\" value=\"\"></td>\n";
366
+        echo "       </tr>\n";
367
+        echo "      </table>\n";
368
+        echo "      <input type=\"submit\" name=\"commit\" value=\"" . _('Add record') . "\" class=\"button\">\n";
369
+        echo "      $rev";
370
+        echo "     </form>\n";
371
+    }
372
+}
373
+
374
+echo "   <div id=\"meta\">\n";
375
+echo "    <table>\n";
376
+echo "     <tr>\n";
377
+echo "      <th colspan=\"2\">" . _('Owner of zone') . "</th>\n";
378
+echo "     </tr>\n";
379
+
380
+$owners = get_users_from_domain_id($zone_id);
381
+
382
+if ($owners == "-1") {
383
+    echo "      <tr><td>" . _('No owner set for this zone.') . "</td></tr>";
384
+} else {
385
+    if ($meta_edit) {
386
+        foreach ($owners as $owner) {
387
+            echo "       <tr>\n";
388
+            echo "        <form method=\"post\" action=\"edit.php?id=" . $zone_id . "\">\n";
389
+            echo "        <td>" . $owner["fullname"] . "</td>\n";
390
+            echo "        <td>\n";
391
+            echo "         <input type=\"hidden\" name=\"delete_owner\" value=\"" . $owner["id"] . "\">\n";
392
+            echo "         <input type=\"submit\" class=\"sbutton\" name=\"co\" value=\"" . _('Delete') . "\">\n";
393
+            echo "        </td>\n";
394
+            echo "        </form>\n";
395
+            echo "       </tr>\n";
396
+        }
397
+    } else {
398
+        foreach ($owners as $owner) {
399
+            echo "    <tr><td>" . $owner["fullname"] . "</td><td>&nbsp;</td></tr>";
400
+        }
401
+    }
402
+}
403
+if ($meta_edit) {
404
+    echo "      <form method=\"post\" action=\"edit.php?id=" . $zone_id . "\">\n";
405
+    echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
406
+    echo "       <tr>\n";
407
+    echo "        <td>\n";
408
+    echo "         <select name=\"newowner\">\n";
409
+    /*
410
+      Show list of users to add as owners of this domain, only if we have permission to do so.
411
+     */
412
+    $users = show_users();
413
+    foreach ($users as $user) {
414
+        $add = '';
415
+        if ($user["id"] == $_SESSION["userid"]) {
416
+            echo "          <option" . $add . " value=\"" . $user["id"] . "\">" . $user["fullname"] . "</option>\n";
417
+        } elseif ($perm_view_others == "1") {
418
+            echo "          <option  value=\"" . $user["id"] . "\">" . $user["fullname"] . "</option>\n";
419
+        }
420
+    }
421
+    echo "         </select>\n";
422
+    echo "        </td>\n";
423
+    echo "        <td>\n";
424
+    echo "         <input type=\"submit\" class=\"sbutton\" name=\"co\" value=\"" . _('Add') . "\">\n";
425
+    echo "        </td>\n";
426
+    echo "       </tr>\n";
427
+    echo "      </form>\n";
428
+}
429
+echo "      <tr>\n";
430
+echo "       <th colspan=\"2\">" . _('Type') . "</th>\n";
431
+echo "      </tr>\n";
432
+
433
+if ($meta_edit) {
434
+    echo "      <form action=\"" . htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES) . "?id=" . $zone_id . "\" method=\"post\">\n";
435
+    echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
436
+    echo "       <tr>\n";
437
+    echo "        <td>\n";
438
+    echo "         <select name=\"newtype\">\n";
439
+    foreach ($server_types as $type) {
440
+        $add = '';
441
+        if ($type == $domain_type) {
442
+            $add = " SELECTED";
443
+        }
444
+
445
+        if (($perm_zone_master_add == "0" && $type == "MASTER") || ($perm_zone_slave_add == "0" && $type == "SLAVE")) {
446
+            continue;
447
+        }
448
+        echo "          <option" . $add . " value=\"" . $type . "\">" . strtolower($type) . "</option>\n";
449
+    }
450
+    echo "         </select>\n";
451
+    echo "        </td>\n";
452
+    echo "        <td>\n";
453
+    echo "         <input type=\"submit\" class=\"sbutton\" name=\"type_change\" value=\"" . _('Change') . "\">\n";
454
+    echo "        </td>\n";
455
+    echo "       </tr>\n";
456
+    echo "      </form>\n";
457
+} else {
458
+    echo "      <tr><td>" . strtolower($domain_type) . "</td><td>&nbsp;</td></tr>\n";
459
+}
460
+
461
+echo "      <tr>\n";
462
+echo "       <th colspan=\"2\">" . _('Template') . "</th>\n";
463
+echo "      </tr>\n";
464
+
465
+if ($meta_edit) {
466
+    echo "      <form action=\"" . htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES) . "?id=" . $zone_id . "\" method=\"post\">\n";
467
+    echo "       <input type=\"hidden\" name=\"current_zone_template\" value=\"" . $zone_template_id . "\">\n";
468
+    echo "       <tr>\n";
469
+    echo "        <td>\n";
470
+    echo "         <select name=\"zone_template\">\n";
471
+    echo "          <option value=\"none\">none</option>\n";
472
+    foreach ($zone_templates as $zone_template) {
473
+        $add = '';
474
+        if ($zone_template['id'] == $zone_template_id) {
475
+            $add = " SELECTED";
476
+        }
477
+        echo "          <option .  $add . value=\"" . $zone_template['id'] . "\">" . $zone_template['name'] . "</option>\n";
478
+    }
479
+    echo "         </select>\n";
480
+    echo "        </td>\n";
481
+    echo "        <td>\n";
482
+    echo "         <input type=\"submit\" class=\"sbutton\" name=\"template_change\" value=\"" . _('Change') . "\">\n";
483
+    echo "        </td>\n";
484
+    echo "       </tr>\n";
485
+    echo "      </form>\n";
486
+} else {
487
+    $zone_template_details = get_zone_templ_details($zone_template_id);
488
+    echo "      <tr><td>" . (isset($zone_template_details) ? strtolower($zone_template_details['name']) : "none" ) . "</td><td>&nbsp;</td></tr>\n";
489
+}
490
+
491
+if ($domain_type == "SLAVE") {
492
+    $slave_master = get_domain_slave_master($zone_id);
493
+    echo "      <tr>\n";
494
+    echo "       <th colspan=\"2\">" . _('IP address of master NS') . "</th>\n";
495
+    echo "      </tr>\n";
496
+
497
+    if ($meta_edit) {
498
+        echo "      <form action=\"" . htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES) . "?id=" . $zone_id . "\" method=\"post\">\n";
499
+        echo "       <input type=\"hidden\" name=\"domain\" value=\"" . $zone_id . "\">\n";
500
+        echo "       <tr>\n";
501
+        echo "        <td>\n";
502
+        echo "         <input type=\"text\" name=\"new_master\" value=\"" . $slave_master . "\" class=\"input\">\n";
503
+        echo "        </td>\n";
504
+        echo "        <td>\n";
505
+        echo "         <input type=\"submit\" class=\"sbutton\" name=\"slave_master_change\" value=\"" . _('Change') . "\">\n";
506
+        echo "        </td>\n";
507
+        echo "       </tr>\n";
508
+        echo "      </form>\n";
509
+    } else {
510
+        echo "      <tr><td>" . $slave_master . "</td><td>&nbsp;</td></tr>\n";
511
+    }
512
+}
513
+echo "     </table>\n";
514
+echo "   </div>\n"; // eo div meta
515
+
516
+include_once("inc/footer.inc.php");

+ 115
- 0
poweradmin/poweradmin-2.1.7/edit_comment.php View File

@@ -0,0 +1,115 @@
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-2014  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-2014 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 (verify_permission('zone_content_view_others')) {
36
+    $perm_view = "all";
37
+} elseif (verify_permission('zone_content_view_own')) {
38
+    $perm_view = "own";
39
+} else {
40
+    $perm_view = "none";
41
+}
42
+
43
+if (verify_permission('zone_content_edit_others')) {
44
+    $perm_content_edit = "all";
45
+} elseif (verify_permission('zone_content_edit_own')) {
46
+    $perm_content_edit = "own";
47
+} else {
48
+    $perm_content_edit = "none";
49
+}
50
+
51
+if (verify_permission('zone_meta_edit_others')) {
52
+    $perm_meta_edit = "all";
53
+} elseif (verify_permission('zone_meta_edit_own')) {
54
+    $perm_meta_edit = "own";
55
+} else {
56
+    $perm_meta_edit = "none";
57
+}
58
+
59
+$zid = $_GET['domain'];
60
+
61
+$user_is_zone_owner = verify_user_is_owner_zoneid($zid);
62
+$zone_type = get_domain_type($zid);
63
+$zone_name = get_zone_name_from_id($zid);
64
+
65
+if (isset($_POST["commit"])) {
66
+    if ($zone_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0") {
67
+        error(ERR_PERM_EDIT_COMMENT);
68
+    } else {
69
+        edit_zone_comment($_GET['domain'], $_POST['comment']);
70
+        success(SUC_COMMENT_UPD);
71
+    }
72
+}
73
+
74
+echo "    <h2>" . _('Edit comment in zone') . " " . $zone_name . "</h2>\n";
75
+
76
+if ($perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0") {
77
+    error(ERR_PERM_VIEW_COMMENT);
78
+} else {
79
+    $comment = get_zone_comment($zid);
80
+    echo "     <form method=\"post\" action=\"edit_comment.php?domain=" . $zid . "\">\n";
81
+    echo "      <table>\n";
82
+    echo "      <tr>\n";
83
+    echo "       <td colspan=\"6\">&nbsp;</td>\n";
84
+    echo "      </tr>\n";
85
+    echo "      <tr>\n";
86
+    echo "       <td>&nbsp;</td><td colspan=\"5\">Comments:</td>\n";
87
+    echo "      </tr>\n";
88
+
89
+    if ($zone_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0") {
90
+        echo "    <tr>\n";
91
+        echo "     <td class=\"n\">\n";
92
+        echo "      &nbsp;\n";
93
+        echo "     </td>\n";
94
+        echo "     <td colspan=\"4\"><textarea rows=\"15\" name=\"comment\" disabled>" . $comment . "</textarea></td>\n";
95
+        echo "     <td>&nbsp;</td>\n";
96
+        echo "    </tr>\n";
97
+    } else {
98
+        echo "    <tr>\n";
99
+        echo "     <td class=\"n\">\n";
100
+        echo "      &nbsp;\n";
101
+        echo "     </td>\n";
102
+        echo "     <td colspan=\"4\"><textarea rows=\"15\" name=\"comment\">" . $comment . "</textarea></td>\n";
103
+        echo "     <td>&nbsp;</td>\n";
104
+        echo "    </tr>\n";
105
+    }
106
+    echo "      </table>\n";
107
+    echo "      <p>\n";
108
+    echo "       <input type=\"submit\" name=\"commit\" value=\"" . _('Commit changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
109
+    echo "       <input type=\"reset\" name=\"reset\" value=\"" . _('Reset changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
110
+    echo "      </p>\n";
111
+    echo "     </form>\n";
112
+}
113
+
114
+
115
+include_once("inc/footer.inc.php");

+ 99
- 0
poweradmin/poweradmin-2.1.7/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-2014  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-2014 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 (!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
+        update_perm_templ_details($_POST);
49
+        success(SUC_RECORD_UPD);
50
+    }
51
+
52
+    $templ = get_permission_template_details($id);
53
+    $perms_templ = get_permissions_by_template_id($id);
54
+    $perms_avail = 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");

+ 164
- 0
poweradmin/poweradmin-2.1.7/edit_record.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-2014  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-2014 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 (verify_permission('zone_content_view_others')) {
38
+    $perm_view = "all";
39
+} elseif (verify_permission('zone_content_view_own')) {
40
+    $perm_view = "own";
41
+} else {
42
+    $perm_view = "none";
43
+}
44
+
45
+if (verify_permission('zone_content_edit_others')) {
46
+    $perm_content_edit = "all";
47
+} elseif (verify_permission('zone_content_edit_own')) {
48
+    $perm_content_edit = "own";
49
+} else {
50
+    $perm_content_edit = "none";
51
+}
52
+
53
+if (verify_permission('zone_meta_edit_others')) {
54
+    $perm_meta_edit = "all";
55
+} elseif (verify_permission('zone_meta_edit_own')) {
56
+    $perm_meta_edit = "own";
57
+} else {
58
+    $perm_meta_edit = "none";
59
+}
60
+
61
+$zid = get_zone_id_from_record_id($_GET['id']);
62
+
63
+$user_is_zone_owner = 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" && $user_is_zone_owner == "0") {
69
+        error(ERR_PERM_EDIT_RECORD);
70
+    } else {
71
+        $old_record_info = get_record_from_id($_POST["rid"]);
72
+        $ret_val = edit_record($_POST);
73
+        if ($ret_val == "1") {
74
+            if ($_POST['type'] != "SOA") {
75
+                update_soa_serial($zid);
76
+            }
77
+            success(SUC_RECORD_UPD);
78
+            $new_record_info = get_record_from_id($_POST["rid"]);
79
+            log_info(sprintf('client_ip:%s user:%s operation:edit_record'
80
+                             .' old_record_type:%s old_record:%s old_content:%s old_ttl:%s old_priority:%s'
81
+                             .' record_type:%s record:%s content:%s ttl:%s priority:%s',
82
+                              $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"],
83
+                              $old_record_info['type'], $old_record_info['name'], $old_record_info['content'], $old_record_info['ttl'], $old_record_info['prio'], 
84
+                              $new_record_info['type'], $new_record_info['name'], $new_record_info['content'], $new_record_info['ttl'], $new_record_info['prio']));
85
+
86
+            if ($pdnssec_use) {
87
+                if (dnssec_rectify_zone($zid)) {
88
+                    success(SUC_EXEC_PDNSSEC_RECTIFY_ZONE);
89
+                }
90
+            }
91
+        }
92
+    }
93
+}
94
+
95
+echo "    <h2>" . _('Edit record in zone') . " \"<a href=\"edit.php?id=" . $zid . "\">" . $zone_name . "</a>\"</h2>\n";
96
+
97
+if ($perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0") {
98
+    error(ERR_PERM_VIEW_RECORD);
99
+} else {
100
+    $record = get_record_from_id($_GET["id"]);
101
+    echo "     <form method=\"post\" action=\"edit_record.php?domain=" . $zid . "&amp;id=" . $_GET["id"] . "\">\n";
102
+    echo "      <table>\n";
103
+    echo "       <tr>\n";
104
+    echo "        <th>" . _('Name') . "</th>\n";
105
+    echo "        <th>&nbsp;</th>\n";
106
+    echo "        <th>" . _('Type') . "</th>\n";
107
+    echo "        <th>" . _('Content') . "</th>\n";
108
+    echo "        <th>" . _('Priority') . "</th>\n";
109
+    echo "        <th>" . _('TTL') . "</th>\n";
110
+    echo "       </tr>\n";
111
+
112
+    /*
113
+      Sanitize content due to SPF record quoting in PowerDNS
114
+     */
115
+    if ($record['type'] == "SRV" || $record['type'] == "SPF" || $record['type'] == "TXT") {
116
+        $clean_content = trim($record['content'], "\x22\x27");
117
+    } else {
118
+        $clean_content = $record['content'];
119
+    }
120
+
121
+    if ($zone_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0") {
122
+        echo "      <tr>\n";
123
+        echo "       <td>" . $record["name"] . "</td>\n";
124
+        echo "       <td>IN</td>\n";
125
+        echo "       <td>" . htmlspecialchars($record["type"]) . "</td>\n";
126
+        echo "       <td>" . htmlspecialchars($clean_content) . "</td>\n";
127
+        echo "       <td>" . htmlspecialchars($record["prio"]) . "</td>\n";
128
+        echo "       <td>" . htmlspecialchars($record["ttl"]) . "</td>\n";
129
+        echo "      </tr>\n";
130
+    } else {
131
+        echo "      <tr>\n";
132
+        echo "       <td><input type=\"hidden\" name=\"rid\" value=\"" . $_GET["id"] . "\">\n";
133
+        echo "       <input type=\"hidden\" name=\"zid\" value=\"" . $zid . "\">\n";
134
+        echo "       <input type=\"text\" name=\"name\" value=\"" . htmlspecialchars(trim(str_replace($zone_name, '', $record["name"]), '.')) . "\" class=\"input\">." . $zone_name . "</td>\n";
135
+        echo "       <td>IN</td>\n";
136
+        echo "       <td>\n";
137
+        echo "        <select name=\"type\">\n";
138
+        $found_selected_type = false;
139
+        foreach (get_record_types() as $type_available) {
140
+            if ($type_available == $record["type"]) {
141
+                $add = " SELECTED";
142
+                $found_selected_type = true;
143
+            } else {
144
+                $add = "";
145
+            }
146
+            echo "         <option" . $add . " value=\"" . htmlspecialchars($type_available) . "\" >" . $type_available . "</option>\n";
147
+        }
148
+        if (!$found_selected_type)
149
+            echo "         <option SELECTED value=\"" . htmlspecialchars($record['type']) . "\"><i>" . $record['type'] . "</i></option>\n";
150
+        echo "        </select>\n";
151
+        echo "       </td>\n";
152
+        echo "       <td><input type=\"text\" name=\"content\" value=\"" . htmlspecialchars($clean_content) . "\" class=\"input\"></td>\n";
153
+        echo "       <td><input type=\"text\" name=\"prio\" value=\"" . htmlspecialchars($record["prio"]) . "\" class=\"sinput\"></td>\n";
154
+        echo "       <td><input type=\"text\" name=\"ttl\" value=\"" . htmlspecialchars($record["ttl"]) . "\" class=\"sinput\"></td>\n";
155
+        echo "      </tr>\n";
156
+    }
157
+    echo "      </table>\n";
158
+    echo "       <input type=\"submit\" name=\"commit\" value=\"" . _('Commit changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
159
+    echo "       <input type=\"reset\" name=\"reset\" value=\"" . _('Reset changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
160
+    echo "     </form>\n";
161
+}
162
+
163
+
164
+include_once("inc/footer.inc.php");

+ 172
- 0
poweradmin/poweradmin-2.1.7/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-2014  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-2014 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
+verify_permission('user_edit_own') ? $perm_edit_own = "1" : $perm_edit_own = "0";
41
+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 (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 = 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 (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 (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 (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");

+ 201
- 0
poweradmin/poweradmin-2.1.7/edit_zone_templ.php View File

@@ -0,0 +1,201 @@
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-2014  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-2014 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 (!(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
+                /*
136
+                  Sanitize content due to SPF record quoting in PowerDNS
137
+                 */
138
+                if ($r['type'] == "SRV" || $r['type'] == "SPF") {
139
+                    $clean_content = trim($r['content'], "\x22\x27");
140
+                } else {
141
+                    $clean_content = $r['content'];
142
+                }
143
+                echo "       </select>\n";
144
+                echo "      </td>\n";
145
+                echo "      <td class=\"u\"><input class=\"wide\" name=\"record[" . $r['id'] . "][content]\" value='" . $clean_content . "'></td>\n";
146
+                if ($r['type'] == "MX" || $r['type'] == "SRV") {
147
+                    echo "      <td class=\"u\"><input name=\"record[" . $r['id'] . "][prio]\" value=\"" . $r['prio'] . "\"></td>\n";
148
+                } else {
149
+                    echo "      <td class=\"n\">&nbsp;</td>\n";
150
+                }
151
+                echo "      <td class=\"u\"><input name=\"record[" . $r['id'] . "][ttl]\" value=\"" . $r['ttl'] . "\"></td>\n";
152
+                echo "     </tr>\n";
153
+            }
154
+            echo "     <tr>\n";
155
+            echo "      <td colspan=\"6\"><br><b>Hint:</b></td>\n";
156
+            echo "     </tr>\n";
157
+            echo "     <tr>\n";
158
+            echo "      <td colspan=\"6\">" . _('The following placeholders can be used in template records') . "</td>\n";
159
+            echo "     </tr>\n";
160
+            echo "     <tr>\n";
161
+            echo "      <td colspan=\"6\"><br>&nbsp;&nbsp;&nbsp;&nbsp; * [ZONE] - " . _('substituted with current zone name') . "<br>";
162
+            echo "&nbsp;&nbsp;&nbsp;&nbsp; * [SERIAL] - " . _('substituted with current date and 2 numbers') . " (YYYYMMDD + 00)</td>\n";
163
+            echo "     </tr>\n";
164
+            echo "     <tr>\n";
165
+            echo "      <td colspan=\"6\"><br>Save as new template:</td>\n";
166
+            echo "     </tr>\n";
167
+            echo "      <tr>\n";
168
+            echo "       <th>" . _('Template Name') . "</th>\n";
169
+            echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"\"></td>\n";
170
+            echo "      </tr>\n";
171
+            echo "      <tr>\n";
172
+            echo "       <th>" . _('Template Description') . "</th>\n";
173
+            echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"\"></td>\n";
174
+            echo "      </tr>\n";
175
+            echo "    </table>\n";
176
+            echo "     <input type=\"submit\" class=\"button\" name=\"commit\" value=\"" . _('Commit changes') . "\">\n";
177
+            echo "     <input type=\"reset\" class=\"button\" name=\"reset\" value=\"" . _('Reset changes') . "\">\n";
178
+            echo "     <input type=\"submit\" class=\"button\" name=\"save_as\" value=\"" . _('Save as template') . "\">\n";
179
+            echo "     <input type=\"submit\" class=\"button\" name=\"update_zones\" value=\"" . _('Update zones') . "\">\n";
180
+            echo "    </form>";
181
+        }
182
+
183
+        echo "    <form method=\"post\" action=\"\">\n";
184
+        echo "     <table>\n";
185
+        echo "      <tr>\n";
186
+        echo "       <th>" . _('Name') . "</th>\n";
187
+        echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_name\" value=\"" . $templ_details['name'] . "\"></td>\n";
188
+        echo "      </tr>\n";
189
+        echo "      <tr>\n";
190
+        echo "       <th>" . _('Description') . "</th>\n";
191
+        echo "       <td><input class=\"wide\" type=\"text\" name=\"templ_descr\" value=\"" . $templ_details['descr'] . "\"></td>\n";
192
+        echo "      </tr>\n";
193
+        echo "     </table>\n";
194
+        echo "     <input type=\"submit\" class=\"button\" name=\"edit\" value=\"" . _('Commit changes') . "\">\n";
195
+        echo "     </form>\n";
196
+        echo "    <input type=\"button\" class=\"button\" OnClick=\"location.href='add_zone_templ_record.php?id=" . $zone_templ_id . "'\" value=\"" . _('Add record') . "\">&nbsp;&nbsp\n";
197
+        echo "    <input type=\"button\" class=\"button\" OnClick=\"location.href='delete_zone_templ.php?id=" . $zone_templ_id . "'\" value=\"" . _('Delete zone template') . "\">\n";
198
+    }
199
+}
200
+
201
+include_once("inc/footer.inc.php");

+ 118
- 0
poweradmin/poweradmin-2.1.7/edit_zone_templ_record.php View File

@@ -0,0 +1,118 @@
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-2014  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-2014 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 (!(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 (!(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
+    /*
97
+      Sanitize content due to SPF record quoting in PowerDNS
98
+     */
99
+    if ($record['type'] == "SRV" || $record['type'] == "SPF" || $record['type'] == "TXT") {
100
+        $clean_content = trim($record['content'], "\x22\x27");
101
+    } else {
102
+        $clean_content = $record['content'];
103
+    }
104
+    echo "        </select>\n";
105
+    echo "       </td>\n";
106
+    echo "       <td><input type=\"text\" name=\"content\" value=\"" . htmlspecialchars($clean_content) . "\" class=\"input\"></td>\n";
107
+    echo "       <td><input type=\"text\" name=\"prio\" value=\"" . htmlspecialchars($record["prio"]) . "\" class=\"sinput\"></td>\n";
108
+    echo "       <td><input type=\"text\" name=\"ttl\" value=\"" . htmlspecialchars($record["ttl"]) . "\" class=\"sinput\"></td>\n";
109
+    echo "      </tr>\n";
110
+    echo "      </table>\n";
111
+    echo "      <p>\n";
112
+    echo "       <input type=\"submit\" name=\"commit\" value=\"" . _('Commit changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
113
+    echo "       <input type=\"reset\" name=\"reset\" value=\"" . _('Reset changes') . "\" class=\"button\">&nbsp;&nbsp;\n";
114
+    echo "      </p>\n";
115
+    echo "     </form>\n";
116
+}
117
+
118
+include_once("inc/footer.inc.php");

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


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


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


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


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


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


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


+ 249
- 0
poweradmin/poweradmin-2.1.7/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
+}

+ 242
- 0
poweradmin/poweradmin-2.1.7/inc/PDOLayer.php View File

@@ -0,0 +1,242 @@
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-2014  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-2014 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' && isset($options['type'])) {
226
+            $query .= ' ENGINE=' . $options['type'];
227
+        }
228
+        $this->exec($query);
229
+    }
230
+
231
+    /**
232
+     * Drop an existing table
233
+     *
234
+     * @link http://pear.php.net/package/MDB2/docs/2.5.0b3/MDB2/MDB2_Driver_Manager_Common.html#methoddropTable
235
+     * @param string $name name of the table that should be dropped
236
+     */
237
+    public function dropTable($name) {
238
+        $query = "DROP TABLE $name";
239
+        $this->exec($query);
240
+    }
241
+
242
+}

+ 313
- 0
poweradmin/poweradmin-2.1.7/inc/auth.inc.php View File

@@ -0,0 +1,313 @@
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-2014  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
+ * Authentication functions
25
+ *
26
+ * @package Poweradmin
27
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
28
+ * @copyright   2010-2014 Poweradmin Development Team
29
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
30
+ */
31
+
32
+/** Authenticate Session
33
+ *
34
+ * Checks if user is logging in, logging out, or session expired and performs
35
+ * actions accordingly
36
+ *
37
+ * @return null
38
+ */
39
+function doAuthenticate() {
40
+    global $iface_expire;
41
+    global $session_key;
42
+    global $ldap_use;
43
+
44
+    if (isset($_SESSION['userid']) && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] == "logout") {
45
+        logout(_('You have logged out.'), 'success');
46
+    }
47
+
48
+    // If a user had just entered his/her login && password, store them in our session.
49
+    if (isset($_POST["authenticate"])) {
50
+        $_SESSION["userpwd"] = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($session_key), $_POST['password'], MCRYPT_MODE_CBC, md5(md5($session_key))));
51
+
52
+        $_SESSION["userlogin"] = $_POST["username"];
53
+        $_SESSION["userlang"] = $_POST["userlang"];
54
+    }
55
+
56
+    // Check if the session hasnt expired yet.
57
+    if ((isset($_SESSION["userid"])) && ($_SESSION["lastmod"] != "") && ((time() - $_SESSION["lastmod"]) > $iface_expire)) {
58
+        logout(_('Session expired, please login again.'), 'error');
59
+    }
60
+
61
+    // If the session hasn't expired yet, give our session a fresh new timestamp.
62
+    $_SESSION["lastmod"] = time();
63
+
64
+    if ($ldap_use && userUsesLDAP()) {
65
+        LDAPAuthenticate();
66
+    } else {
67
+        SQLAuthenticate();
68
+    }
69
+}
70
+
71
+function userUsesLDAP() {
72
+    global $db;
73
+
74
+    $rowObj = $db->queryRow("SELECT id FROM users WHERE username=" . $db->quote($_SESSION["userlogin"], 'text') . " AND use_ldap=1");
75
+    if ($rowObj) {
76
+        return true;
77
+    }
78
+    return false;
79
+}
80
+
81
+function LDAPAuthenticate() {
82
+    global $db;
83
+    global $session_key;
84
+    global $ldap_uri;
85
+    global $ldap_debug;
86
+    global $ldap_basedn;
87
+    global $ldap_binddn;
88
+    global $ldap_bindpw;
89
+    global $ldap_proto;
90
+    global $ldap_user_attribute;
91
+
92
+    if (isset($_SESSION["userlogin"]) && isset($_SESSION["userpwd"])) {
93
+        if ($ldap_debug) {
94
+            ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
95
+        }
96
+        $ldapconn = ldap_connect($ldap_uri);
97
+        if (!$ldapconn) {
98
+            if (isset($_POST["authenticate"]))
99
+                log_error(sprintf('Failed LDAP authentication attempt from [%s] Reason: ldap_connect failed', $_SERVER['REMOTE_ADDR']));
100
+            logout(_('Failed to connect to LDAP server!'), 'error');
101
+            return;
102
+        }
103
+
104
+        $ldapbind = ldap_bind($ldapconn, $ldap_binddn, $ldap_bindpw);
105
+        ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, $ldap_proto);
106
+        if (!$ldapbind) {
107
+            if (isset($_POST["authenticate"])) 
108
+                log_error(sprintf('Failed LDAP authentication attempt from [%s] Reason: ldap_bind failed', $_SERVER['REMOTE_ADDR']));
109
+            logout(_('Failed to bind to LDAP server!'), 'error');
110
+            return;
111
+        }
112
+
113
+        $attributes = array($ldap_user_attribute, 'dn');
114
+        $filter = "(" . $ldap_user_attribute . "=" . $_SESSION["userlogin"] . ")";
115
+        $ldapsearch = ldap_search($ldapconn, $ldap_basedn, $filter, $attributes);
116
+        if (!$ldapsearch) {
117
+            if (isset($_POST["authenticate"]) ) 
118
+                log_error(sprintf('Failed LDAP authentication attempt from [%s] Reason: ldap_search failed', $_SERVER['REMOTE_ADDR']));
119
+            logout(_('Failed to search LDAP.'), 'error');
120
+            return;
121
+        }
122
+
123
+        //Checking first that we only found exactly 1 user, get the DN of this user.  We'll use this to perform the actual authentication.
124
+        $entries = ldap_get_entries($ldapconn, $ldapsearch);
125
+        if ($entries["count"] != 1) {
126
+            if (isset($_POST["authenticate"])) {
127
+                if ($entries["count"] == 0 ){ 
128
+                    log_warn(sprintf('Failed LDAP authentication attempt from [%s] for user \'%s\' Reason: No such user', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"])); 
129
+                } else {
130
+                    log_error(sprintf('Failed LDAP authentication attempt from [%s] for user \'%s\' Reason: Duplicate usernames detected', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"]));
131
+                }
132
+            }
133
+            logout(_('Failed to authenticate against LDAP.'), 'error');
134
+            return;
135
+        }
136
+        $user_dn = $entries[0]["dn"];
137
+
138
+        $session_pass = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($session_key), base64_decode($_SESSION["userpwd"]), MCRYPT_MODE_CBC, md5(md5($session_key))), "\0");
139
+        $ldapbind = ldap_bind($ldapconn, $user_dn, $session_pass);
140
+        if (!$ldapbind) {
141
+            if (isset($_POST["authenticate"]) ) 
142
+                log_warn(sprintf('Failed LDAP authentication attempt from [%s] for user \'%s\' Reason: Incorrect password', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"]));
143
+            auth(_('LDAP Authentication failed!'), "error");
144
+            return;
145
+        }
146
+        //LDAP AUTH SUCCESSFUL
147
+        //Make sure the user is 'active' and fetch id and name.
148
+        $rowObj = $db->queryRow("SELECT id, fullname FROM users WHERE username=" . $db->quote($_SESSION["userlogin"], 'text') . " AND active=1");
149
+        if (!$rowObj) {
150
+            if (isset($_POST["authenticate"]) )
151
+                log_warn(sprintf('Failed LDAP authentication attempt from [%s] for user \'%s\' Reason: User is inactive', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"]));
152
+            auth(_('LDAP Authentication failed!'), "error");
153
+            return;
154
+        }
155
+        $_SESSION["userid"] = $rowObj["id"];
156
+        $_SESSION["name"] = $rowObj["fullname"];
157
+        $_SESSION["auth_used"] = "ldap";
158
+
159
+        if (isset($_POST["authenticate"])) {
160
+            log_notice( sprintf('Successful LDAP authentication attempt from [%s] for user \'%s\'', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"]) );
161
+            //If a user has just authenticated, redirect him to requested page
162
+            session_write_close();
163
+            $redirect_url = ($_POST["query_string"] ? $_SERVER['SCRIPT_NAME'] . "?" . $_POST["query_string"] : $_SERVER['SCRIPT_NAME']);
164
+            clean_page($redirect_url);
165
+            exit;
166
+        }
167
+    } else {
168
+        //No username and password set, show auth form (again).
169
+        auth();
170
+    }
171
+}
172
+
173
+function SQLAuthenticate() {
174
+    global $db;
175
+    global $password_encryption;
176
+    global $session_key;
177
+
178
+    if (isset($_SESSION["userlogin"]) && isset($_SESSION["userpwd"])) {
179
+        //Username and password are set, lets try to authenticate.
180
+        $session_pass = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($session_key), base64_decode($_SESSION["userpwd"]), MCRYPT_MODE_CBC, md5(md5($session_key))), "\0");
181
+
182
+        $rowObj = $db->queryRow("SELECT id, fullname, password FROM users WHERE username=" . $db->quote($_SESSION["userlogin"], 'text') . " AND active=1");
183
+
184
+        if ($rowObj) {
185
+            if ($password_encryption == 'md5salt') {
186
+                $session_password = mix_salt(extract_salt($rowObj["password"]), $session_pass);
187
+            } else {
188
+                $session_password = md5($session_pass);
189
+            }
190
+
191
+            if ($session_password == $rowObj["password"]) {
192
+
193
+                $_SESSION["userid"] = $rowObj["id"];
194
+                $_SESSION["name"] = $rowObj["fullname"];
195
+                $_SESSION["auth_used"] = "internal";
196
+
197
+                if (isset($_POST["authenticate"])) {
198
+                    log_notice(sprintf('Successful authentication attempt from [%s] for user \'%s\'', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"]));
199
+                    //If a user has just authenticated, redirect him to requested page
200
+                    session_write_close();
201
+                    $redirect_url = ($_POST["query_string"] ? $_SERVER['SCRIPT_NAME'] . "?" . $_POST["query_string"] : $_SERVER['SCRIPT_NAME']);
202
+                    clean_page($redirect_url);
203
+                    exit;
204
+                }
205
+            } else if (isset($_POST['authenticate'])) {
206
+//				auth( _('Authentication failed! - <a href="reset_password.php">(forgot password)</a>'),"error");
207
+                auth(_('Authentication failed!'), "error");
208
+            } else {
209
+                auth();
210
+            }
211
+        } else if (isset($_POST['authenticate'])) {
212
+            log_warn(sprintf('Failed authentication attempt from [%s]', $_SERVER['REMOTE_ADDR']));
213
+
214
+            //Authentication failed, retry.
215
+//			auth( _('Authentication failed! - <a href="reset_password.php">(forgot password)</a>'),"error");
216
+            auth(_('Authentication failed!'), "error");
217
+        } else {
218
+            unset($_SESSION["userpwd"]);
219
+            unset($_SESSION["userlogin"]);
220
+            auth();
221
+        }
222
+    } else {
223
+        //No username and password set, show auth form (again).
224
+        auth();
225
+    }
226
+}
227
+
228
+/** Print the login form
229
+ *
230
+ * @param string $msg Error Message
231
+ * @param string $type Message type [default='success', 'error']
232
+ *
233
+ * @return null
234
+ */
235
+function auth($msg = "", $type = "success") {
236
+    include_once('inc/header.inc.php');
237
+    include('inc/config.inc.php');
238
+
239
+    if ($msg) {
240
+        print "<div class=\"$type\">$msg</div>\n";
241
+    }
242
+    ?>
243
+    <h2><?php echo _('Log in'); ?></h2>
244
+    <form method="post" action="<?php echo htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES); ?>">
245
+        <input type="hidden" name="query_string" value="<?php echo htmlentities($_SERVER["QUERY_STRING"]); ?>">
246
+        <table border="0">
247
+            <tr>
248
+                <td class="n" width="100"><?php echo _('Username'); ?>:</td>
249
+                <td class="n"><input type="text" class="input" name="username" id="username"></td>
250
+            </tr>
251
+            <tr>
252
+                <td class="n"><?php echo _('Password'); ?>:</td>
253
+                <td class="n"><input type="password" class="input" name="password"></td>
254
+            </tr>
255
+            <tr>
256
+                <td class="n"><?php echo _('Language'); ?>:</td>
257
+                <td class="n">
258
+                    <select class="input" name="userlang">
259
+                        <?php
260
+                        // List available languages (sorted alphabetically)
261
+                        include_once('inc/countrycodes.inc.php');
262
+                        $locales = scandir('locale/');
263
+                        foreach ($locales as $locale) {
264
+                            if (strlen($locale) == 5) {
265
+                                $locales_fullname[$locale] = $countrycodes[substr($locale, 0, 2)];
266
+                            }
267
+                        }
268
+                        asort($locales_fullname);
269
+                        foreach ($locales_fullname as $locale => $language) {
270
+                            if ($locale == $iface_lang) {
271
+                                echo _('<option selected value="' . $locale . '">' . $language);
272
+                            } else {
273
+                                echo _('<option value="' . $locale . '">' . $language);
274
+                            }
275
+                        }
276
+                        ?>
277
+                    </select>
278
+                </td>
279
+            </tr>
280
+            <tr>
281
+                <td class="n">&nbsp;</td>
282
+                <td class="n">
283
+                    <input type="submit" name="authenticate" class="button" value=" <?php echo _('Go'); ?> ">
284
+                </td>
285
+            </tr>
286
+        </table>
287
+    </form>
288
+    <script type="text/javascript">
289
+        <!--
290
+      document.getElementById('username').focus();
291
+    //-->
292
+    </script>
293
+    <?php
294
+    include_once('inc/footer.inc.php');
295
+    exit;
296
+}
297
+
298
+/** Logout the user
299
+ *
300
+ * Logout the user and kickback to login form
301
+ *
302
+ * @param string $msg Error Message
303
+ * @param string $type Message type [default='']
304
+ *
305
+ * @return null
306
+ */
307
+function logout($msg = "", $type = "") {
308
+    session_unset();
309
+    session_destroy();
310
+    session_write_close();
311
+    auth($msg, $type);
312
+    exit;
313
+}

+ 44
- 0
poweradmin/poweradmin-2.1.7/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-2014 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 = 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
+}

+ 75
- 0
poweradmin/poweradmin-2.1.7/inc/config-me.inc.php View File

@@ -0,0 +1,75 @@
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-2014 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_file		= '';		# used only for SQLite, provide full path to database file
25
+//$db_debug		= false;	# show all SQL queries
26
+$db_layer		= 'PDO';	# or MDB2
27
+//$db_ssl_ca            = '';
28
+// Security settings
29
+// This should be changed upon install
30
+$session_key = 'p0w3r4dm1n';
31
+$password_encryption = 'md5'; // or md5salt
32
+
33
+// Interface settings
34
+$iface_lang = 'en_EN';
35
+$iface_style = 'example';
36
+$iface_rowamount = 50;
37
+$iface_expire = 1800;
38
+$iface_zonelist_serial = false;
39
+$iface_title = 'Poweradmin';
40
+$iface_add_reverse_record = true;
41
+
42
+// Predefined DNS settings
43
+$dns_hostmaster = '';
44
+$dns_ns1 = '';
45
+$dns_ns2 = '';
46
+$dns_ttl = 86400;
47
+$dns_fancy = false;
48
+$dns_strict_tld_check = false;
49
+$dns_top_level_tld_check = false;     // Don't allow to create top level TLDs
50
+$dns_third_level_check = false;
51
+// Timezone settings
52
+// See <http://www.php.net/manual/en/timezones.php> for help.
53
+//$timezone		= 'UTC';
54
+// Logging settings
55
+// Syslog usage - writes authentication attempts to syslog
56
+// This facility could be used in combination with fail2ban to
57
+// ban IPs with break-in attempts
58
+$syslog_use = false;
59
+$syslog_ident = 'poweradmin';
60
+// On Windows usually only LOG_USER is available
61
+$syslog_facility = LOG_USER;
62
+
63
+// PowerDNSSEC settings
64
+$pdnssec_use = false;
65
+$pdnssec_command = '/usr/bin/pdnssec';
66
+
67
+// LDAP settings
68
+$ldap_use = false;
69
+$ldap_debug = false;
70
+$ldap_uri = 'ldap://domaincontroller.example.com';
71
+$ldap_basedn = 'OU=Users,DC=example,DC=com';
72
+$ldap_binddn = 'GROUP\lookupuser';
73
+$ldap_bindpw = 'some_password';
74
+$ldap_user_attribute = 'sAMAccountName';
75
+$ldap_proto = 3;

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

@@ -0,0 +1,188 @@
1
+<?php
2
+
3
+$countrycodes = 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
+);

+ 228
- 0
poweradmin/poweradmin-2.1.7/inc/database.inc.php View File

@@ -0,0 +1,228 @@
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-2014  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-2014 Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+global $db_layer;
33
+
34
+// if DB abstraction layer is not defined in configuration file then try to
35
+// auto-configure otherwise fail gracefully
36
+
37
+if (!isset($db_layer)) {
38
+    // Use MDB2 by default because PDO support is quite experimental
39
+    if (@include_once 'MDB2.php') {
40
+        $db_layer = 'MDB2';
41
+    } elseif (class_exists('PDO', false)) {
42
+        $db_layer = 'PDO';
43
+        include_once 'PDOLayer.php';
44
+    } else {
45
+        die(error('You have to install MDB2 or PDO library!'));
46
+    }
47
+} else {
48
+    if ($db_layer == 'MDB2') {
49
+        (@include_once 'MDB2.php') or die(error('You have to install MDB2 library!'));
50
+    }
51
+
52
+    if ($db_layer == 'PDO') {
53
+        if (class_exists('PDO', false)) {
54
+            include_once 'PDOLayer.php';
55
+        } else {
56
+            die(error('You have to install PDO library!'));
57
+        }
58
+    }
59
+}
60
+
61
+/** Print database error message
62
+ *
63
+ * @param object $msg Database error object
64
+ */
65
+function dbError($msg) {
66
+    $debug = $msg->getDebugInfo();
67
+
68
+    if (preg_match("/Unknown column 'zone_templ_id'/", $debug)) {
69
+        $debug = ERR_DB_NO_DB_UPDATE;
70
+    }
71
+
72
+    echo "     <div class=\"error\">Error: " . $debug . "</div>\n";
73
+    include_once("footer.inc.php");
74
+    die();
75
+}
76
+
77
+if (isset($db_layer) && $db_layer == 'MDB2') {
78
+    @PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'dbError');
79
+}
80
+
81
+/**  Connect to Database
82
+ *
83
+ * @return object $db Database object
84
+ */
85
+function dbConnect() {
86
+    // XXX: one day all globals will die, I promise
87
+    global $db_type;
88
+    global $db_user;
89
+    global $db_pass;
90
+    global $db_host;
91
+    global $db_port;
92
+    global $db_name;
93
+    global $db_file;
94
+    global $db_layer;
95
+    global $db_debug;
96
+    global $db_ssl_ca;
97
+
98
+    global $sql_regexp;
99
+
100
+    if (!(isset($db_type) && $db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'pgsql' || $db_type == 'sqlite' || $db_type == 'sqlite3' || $db_type == 'oci8')) {
101
+        include_once("header.inc.php");
102
+        error(ERR_DB_NO_DB_TYPE);
103
+        include_once("footer.inc.php");
104
+        exit;
105
+    }
106
+
107
+    if ($db_type != 'sqlite' && $db_type != 'sqlite3' && !(isset($db_user) && $db_user != "")) {
108
+        include_once("header.inc.php");
109
+        error(ERR_DB_NO_DB_USER);
110
+        include_once("footer.inc.php");
111
+        exit;
112
+    }
113
+
114
+    if ($db_type != 'sqlite' && $db_type != 'sqlite3' && !(isset($db_pass) && $db_pass != '')) {
115
+        include_once("header.inc.php");
116
+        error(ERR_DB_NO_DB_PASS);
117
+        include_once("footer.inc.php");
118
+        exit;
119
+    }
120
+
121
+    if ($db_type != 'sqlite' && $db_type != 'sqlite3' && !(isset($db_host) && $db_host != '')) {
122
+        include_once("header.inc.php");
123
+        error(ERR_DB_NO_DB_HOST);
124
+        include_once("footer.inc.php");
125
+        exit;
126
+    }
127
+
128
+    if ($db_type != 'sqlite' && $db_type != 'sqlite3' && !(isset($db_name) && $db_name != '')) {
129
+        include_once("header.inc.php");
130
+        error(ERR_DB_NO_DB_NAME);
131
+        include_once("footer.inc.php");
132
+        exit;
133
+    }
134
+
135
+    if ($db_type != 'sqlite' && $db_type != 'sqlite3' && !(isset($db_port)) || $db_port == '') {
136
+        if ($db_type == "mysql" || $db_type == "mysqli") {
137
+            $db_port = 3306;
138
+        } else if ($db_type == 'oci8') {
139
+            $db_port = 1521;
140
+        } else {
141
+            $db_port = 5432;
142
+        }
143
+    }
144
+
145
+    if (($db_type == 'sqlite' || $db_type == 'sqlite3') && (!(isset($db_file) && $db_file != ''))) {
146
+        include_once("header.inc.php");
147
+        error(ERR_DB_NO_DB_FILE);
148
+        include_once("footer.inc.php");
149
+        exit;
150
+    }
151
+
152
+    if ($db_layer == 'MDB2') {
153
+        if ($db_type == 'sqlite') {
154
+            $dsn = "$db_type:///$db_file";
155
+        } else if ($db_type == 'sqlite3') {
156
+            $dsn = "pdoSqlite:///$db_file";
157
+        } else {
158
+            if ($db_type == 'oci8') {
159
+                $db_name = '?service=' . $db_name;
160
+            }
161
+            $dsn = "$db_type://$db_user:$db_pass@$db_host:$db_port/$db_name";
162
+            if (($db_type == 'mysqli') && (isset($db_ssl_ca))) {
163
+                $dsn .= "?ca=$db_ssl_ca";
164
+            }
165
+        }
166
+    }
167
+
168
+    if ($db_layer == 'PDO') {
169
+        if ($db_type == 'sqlite' || $db_type == 'sqlite3') {
170
+            $dsn = "$db_type:$db_file";
171
+        } else {
172
+            if ($db_type == 'oci8') {
173
+                $db_name = '?service=' . $db_name;
174
+            }
175
+            $dsn = "$db_type:host=$db_host;port=$db_port;dbname=$db_name";
176
+        }
177
+    }
178
+
179
+    if ($db_layer == 'MDB2') {
180
+        $options = array(
181
+            'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL,
182
+        );
183
+
184
+        if (($db_type == 'mysqli') && (isset($db_ssl_ca))) {
185
+            $options['ssl'] = true;
186
+        }
187
+
188
+        $db = MDB2::connect($dsn, $options);
189
+    }
190
+
191
+    if ($db_layer == 'PDO') {
192
+        $db = new PDOLayer($dsn, $db_user, $db_pass);
193
+    }
194
+
195
+    if (isset($db_debug) && $db_debug) {
196
+        $db->setOption('debug', 1);
197
+    }
198
+
199
+    // FIXME - it's strange, but this doesn't work, perhaps bug in MDB2 library
200
+    if (@PEAR::isError($db)) {
201
+        // Error handling should be put.
202
+        error(MYSQL_ERROR_FATAL, $db->getMessage());
203
+    }
204
+
205
+    // Do an ASSOC fetch. Gives us the ability to use ["id"] fields.
206
+    if ($db_layer == 'MDB2') {
207
+        $db->setFetchMode(MDB2_FETCHMODE_ASSOC);
208
+    }
209
+
210
+    /* erase info */
211
+    $dsn = '';
212
+
213
+    // Add support for regular expressions in both MySQL and PostgreSQL
214
+    if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'sqlite' || $db_type == 'sqlite3') {
215
+        $sql_regexp = "REGEXP";
216
+    } elseif ($db_type == "oci8") {
217
+        # TODO: what is regexp syntax in Oracle?
218
+        $sql_regexp = "";
219
+    } elseif ($db_type == "pgsql") {
220
+        $sql_regexp = "~";
221
+    } else {
222
+        include_once("header.inc.php");
223
+        error(ERR_DB_NO_DB_TYPE);
224
+        include_once("footer.inc.php");
225
+        exit;
226
+    }
227
+    return $db;
228
+}

+ 882
- 0
poweradmin/poweradmin-2.1.7/inc/dns.inc.php View File

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

+ 580
- 0
poweradmin/poweradmin-2.1.7/inc/dnssec.inc.php View File

@@ -0,0 +1,580 @@
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-2014  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-2014 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 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
+ * @return mixed[] Array with output from command execution and error code
56
+ */
57
+function call_dnssec($command, $args) {
58
+    global $pdnssec_command;
59
+    $output = '';
60
+    $return_code = -1;
61
+
62
+    if (!is_pdnssec_callable()) {
63
+        return array($output, $return_code);
64
+    }
65
+
66
+    $command = join(' ', array(
67
+        $pdnssec_command,
68
+        $command,
69
+        $args)
70
+    );
71
+
72
+    exec($command, $output, $return_code);
73
+
74
+    return array($output, $return_code);
75
+}
76
+
77
+/** Execute PDNSSEC rectify-zone command for Domain ID
78
+ *
79
+ * If a Domain is dnssec enabled, or uses features as
80
+ * e.g. ALSO-NOTIFY, ALLOW-AXFR-FROM, TSIG-ALLOW-AXFR
81
+ * following has to be executed
82
+ * pdnssec rectify-zone $domain
83
+ *
84
+ * @param int $domain_id Domain ID
85
+ *
86
+ * @return boolean true on success, false on failure or unnecessary
87
+ */
88
+function dnssec_rectify_zone($domain_id) {
89
+    global $db;
90
+    global $pdnssec_command;
91
+
92
+    $output = array();
93
+
94
+    /* if pdnssec_command is set we perform ``pdnssec rectify-zone $domain`` on all zones,
95
+     * as pdns needs the "auth" column for all zones if dnssec is enabled
96
+     *
97
+     * If there is any entry at domainmetadata table for this domain,
98
+     * it is an error if pdnssec_command is not set */
99
+    $query = "SELECT COUNT(id) FROM domainmetadata WHERE domain_id = " . $db->quote($domain_id, 'integer');
100
+    $count = $db->queryOne($query);
101
+
102
+    if (PEAR::isError($count)) {
103
+        error($count->getMessage());
104
+        return false;
105
+    }
106
+
107
+    if (isset($pdnssec_command)) {
108
+        $domain = get_zone_name_from_id($domain_id);
109
+        $command = $pdnssec_command . " rectify-zone " . $domain;
110
+
111
+        if (!is_pdnssec_callable()) {
112
+            return false;
113
+        }
114
+
115
+        exec($command, $output, $return_code);
116
+        if ($return_code != 0) {
117
+            error(ERR_EXEC_PDNSSEC_RECTIFY_ZONE);
118
+            return false;
119
+        }
120
+
121
+        return true;
122
+    } else if ($count >= 1) {
123
+        error(ERR_EXEC_PDNSSEC);
124
+        return false;
125
+    }
126
+
127
+    return false;
128
+}
129
+
130
+/** Execute PDNSSEC secure-zone command for Domain Name
131
+ *
132
+ * @param string $domain_name Domain Name
133
+ *
134
+ * @return boolean true on success, false on failure or unnecessary
135
+ */
136
+function dnssec_secure_zone($domain_name) {
137
+    $call_result = call_dnssec('secure-zone', $domain_name);
138
+    $return_code = $call_result[1];
139
+
140
+    if ($return_code != 0) {
141
+        error(ERR_EXEC_PDNSSEC_SECURE_ZONE);
142
+        return false;
143
+    }
144
+
145
+    return true;
146
+}
147
+
148
+/** Execute PDNSSEC disable-dnssec command for Domain Name
149
+ *
150
+ * @param string $domain_name Domain Name
151
+ *
152
+ * @return boolean true on success, false on failure or unnecessary
153
+ */
154
+function dnssec_unsecure_zone($domain_name) {
155
+    $call_result = call_dnssec('disable-dnssec', $domain_name);
156
+    $return_code = $call_result[1];
157
+
158
+    if ($return_code != 0) {
159
+        error(ERR_EXEC_PDNSSEC_DISABLE_ZONE);
160
+        return false;
161
+    }
162
+
163
+    return true;
164
+}
165
+
166
+/** Check if zone is secured
167
+ *
168
+ * @param string $domain_name Domain Name
169
+ *
170
+ * @return boolean true on success, false on failure
171
+ */
172
+function dnssec_is_zone_secured($domain_name) {
173
+    $call_result = call_dnssec('show-zone', $domain_name);
174
+    $output = $call_result[0];
175
+    $return_code = $call_result[1];
176
+
177
+    if ($return_code != 0) {
178
+        error(ERR_EXEC_PDNSSEC_SHOW_ZONE);
179
+        return false;
180
+    }
181
+
182
+    return (count($output) == 0 ? false : true);
183
+}
184
+
185
+/** Use presigned RRSIGs from storage
186
+ *
187
+ * @param string $domain_name Domain Name
188
+ */
189
+function dnssec_set_nsec3($domain_name) {
190
+    call_dnssec('set-nsec3', $domain_name);
191
+}
192
+
193
+/** Switch back to NSEC
194
+ *
195
+ * @param string $domain_name Domain Name
196
+ */
197
+function dnssec_unset_nsec3($domain_name) {
198
+    call_dnssec('unset-nsec3', $domain_name);
199
+}
200
+
201
+/** Return nsec type
202
+ *
203
+ * @param string $domain_name Domain Name
204
+ *
205
+ * @return string nsec or nsec3
206
+ */
207
+function dnssec_get_nsec_type($domain_name) {
208
+    $call_result = call_dnssec('show-zone', $domain_name);
209
+    $output = $call_result[0];
210
+
211
+    return ($output[0] == 'Zone has NSEC semantics' ? 'nsec' : 'nsec3');
212
+}
213
+
214
+/** Use presigned RRSIGs from storage
215
+ *
216
+ * @param string $domain_name Domain Name
217
+ */
218
+function dnssec_set_presigned($domain_name) {
219
+    call_dnssec('set-presigned', $domain_name);
220
+}
221
+
222
+/** No longer use presigned RRSIGs
223
+ *
224
+ * @param string $domain_name Domain Name
225
+ */
226
+function dnssec_unset_presigned($domain_name) {
227
+    call_dnssec('unset-presigned', $domain_name);
228
+}
229
+
230
+/** Return presigned status
231
+ *
232
+ * @param string $domain_name Domain Name
233
+ *
234
+ * @return boolean true if zone is presigned, otherwise false
235
+ */
236
+function dnssec_get_presigned_status($domain_name) {
237
+    $call_result = call_dnssec('show-zone', $domain_name);
238
+    $output = $call_result[0];
239
+
240
+    return ($output[1] == 'Zone is presigned' ? true : false);
241
+}
242
+
243
+/** Rectify all zones.
244
+ */
245
+function dnssec_rectify_all_zones() {
246
+    call_dnssec('rectify-all-zones', '');
247
+}
248
+
249
+/** Return DS records
250
+ *
251
+ * @param string $domain_name Domain Name
252
+ *
253
+ * @return mixed[] DS records
254
+ */
255
+function dnssec_ds_records($domain_name) {
256
+    $call_result = call_dnssec('show-zone', $domain_name);
257
+    $output = $call_result[0];
258
+    $return_code = $call_result[1];
259
+
260
+    if ($return_code != 0) {
261
+        error(ERR_EXEC_PDNSSEC_SHOW_ZONE);
262
+        return false;
263
+    }
264
+
265
+    $ds_records = array();
266
+    foreach ($output as $line) {
267
+        if (substr($line, 0, 2) == 'DS') {
268
+            $items = explode(' ', $line);
269
+            $ds_line = join(" ", array_slice($items, 2));
270
+            $ds_records[] = $ds_line;
271
+        }
272
+    }
273
+
274
+    return $ds_records;
275
+}
276
+
277
+/** Return algorithm name for given number
278
+ *
279
+ * @param int $algo Algorithm id
280
+ *
281
+ * @return string algorithm name
282
+ */
283
+function dnssec_algorithm_to_name($algo) {
284
+    $name = 'Unallocated/Reserved';
285
+
286
+    switch ($algo) {
287
+        case 0:
288
+            $name = 'Reserved';
289
+            break;
290
+        case 1:
291
+            $name = 'RSAMD5';
292
+            break;
293
+        case 2:
294
+            $name = 'DH';
295
+            break;
296
+        case 3:
297
+            $name = 'DSA';
298
+            break;
299
+        case 4:
300
+            $name = 'ECC';
301
+            break;
302
+        case 5:
303
+            $name = 'RSASHA1';
304
+            break;
305
+        case 6:
306
+            $name = 'DSA-NSEC3-SHA1';
307
+            break;
308
+        case 7:
309
+            $name = 'RSASHA1-NSEC3-SHA1';
310
+            break;
311
+        case 8:
312
+            $name = 'RSASHA256';
313
+            break;
314
+        case 9:
315
+            $name = 'Reserved';
316
+            break;
317
+        case 10:
318
+            $name = 'RSASHA512';
319
+            break;
320
+        case 11:
321
+            $name = 'Reserved';
322
+            break;
323
+        case 12:
324
+            $name = 'ECC-GOST';
325
+            break;
326
+        case 13:
327
+            $name = 'ECDSAP256SHA256';
328
+            break;
329
+        case 14:
330
+            $name = 'ECDSAP384SHA384';
331
+            break;
332
+        case 252:
333
+            $name = 'INDIRECT';
334
+            break;
335
+        case 253:
336
+            $name = 'PRIVATEDNS';
337
+            break;
338
+        case 254:
339
+            $name = 'PRIVATEOID';
340
+            break;
341
+    }
342
+
343
+    return $name;
344
+}
345
+
346
+/** Return algorihtm name for given short name
347
+ *
348
+ * @param string $short_name Short algorithm name
349
+ */
350
+function dnssec_shorthand_to_algorithm_name($short_name) {
351
+    $name = 'Unknown';
352
+
353
+    switch ($short_name) {
354
+        case "rsamd5":
355
+            $name = dnssec_algorithm_to_name(1);
356
+            break;
357
+        case "dh":
358
+            $name = dnssec_algorithm_to_name(2);
359
+            break;
360
+        case "dsa":
361
+            $name = dnssec_algorithm_to_name(3);
362
+            break;
363
+        case "ecc":
364
+            $name = dnssec_algorithm_to_name(4);
365
+            break;
366
+        case "rsasha1":
367
+            $name = dnssec_algorithm_to_name(5);
368
+            break;
369
+        case "rsasha256":
370
+            $name = dnssec_algorithm_to_name(8);
371
+            break;
372
+        case "rsasha512":
373
+            $name = dnssec_algorithm_to_name(10);
374
+            break;
375
+        case "gost":
376
+            $name = dnssec_algorithm_to_name(12);
377
+            break;
378
+        case "ecdsa256":
379
+            $name = dnssec_algorithm_to_name(13);
380
+            break;
381
+        case "ecdsa384":
382
+            $name = dnssec_algorithm_to_name(14);
383
+            break;
384
+        case "ed25519":
385
+            $name = dnssec_algorithm_to_name(250);
386
+            break;
387
+    }
388
+
389
+    return $name;
390
+}
391
+
392
+/** Get name of digest type
393
+ *
394
+ * @param int $type Digest type id
395
+ *
396
+ * @return string digest name
397
+ */
398
+function dnssec_get_digest_name($type) {
399
+    $name = 'Unknown';
400
+
401
+    switch ($type) {
402
+        case 1:
403
+            $name = 'SHA-1';
404
+            break;
405
+        case 2:
406
+            $name = 'SHA-256 ';
407
+            break;
408
+    }
409
+
410
+    return $name;
411
+}
412
+
413
+/** Check if zone is secured
414
+ *
415
+ * @param string $domain_name Domain Name
416
+ *
417
+ * @return string string containing dns key
418
+ */
419
+function dnssec_dnskey_record($domain_name) {
420
+    $call_result = call_dnssec('show-zone', $domain_name);
421
+    $output = $call_result[0];
422
+    $return_code = $call_result[1];
423
+
424
+    if ($return_code != 0) {
425
+        error(ERR_EXEC_PDNSSEC_SHOW_ZONE);
426
+        return false;
427
+    }
428
+
429
+    $dns_key = '';
430
+    foreach ($output as $line) {
431
+        if (substr($line, 0, 3) == 'KSK') {
432
+            $items = explode(' ', $line);
433
+            $dns_key = join(" ", array_slice($items, 3));
434
+        }
435
+    }
436
+
437
+    return $dns_key;
438
+}
439
+
440
+/** Activate zone key
441
+ *
442
+ * @param string $domain_name Domain Name
443
+ *
444
+ * @return boolean true on success, false on failure
445
+ */
446
+function dnssec_activate_zone_key($domain_name, $key_id) {
447
+    $call_result = call_dnssec('activate-zone-key', join(" ", array($domain_name, $key_id)));
448
+    $return_code = $call_result[1];
449
+
450
+    if ($return_code != 0) {
451
+        error(ERR_EXEC_PDNSSEC_SHOW_ZONE);
452
+        return false;
453
+    }
454
+
455
+    return true;
456
+}
457
+
458
+/** Deactivate zone key
459
+ *
460
+ * @param string $domain_name Domain Name
461
+ *
462
+ * @return boolean true on success, false on failure
463
+ */
464
+function dnssec_deactivate_zone_key($domain_name, $key_id) {
465
+    $call_result = call_dnssec('deactivate-zone-key', join(" ", array($domain_name, $key_id)));
466
+    $return_code = $call_result[1];
467
+
468
+    if ($return_code != 0) {
469
+        error(ERR_EXEC_PDNSSEC_SHOW_ZONE);
470
+        return false;
471
+    }
472
+
473
+    return true;
474
+}
475
+
476
+/** Get list of existing DNSSEC keys
477
+ *
478
+ * @param string $domain_name Domain Name
479
+ *
480
+ * @return mixed[] array with DNSSEC keys
481
+ */
482
+function dnssec_get_keys($domain_name) {
483
+    $call_result = call_dnssec('show-zone', $domain_name);
484
+    $output = $call_result[0];
485
+    $return_code = $call_result[1];
486
+
487
+    if ($return_code != 0) {
488
+        error(ERR_EXEC_PDNSSEC_SHOW_ZONE);
489
+        return false;
490
+    }
491
+
492
+    $keys = array();
493
+    foreach ($output as $line) {
494
+        if (substr($line, 0, 2) == 'ID') {
495
+            $items = explode(' ', $line);
496
+            $bits_array = explode("\t", $items[12]);
497
+            $keys[] = array($items[2], substr($items[3], 1, -2), substr($items[6], 0, -1), substr($items[9], 0, -1), $bits_array[0], $items[13]);
498
+        }
499
+    }
500
+
501
+    return $keys;
502
+}
503
+
504
+/** Create new DNSSEC key
505
+ *
506
+ * @param string $domain_name Domain Name
507
+ * @param string $key_type Key type
508
+ * @param string $bits Bits in length
509
+ * @param string $algorithm Algorithm
510
+ *
511
+ * @return boolean true on success, false on failure
512
+ */
513
+function dnssec_add_zone_key($domain_name, $key_type, $bits, $algorithm) {
514
+    $call_result = call_dnssec('add-zone-key', join(" ", array($domain_name, $key_type, $bits, $algorithm)));
515
+    $return_code = $call_result[1];
516
+
517
+    if ($return_code != 0) {
518
+        error(ERR_EXEC_PDNSSEC_ADD_ZONE_KEY);
519
+        return false;
520
+    }
521
+
522
+    return true;
523
+}
524
+
525
+/** Remove DNSSEC key
526
+ *
527
+ * @param string $domain_name Domain Name
528
+ * @param int $key_id Key ID
529
+ *
530
+ * @return boolean true on success, false on failure
531
+ */
532
+function dnssec_remove_zone_key($domain_name, $key_id) {
533
+    $call_result = call_dnssec('remove-zone-key', join(" ", array($domain_name, $key_id)));
534
+    $return_code = $call_result[1];
535
+
536
+    if ($return_code != 0) {
537
+        error(ERR_EXEC_PDNSSEC_ADD_ZONE_KEY);
538
+        return false;
539
+    }
540
+
541
+    return true;
542
+}
543
+
544
+/** Check if given key exists
545
+ *
546
+ * @param string $domain_name Domain Name
547
+ * @param int $key_id Key ID
548
+ *
549
+ * @return boolean true if exists, otherwise false
550
+ */
551
+function dnssec_zone_key_exists($domain_name, $key_id) {
552
+    $keys = dnssec_get_keys($domain_name);
553
+
554
+    foreach ($keys as $key) {
555
+        if ($key[0] == $key_id) {
556
+            return true;
557
+        }
558
+    }
559
+
560
+    return false;
561
+}
562
+
563
+/** Return requested key
564
+ *
565
+ * @param string $domain_name Domain Name
566
+ * @param int $key_id Key ID
567
+ *
568
+ * @return mixed[] true if exists, otherwise false
569
+ */
570
+function dnssec_get_zone_key($domain_name, $key_id) {
571
+    $keys = dnssec_get_keys($domain_name);
572
+
573
+    foreach ($keys as $key) {
574
+        if ($key[0] == $key_id) {
575
+            return $key;
576
+        }
577
+    }
578
+
579
+    return array();
580
+}

+ 160
- 0
poweradmin/poweradmin-2.1.7/inc/error.inc.php View File

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

+ 35
- 0
poweradmin/poweradmin-2.1.7/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-2014  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-2014 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
+

+ 69
- 0
poweradmin/poweradmin-2.1.7/inc/footer.inc.php View File

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

+ 108
- 0
poweradmin/poweradmin-2.1.7/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-2014  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-2014 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
+    verify_permission('search') ? $perm_search = "1" : $perm_search = "0";
62
+    verify_permission('zone_content_view_own') ? $perm_view_zone_own = "1" : $perm_view_zone_own = "0";
63
+    verify_permission('zone_content_view_others') ? $perm_view_zone_other = "1" : $perm_view_zone_other = "0";
64
+    verify_permission('supermaster_view') ? $perm_supermaster_view = "1" : $perm_supermaster_view = "0";
65
+    verify_permission('zone_master_add') ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0";
66
+    verify_permission('zone_slave_add') ? $perm_zone_slave_add = "1" : $perm_zone_slave_add = "0";
67
+    verify_permission('supermaster_add') ? $perm_supermaster_add = "1" : $perm_supermaster_add = "0";
68
+    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";

+ 149
- 0
poweradmin/poweradmin-2.1.7/inc/helper.js View File

@@ -0,0 +1,149 @@
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-2014  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 = new Array();
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
+            domains = new Array(),
127
+            allEmpty = true,
128
+            domains = getDomainsElements();
129
+
130
+    if (domains.length == 1) {
131
+        if ((domains[0].value.length == 0 || domains[0].value == null || domains[0].value == "")) {
132
+            alert('Zone name cannot be empty');
133
+            return false;
134
+        }
135
+    } else {
136
+        for (key in domains) {
137
+            if ((domains[key].value.length != 0)) {
138
+                allEmpty = false;
139
+            }
140
+        }
141
+
142
+        if (true === allEmpty) {
143
+            alert('Please fill in at least one Zone name');
144
+            return false;
145
+        }
146
+    }
147
+
148
+    add_zone_master.submit();
149
+}

+ 50
- 0
poweradmin/poweradmin-2.1.7/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-2014  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-2014 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.7/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-2014  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-2014 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
+}

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


+ 653
- 0
poweradmin/poweradmin-2.1.7/inc/templates.inc.php View File

@@ -0,0 +1,653 @@
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-2014  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-2014 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 (!(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 (!(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 (!(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 (!(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
+            if ($type == "SPF") {
312
+                $content = $db->quote(stripslashes('\"' . $content . '\"'), 'text');
313
+            } else {
314
+                $content = $db->quote($content, 'text');
315
+            }
316
+            $query = "INSERT INTO zone_templ_records (zone_templ_id, name, type, content, ttl, prio) VALUES ("
317
+                    . $db->quote($zone_templ_id, 'integer') . ","
318
+                    . $db->quote($name, 'text') . ","
319
+                    . $db->quote($type, 'text') . ","
320
+                    . $content . ","
321
+                    . $db->quote($ttl, 'integer') . ","
322
+                    . $db->quote($prio, 'integer') . ")";
323
+            $result = $db->query($query);
324
+            if (PEAR::isError($result)) {
325
+                error($result->getMessage());
326
+                return false;
327
+            }
328
+            return true;
329
+        } else {
330
+            error(ERR_DNS_HOSTNAME);
331
+            return false;
332
+        }
333
+    }
334
+}
335
+
336
+/** Modify zone template reocrd
337
+ *
338
+ * Edit a record for a zone template.
339
+ * This function validates it if correct it inserts it into the database.
340
+ *
341
+ * @param mixed[] $record zone record array
342
+ *
343
+ * @return boolean true on success, false otherwise
344
+ */
345
+function edit_zone_templ_record($record) {
346
+    global $db;
347
+
348
+    if (!(verify_permission('zone_master_add'))) {
349
+        error(ERR_PERM_EDIT_RECORD);
350
+        return false;
351
+    } else {
352
+        if ("" != $record['name']) {
353
+            if ($record['type'] == "SPF") {
354
+                $content = $db->quote(stripslashes('\"' . $record['content'] . '\"'), 'text');
355
+            } else {
356
+                $content = $db->quote($record['content'], 'text');
357
+            }
358
+            $query = "UPDATE zone_templ_records
359
+                                SET name=" . $db->quote($record['name'], 'text') . ",
360
+                                type=" . $db->quote($record['type'], 'text') . ",
361
+                                content=" . $content . ",
362
+                                ttl=" . $db->quote($record['ttl'], 'integer') . ",
363
+                                prio=" . $db->quote(isset($record['prio']) ? $record['prio'] : 0, 'integer') . "
364
+                                WHERE id=" . $db->quote($record['rid'], 'integer');
365
+            $result = $db->query($query);
366
+            if (PEAR::isError($result)) {
367
+                error($result->getMessage());
368
+                return false;
369
+            }
370
+            return true;
371
+        } else {
372
+            error(ERR_DNS_HOSTNAME);
373
+            return false;
374
+        }
375
+    }
376
+}
377
+
378
+/** Delete a record for a zone template by a given id
379
+ *
380
+ * @param int $rid template record id
381
+ *
382
+ * @return boolean true on success, false otherwise
383
+ */
384
+function delete_zone_templ_record($rid) {
385
+    global $db;
386
+
387
+    if (!(verify_permission('zone_master_add'))) {
388
+        error(ERR_PERM_DEL_RECORD);
389
+        return false;
390
+    } else {
391
+        $query = "DELETE FROM zone_templ_records WHERE id = " . $db->quote($rid, 'integer');
392
+        $result = $db->query($query);
393
+        if (PEAR::isError($result)) {
394
+            error($result->getMessage());
395
+            return false;
396
+        }
397
+        return true;
398
+    }
399
+}
400
+
401
+/** Check if the session user is the owner for the zone template
402
+ *
403
+ * @param int $zone_templ_id zone template id
404
+ * @param int $userid user id
405
+ *
406
+ * @return boolean true on success, false otherwise
407
+ */
408
+function get_zone_templ_is_owner($zone_templ_id, $userid) {
409
+    global $db;
410
+
411
+    $query = "SELECT owner FROM zone_templ WHERE id = " . $db->quote($zone_templ_id, 'integer');
412
+    $result = $db->queryOne($query);
413
+    if (PEAR::isError($result)) {
414
+        error($result->getMessage());
415
+        return false;
416
+    }
417
+
418
+    if ($result == $userid) {
419
+        return true;
420
+    } else {
421
+        return false;
422
+    }
423
+}
424
+
425
+/** Add a zone template from zone / another template
426
+ *
427
+ * @param string $template_name template name
428
+ * @param string $description description
429
+ * @param int $userid user id
430
+ * @param mixed[] $records array of zone records
431
+ * @param string $domain domain to substitute with '[ZONE]' (optional) [default=null]
432
+ *
433
+ * @return boolean true on success, false otherwise
434
+ */
435
+function add_zone_templ_save_as($template_name, $description, $userid, $records, $domain = null) {
436
+    global $db;
437
+    global $db_layer;
438
+    global $db_type;
439
+
440
+    if (!(verify_permission('zone_master_add'))) {
441
+        error(ERR_PERM_ADD_ZONE_TEMPL);
442
+        return false;
443
+    } else {
444
+        $result = $db->beginTransaction();
445
+
446
+        $query = "INSERT INTO zone_templ (name, descr, owner)
447
+			VALUES ("
448
+                . $db->quote($template_name, 'text') . ", "
449
+                . $db->quote($description, 'text') . ", "
450
+                . $db->quote($userid, 'integer') . ")";
451
+
452
+        $result = $db->exec($query);
453
+
454
+        if ($db_layer == 'MDB2' && ($db_type == 'mysql' || $db_type == 'pgsql')) {
455
+            $zone_templ_id = $db->lastInsertId('zone_templ', 'id');
456
+        } else if ($db_layer == 'PDO' && $db_type == 'pgsql') {
457
+            $zone_templ_id = $db->lastInsertId('zone_templ_id_seq');
458
+        } else {
459
+            $zone_templ_id = $db->lastInsertId();
460
+        }
461
+
462
+        $owner = get_zone_templ_is_owner($zone_templ_id, $_SESSION['userid']);
463
+
464
+        foreach ($records as $record) {
465
+            if ($record['type'] == "SPF") {
466
+                $content = $db->quote(stripslashes('\"' . $record['content'] . '\"'), 'text');
467
+            } else {
468
+                $content = $db->quote($record['content'], 'text');
469
+            }
470
+
471
+            $name = $domain ? preg_replace('/' . $domain . '/', '[ZONE]', $record['name']) : $record['name'];
472
+            $content = $domain ? preg_replace('/' . $domain . '/', '[ZONE]', $content) : $content;
473
+
474
+            $query2 = "INSERT INTO zone_templ_records (zone_templ_id, name, type, content, ttl, prio) VALUES ("
475
+                    . $db->quote($zone_templ_id, 'integer') . ","
476
+                    . $db->quote($name, 'text') . ","
477
+                    . $db->quote($record['type'], 'text') . ","
478
+                    . $content . ","
479
+                    . $db->quote($record['ttl'], 'integer') . ","
480
+                    . $db->quote(isset($record['prio']) ? $record['prio'] : 0, 'integer') . ")";
481
+            $result = $db->exec($query2);
482
+        }
483
+
484
+        if (PEAR::isError($result)) {
485
+            $result = $db->rollback();
486
+        } else {
487
+            $result = $db->commit();
488
+        }
489
+    }
490
+    return true;
491
+}
492
+
493
+/** Get list of all zones using template
494
+ *
495
+ * @param int $zone_templ_id zone template id
496
+ * @param int $userid user id
497
+ *
498
+ * @return mixed[] array of zones [id,name,type,count_records]
499
+ */
500
+function get_list_zone_use_templ($zone_templ_id, $userid) {
501
+    global $db;
502
+
503
+    if (verify_permission('zone_content_edit_others')) {
504
+        $perm_edit = "all";
505
+    } elseif (verify_permission('zone_content_edit_own')) {
506
+        $perm_edit = "own";
507
+    } else {
508
+        $perm_edit = "none";
509
+    }
510
+
511
+    $sql_add = '';
512
+    if ($perm_edit != "all") {
513
+        $sql_add = " AND zones.domain_id = domains.id
514
+				AND zones.owner = " . $db->quote($userid, 'integer');
515
+    }
516
+
517
+    $query = "SELECT domains.id,
518
+			domains.name,
519
+			domains.type,
520
+			Record_Count.count_records
521
+			FROM domains
522
+			LEFT JOIN zones ON domains.id=zones.domain_id
523
+			LEFT JOIN (
524
+				SELECT COUNT(domain_id) AS count_records, domain_id FROM records GROUP BY domain_id
525
+			) Record_Count ON Record_Count.domain_id=domains.id
526
+			WHERE 1=1" . $sql_add . "
527
+                        AND zone_templ_id = " . $db->quote($zone_templ_id, 'integer') . "
528
+			GROUP BY domains.name, domains.id, domains.type, Record_Count.count_records";
529
+
530
+    $result = $db->query($query);
531
+    if (PEAR::isError($result)) {
532
+        error("Not all tables available in database, please make sure all upgrade/install proceedures were followed");
533
+        return false;
534
+    }
535
+
536
+    $zone_list = array();
537
+    while ($zone = $result->fetchRow()) {
538
+        $zone_list[] = array(
539
+            "id" => $zone['id'],
540
+            "name" => $zone['name'],
541
+            "type" => $zone['type'],
542
+            "count_records" => $zone['count_records']
543
+        );
544
+    }
545
+    return $zone_list;
546
+}
547
+
548
+/** Modify zone template
549
+ *
550
+ * @param mixed[] $details array of new zone template details
551
+ * @param int $zone_templ_id zone template id
552
+ *
553
+ * @return boolean true on success, false otherwise
554
+ */
555
+function edit_zone_templ($details, $zone_templ_id) {
556
+    global $db;
557
+    $zone_name_exists = zone_templ_name_exists($details['templ_name'], $zone_templ_id);
558
+    if (!(verify_permission('zone_master_add'))) {
559
+        error(ERR_PERM_ADD_ZONE_TEMPL);
560
+        return false;
561
+    } elseif ($zone_name_exists != '0') {
562
+        error(ERR_ZONE_TEMPL_EXIST);
563
+        return false;
564
+    } else {
565
+        $query = "UPDATE zone_templ
566
+			SET name=" . $db->quote($details['templ_name'], 'text') . ",
567
+			descr=" . $db->quote($details['templ_descr'], 'text') . "
568
+			WHERE id=" . $db->quote($zone_templ_id, 'integer');
569
+
570
+        $result = $db->query($query);
571
+        if (PEAR::isError($result)) {
572
+            error($result->getMessage());
573
+            return false;
574
+        }
575
+
576
+        return true;
577
+    }
578
+}
579
+
580
+/** Check if zone template name exists
581
+ *
582
+ * @param string $zone_templ_name zone template name
583
+ * @param int $zone_templ_id zone template id (optional) [default=null]
584
+ *
585
+ * @return int number of matching templates
586
+ */
587
+function zone_templ_name_exists($zone_templ_name, $zone_templ_id = null) {
588
+    global $db;
589
+
590
+    $sql_add = '';
591
+    if ($zone_templ_id) {
592
+        $sql_add = " AND id != " . $db->quote($zone_templ_id, 'integer');
593
+    }
594
+
595
+    $query = "SELECT COUNT(id) FROM zone_templ WHERE name = " . $db->quote($zone_templ_name, 'text') . "" . $sql_add;
596
+    $count = $db->queryOne($query);
597
+    if (PEAR::isError($count)) {
598
+        error($count->getMessage());
599
+        return false;
600
+    }
601
+
602
+    return $count;
603
+}
604
+
605
+/** Parse string and substitute domain and serial
606
+ *
607
+ * @param string $val string to parse containing tokens '[ZONE]' and '[SERIAL]'
608
+ * @param string $domain domain to subsitute for '[ZONE]'
609
+ *
610
+ * @return string interpolated/parsed string
611
+ */
612
+function parse_template_value($val, $domain) {
613
+    $serial = date("Ymd");
614
+    $serial .= "00";
615
+
616
+    $val = str_replace('[ZONE]', $domain, $val);
617
+    $val = str_replace('[SERIAL]', $serial, $val);
618
+    return $val;
619
+}
620
+
621
+/** Add relation between zone record and template
622
+ *
623
+ * @param type $db DB link
624
+ * @param type $domain_id Domain id
625
+ * @param type $record_id Record id
626
+ * @param type $zone_templ_id Zone template id
627
+ */
628
+function add_record_relation_to_templ($db, $domain_id, $record_id, $zone_templ_id) {
629
+    $query = "INSERT INTO records_zone_templ (domain_id, record_id, zone_templ_id) VALUES ("
630
+            . $db->quote($domain_id, 'integer') . ","
631
+            . $db->quote($record_id, 'integer') . ","
632
+            . $db->quote($zone_templ_id, 'integer') . ")";
633
+    $db->query($query);
634
+}
635
+
636
+/** Check if given relation exists
637
+ *
638
+ * @param type $db
639
+ * @param type $domain_id
640
+ * @param type $record_id
641
+ * @param type $zone_templ_id
642
+ * @return boolean true on success, false on failure
643
+ */
644
+function record_relation_to_templ_exists($db, $domain_id, $record_id, $zone_templ_id) {
645
+    $query = "SELECT COUNT(*) FROM records_zone_templ WHERE domain_id = " . $db->quote($domain_id, 'integer') .
646
+            " AND record_id = " . $db->quote($record_id, 'integer') . " AND zone_templ_id = " . $db->quote($zone_templ_id, 'integer');
647
+    $count = $db->queryOne($query);
648
+    if ($count == 0) {
649
+        return false;
650
+    }
651
+
652
+    return true;
653
+}

+ 626
- 0
poweradmin/poweradmin-2.1.7/inc/toolkit.inc.php View File

@@ -0,0 +1,626 @@
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-2014  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-2014 Poweradmin Development Team
29
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
30
+ */
31
+// Fix for Strict Standards: Non-static method PEAR::setErrorHandling() should not be called statically
32
+// TODO: remove after PEAR::MDB2 replacement with PDO
33
+ini_set('error_reporting', E_ALL & ~ (E_NOTICE | E_STRICT));
34
+
35
+// TODO: display elapsed time and memory consumption,
36
+// used to check improvements in refactored version
37
+$display_stats = false;
38
+if ($display_stats)
39
+    include('inc/benchmark.php');
40
+
41
+ob_start();
42
+
43
+require_once("error.inc.php");
44
+
45
+if (!function_exists('session_start'))
46
+    die(error('You have to install PHP session extension!'));
47
+if (!function_exists('_'))
48
+    die(error('You have to install PHP gettext extension!'));
49
+if (!function_exists('mcrypt_encrypt'))
50
+    die(error('You have to install PHP mcrypt extension!'));
51
+
52
+session_start();
53
+
54
+include_once("config-me.inc.php");
55
+
56
+if (!@include_once("config.inc.php")) {
57
+    error(_('You have to create a config.inc.php!'));
58
+}
59
+
60
+/* * ***********
61
+ * Constants *
62
+ * *********** */
63
+
64
+if (isset($_GET["start"])) {
65
+    define('ROWSTART', (($_GET["start"] - 1) * $iface_rowamount));
66
+} else {
67
+    /** Starting row
68
+     */
69
+    define('ROWSTART', 0);
70
+}
71
+
72
+if (isset($_GET["letter"])) {
73
+    define('LETTERSTART', $_GET["letter"]);
74
+    $_SESSION["letter"] = $_GET["letter"];
75
+} elseif (isset($_SESSION["letter"])) {
76
+    define('LETTERSTART', $_SESSION["letter"]);
77
+} else {
78
+    /** Starting letter
79
+     */
80
+    define('LETTERSTART', "a");
81
+}
82
+
83
+if (isset($_GET["zone_sort_by"]) && preg_match("/^[a-z_]+$/", $_GET["zone_sort_by"])) {
84
+    define('ZONE_SORT_BY', $_GET["zone_sort_by"]);
85
+    $_SESSION["zone_sort_by"] = $_GET["zone_sort_by"];
86
+} elseif (isset($_POST["zone_sort_by"]) && preg_match("/^[a-z_]+$/", $_POST["zone_sort_by"])) {
87
+    define('ZONE_SORT_BY', $_POST["zone_sort_by"]);
88
+    $_SESSION["zone_sort_by"] = $_POST["zone_sort_by"];
89
+} elseif (isset($_SESSION["zone_sort_by"])) {
90
+    define('ZONE_SORT_BY', $_SESSION["zone_sort_by"]);
91
+} else {
92
+    /** Field to sort zone by
93
+     */
94
+    define('ZONE_SORT_BY', "name");
95
+}
96
+
97
+if (isset($_SESSION["userlang"])) {
98
+    $iface_lang = $_SESSION["userlang"];
99
+}
100
+
101
+if (isset($_GET["record_sort_by"]) && preg_match("/^[a-z_]+$/", $_GET["record_sort_by"])) {
102
+    define('RECORD_SORT_BY', $_GET["record_sort_by"]);
103
+    $_SESSION["record_sort_by"] = $_GET["record_sort_by"];
104
+} elseif (isset($_POST["record_sort_by"]) && preg_match("/^[a-z_]+$/", $_POST["record_sort_by"])) {
105
+    define('RECORD_SORT_BY', $_POST["record_sort_by"]);
106
+    $_SESSION["record_sort_by"] = $_POST["record_sort_by"];
107
+} elseif (isset($_SESSION["record_sort_by"])) {
108
+    define('RECORD_SORT_BY', $_SESSION["record_sort_by"]);
109
+} else {
110
+    /** Record to sort zone by
111
+     */
112
+    define('RECORD_SORT_BY', "name");
113
+}
114
+
115
+$valid_tlds = array("ac", "academy", "actor", "ad", "ae", "aero", "af", "ag",
116
+    "agency", "ai", "al", "am", "an", "ao", "aq", "ar", "arpa", "as", "asia",
117
+    "at", "au", "aw", "ax", "az", "ba", "bar", "bargains", "bb", "bd", "be",
118
+    "berlin", "best", "bf", "bg", "bh", "bi", "bid", "bike", "biz", "bj", "blue",
119
+    "bm", "bn", "bo", "boutique", "br", "bs", "bt", "build", "builders", "buzz",
120
+    "bv", "bw", "by", "bz", "ca", "cab", "camera", "camp", "cards", "careers",
121
+    "cat", "catering", "cc", "cd", "center", "ceo", "cf", "cg", "ch", "cheap",
122
+    "christmas", "ci", "ck", "cl", "cleaning", "clothing", "club", "cm", "cn",
123
+    "co", "codes", "coffee", "com", "community", "company", "computer", "condos",
124
+    "construction", "contractors", "cool", "coop", "cr", "cruises", "cu", "cv",
125
+    "cw", "cx", "cy", "cz", "dance", "dating", "de", "democrat", "diamonds",
126
+    "directory", "dj", "dk", "dm", "do", "domains", "dz", "ec", "edu",
127
+    "education", "ee", "eg", "email", "enterprises", "equipment", "er", "es",
128
+    "estate", "et", "eu", "events", "expert", "exposed", "farm", "fi", "fish",
129
+    "fj", "fk", "flights", "florist", "fm", "fo", "foundation", "fr", "futbol",
130
+    "ga", "gallery", "gb", "gd", "ge", "gf", "gg", "gh", "gi", "gift", "gl",
131
+    "glass", "gm", "gn", "gov", "gp", "gq", "gr", "graphics", "gs", "gt", "gu",
132
+    "guitars", "guru", "gw", "gy", "hk", "hm", "hn", "holdings", "holiday",
133
+    "house", "hr", "ht", "hu", "id", "ie", "il", "im", "immobilien", "in",
134
+    "industries", "info", "institute", "int", "international", "io", "iq", "ir",
135
+    "is", "it", "je", "jm", "jo", "jobs", "jp", "kaufen", "ke", "kg", "kh", "ki",
136
+    "kim", "kitchen", "kiwi", "km", "kn", "koeln", "kp", "kr", "kred", "kw", "ky",
137
+    "kz", "la", "land", "lb", "lc", "li", "lighting", "limo", "link", "lk", "lr",
138
+    "ls", "lt", "lu", "luxury", "lv", "ly", "ma", "maison", "management", "mango",
139
+    "marketing", "mc", "md", "me", "menu", "mg", "mh", "mil", "mk", "ml", "mm",
140
+    "mn", "mo", "mobi", "moda", "monash", "mp", "mq", "mr", "ms", "mt", "mu",
141
+    "museum", "mv", "mw", "mx", "my", "mz", "na", "nagoya", "name", "nc", "ne",
142
+    "net", "neustar", "nf", "ng", "ni", "ninja", "nl", "no", "np", "nr", "nu",
143
+    "nz", "okinawa", "om", "onl", "org", "pa", "partners", "parts", "pe", "pf",
144
+    "pg", "ph", "photo", "photography", "photos", "pics", "pink", "pk", "pl",
145
+    "plumbing", "pm", "pn", "post", "pr", "pro", "productions", "properties",
146
+    "ps", "pt", "pub", "pw", "py", "qa", "qpon", "re", "recipes", "red",
147
+    "rentals", "repair", "report", "reviews", "rich", "ro", "rs", "ru", "ruhr",
148
+    "rw", "sa", "sb", "sc", "sd", "se", "sexy", "sg", "sh", "shiksha", "shoes",
149
+    "si", "singles", "sj", "sk", "sl", "sm", "sn", "so", "social", "solar",
150
+    "solutions", "sr", "st", "su", "supplies", "supply", "support", "sv", "sx",
151
+    "sy", "systems", "sz", "tattoo", "tc", "td", "technology", "tel", "tf", "tg",
152
+    "th", "tienda", "tips", "tj", "tk", "tl", "tm", "tn", "to", "today", "tokyo",
153
+    "tools", "tp", "tr", "training", "travel", "tt", "tv", "tw", "tz", "ua", "ug",
154
+    "uk", "uno", "us", "uy", "uz", "va", "vacations", "vc", "ve", "ventures",
155
+    "vg", "vi", "viajes", "villas", "vision", "vn", "vote", "voting", "voto",
156
+    "voyage", "vu", "wang", "watch", "wed", "wf", "wien", "wiki", "works", "ws",
157
+    "xn--3bst00m", "xn--3ds443g", "xn--3e0b707e", "xn--45brj9c", "xn--55qw42g",
158
+    "xn--55qx5d", "xn--6frz82g", "xn--6qq986b3xl", "xn--80ao21a", "xn--80asehdb",
159
+    "xn--80aswg", "xn--90a3ac", "xn--c1avg", "xn--cg4bki",
160
+    "xn--clchc0ea0b2g2a9gcd", "xn--d1acj3b", "xn--fiq228c5hs", "xn--fiq64b",
161
+    "xn--fiqs8s", "xn--fiqz9s", "xn--fpcrj9c3d", "xn--fzc2c9e2c", "xn--gecrj9c",
162
+    "xn--h2brj9c", "xn--i1b6b1a6a2e", "xn--io0a7i", "xn--j1amh", "xn--j6w193g",
163
+    "xn--kprw13d", "xn--kpry57d", "xn--l1acc", "xn--lgbbat1ad8j", "xn--mgb9awbf",
164
+    "xn--mgba3a4f16a", "xn--mgbaam7a8h", "xn--mgbab2bd", "xn--mgbayh7gpa",
165
+    "xn--mgbbh1a71e", "xn--mgbc0a9azcg", "xn--mgberp4a5d4ar", "xn--mgbx4cd0ab",
166
+    "xn--ngbc5azd", "xn--nqv7f", "xn--nqv7fs00ema", "xn--o3cw4h", "xn--ogbpf8fl",
167
+    "xn--p1ai", "xn--pgbs0dh", "xn--q9jyb4c", "xn--s9brj9c", "xn--unup4y",
168
+    "xn--wgbh1c", "xn--wgbl6a", "xn--xkc2al3hye2a", "xn--xkc2dl3a5ee0h",
169
+    "xn--yfro4i67o", "xn--ygbi2ammx", "xn--zfr164b", "xxx", "xyz", "ye", "yt",
170
+    "za", "zm", "zone", "zw");
171
+
172
+// Special TLDs for testing and documentation purposes
173
+// http://tools.ietf.org/html/rfc2606#section-2
174
+array_push($valid_tlds, 'test', 'example', 'invalid', 'localhost');
175
+
176
+/* Database connection */
177
+require_once("database.inc.php");
178
+// Generates $db variable to access database.
179
+// Array of the available zone types
180
+$server_types = array("MASTER", "SLAVE", "NATIVE");
181
+
182
+// $rtypes - array of possible record types
183
+$rtypes = array(
184
+    'A',
185
+    'AAAA',
186
+    'AFSDB',
187
+    'CERT',
188
+    'CNAME',
189
+    'DHCID',
190
+    'DLV',
191
+    'DNSKEY',
192
+    'DS',
193
+    'EUI48',
194
+    'EUI64',
195
+    'HINFO',
196
+    'IPSECKEY',
197
+    'KEY',
198
+    'KX',
199
+    'LOC',
200
+    'MINFO',
201
+    'MR',
202
+    'MX',
203
+    'NAPTR',
204
+    'NS',
205
+    'NSEC',
206
+    'NSEC3',
207
+    'NSEC3PARAM',
208
+    'OPT',
209
+    'PTR',
210
+    'RKEY',
211
+    'RP',
212
+    'RRSIG',
213
+    'SOA',
214
+    'SPF',
215
+    'SRV',
216
+    'SSHFP',
217
+    'TLSA',
218
+    'TSIG',
219
+    'TXT',
220
+    'WKS',
221
+);
222
+
223
+// If fancy records is enabled, extend this field.
224
+if ($dns_fancy) {
225
+    $rtypes[] = 'URL';
226
+    $rtypes[] = 'MBOXFW';
227
+    $rtypes[] = 'CURL';
228
+}
229
+
230
+
231
+/* * ***********
232
+ * Includes  *
233
+ * *********** */
234
+
235
+require_once("i18n.inc.php");
236
+require_once("auth.inc.php");
237
+require_once("users.inc.php");
238
+require_once("dns.inc.php");
239
+require_once("record.inc.php");
240
+require_once("dnssec.inc.php");
241
+require_once("templates.inc.php");
242
+
243
+$db = dbConnect();
244
+doAuthenticate();
245
+
246
+
247
+/* * ***********
248
+ * Functions *
249
+ * *********** */
250
+
251
+/** Print paging menu
252
+ *
253
+ * Display the page option: [ < ][ 1 ] .. [ 8 ][ 9 ][ 10 ][ 11 ][ 12 ][ 13 ][ 14 ][ 15 ][ 16 ] .. [ 34 ][ > ]
254
+ *
255
+ * @param int $amount Total number of items
256
+ * @param int $rowamount Per page number of items
257
+ * @param int $id Page specific ID (Zone ID, Template ID, etc)
258
+ *
259
+ * @return null
260
+ */
261
+function show_pages($amount, $rowamount, $id = '') {
262
+    if ($amount > $rowamount) {
263
+        $num = 8;
264
+        $poutput = '';
265
+        $lastpage = ceil($amount / $rowamount);
266
+        $startpage = 1;
267
+
268
+        if (!isset($_GET["start"]))
269
+            $_GET["start"] = 1;
270
+        $start = $_GET["start"];
271
+
272
+        if ($lastpage > $num & $start > ($num / 2)) {
273
+            $startpage = ($start - ($num / 2));
274
+        }
275
+
276
+        echo _('Show page') . ":<br>";
277
+
278
+        if ($lastpage > $num & $start > 1) {
279
+            $poutput .= '<a href=" ' . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES);
280
+            $poutput .= '?start=' . ($start - 1);
281
+            if ($id != '')
282
+                $poutput .= '&id=' . $id;
283
+            $poutput .= '">';
284
+            $poutput .= '[ < ]';
285
+            $poutput .= '</a>';
286
+        }
287
+        if ($start != 1) {
288
+            $poutput .= '<a href=" ' . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES);
289
+            $poutput .= '?start=1';
290
+            if ($id != '')
291
+                $poutput .= '&id=' . $id;
292
+            $poutput .= '">';
293
+            $poutput .= '[ 1 ]';
294
+            $poutput .= '</a>';
295
+            if ($startpage > 2)
296
+                $poutput .= ' .. ';
297
+        }
298
+
299
+        for ($i = $startpage; $i <= min(($startpage + $num), $lastpage); $i++) {
300
+            if ($start == $i) {
301
+                $poutput .= '[ <b>' . $i . '</b> ]';
302
+            } elseif ($i != $lastpage & $i != 1) {
303
+                $poutput .= '<a href=" ' . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES);
304
+                $poutput .= '?start=' . $i;
305
+                if ($id != '')
306
+                    $poutput .= '&id=' . $id;
307
+                $poutput .= '">';
308
+                $poutput .= '[ ' . $i . ' ]';
309
+                $poutput .= '</a>';
310
+            }
311
+        }
312
+
313
+        if ($start != $lastpage) {
314
+            if (min(($startpage + $num), $lastpage) < ($lastpage - 1))
315
+                $poutput .= ' .. ';
316
+            $poutput .= '<a href=" ' . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES);
317
+            $poutput .= '?start=' . $lastpage;
318
+            if ($id != '')
319
+                $poutput .= '&id=' . $id;
320
+            $poutput .= '">';
321
+            $poutput .= '[ ' . $lastpage . ' ]';
322
+            $poutput .= '</a>';
323
+        }
324
+
325
+        if ($lastpage > $num & $start < $lastpage) {
326
+            $poutput .= '<a href=" ' . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES);
327
+            $poutput .= '?start=' . ($start + 1);
328
+            if ($id != '')
329
+                $poutput .= '&id=' . $id;
330
+            $poutput .= '">';
331
+            $poutput .= '[ > ]';
332
+            $poutput .= '</a>';
333
+        }
334
+
335
+        echo $poutput;
336
+    }
337
+}
338
+
339
+/** Print alphanumeric paging menu
340
+ *
341
+ * Display the alphabetic option: [0-9] [a] [b] .. [z]
342
+ *
343
+ * @param string $letterstart Starting letter/number or 'all'
344
+ * @param boolean $userid unknown usage
345
+ *
346
+ * @return null
347
+ */
348
+function show_letters($letterstart, $userid = true) {
349
+    echo _('Show zones beginning with') . ":<br>";
350
+
351
+    $letter = "[[:digit:]]";
352
+    if ($letterstart == "1") {
353
+        echo "<span class=\"lettertaken\">[ 0-9 ]</span> ";
354
+    } elseif (zone_letter_start($letter, $userid)) {
355
+        echo "<a href=\"" . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES) . "?letter=1\">[ 0-9 ]</a> ";
356
+    } else {
357
+        echo "[ <span class=\"letternotavailable\">0-9</span> ] ";
358
+    }
359
+
360
+    foreach (range('a', 'z') as $letter) {
361
+        if ($letter == $letterstart) {
362
+            echo "<span class=\"lettertaken\">[ " . $letter . " ]</span> ";
363
+        } elseif (zone_letter_start($letter, $userid)) {
364
+            echo "<a href=\"" . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES) . "?letter=" . $letter . "\">[ " . $letter . " ]</a> ";
365
+        } else {
366
+            echo "[ <span class=\"letternotavailable\">" . $letter . "</span> ] ";
367
+        }
368
+    }
369
+
370
+    if ($letterstart == '_') {
371
+        echo "<span class=\"lettertaken\">[ _ ]</span> ";
372
+    } elseif (zone_letter_start('_', $userid)) {
373
+        echo "<a href=\"" . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES) . "?letter=_\">[ _ ]</a> ";
374
+    } else {
375
+        echo "[ <span class=\"letternotavailable\">_</span> ] ";
376
+    }
377
+
378
+    if ($letterstart == 'all') {
379
+        echo "<span class=\"lettertaken\">[ Show all ]</span>";
380
+    } else {
381
+        echo "<a href=\"" . htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES) . "?letter=all\">[ Show all ]</a> ";
382
+    }
383
+}
384
+
385
+/** Check if any zones start with letter
386
+ *
387
+ * @param string $letter Starting Letter
388
+ * @param boolean $userid unknown usage
389
+ *
390
+ * @return int 1 if rows found, 0 otherwise
391
+ */
392
+function zone_letter_start($letter, $userid = true) {
393
+    global $db;
394
+    global $sql_regexp;
395
+    $query = "SELECT
396
+			domains.id AS domain_id,
397
+			zones.owner,
398
+			domains.name AS domainname
399
+			FROM domains
400
+			LEFT JOIN zones ON domains.id=zones.domain_id
401
+			WHERE substring(domains.name,1,1) " . $sql_regexp . " " . $db->quote("^" . $letter, 'text');
402
+    $db->setLimit(1);
403
+    $result = $db->queryOne($query);
404
+    return ($result ? 1 : 0);
405
+}
406
+
407
+/** Print success message (toolkit.inc)
408
+ *
409
+ * @param string $msg Success message
410
+ *
411
+ * @return null
412
+ */
413
+function success($msg) {
414
+    if ($msg) {
415
+        echo "     <div class=\"success\">" . $msg . "</div>\n";
416
+    } else {
417
+        echo "     <div class=\"success\">" . _('Something has been successfully performed. What exactly, however, will remain a mystery.') . "</div>\n";
418
+    }
419
+}
420
+
421
+/** Print message
422
+ *
423
+ * Something has been done nicely, display a message and a back button.
424
+ *
425
+ * @param string $msg Message
426
+ *
427
+ * @return null
428
+ */
429
+function message($msg) {
430
+    include_once("header.inc.php");
431
+    ?>
432
+    <P><TABLE CLASS="messagetable"><TR><TD CLASS="message"><H2><?php echo _('Success!'); ?></H2>
433
+                <BR>
434
+                <FONT STYLE="font-weight: Bold">
435
+                <P>
436
+                    <?php
437
+                    if ($msg) {
438
+                        echo nl2br($msg);
439
+                    } else {
440
+                        echo _('Successful!');
441
+                    }
442
+                    ?>
443
+                </P>
444
+                <BR>
445
+                <P>
446
+                    <a href="javascript:history.go(-1)">&lt;&lt; <?php echo _('back'); ?></a></FONT>
447
+                </P>
448
+            </TD></TR></TABLE></P>
449
+    <?php
450
+    include_once("footer.inc.php");
451
+}
452
+
453
+/** Send 302 Redirect with optional argument
454
+ *
455
+ * Reroute a user to a cleanpage of (if passed) arg
456
+ *
457
+ * @param string $arg argument string to add to url
458
+ *
459
+ * @return null
460
+ */
461
+function clean_page($arg = '') {
462
+    if (!$arg) {
463
+        header("Location: " . htmlentities($_SERVER['SCRIPT_NAME'], ENT_QUOTES) . "?time=" . time());
464
+        exit;
465
+    } else {
466
+        if (preg_match('!\?!si', $arg)) {
467
+            $add = "&time=";
468
+        } else {
469
+            $add = "?time=";
470
+        }
471
+        header("Location: $arg$add" . time());
472
+        exit;
473
+    }
474
+}
475
+
476
+/** Print active status
477
+ *
478
+ * @param int $res status, 0 for inactive, 1 active
479
+ *
480
+ * @return string html containing status
481
+ */
482
+function get_status($res) {
483
+    if ($res == '0') {
484
+        return "<FONT CLASS=\"inactive\">" . _('Inactive') . "</FONT>";
485
+    } elseif ($res == '1') {
486
+        return "<FONT CLASS=\"active\">" . _('Active') . "</FONT>";
487
+    }
488
+}
489
+
490
+/** Validate email address string
491
+ *
492
+ * @param string $address email address string
493
+ *
494
+ * @return boolean true if valid, false otherwise
495
+ */
496
+function is_valid_email($address) {
497
+    $fields = preg_split("/@/", $address, 2);
498
+    if ((!preg_match("/^[0-9a-z]([-_.]?[0-9a-z])*$/i", $fields[0])) || (!isset($fields[1]) || $fields[1] == '' || !is_valid_hostname_fqdn($fields[1], 0))) {
499
+        return false;
500
+    }
501
+    return true;
502
+}
503
+
504
+/** Validate numeric string
505
+ *
506
+ * @param string $string number
507
+ *
508
+ * @return boolean true if number, false otherwise
509
+ */
510
+function v_num($string) {
511
+    if (!preg_match("/^[0-9]+$/i", $string)) {
512
+        return false;
513
+    } else {
514
+        return true;
515
+    }
516
+}
517
+
518
+/** Debug print
519
+ *
520
+ * @param string $var debug statement
521
+ *
522
+ * @return null
523
+ */
524
+function debug_print($var) {
525
+    echo "<pre style=\"border: 2px solid blue;\">\n";
526
+    if (is_array($var)) {
527
+        print_r($var);
528
+    } else {
529
+        echo $var;
530
+    }
531
+    echo "</pre>\n";
532
+}
533
+
534
+/** Set timezone (required for PHP5)
535
+ *
536
+ * Set timezone to configured tz or UTC it not set
537
+ *
538
+ * @return null
539
+ */
540
+function set_timezone() {
541
+    global $timezone;
542
+
543
+    if (function_exists('date_default_timezone_set')) {
544
+        if (isset($timezone)) {
545
+            date_default_timezone_set($timezone);
546
+        } else if (!ini_get('date.timezone')) {
547
+            date_default_timezone_set('UTC');
548
+        }
549
+    }
550
+}
551
+
552
+/** Generate random salt for encryption
553
+ *
554
+ * @param int $len salt length (default=5)
555
+ *
556
+ * @return string salt string
557
+ */
558
+function generate_salt($len = 5) {
559
+    $valid_characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890@#$%^*()_-!';
560
+    $valid_len = strlen($valid_characters) - 1;
561
+    $salt = "";
562
+
563
+    for ($i = 0; $i < $len; $i++) {
564
+        $salt .= $valid_characters[rand(0, $valid_len)];
565
+    }
566
+
567
+    return $salt;
568
+}
569
+
570
+/** Extract salt from password
571
+ *
572
+ * @param string $password salted password
573
+ *
574
+ * @return string salt
575
+ */
576
+function extract_salt($password) {
577
+    return substr(strchr($password, ':'), 1);
578
+}
579
+
580
+/** Generate salted password
581
+ *
582
+ * @param string $salt salt
583
+ * @param string $pass password
584
+ *
585
+ * @return string salted password
586
+ */
587
+function mix_salt($salt, $pass) {
588
+    return md5($salt . $pass) . ':' . $salt;
589
+}
590
+
591
+/** Generate random salt and salted password
592
+ *
593
+ * @param string $pass password
594
+ *
595
+ * @return salted password
596
+ */
597
+function gen_mix_salt($pass) {
598
+    $salt = generate_salt();
599
+    return mix_salt($salt, $pass);
600
+}
601
+
602
+
603
+function do_log($syslog_message,$priority){
604
+    global $syslog_use, $syslog_ident, $syslog_facility;
605
+    if ($syslog_use) {
606
+        openlog($syslog_ident, LOG_PERROR, $syslog_facility);
607
+        syslog($priority, $syslog_message);
608
+        closelog();
609
+    }
610
+}
611
+
612
+function log_error($syslog_message) {
613
+    do_log($syslog_message,LOG_ERR);
614
+}
615
+
616
+function log_warn($syslog_message) {
617
+    do_log($syslog_message,LOG_WARNING);
618
+}
619
+
620
+function log_notice($syslog_message) {
621
+    do_log($syslog_message,LOG_NOTICE);
622
+}
623
+
624
+function log_info($syslog_message) {
625
+    do_log($syslog_message,LOG_INFO);
626
+}

+ 932
- 0
poweradmin/poweradmin-2.1.7/inc/users.inc.php View File

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

+ 32
- 0
poweradmin/poweradmin-2.1.7/inc/version.inc.php View File

@@ -0,0 +1,32 @@
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-2014  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
+ * File that contains system version
26
+ *
27
+ * @package     Poweradmin
28
+ * @copyright   2007-2010 Rejo Zenger <rejo@zenger.nl>
29
+ * @copyright   2010-2014 Poweradmin Development Team
30
+ * @license     http://opensource.org/licenses/GPL-3.0 GPL
31
+ */
32
+$VERSION = '2.1.7';

+ 75
- 0
poweradmin/poweradmin-2.1.7/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-2014  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-2014 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
+verify_permission('search') ? $perm_search = "1" : $perm_search = "0";
38
+verify_permission('zone_content_view_own') ? $perm_view_zone_own = "1" : $perm_view_zone_own = "0";
39
+verify_permission('zone_content_view_others') ? $perm_view_zone_other = "1" : $perm_view_zone_other = "0";
40
+verify_permission('supermaster_view') ? $perm_supermaster_view = "1" : $perm_supermaster_view = "0";
41
+verify_permission('zone_master_add') ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0";
42
+verify_permission('zone_slave_add') ? $perm_zone_slave_add = "1" : $perm_zone_slave_add = "0";
43
+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.7/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-2014  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-2014 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
+verify_permission('templ_perm_edit') ? $perm_templ_perm_edit = "1" : $perm_templ_perm_edit = "0";
35
+
36
+$permission_templates = 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 = 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.7/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-2014  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-2014 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
+(verify_permission('supermaster_view')) ? $perm_sm_view = "1" : $perm_sm_view = "0";
36
+(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");

+ 72
- 0
poweradmin/poweradmin-2.1.7/list_zone_templ.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-2014  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-2014 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
+verify_permission('zone_master_add') ? $perm_zone_master_add = "1" : $perm_zone_master_add = "0";
35
+
36
+$zone_templ = get_list_zone_templ($_SESSION['userid']);
37
+$username = get_fullname_from_userid($_SESSION['userid']);
38
+
39
+if ($perm_zone_master_add == "0") {
40
+    error(ERR_PERM_EDIT_ZONE_TEMPL);
41
+} else {
42
+    echo "    <h2>" . _('Zone templates for') . " " . $username . "</h2>\n";
43
+    echo "     <table>\n";
44
+    echo "      <tr>\n";
45
+    echo "       <th>&nbsp;</th>\n";
46
+    echo "       <th>" . _('Name') . "</th>\n";
47
+    echo "       <th>" . _('Description') . "</th>\n";
48
+    echo "      </tr>\n";
49
+
50
+    foreach ($zone_templ as $template) {
51
+
52
+        echo "      <tr>\n";
53
+        if ($perm_zone_master_add == "1") {
54
+            echo "       <td>\n";
55
+            echo "        <a href=\"edit_zone_templ.php?id=" . $template["id"] . "\"><img src=\"images/edit.gif\" alt=\"[ " . _('Edit template') . " ]\"></a>\n";
56
+            echo "        <a href=\"delete_zone_templ.php?id=" . $template["id"] . "\"><img src=\"images/delete.gif\" alt=\"[ " . _('Delete template') . " ]\"></a>\n";
57
+            echo "       </td>\n";
58
+        } else {
59
+            echo "       <td>&nbsp;</td>\n";
60
+        }
61
+        echo "       <td class=\"y\">" . $template['name'] . "</td>\n";
62
+        echo "       <td class=\"y\">" . $template['descr'] . "</td>\n";
63
+        echo "      </tr>\n";
64
+    }
65
+
66
+    echo "     </table>\n";
67
+    echo "     <ul>\n";
68
+    echo "      <li><a href=\"add_zone_templ.php\">" . _('Add zone template') . "</a>.</li>\n";
69
+    echo "     </ul>\n";
70
+}
71
+
72
+include_once("inc/footer.inc.php");

+ 165
- 0
poweradmin/poweradmin-2.1.7/list_zones.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-2014  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-2014 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 (verify_permission('zone_content_view_others')) {
38
+    $perm_view = "all";
39
+} elseif (verify_permission('zone_content_view_own')) {
40
+    $perm_view = "own";
41
+} else {
42
+    $perm_view = "none";
43
+}
44
+
45
+if (verify_permission('zone_content_edit_others')) {
46
+    $perm_edit = "all";
47
+} elseif (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'))) {
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);
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);
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>" . _('Owner') . "</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
+        $zone_owners = get_fullnames_owners_from_domainid($zone['id']);
126
+        if ($iface_zonelist_serial)
127
+            $serial = get_serial_by_zid($zone['id']);
128
+
129
+        if ($perm_edit != "all" || $perm_edit != "none") {
130
+            $user_is_zone_owner = verify_user_is_owner_zoneid($zone["id"]);
131
+        }
132
+        echo "         <tr>\n";
133
+        echo "          <td class=\"checkbox\">\n";
134
+        if ($count_zones_edit > 0 && ($perm_edit == "all" || ( $perm_edit == "own" && $user_is_zone_owner == "1"))) {
135
+            echo "       <input type=\"checkbox\" name=\"zone_id[]\" value=\"" . $zone['id'] . "\">";
136
+        }
137
+        echo "          </td>\n";
138
+        echo "          <td class=\"actions\">\n";
139
+        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";
140
+        if ($perm_edit == "all" || ( $perm_edit == "own" && $user_is_zone_owner == "1")) {
141
+            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";
142
+        }
143
+        echo "          </td>\n";
144
+        echo "          <td class=\"name\">" . $zone["name"] . "</td>\n";
145
+        echo "          <td class=\"type\">" . strtolower($zone["type"]) . "</td>\n";
146
+        echo "          <td class=\"count\">" . $zone["count_records"] . "</td>\n";
147
+        echo "          <td class=\"owner\">" . $zone_owners . "</td>\n";
148
+        if ($iface_zonelist_serial) {
149
+            if ($serial != "") {
150
+                echo "          <td class=\"y\">" . $serial . "</td>\n";
151
+            } else {
152
+                echo "          <td class=\"n\">&nbsp;</td>\n";
153
+            }
154
+        }
155
+        if ($pdnssec_use) {
156
+            echo "          <td class=\"dnssec\"><input type=\"checkbox\" onclick=\"return false\" " . (dnssec_is_zone_secured($zone['name']) ? 'checked' : '') . "></td>\n";
157
+        }
158
+        echo "           </tr>\n";
159
+    }
160
+    echo "          </table>\n";
161
+    echo "      <input type=\"submit\" name=\"commit\" value=\"" . _('Delete zone(s)') . "\" class=\"button\">\n";
162
+    echo "     </form>\n";
163
+}
164
+
165
+include_once("inc/footer.inc.php");

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


+ 88
- 0
poweradmin/poweradmin-2.1.7/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.7/locale/cs_CZ/LC_MESSAGES/messages.mo View File


+ 979
- 0
poweradmin/poweradmin-2.1.7/locale/de_DE/LC_MESSAGES/de.po View File

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

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


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


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


+ 887
- 0
poweradmin/poweradmin-2.1.7/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.7/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.7/locale/fr_FR/LC_MESSAGES/messages.mo View File


+ 82
- 0
poweradmin/poweradmin-2.1.7/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
+

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


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


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


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


+ 88
- 0
poweradmin/poweradmin-2.1.7/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.7/locale/lt_LT/LC_MESSAGES/messages.mo View File


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


+ 0
- 0
poweradmin/poweradmin-2.1.7/locale/nb_NO/LC_MESSAGES/nb.po View File


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

Loading…
Cancel
Save