Changeset 15 for trunk/dns.cgi
- Timestamp:
- 09/15/09 08:51:42 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r13 r15 61 61 # default 62 62 #my $perpage = 15; 63 my $perpage = 4;63 my $perpage = 3; 64 64 my $offset = ($webvar{offset} ? $webvar{offset} : 0); 65 65 … … 78 78 initGlobals($dbh); 79 79 80 # Default page is a login page81 my $page; # to be initialized as an HTML::Template entity sooner or later80 ## Default page is a login page 81 #my $page; # to be initialized as an HTML::Template entity sooner or later 82 82 83 83 84 84 85 85 # decide which page to spit out... 86 if (!$webvar{page}) { 87 $page = HTML::Template->new(filename => "$templatedir/login.tmpl"); 88 } else { 89 $page = HTML::Template->new(filename => "$templatedir/$webvar{page}.tmpl"); 90 } 86 $webvar{page} = 'login' if !$webvar{page}; 87 #if (!$webvar{page}) { 88 # $page = HTML::Template->new(filename => "$templatedir/login.tmpl"); 89 #} else { 90 #} 91 92 my $page = HTML::Template->new(filename => "$templatedir/$webvar{page}.tmpl"); 91 93 92 94 $page->param(sid => $sid); … … 176 178 } elsif ($webvar{page} eq 'record') { 177 179 if ($webvar{recact} eq 'new') { 178 $page->param(recact => "Add record to"); 180 $page->param(todo => "Add record to"); 181 $page->param(recact => "add"); 179 182 stdrecs(); 183 } elsif ($webvar{recact} eq 'add') { 184 185 my @recargs = ($dbh,$webvar{defrec},$webvar{parentid},$webvar{name},$webvar{type},$webvar{address},$webvar{ttl}); 186 if ($webvar{type} == $reverse_typemap{MX} or $webvar{type} == $reverse_typemap{SRV}) { 187 push @recargs, $webvar{distance}; 188 if ($webvar{type} == $reverse_typemap{SRV}) { 189 push @recargs, $webvar{weight}; 190 push @recargs, $webvar{port}; 191 } 192 } 193 # wtf? 194 # push @recargs, 195 my ($code,$msg) = addRec(@recargs); 196 197 if ($code eq 'OK') { 198 changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}); 199 # showdomain($webvar{defrec},$webvar{parentid}); 200 # NB: should **really** redirect here, in case of reload. >_< eyowch. 201 } else { 202 $page->param(add_failed => 1); 203 $page->param(errmsg => $msg); 204 stdrecs($webvar{type}); # populate the form... er, mostly. 205 $page->param(name => $webvar{name}); 206 $page->param(address => $webvar{address}); 207 $page->param(distance => $webvar{distance}) 208 if ($webvar{type} == $reverse_typemap{MX} or $webvar{type} == $reverse_typemap{SRV}); 209 $page->param(weight => $webvar{weight}) if $webvar{type} == $reverse_typemap{SRV}; 210 $page->param(port => $webvar{port}) if $webvar{type} == $reverse_typemap{SRV}; 211 } 212 213 $page->param(defrec => $webvar{defrec}); 214 180 215 } elsif ($webvar{recact} eq 'edit') { 181 $page->param(recact => "Edit record in"); 216 217 $page->param(todo => "Edit record in"); 182 218 my $sth = $dbh->prepare("SELECT host,type,val,distance,weight,port,ttl FROM ". 183 219 ($webvar{defrec} eq 'y' ? 'default_' : '')."records WHERE record_id=?"); … … 322 358 foreach (@debugbits) { print; } 323 359 324 $page->param(grp => $group) ;360 $page->param(grp => $group) if $webvar{page} ne 'login'; 325 361 326 362 # spit it out
Note:
See TracChangeset
for help on using the changeset viewer.