From 5972196ee5ac7deb2291814bd1c278ce69e4b32a Mon Sep 17 00:00:00 2001 From: Olivier Thauvin Date: Tue, 19 Oct 2010 22:50:58 +0000 Subject: - ask confirm by mail on host information update to avoid spam --- root/html/includes/host_information.tt | 59 +++++++++++++++++++++++++--------- root/html/pages/mirrors/mirror.tt | 3 +- root/html/pages/new/new_host.tt | 2 +- root/html/pages/validate/error.tt | 1 + root/html/pages/validate/validate.tt | 1 + root/mail/host_up_request.tt | 11 +++++++ 6 files changed, 59 insertions(+), 18 deletions(-) create mode 100644 root/html/pages/validate/error.tt create mode 100644 root/html/pages/validate/validate.tt create mode 100644 root/mail/host_up_request.tt (limited to 'root') diff --git a/root/html/includes/host_information.tt b/root/html/includes/host_information.tt index 9093f98..b7b02f3 100644 --- a/root/html/includes/host_information.tt +++ b/root/html/includes/host_information.tt @@ -1,13 +1,17 @@
-[% IF NOT host.readonly %] +[% IF c.req.param('modify') AND NOT host.readonly %] + [% edit = 1 %] +[% END %] + +[% IF edit %]
[% END %] -[% IF NOT host.readonly %] +[% IF edit %] [% END %] +[% IF edit AND needmail %] + + + +[% END %]
Country -[% IF host.readonly %] +[% IF NOT edit %] [% c.model('Mirrors').country_info(host.country).name | html %] [% ELSE %]
City -[% IF host.readonly %] -[% host.city | html %] -[% ELSE %] +[% IF edit %] +[% ELSE %] +[% host.city | html %] [% END %]
Latitude -[% IF host.readonly %] -[% host.latitude | html %] -[% ELSE %] +[% IF edit %] +[% ELSE %] +[% host.latitude | html %] [% END %]
Longitude -[% IF host.readonly %] -[% host.longitude | html %] -[% ELSE %] +[% IF edit %] +[% ELSE %] +[% host.longitude | html %] [% END %]
Click on the map to update latitude and longitude
Synchronized from -[% IF host.readonly %] +[% IF NOT edit %] [% host.syncfrom | html %] [% ELSE %] [% FOREACH mirror = c.model('Mirrors').find_mirrors %] @@ -74,7 +78,7 @@
Approximated bandwidth -[% IF host.readonly %] +[% IF NOT edit %] [% c.model('Mirrors').bandwidth_name(host.bandwidth) | html %] [% ELSE %]
+Please enter your e-mail address:
+
+a mail will be be sent with the link to confirm
+your update request.
+
-[% IF NOT host.readonly %] +[% IF edit %]
+[% ELSE %] +[% IF NOT host.readonly %] +
+ +
+[% END %] [% END %]
@@ -111,7 +131,7 @@ var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); -[% IF NOT host.readonly %] +[% IF edit %] google.maps.event.addListener(map, 'click', function(event) { recordposition(event.latLng); }); @@ -120,6 +140,13 @@ document.getElementById("latitude").value = location.lat(); document.getElementById("longitude").value = location.lng(); } +[% ELSE %] + var myLatlng = new google.maps.LatLng([% host.latitude %],[% host.longitude %]); + var marker = new google.maps.Marker({ + position: myLatlng, + map: map, + title:"[% host.hostname %]" + }); [% END %] } diff --git a/root/html/pages/mirrors/mirror.tt b/root/html/pages/mirrors/mirror.tt index dad43c2..b27cfac 100644 --- a/root/html/pages/mirrors/mirror.tt +++ b/root/html/pages/mirrors/mirror.tt @@ -3,7 +3,8 @@

Host information

[% INCLUDE 'host_information.tt' - action = c.uri_for(hostname) + action = c.uri_for(hostname), + needmail = 1 %]

URLs to the distribution

diff --git a/root/html/pages/new/new_host.tt b/root/html/pages/new/new_host.tt index d73600c..ecf51b8 100644 --- a/root/html/pages/new/new_host.tt +++ b/root/html/pages/new/new_host.tt @@ -11,4 +11,4 @@ -[% INCLUDE 'host_information.tt' %] +[% INCLUDE 'host_information.tt' edit = 1 %] diff --git a/root/html/pages/validate/error.tt b/root/html/pages/validate/error.tt new file mode 100644 index 0000000..a5b88c4 --- /dev/null +++ b/root/html/pages/validate/error.tt @@ -0,0 +1 @@ +

No request found

diff --git a/root/html/pages/validate/validate.tt b/root/html/pages/validate/validate.tt new file mode 100644 index 0000000..d57e10e --- /dev/null +++ b/root/html/pages/validate/validate.tt @@ -0,0 +1 @@ +

[% hostname | html %] formation has been updated

diff --git a/root/mail/host_up_request.tt b/root/mail/host_up_request.tt new file mode 100644 index 0000000..56b4e91 --- /dev/null +++ b/root/mail/host_up_request.tt @@ -0,0 +1,11 @@ +Hi, + +You (hopefully) asked to update information about Mageia mirror. + +To confirm the requst please visit: + +[% c.uri_for('/validate', reqid) %] + +If this is an unwanted action, please ignore this mail. + +Regards. -- cgit v1.2.1