Plugin Directory

Changeset 950199


Ignore:
Timestamp:
07/17/2014 10:34:08 AM (12 years ago)
Author:
marcus.downing
Message:

Version 1.3

Location:
site-pin/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • site-pin/trunk/readme.txt

    r915407 r950199  
    33Tags: auth
    44Requires at least: 3.0
    5 Tested up to: 3.9
     5Tested up to: 3.9.1
    66Stable tag: trunk
    77License: GPLv2
     
    8787== Changelog ==
    8888
     89= 1.3 =
     90* Improved redirection after PIN entry
     91
    8992= 1.2 =
    9093* Fix for admin CSS in new versions of WordPress
  • site-pin/trunk/site-pin.php

    r909629 r950199  
    44Plugin URI: http://www.bang-on.net/
    55Description: Prevent careless visitors by locking your site down with a PIN
    6 Version: 1.2
     6Version: 1.3
    77Author: Marcus Downing
    88Contributors: marcusdowning, diddledan
     
    6868      //  (making sure the Site PIN page isn't cached)
    6969      $redirect = remove_query_arg('site_pin');
    70 
    71       define('DONOTCACHEPAGE', true);
    72 
    73       header("HTTP/1.0 200 OK");
    74       header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    75       header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    76       header("Cache-Control: no-store, no-cache, must-revalidate");
    77       header("Cache-Control: post-check=0, pre-check=0", false);
    78       header("Pragma: no-cache");
    79       header("Location", $redirect);
    80       ?><!DOCTYPE HTML>
    81         <html lang="en-US">
    82           <head>
    83             <meta charset="UTF-8">
    84             <meta http-equiv="refresh" content="1;url=<?php echo $redirect; ?>">
    85             <script type="text/javascript">
    86                 window.location.href = "<?php echo $redirect; ?>"
    87             </script>
    88             <title>Page Redirection</title>
    89           </head>
    90           <body>
    91             If you are not redirected automatically, follow the <a href='<?php echo $redirect; ?>'>link to example</a>
    92           </body>
    93       </html><?php
     70      wp_redirect($redirect);
    9471      exit;
    9572    }
     
    127104
    128105function site_pin_readout() {
     106  if (!current_user_can('edit_posts'))
     107    return;
    129108  $enabled = (boolean) get_site_option('site_pin_enable', true);
    130109  $pin = (string) get_site_option('site_pin_code', "0000");
     
    132111
    133112  ?><div class="wrap">
    134   <h2>Site PIN</h2>
     113  <h1><i class="dashicons dashicons-admin-network"></i> Site PIN</h1>
    135114  <?php if ($enabled) { ?>
    136115    The site requires a PIN to read:
     
    145124
    146125function site_pin_settings() {
     126  if (!current_user_can('edit_theme_options'))
     127    return;
    147128  $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : false;
    148129  switch ($action) {
     
    172153
    173154  <div id='bang-main' class="wrap">
    174   <h2>Site PIN</h2>
     155  <h1><i class="dashicons dashicons-admin-network"></i> Site PIN</h1>
    175156  <form method="post">
    176157    <p><label for='enable'><input type='checkbox' id='enable' name='site_pin_enable' <?php echo $checked ?>/>
Note: See TracChangeset for help on using the changeset viewer.