Changeset 950199
- Timestamp:
- 07/17/2014 10:34:08 AM (12 years ago)
- Location:
- site-pin/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
site-pin.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
site-pin/trunk/readme.txt
r915407 r950199 3 3 Tags: auth 4 4 Requires at least: 3.0 5 Tested up to: 3.9 5 Tested up to: 3.9.1 6 6 Stable tag: trunk 7 7 License: GPLv2 … … 87 87 == Changelog == 88 88 89 = 1.3 = 90 * Improved redirection after PIN entry 91 89 92 = 1.2 = 90 93 * Fix for admin CSS in new versions of WordPress -
site-pin/trunk/site-pin.php
r909629 r950199 4 4 Plugin URI: http://www.bang-on.net/ 5 5 Description: Prevent careless visitors by locking your site down with a PIN 6 Version: 1. 26 Version: 1.3 7 7 Author: Marcus Downing 8 8 Contributors: marcusdowning, diddledan … … 68 68 // (making sure the Site PIN page isn't cached) 69 69 $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); 94 71 exit; 95 72 } … … 127 104 128 105 function site_pin_readout() { 106 if (!current_user_can('edit_posts')) 107 return; 129 108 $enabled = (boolean) get_site_option('site_pin_enable', true); 130 109 $pin = (string) get_site_option('site_pin_code', "0000"); … … 132 111 133 112 ?><div class="wrap"> 134 <h 2>Site PIN</h2>113 <h1><i class="dashicons dashicons-admin-network"></i> Site PIN</h1> 135 114 <?php if ($enabled) { ?> 136 115 The site requires a PIN to read: … … 145 124 146 125 function site_pin_settings() { 126 if (!current_user_can('edit_theme_options')) 127 return; 147 128 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : false; 148 129 switch ($action) { … … 172 153 173 154 <div id='bang-main' class="wrap"> 174 <h 2>Site PIN</h2>155 <h1><i class="dashicons dashicons-admin-network"></i> Site PIN</h1> 175 156 <form method="post"> 176 157 <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.