Changeset 47


Ignore:
Timestamp:
12/10/09 13:29:16 (15 years ago)
Author:
Kris Deugau
Message:

/trunk

checkpoint
Cosmetic shuffle of "which page am I processing?" logic to group related pages
Add stub for WHOIS, stub-and-a-bit for log display
Remove several obsolete or unused templates (mostly copies of Vega's output)

Location:
trunk
Files:
4 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r44 r47  
    154154  listdomains();
    155155
    156 } elsif ($webvar{page} eq 'reclist') {
    157 
    158   # Handle record list for both default records (per-group) and live domain records
    159 
    160   $page->param(defrec => $webvar{defrec});
    161   $page->param(id => $webvar{id});
    162   $page->param(curpage => $webvar{page});
    163 
    164 # select count(*) from (default_)?records where (group|domain)_id=?
    165     my $sth = $dbh->prepare("SELECT count(*) FROM ".
    166         ($webvar{defrec} eq 'y' ? 'default_' : '')."records ".
    167         "WHERE ".($webvar{defrec} eq 'y' ? 'group' : 'domain')."_id=? ".
    168         "AND NOT type=$reverse_typemap{SOA}");
    169     $sth->execute($webvar{id});
    170     my ($count) = ($sth->fetchrow_array);
    171 
    172 # fill the page-count and first-previous-next-last-all details
    173   fill_pgcount($count,"records",domainName($dbh,$webvar{id}));
    174   fill_fpnla($count);  # should put some params on this sub...
    175 
    176   $page->param(defrec => $webvar{defrec});
    177   if ($webvar{defrec} eq 'y') {
    178 ##fixme: hardcoded group
    179     showdomain('y',$curgroup);
    180   } else {
    181     showdomain('n',$webvar{id});
    182   }
    183 
    184156} elsif ($webvar{page} eq 'newdomain') {
    185157
     
    211183    # cancelled.  whee!
    212184    changepage(page => "domlist");
     185  }
     186
     187} elsif ($webvar{page} eq 'reclist') {
     188
     189  # Handle record list for both default records (per-group) and live domain records
     190
     191  $page->param(defrec => $webvar{defrec});
     192  $page->param(id => $webvar{id});
     193  $page->param(curpage => $webvar{page});
     194
     195# select count(*) from (default_)?records where (group|domain)_id=?
     196    my $sth = $dbh->prepare("SELECT count(*) FROM ".
     197        ($webvar{defrec} eq 'y' ? 'default_' : '')."records ".
     198        "WHERE ".($webvar{defrec} eq 'y' ? 'group' : 'domain')."_id=? ".
     199        "AND NOT type=$reverse_typemap{SOA}");
     200    $sth->execute($webvar{id});
     201    my ($count) = ($sth->fetchrow_array);
     202
     203# fill the page-count and first-previous-next-last-all details
     204  fill_pgcount($count,"records",domainName($dbh,$webvar{id}));
     205  fill_fpnla($count);  # should put some params on this sub...
     206
     207  $page->param(defrec => $webvar{defrec});
     208  if ($webvar{defrec} eq 'y') {
     209##fixme: hardcoded group
     210    showdomain('y',$curgroup);
     211  } else {
     212    showdomain('n',$webvar{id});
    213213  }
    214214
     
    639639  }
    640640
     641} elsif ($webvar{page} eq 'whois') {
     642
     643} elsif ($webvar{page} eq 'log') {
     644
     645##fixme put in some real log-munching stuff
     646##fixme need to add bits to *create* log entries...
     647  my $sth = $dbh->prepare("SELECT * FROM log");
     648  $sth->execute;
     649  my @logbits;
     650  while (my @data = $sth->fetchrow_array) {
     651    my %row;
     652# (1,1,1,'test@test','Test','frobbed the whatsit',now());
     653    $row{userfname} = $data[4];
     654    $row{userid} = $data[1];
     655    $row{useremail} = $data[3];
     656    $row{logentry} = $data[5];
     657    $row{logtime} = $data[6];
     658    push @logbits, \%row;
     659  }
     660  $page->param(logentries => \@logbits);
     661
    641662}
    642663
     
    927948  fill_colheads(\@cols, \%colheads);
    928949
    929   $page->param(sortorder => $sortorder);
     950#  $page->param(sortorder => $sortorder);
    930951  # hack! hack! pthbttt.  have to rethink the status column storage,
    931952  # or inactive comes "before" active.  *sigh*
  • trunk/templates/log.tmpl

    r2 r47  
    1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    2 <HTML>
    3     <HEAD>
    4         <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    5         <TITLE>VegaDNS Administration</TITLE>
    6         <link rel="STYLESHEET" type="text/css" href="templates/core-style.css">
    7         <!--[if gte IE 5.5000]>
    8         <script type="text/javascript" src="templates/pngfix.js"></script>
    9         <![endif]-->
    10             </HEAD>
    11 <body onload="focus()">
    12 <table border="0" height="100%" width="100%">
     1<!-- <TMPL_VAR NAME=sid> -->
     2<table class="wholepage"><tr>
     3<TMPL_INCLUDE NAME="menu.tmpl">
    134
    14     <tr valign="top">
     5<td align="center">
    156
    16         <td class="border" width="20%" align="left">
    17         &nbsp;<b>test@test.com</b> logged in<br>
    18     &nbsp<a href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=end">log out</a>
    19     <hr>
    20     <table border="0" cellpadding="0" cellspacing="0">
     7<div id="datatablewrapper">
    218
    22 <tr><td><table cellpadding="0" cellspacing="0" border="0"><tr><td><img border="0" alt="home"
    23 src="images/home.png"></td><td><a
    24 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=groups&group=1">VegaDNS</a></td></tr></table>
    25 <table cellpadding="0" cellspacing="0" border="0"><tr><td><img border="0" src="images/dirtree_tee.gif"><td><img
    26 border="0" src="images/newfolder.png"></td><td><a
    27 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=domains&group=1">Domains</a></td></tr></table>
    28 <table cellpadding="0" cellspacing="0" border="0"><tr><td><img border="0"
    29 src="images/dirtree_tee.gif"></td><td><img border="0" src="images/user_folder.png"></td><td><a
    30 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=users&group=1">Users</a></td></tr></table>
    31 <table cellpadding="0" cellspacing="0" border="0"><tr><td><img border="0"
    32 src="images/dirtree_tee.gif"></td><td><img border="0" src="images/newfolder.png"></td><td class="white"><a
    33 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=log&group=1">Log</a></td></tr></table>
    34 <!-- COUNTER: 1 COUNT: 2 -->
    35 <table cellpadding="0" cellspacing="0" border="0"><tr><td><a
    36 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&expanded=2&group=1&mode=log"><img
    37 border="0" alt="home" src="images/dirtree_plus_tee.gif"><td><a
    38 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=groups&group=2"><img border="0"
    39 alt="home" src="images/group.gif"></a></td><td><a
    40 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=groups&group=2">domain
    41 owners</a></td></tr></table>
    42 <!-- COUNTER: 2 COUNT: 2 -->
    43 <table cellpadding="0" cellspacing="0" border="0"><tr><td><a
    44 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&expanded=3&group=1&mode=log"><img
    45 border="0" alt="home" src="images/dirtree_plus_elbow.gif"><td><a
    46 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=groups&group=3"><img border="0"
    47 alt="home" src="images/group.gif"></a></td><td><a
    48 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=groups&group=3">bulk
    49 hosters</a></td></tr></table>
    50 </td></tr>
     9<table border="0" width="70%">
     10<tr><th colspan="5" align="center">Log entries for domain</th></tr>
     11  <tr class="darkrowheader">
     12      <td>Name</td>
     13      <td>Customer ID</td>
     14      <td>Email</td>
     15      <td>Log Entry</td>
     16      <td>Date / Time</td>
     17  </tr>
     18<TMPL_IF logentries>
     19<TMPL_LOOP NAME=logentries>
     20    <tr class="datalinelight">
     21        <td><TMPL_VAR NAME=userfname></td>
     22        <td><TMPL_VAR NAME=userid></td>
     23        <td><TMPL_VAR NAME=useremail></td>
     24        <td><TMPL_VAR NAME=logentry></td>
     25        <td><TMPL_VAR NAME=logtime></td>
     26    </tr>
     27</TMPL_LOOP>
     28<TMPL_ELSE>
     29    <tr class="datalinelight">
     30        <td colspan="5" align="center">No log entries found</td>
     31    </tr>
     32</TMPL_IF>
    5133</table>
    5234
     35</div>
    5336
    54    
    55     <hr>
    56         <a
    57 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=default_records">Default
    58 Records</a><br>
    59         <a
    60 href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=domains&domain_mode=import_domains">AXFR
    61 Import</a><br>
    62         <a href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=dnsquery">DNS
    63 Query</a><br>
    64         <a href="/index.php?VDNSSessid=65d033c4ff10d2e73c9ca1050c7746f1&state=logged_in&mode=whoisquery">Whois
    65 Query</a>    </td>
    66 
    67     <td align="center">
    68     <img src="images/vegadns-small.png" alt="VegaDNS"><p>
    69         <br></b><br>
    70     <p>
    71 Log entries for domain <p>
    72 <table border=0 width="70%">
    73   <tr bgcolor="#cccccc">
    74       <td>Name</td>
    75       <td>Customer ID</td>
    76 
    77       <td>Email</td>
    78       <td>Log Entry</td>
    79       <td>Date / Time</td></td>
    80   </tr>
    81 
    82     <tr bgcolor="#eeeeee">
    83         <td nowrap>Test User</td>
    84 
    85         <td nowrap>1</td>
    86         <td nowrap>test@test.com</td>
    87         <td nowrap>added domain foo.com with status active</td>
    88         <td nowrap>03/28/2008 16:06:32</td>
    89     </tr>
    90     <tr bgcolor="#eeeeee">
    91         <td nowrap>Test User</td>
    92 
    93         <td nowrap>1</td>
    94         <td nowrap>test@test.com</td>
    95         <td nowrap>added soa</td>
    96         <td nowrap>03/28/2008 16:06:32</td>
    97     </tr>
    98     <tr bgcolor="#eeeeee">
    99         <td nowrap>Test User</td>
    100 
    101         <td nowrap>1</td>
    102         <td nowrap>test@test.com</td>
    103         <td nowrap>added N foo.com with value ns1.example.com</td>
    104         <td nowrap>03/28/2008 16:06:32</td>
    105     </tr>
    106     <tr bgcolor="#eeeeee">
    107         <td nowrap>Test User</td>
    108 
    109         <td nowrap>1</td>
    110         <td nowrap>test@test.com</td>
    111         <td nowrap>added C www.foo.com with value webcluster.example.com</td>
    112         <td nowrap>03/28/2008 16:06:32</td>
    113     </tr>
    114     <tr bgcolor="#eeeeee">
    115         <td nowrap>Test User</td>
    116 
    117         <td nowrap>1</td>
    118         <td nowrap>test@test.com</td>
    119         <td nowrap>added C mail.foo.com with value dmail.example.com</td>
    120         <td nowrap>03/28/2008 16:06:32</td>
    121     </tr>
    122     <tr bgcolor="#eeeeee">
    123         <td nowrap>Test User</td>
    124 
    125         <td nowrap>1</td>
    126         <td nowrap>test@test.com</td>
    127         <td nowrap>added M foo.com with value dmail.example.com</td>
    128         <td nowrap>03/28/2008 16:06:32</td>
    129     </tr>
    130     <tr bgcolor="#eeeeee">
    131         <td nowrap>Test User</td>
    132 
    133         <td nowrap>1</td>
    134         <td nowrap>test@test.com</td>
    135         <td nowrap>Changed status to INACTIVE</td>
    136         <td nowrap>03/28/2008 16:24:12</td>
    137     </tr>
    138     <tr bgcolor="#eeeeee">
    139         <td nowrap>Test User</td>
    140 
    141         <td nowrap>1</td>
    142         <td nowrap>test@test.com</td>
    143         <td nowrap>Changed status to ACTIVE</td>
    144         <td nowrap>03/28/2008 16:27:44</td>
    145     </tr>
    146     <tr bgcolor="#eeeeee">
    147         <td nowrap>Test User</td>
    148 
    149         <td nowrap>1</td>
    150         <td nowrap>test@test.com</td>
    151         <td nowrap>imported via axfr from olddns.webhart.net</td>
    152         <td nowrap>06/13/2008 13:47:44</td>
    153     </tr>
     37</td>
     38</tr>
    15439</table>
    15540
    156 </table>   
    157 
    158 </tr>
    159 </table>
    160 </center>
    161 execution time: 0.04 seconds
    162 </body>
    163 </html>
  • trunk/templates/useradmin.tmpl

    r44 r47  
    3131<TMPL_LOOP name=usertable>
    3232<tr class="row<TMPL_VAR name=bg>">
    33         <td align="left"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=userman&amp;action=chuser&amp;user=<TMPL_VAR NAME=userid>"><TMPL_VAR NAME=username></a></td>
     33        <td align="left"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=useradmin&amp;action=chuser&amp;user=<TMPL_VAR NAME=userid>"><TMPL_VAR NAME=username></a></td>
    3434        <td><TMPL_VAR name=userfull></td>
    3535        <td><TMPL_VAR name=usertype></td>
Note: See TracChangeset for help on using the changeset viewer.