Warn about requesting www.* domains
authorAdam Chlipala <adamc@hcoop.net>
Tue, 1 Jan 2008 21:44:45 +0000 (21:44 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Tue, 1 Jan 2008 21:44:45 +0000 (21:44 +0000)
domain.mlt

index 78dc955..99b6a8e 100644 (file)
@@ -4,14 +4,19 @@ val admin = Group.inGroupName "server";
 
 if $"req" <> "" then
        val dom = $"req";
-       if Util.validDomain dom then
+       if not (Util.validDomain dom) then
+               %><h3>Invalid domain name</h3><%
+       elseif String.isPrefix "www." dom and $"want_www" = "" then
+               val base = String.extract (dom, 4, NONE)
+               %><h3>Are you sure you want to request a domain that begins with "www."?</h3>
+               <p>You probably meant to request <tt><% base %></tt> instead, which would grant you the ability to configure <tt><% dom %></tt> as well.  Unless you've registered <tt><% dom %></tt> directly with your registrar, you will be unable to configure it without the right to set nameservers for <tt><% base %></tt>.</p>
+               <p><a href="?req=<% Web.urlEncode dom %>&want_www=1&msg=<% Web.urlEncode ($"msg") %>">Yes, go ahead and place the request!</a></p><%
+       else
                val id = Domain.add (Init.getUserId(), dom, $"msg");
                if not (Domain.notifyNew id) then
                        %><h3>Error sending e-mail notification</h3><%
                end
                %><h3>Request added</h3><%
-       else
-               %><h3>Invalid domain name</h3><%
        end
 
 elseif $"cmd" = "open" then