Changeset 95 for trunk/templates


Ignore:
Timestamp:
04/15/11 17:53:45 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

Add commented attempt to autolocate the script's full base path

for use lib; commented bits fail due to taint mode. *sigh*

Add ACL checks for domain edit, create, and delete. Generalize

error message handling so that we don't get "Error deleting
domain: You don't have permission to add a domain"-ish messages.

Trim some code after a changepage() call (since it issues a 302

redirect and exits...)

Add ACL checks for record edit, create, and delete. Apply similar

error-message handling fixups as done with domain processing.

Location:
trunk/templates
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/templates/domlist.tmpl

    r44 r95  
    55<td align="center">
    66
    7  <TMPL_IF del_failed>
    8   <div class='errmsg'>Error deleting domain <TMPL_VAR NAME=domain>: <TMPL_VAR NAME=errmsg></div>
     7 <TMPL_IF errmsg>
     8  <div class='errmsg'><TMPL_VAR NAME=errmsg></div>
    99 </TMPL_IF>
    1010
     
    1919</tr>
    2020<tr><td colspan="3" align="center"><TMPL_INCLUDE NAME="lettsearch.tmpl"></td></tr>
    21 <tr><td colspan="3" align="right"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=newdomain">New Domain</a></td></tr>
     21<tr><td colspan="3" align="right"><TMPL_IF domain_create><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=newdomain">New Domain</a></TMPL_IF></td></tr>
    2222</table>
    2323
     
    3131src="images/<TMPL_VAR NAME=sortorder>.png" /></TMPL_IF></td>
    3232</TMPL_LOOP>
    33         <td class="datahead_s">Change Status</td>
    34         <td class="datahead_s">Delete</td>
     33<TMPL_IF domain_edit>   <td class="datahead_s">Change Status</td></TMPL_IF>
     34<TMPL_IF domain_delete> <td class="datahead_s">Delete</td></TMPL_IF>
    3535</tr>
    3636<TMPL_IF name=domtable>
     
    4040        <td><TMPL_VAR name=status></td>
    4141        <td><TMPL_VAR name=group></td>
    42         <td align="center"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=domlist<TMPL_IF NAME=offset>&amp;offset=<TMPL_VAR NAME=offset></TMPL_IF>&amp;id=<TMPL_VAR NAME=domainid>&amp;action=<TMPL_IF NAME=mkactive>domon<TMPL_ELSE>domoff</TMPL_IF>"><TMPL_IF NAME=mkactive>activate<TMPL_ELSE>deactivate</TMPL_IF></a></td>
    43         <td align="center"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=deldom&amp;id=<TMPL_VAR NAME=domainid>"><img src="images/trash2.png" alt="[ Delete ]" /></a></td>
     42<TMPL_IF domain_edit>   <td align="center"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=domlist<TMPL_IF NAME=offset>&amp;offset=<TMPL_VAR NAME=offset></TMPL_IF>&amp;id=<TMPL_VAR NAME=domainid>&amp;action=<TMPL_IF NAME=mkactive>domon<TMPL_ELSE>domoff</TMPL_IF>"><TMPL_IF NAME=mkactive>activate<TMPL_ELSE>deactivate</TMPL_IF></a></td></TMPL_IF>
     43<TMPL_IF domain_delete> <td align="center"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=deldom&amp;id=<TMPL_VAR NAME=domainid>"><img src="images/trash2.png" alt="[ Delete ]" /></a></td></TMPL_IF>
    4444</tr>
    4545</TMPL_LOOP>
  • trunk/templates/reclist.tmpl

    r76 r95  
    55<td align="center" valign="top">
    66
    7  <TMPL_IF del_failed>
    8   <div class='errmsg'>Error deleting record: <TMPL_VAR NAME=errmsg></div>
     7 <TMPL_IF errmsg>
     8  <div class='errmsg'><TMPL_VAR NAME=errmsg></div>
    99 </TMPL_IF>
    1010
     
    4141<tr class="darkrowheader">
    4242        <td colspan="4">Records</td>
    43         <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>
     43<TMPL_IF record_create> <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></TMPL_IF>
    4444        <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>
    4545</tr>
     
    5656 NAME=defrec>"><TMPL_VAR NAME=colname></a><TMPL_IF NAME=sortorder>&nbsp;<img alt="<TMPL_VAR
    5757 NAME=sortorder>" src="images/<TMPL_VAR NAME=sortorder>.png" /></TMPL_IF></td></TMPL_LOOP>
    58         <td>Delete</td>
     58<TMPL_IF record_delete> <td>Delete</td></TMPL_IF>
    5959</tr>
    6060<TMPL_LOOP NAME=reclist>
    6161<tr class="row<TMPL_VAR NAME=row>">
    62         <td><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=edit&amp;id=<TMPL_VAR NAME=record_id>"><TMPL_VAR NAME=host></a></td>
     62        <td><TMPL_IF record_edit><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=edit&amp;id=<TMPL_VAR NAME=record_id>"><TMPL_VAR NAME=host></a><TMPL_ELSE><TMPL_VAR NAME=host></TMPL_IF></td>
    6363        <td><TMPL_VAR NAME=type></td>
    6464        <td><TMPL_VAR NAME=val></td>
     
    6767        <td><TMPL_VAR NAME=port></td>
    6868        <td><TMPL_VAR NAME=ttl></td>
    69         <td align="center"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=delrec&amp;id=<TMPL_VAR NAME=record_id>&amp;defrec=<TMPL_VAR NAME=defrec>&amp;parentid=<TMPL_VAR NAME=id>"><img src="images/trash2.png" alt="[ Delete ]" /></a></td>
     69<TMPL_IF record_delete> <td align="center"><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&amp;page=delrec&amp;id=<TMPL_VAR NAME=record_id>&amp;defrec=<TMPL_VAR NAME=defrec>&amp;parentid=<TMPL_VAR NAME=id>"><img src="images/trash2.png" alt="[ Delete ]" /></a></td></TMPL_IF>
    7070</tr>
    7171</TMPL_LOOP>
Note: See TracChangeset for help on using the changeset viewer.