forked from virtualmin/virtualmin-registrar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cgi_args.pl
executable file
·36 lines (34 loc) · 857 Bytes
/
cgi_args.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use strict;
no strict 'refs';
use warnings;
our %access;
our $module_name;
do 'virtualmin-registrar-lib.pl';
sub cgi_args
{
my ($cgi) = @_;
no warnings "once";
my ($d) = grep { &virtual_server::can_edit_domain($_) &&
$_->{$module_name} } &virtual_server::list_domains();
use warnings "once";
if ($cgi eq 'edit_contact.cgi' || $cgi eq 'edit_dereg.cgi' ||
$cgi eq 'edit_ns.cgi' || $cgi eq 'edit_renew.cgi') {
# Domain-based form
return $d ? 'dom='.&urlize($d->{'dom'}) : 'none';
}
elsif ($cgi eq 'edit.cgi') {
# Show first account
my @accounts = &list_registrar_accounts();
return !$access{'registrar'} ? 'none' :
@accounts ? 'id='.$accounts[0]->{'id'} :
'registrar=rcom';
}
elsif ($cgi eq 'list.cgi') {
# Works with no args
return '';
}
elsif ($cgi eq 'create_form.cgi') {
return 'registrar=rcom';
}
return undef;
}