Ignore:
Timestamp:
Nov 28, 2018, 10:18:04 AM (5 years ago)
Author:
plg
Message:

Simpler user interface, display banned IP current status, regroup IP management

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AntiAspi/admin.tpl

    r31372 r31953  
    2323        input.hide();
    2424    });
     25
     26    jQuery('.add-ip-allowed-form-toggle').click(function(e) {
     27        jQuery('.add-ip-allowed-form').toggle();
     28        e.preventDefault();
     29    })
    2530});
    2631
     
    4045
    4146        <fieldset>
    42           <legend>{'Action IP banned'|@translate}</legend>
     47          <legend>{'Banned IP addresses'|@translate}</legend>
    4348                <form method="post" >
    44                         <div style="text-align:center;">
    45                                 <input class="submit" name="submitdeleteall" type="submit" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');" value="{'Delete all IP Ban'|@translate}"/>
    46                                 <input class="submit" name="submitdeletedeprecated" type="submit" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');" value="{'Delete deprecated IP Ban'|@translate}"/>
     49                        <div style="text-align:center;margin-bottom: 30px;">
     50
     51                                <button name="submitdeleteall" type="submit" class="buttonLike" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">
     52                    <i class="icon-trash"></i> {'Delete all'|@translate}
     53                </button>
     54
     55                                <button name="submitdeletedeprecated" type="submit" class="buttonLike" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">
     56                    <i class="icon-trash"></i> {'Delete deprecated only'|@translate}
     57                </button>
     58
    4759                        </div>
    4860                </form>
    49         </fieldset>
    50 <form method="post" >
    51         <fieldset>
    52           <legend>{'List IP banned'|@translate}</legend>
     61         
    5362           <table class="lban">
    5463                {foreach from=$ipban2 item=ipban}
     
    5665                        <td><!-- {$ipban.ID} --> {$ipban.IP}</td>
    5766                        <td>{$ipban.DATE}</td>
     67                        <td><span class="badge badge-{$ipban.STATUS}">{$ipban.STATUS}</span></td>
    5868                        <td>
    5969                        <a href="{$ipban.U_DELETE}" onclick="return confirm( document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');">
    60                                 <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" id="btn_delete" alt="{'delete'|@translate}" title="{'Delete'|@translate}" />
     70                <i class="icon-trash" id="btn_delete" title="{'Delete'|@translate}"></i>
    6171                        </a>
    6272                        </td>
     
    6575         </table>
    6676        </fieldset>
    67 </form>
     77
     78         <fieldset class="antiaspi-whitelist">
     79      <legend>{'Whitelist (allowed ip addresses)'|translate}</legend>
     80        <form method="post">
     81                        <a href="#" class="icon-plus-circled add-ip-allowed-form-toggle">{'Add allowed IP'|@translate}</a>
     82                        <span class="add-ip-allowed-form">
     83                        {'IP'|@translate} <input " type="text" name="insipallowed" data-ip placeholder="123.123.123.123" value="" size="50" maxlenght="50" required pattern="^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$">
     84                        <input class="submit" name="submitaddipallowed" type="submit" value="{'Add IP'|@translate}" />
     85                        </span>
     86        </form>
     87                <table class="lban">
     88                        {foreach from=$allowip item=allowip2}
     89                          <tr>
     90                                <td>{$allowip2.IP}</td>
     91                                <td>
     92                                <a href="{$allowip2.U_DELETE}" onclick="return confirm( document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');">
     93                                        <i class="icon-trash" id="btn_delete" title="{'Delete'|@translate}"></i>
     94                                </a>
     95                                </td>
     96                          </tr>
     97                        {/foreach}
     98                 </table>
     99         </fieldset>
    68100{/if}
     101
    69102{if isset ($ipconfiggest)}
    70103<form method="post">
    71104 <fieldset>
    72105  <legend>{'Configuration'|translate}</legend>
    73          <fieldset>
    74106                <p class="input" style="width: 700px;">
    75107                  <label for="insdiffa"><strong>{'IP banned if '|@translate}<span></span></strong></label>
     
    80112                        <input type="text" name="insdiffb" data-min="5" data-max="3599" class="range" value="{$ipconfiggest.DIFFB}"/>
    81113                </p>
    82         </fieldset>
    83         <fieldset>
    84                 <p class="input" style="width: 700px;">
     114
     115                <p class="input" style="width: 700px;margin-top: 50px;">
    85116                  <label for="inssamea"><strong>{'IP banned if same '|@translate}<span></span></strong></label>
    86117                  <input type="text" name="inssamea" data-min="10" data-max="500" class="range" value="{$ipconfiggest.SAMEA}"/> 
    87118                </p>   
    88                 <p class="input" style="width: 700px;">
     119                <p class="input" style="width: 700px;margin-bottom: 50px;">
    89120                        <label for="inssameb"><strong>{' different pages viewed in <span></span> seconds'|@translate} </strong></label>
    90121                        <input type="text" name="inssameb" data-min="5" data-max="3599" class="range" value="{$ipconfiggest.SAMEB}"/>
    91122                </p>
    92         </fieldset>
     123
    93124        <p>
    94125        <strong>{'only guest'|@translate}</strong>
     
    101132                ({'If yes, apply antiaspi only on picture page'|@translate})
    102133    </p>
    103          <fieldset>
    104       <legend>{'allowed ip'|translate}</legend>
    105                 <table class="lban">
    106                         {foreach from=$allowip item=allowip2}
    107                           <tr>
    108                                 <td>{$allowip2.IP}</td>
    109                                 <td>
    110                                 <a href="{$allowip2.U_DELETE}" onclick="return confirm( document.getElementById('btn_delete').title + '\n\n' + '{'Are you sure?'|@translate|@escape:'javascript'}');">
    111                                         <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/delete.png" id="btn_delete" alt="{'delete'|@translate}" title="{'Delete'|@translate}" />
    112                                 </a>
    113                                 </td>
    114                           </tr>
    115                         {/foreach}
    116                  </table>
    117          </fieldset>
    118     <p>
    119         <input class="submit" type="submit" name="submitconfban" value="{'Submit'|@translate}">
     134    <p style="margin-top: 50px">
     135        <button name="submitconfban" type="submit" class="buttonLike">
     136            <i class="icon-floppy"></i> {'Save Settings'|@translate}
     137        </button>
    120138    </p>
    121139 </fieldset>
    122140</form>
    123   {if isset ($ipconfiggest)}
    124         <form method="post">
    125                 <fieldset>
    126                         <legend>{'Add IP allowed'|@translate}</legend>
    127                         {'IP'|@translate} <input " type="text" name="insipallowed" data-ip placeholder="123.123.123.123" value="" size="50" maxlenght="50" required pattern="^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$">
    128                         <br>
    129                         <br>
    130                                 <div style="text-align:center;">
    131                                 <input class="submit" name="submitaddipallowed" type="submit" value="{'Submit'|@translate}" />
    132                                 </div>
    133                 </fieldset>
    134         </form>
    135141{/if}
    136 {/if}
Note: See TracChangeset for help on using the changeset viewer.