summaryrefslogtreecommitdiff
path: root/httemplate/edit/svc_domain.cgi
diff options
context:
space:
mode:
authorrsiddall <rsiddall>2009-05-15 19:43:06 +0000
committerrsiddall <rsiddall>2009-05-15 19:43:06 +0000
commited51376381b04d1258c079e65059ab4d678dea7e (patch)
tree018628669bbe3f210b9b058bcf2e24c1497fe11c /httemplate/edit/svc_domain.cgi
parentd83a396941b780eddcfd21c7e90c4b653cb97420 (diff)
Simple domain registration at Tucows OpenSRS using an export based on
Net::OpenSRS. When a domain is added and the export runs, it will register the domain or initiate a transfer. You can also choose no action. There's currently no provision for revoking domains or renewing registrations. Depending on the settings at OpenSRS, orders may look like they've succeeded in Freeside but actually be queued pending input by the reseller at OpenSRS. The part_export CGIs were modified to allow a multi-valued select to be used to control which TLDs are enabled for registration.
Diffstat (limited to 'httemplate/edit/svc_domain.cgi')
-rwxr-xr-xhttemplate/edit/svc_domain.cgi42
1 files changed, 34 insertions, 8 deletions
diff --git a/httemplate/edit/svc_domain.cgi b/httemplate/edit/svc_domain.cgi
index 56ba604bf..10079ce98 100755
--- a/httemplate/edit/svc_domain.cgi
+++ b/httemplate/edit/svc_domain.cgi
@@ -7,17 +7,31 @@
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
<INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>">
-<INPUT TYPE="radio" NAME="action" VALUE="N"<% $kludge_action eq 'N' ? ' CHECKED' : '' %>>New
+<% ntable("#cccccc",2) %>
+<TR>
+<P>Domain <INPUT TYPE="text" NAME="domain" VALUE="<% $domain %>" SIZE=28 MAXLENGTH=63>
<BR>
+% if ($export) {
+Available top-level domains: <% $export->option('tlds') %>
+</TR>
-<INPUT TYPE="radio" NAME="action" VALUE="M"<% $kludge_action eq 'M' ? ' CHECKED' : '' %>>Transfer
+<TR>
+<INPUT TYPE="radio" NAME="action" VALUE="N"<% $kludge_action eq 'N' ? ' CHECKED' : '' %>>Register at <% $registrar->{'name'} %>
+<BR>
-<P>Domain <INPUT TYPE="text" NAME="domain" VALUE="<% $domain %>" SIZE=28 MAXLENGTH=63>
+<INPUT TYPE="radio" NAME="action" VALUE="M"<% $kludge_action eq 'M' ? ' CHECKED' : '' %>>Transfer to <% $registrar->{'name'} %>
+<BR>
-<BR>Purpose/Description: <INPUT TYPE="text" NAME="purpose" VALUE="<% $purpose %>" SIZE=64>
+<INPUT TYPE="radio" NAME="action" VALUE="I"<% $kludge_action eq 'I' ? ' CHECKED' : '' %>>Registered elsewhere
-<P><INPUT TYPE="submit" VALUE="Submit">
+</TR>
+
+% }
+<TR>
+<P><INPUT TYPE="submit" VALUE="Submit">
+</TR>
+</TABLE>
</FORM>
<% include('/elements/footer.html') %>
@@ -27,7 +41,7 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
-my($svcnum, $pkgnum, $svcpart, $kludge_action, $purpose, $part_svc,
+my($svcnum, $pkgnum, $svcpart, $kludge_action, $part_svc,
$svc_domain);
if ( $cgi->param('error') ) {
@@ -38,7 +52,6 @@ if ( $cgi->param('error') ) {
$pkgnum = $cgi->param('pkgnum');
$svcpart = $cgi->param('svcpart');
$kludge_action = $cgi->param('action');
- $purpose = $cgi->param('purpose');
$part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } );
die "No part_svc entry!" unless $part_svc;
@@ -61,7 +74,6 @@ if ( $cgi->param('error') ) {
} else { #editing
$kludge_action = '';
- $purpose = '';
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/ or die "unparsable svcnum";
$svcnum=$1;
@@ -82,6 +94,20 @@ my $action = $svcnum ? 'Edit' : 'Add';
my $svc = $part_svc->getfield('svc');
+my @exports = $part_svc->part_export();
+
+my $registrar;
+my $export;
+
+# Find the first export that does domain registration
+foreach (@exports) {
+ $export = $_ if $_->can('registrar');
+}
+# If we have a domain registration export, get the registrar object
+if ($export) {
+ $registrar = $export->registrar;
+}
+
my $otaker = getotaker;
my $domain = $svc_domain->domain;