Changeset 60 for trunk/dns.cgi


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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.