Changeset 60


Ignore:
Timestamp:
01/15/10 14:52:28 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

Littleish cosmetic tweaks to log display
Tweaks to calls into log display page so that it shows the right data
Stub in section to show log for a user (not sure how useful this will

be...) - NB, this is not linked from anywhere and not present at all
in Vega's implementation

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r59 r60  
    247247  } else {
    248248    showdomain('n',$webvar{id});
     249    $page->param(logdom => 1);
    249250  }
    250251
     
    709710##fixme need to add bits to *create* log entries...
    710711  my $sql = "SELECT user_id, email, name, entry, date_trunc('second',stamp) FROM log WHERE ";
    711   my $id = $curgroup;
    712   if ($webvar{ltype} && $webvar{ltype} eq 'dom') {
     712  my $id = $curgroup;  # we do this because the group log may be called from (almost) any page,
     713                       # but the others are much more limited.  this is probably non-optimal.
     714  if ($werbvar{ltype} && $webvar{ltype} eq 'user') {
     715    $sql .= "user_id=?";
     716    $id = $webvar{id};
     717    $page->param(logfor => 'user '.userFullName($dbh,$id));
     718  } elsif ($webvar{ltype} && $webvar{ltype} eq 'dom') {
    713719    $sql .= "domain_id=?";
    714720    $id = $webvar{id};
     721    $page->param(logfor => 'domain '.domainName($dbh,$id));
    715722  } else {
    716723    # Default to listing curgroup log
    717724    $sql .= "group_id=?";
     725    $page->param(logfor => 'group '.groupName($dbh,$id));
    718726  }
    719727  my $sth = $dbh->prepare($sql);
     
    722730  while (my ($uid, $email, $name, $entry, $stamp) = $sth->fetchrow_array) {
    723731    my %row;
    724 # (1,1,1,'test@test','Test','frobbed the whatsit',now());
    725732    $row{userfname} = $name;
    726733    $row{userid} = $uid;
     
    732739  $page->param(logentries => \@logbits);
    733740
    734 }
     741} # end $webvar{page} dance
    735742
    736743
  • trunk/templates/log.tmpl

    r59 r60  
    77<div id="datatablewrapper">
    88
    9 <table border="0" width="70%">
     9<table border="0" width="90%">
    1010<tr><th colspan="5" align="center">Log entries for <TMPL_VAR NAME=logfor></th></tr>
    1111  <tr class="darkrowheader">
  • trunk/templates/reclist.tmpl

    r39 r60  
    3838        <td colspan="4">Records</td>
    3939        <td align="right"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=record&amp;parentid=<TMPL_VAR NAME=id>&amp;defrec=<TMPL_VAR NAME=defrec>&amp;recact=new">Add record</a></td>
    40         <td align="right"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=showlog&amp;id=<TMPL_VAR NAME=id>&amp;defrec=<TMPL_VAR NAME=defrec>">View log</a></td>
     40        <td align="right"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=log&amp;id=<TMPL_VAR NAME=id><TMPL_IF logdom>&amp;ltype=dom</TMPL_IF>">View log</a></td>
    4141</tr>
    4242
Note: See TracChangeset for help on using the changeset viewer.