1 |
filippocarletti |
1.1 |
diff -Nur smeserver-ddclient-1.0.0/createlinks smeserver-ddclient-1.1.0/createlinks |
2 |
|
|
--- smeserver-ddclient-1.0.0/createlinks 2008-04-23 15:41:32.000000000 +0200 |
3 |
|
|
+++ smeserver-ddclient-1.1.0/createlinks 2009-10-08 10:59:22.000000000 +0200 |
4 |
|
|
@@ -8,16 +8,16 @@ |
5 |
|
|
|
6 |
|
|
my $event = 'ddclient'; |
7 |
|
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/ddclient"); |
8 |
|
|
- templates2events("/etc/ddclient", $event); |
9 |
|
|
+ templates2events("/etc/ddclient/ddclient.conf", $event); |
10 |
|
|
|
11 |
|
|
$event = 'domain-delete'; |
12 |
|
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/ddclient"); |
13 |
|
|
- templates2events("/etc/ddclient", $event); |
14 |
|
|
+ templates2events("/etc/ddclient/ddclient.conf", $event); |
15 |
|
|
|
16 |
|
|
$event = 'domain-modify'; |
17 |
|
|
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/ddclient"); |
18 |
|
|
- templates2events("/etc/ddclient", $event); |
19 |
|
|
+ templates2events("/etc/ddclient/ddclient.conf", $event); |
20 |
|
|
|
21 |
|
|
$event = 'post-upgrade'; |
22 |
|
|
- templates2events("/etc/ddclient", $event); |
23 |
|
|
+ templates2events("/etc/ddclient/ddclient.conf", $event); |
24 |
|
|
templates2events("/etc/ppp/ip-up.local", $event); |
25 |
|
|
diff -Nur smeserver-ddclient-1.0.0/root/etc/e-smith/db/configuration/defaults/ddclient/access smeserver-ddclient-1.1.0/root/etc/e-smith/db/configuration/defaults/ddclient/access |
26 |
|
|
--- smeserver-ddclient-1.0.0/root/etc/e-smith/db/configuration/defaults/ddclient/access 2008-04-18 03:32:28.000000000 +0200 |
27 |
|
|
+++ smeserver-ddclient-1.1.0/root/etc/e-smith/db/configuration/defaults/ddclient/access 1970-01-01 01:00:00.000000000 +0100 |
28 |
|
|
@@ -1 +0,0 @@ |
29 |
|
|
-private |
30 |
|
|
diff -Nur smeserver-ddclient-1.0.0/root/etc/e-smith/db/configuration/defaults/ddclient/type smeserver-ddclient-1.1.0/root/etc/e-smith/db/configuration/defaults/ddclient/type |
31 |
|
|
--- smeserver-ddclient-1.0.0/root/etc/e-smith/db/configuration/defaults/ddclient/type 1970-01-01 01:00:00.000000000 +0100 |
32 |
|
|
+++ smeserver-ddclient-1.1.0/root/etc/e-smith/db/configuration/defaults/ddclient/type 2009-10-08 11:00:44.000000000 +0200 |
33 |
|
|
@@ -0,0 +1 @@ |
34 |
|
|
+service |
35 |
|
|
diff -Nur smeserver-ddclient-1.0.0/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration smeserver-ddclient-1.1.0/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration |
36 |
|
|
--- smeserver-ddclient-1.0.0/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration 2006-11-12 16:11:57.000000000 +0100 |
37 |
|
|
+++ smeserver-ddclient-1.1.0/root/etc/e-smith/templates/etc/ddclient/ddclient.conf/20Declaration 2009-10-08 12:24:49.000000000 +0200 |
38 |
|
|
@@ -1,46 +1,19 @@ |
39 |
|
|
{ |
40 |
|
|
- use strict; |
41 |
|
|
- use esmith::util; |
42 |
|
|
- use esmith::ConfigDB; |
43 |
|
|
- use esmith::AccountsDB; |
44 |
|
|
+ use esmith::DomainsDB; |
45 |
|
|
|
46 |
|
|
$OUT=''; |
47 |
|
|
|
48 |
|
|
- my $conf = esmith::ConfigDB->open() |
49 |
|
|
- or die "Unable to open configuration db"; |
50 |
|
|
+ my $ddb = esmith::DomainsDB->open_ro(); |
51 |
|
|
|
52 |
|
|
- my $domaindb = esmith::ConfigDB->open('/home/e-smith/db/domains') |
53 |
|
|
- or die "Unable to open domains db"; |
54 |
|
|
- |
55 |
|
|
- my $edb; |
56 |
|
|
- |
57 |
|
|
- $edb = esmith::ConfigDB->open('/home/e-smith/db/extras') |
58 |
|
|
- or $edb = esmith::ConfigDB->create('/home/e-smith/db/extras'); |
59 |
|
|
- |
60 |
|
|
- #------------------------------------------------------------ |
61 |
|
|
- # Look up domains and domain descriptions |
62 |
|
|
- #------------------------------------------------------------ |
63 |
|
|
- |
64 |
|
|
- my $key; |
65 |
|
|
- my @virtualDomains = (); |
66 |
|
|
- foreach my $domain ($domaindb->get_all_by_prop(type=>'domain')) |
67 |
|
|
- { |
68 |
|
|
- $key = $domain->key; |
69 |
|
|
- push (@virtualDomains, $key); |
70 |
|
|
- } |
71 |
|
|
+ $OUT .="use=web, web=checkip.dyndns.org:8245/, web-skip='IP Address:' \n"; |
72 |
|
|
|
73 |
|
|
- my $numDomains = @virtualDomains; |
74 |
|
|
- if ($numDomains > 0) |
75 |
|
|
+ for my $edom ( $ddb->domains ) |
76 |
|
|
{ |
77 |
|
|
- $OUT .="use=web, web=checkip.dyndns.org:8245/, web-skip='IP Address:' \n"; |
78 |
|
|
- foreach my $dom (sort @virtualDomains) |
79 |
|
|
{ |
80 |
|
|
- my $edom=$edb->get($dom); |
81 |
|
|
|
82 |
|
|
- if( defined $edom ) |
83 |
|
|
- { |
84 |
|
|
- my $dns = $edom->prop('dns'); |
85 |
|
|
- $dns =~ tr/a-z/A-Z/; |
86 |
|
|
+ my $dns = $edom->prop('dns') || ''; |
87 |
|
|
+ next if ($dns eq ''); |
88 |
|
|
+ $dns =~ tr/a-z/A-Z/; |
89 |
|
|
my $login = $edom->prop('login'); |
90 |
|
|
my $password = $edom->prop('password'); |
91 |
|
|
my $pubserv=''; |
92 |
|
|
@@ -136,12 +109,11 @@ |
93 |
|
|
|
94 |
|
|
$OUT .="login=".$login.", \\\n"; |
95 |
|
|
$OUT .="password=".$password." \\\n"; |
96 |
|
|
- $OUT .=$dom."\n"; |
97 |
|
|
+ $OUT .=$edom->key()."\n"; |
98 |
|
|
$OUT .="##\n"; |
99 |
|
|
$OUT .="##\n"; |
100 |
|
|
} |
101 |
|
|
} |
102 |
|
|
} |
103 |
|
|
- } |
104 |
|
|
} |
105 |
|
|
|
106 |
|
|
diff -Nur smeserver-ddclient-1.0.0/root/etc/e-smith/web/functions/ddclient smeserver-ddclient-1.1.0/root/etc/e-smith/web/functions/ddclient |
107 |
|
|
--- smeserver-ddclient-1.0.0/root/etc/e-smith/web/functions/ddclient 2009-10-08 10:55:09.000000000 +0200 |
108 |
|
|
+++ smeserver-ddclient-1.1.0/root/etc/e-smith/web/functions/ddclient 2009-10-08 14:57:44.000000000 +0200 |
109 |
|
|
@@ -80,14 +80,6 @@ |
110 |
|
|
die "Unable to open domains db"; |
111 |
|
|
} |
112 |
|
|
} |
113 |
|
|
- |
114 |
|
|
-my $edb = esmith::ConfigDB->open('/home/e-smith/db/extras'); |
115 |
|
|
- if ( not defined $edb ) { |
116 |
|
|
- $edb = esmith::ConfigDB->open('/home/e-smith/extras'); |
117 |
|
|
- if ( not defined $edb ) { |
118 |
|
|
- $edb = esmith::ConfigDB->create('/home/e-smith/db/extras'); |
119 |
|
|
- } |
120 |
|
|
- } |
121 |
|
|
#------------------------------------------------------------ |
122 |
|
|
# examine state parameter and display the appropriate form |
123 |
|
|
#------------------------------------------------------------ |
124 |
|
|
@@ -228,12 +220,12 @@ |
125 |
|
|
{ |
126 |
|
|
my %properties = $domaindb->get($domain)->props; |
127 |
|
|
|
128 |
|
|
- my $test=$edb->get($domain) || ''; |
129 |
|
|
+ my $test=$domaindb->get($domain) || ''; |
130 |
|
|
|
131 |
|
|
my %extraprops; |
132 |
|
|
if($test ne '') |
133 |
|
|
{ |
134 |
|
|
- %extraprops = $edb->get($domain)->props; |
135 |
|
|
+ %extraprops = $domaindb->get($domain)->props; |
136 |
|
|
} |
137 |
|
|
|
138 |
|
|
my $content; |
139 |
|
|
@@ -333,12 +325,12 @@ |
140 |
|
|
|
141 |
|
|
my %properties = $domaindb->get($domain)->props; |
142 |
|
|
|
143 |
|
|
- my $test=$edb->get($domain) || ''; |
144 |
|
|
+ my $test=$domaindb->get($domain) || ''; |
145 |
|
|
|
146 |
|
|
my %extraprops; |
147 |
|
|
if($test ne '') |
148 |
|
|
{ |
149 |
|
|
- %extraprops = $edb->get($domain)->props; |
150 |
|
|
+ %extraprops = $domaindb->get($domain)->props; |
151 |
|
|
} |
152 |
|
|
|
153 |
|
|
my $content; |
154 |
|
|
@@ -460,7 +452,7 @@ |
155 |
|
|
$properties{'password'} = $domainPassword; |
156 |
|
|
$properties{'mx'} = $domainMX; |
157 |
|
|
|
158 |
|
|
- $edb->new_record($domainName, \%properties); |
159 |
|
|
+ $domaindb->new_record($domainName, \%properties); |
160 |
|
|
|
161 |
|
|
system ("/sbin/e-smith/signal-event", "ddclient"); |
162 |
|
|
|
163 |
|
|
@@ -483,7 +475,7 @@ |
164 |
|
|
|
165 |
|
|
my $domain = $q->param ('domain'); |
166 |
|
|
my $value = $domaindb->get($domain); |
167 |
|
|
- my $evalue = $edb->get($domain); |
168 |
|
|
+ my $evalue = $domaindb->get($domain); |
169 |
|
|
|
170 |
|
|
if ($value) |
171 |
|
|
{ |
172 |
|
|
@@ -602,14 +594,14 @@ |
173 |
|
|
#------------------------------------------------------------ |
174 |
|
|
my $dns = $q->param ('dns'); |
175 |
|
|
|
176 |
|
|
- my $dom=$edb->get($domainName); |
177 |
|
|
+ my $dom=$domaindb->get($domainName); |
178 |
|
|
|
179 |
|
|
$dom->set_prop('dns' => $dns); |
180 |
|
|
$dom->set_prop('login' => $domainLogin); |
181 |
|
|
$dom->set_prop('password' => $domainPassword); |
182 |
|
|
$dom->set_prop('mx' => $domainMX); |
183 |
|
|
|
184 |
|
|
- $edb->reload(); |
185 |
|
|
+ $domaindb->reload(); |
186 |
|
|
|
187 |
|
|
system ("/sbin/e-smith/signal-event", "ddclient"); |
188 |
|
|
|
189 |
|
|
@@ -631,7 +623,7 @@ |
190 |
|
|
|
191 |
|
|
my $domain = $q->param ('domain'); |
192 |
|
|
my $value = $domaindb->get($domain); |
193 |
|
|
- my $evalue = $edb->get($domain); |
194 |
|
|
+ my $evalue = $domaindb->get($domain); |
195 |
|
|
|
196 |
|
|
if ($value) |
197 |
|
|
{ |
198 |
|
|
@@ -701,12 +693,12 @@ |
199 |
|
|
return; |
200 |
|
|
} |
201 |
|
|
|
202 |
|
|
- my $evalue = $edb->get($domain); |
203 |
|
|
+ my $evalue = $domaindb->get($domain); |
204 |
|
|
my %props = $evalue->props; |
205 |
|
|
my $dns = $fm->localise($props{'dns'}); |
206 |
|
|
|
207 |
|
|
- $evalue->delete; |
208 |
|
|
- $edb->reload(); |
209 |
|
|
+ $evalue->set_prop('dns' => ''); |
210 |
|
|
+ $domaindb->reload(); |
211 |
|
|
|
212 |
|
|
system ("/sbin/e-smith/signal-event", "ddclient"); |
213 |
|
|
|
214 |
|
|
@@ -717,3 +709,5 @@ |
215 |
|
|
################################################################################################# |
216 |
|
|
|
217 |
|
|
__DATA__ |
218 |
|
|
+<form> |
219 |
|
|
+</form> |