Changeset 735


Ignore:
Timestamp:
06/23/16 17:11:40 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Refine record search scope/permission so that users without the
location_view permission don't see that column in the record search
results. See #57.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r733 r735  
    19031903
    19041904  # some magic to label and linkify the column headers for sorting
    1905   my @cols = ('domain','revzone','host','type','val','location');
     1905  my @cols = ('domain','revzone','host','type','val');
    19061906  my %colheads = (domain => "Domain (Group)", revzone => "Reverse zone (Group)", host => "Host",
    1907         type => "Type", val => "IP/value", location => "Location");
     1907        type => "Type", val => "IP/value");
     1908  # only users allowed to see location/view data get this column
     1909  if ($permissions{admin} || $permissions{location_view}) {
     1910    $colheads{location} = "Location";
     1911    push @cols, 'location';
     1912  }
    19081913  fill_colheads($sortby, $sortorder, \@cols, \%colheads);
    19091914
  • trunk/templates/recsearch.tmpl

    r731 r735  
    5959<td><TMPL_VAR NAME=val></td>
    6060</TMPL_IF>
    61 <td><TMPL_VAR NAME=location></td>
     61<TMPL_IF mayloc><td><TMPL_VAR NAME=location></td></TMPL_IF>
    6262</tr>
    6363</TMPL_LOOP>
    6464<TMPL_ELSE>
    65 <tr><td colspan="5" align="center">No records found matching '<TMPL_VAR NAME=searchfor>'</td></tr>
     65<tr><td colspan="<TMPL_IF mayloc>6<TMPL_ELSE>5</TMPL_IF>" align="center">No records found matching '<TMPL_VAR NAME=searchfor>'</td></tr>
    6666</TMPL_IF>
    6767</table>
Note: See TracChangeset for help on using the changeset viewer.