Changeset 1478400
- Timestamp:
- 08/19/2016 05:14:56 AM (10 years ago)
- Location:
- loginrequirepress/trunk
- Files:
-
- 3 edited
-
LICENSE (modified) (3 diffs)
-
LoginRequirePress.php (modified) (10 diffs)
-
readme.txt (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
loginrequirepress/trunk/LICENSE
r1436214 r1478400 1 Login RequirePress -- WordPress plugin that allows site administrators to2 specifically designate arbitrary posts with any public3 post type as viewable only after user login.1 Login Require Press -- WordPress plugin that allows site administrators to 2 specifically designate arbitrary posts with any 3 public post type as viewable only after user login. 4 4 5 It is an easy way to require user login to view specific6 pages / posts.5 It is an easy way to require user login to view 6 specific pages / posts. 7 7 8 Unauthenticated site visitors attempting to view any9 page that includes any such specifically designated10 post will then be automatically redirected to the11 site's default login page, and then back to the12 original page after they login, thereby limiting access13 only to logged-in users with subscriber roles and14 above.8 Unauthenticated site visitors attempting to view any 9 page that includes any such specifically designated 10 post will then be automatically redirected to the 11 site's default login page, and then back to the 12 original page after they login, thereby limiting 13 access only to logged-in users with subscriber roles 14 and above. 15 15 16 Plugin will still allow unauthenticated downloading of17 site's feeds, but will filter out any login-requiring18 posts from the feed listings.16 Plugin will still allow unauthenticated downloading 17 of site's feeds, but will filter out any 18 login-requiring posts from the feed listings. 19 19 20 Plugin will protect the titles and contents of login- 21 requiring posts in search result page listings when the 22 user is not logged in. The titles / contents will be 23 replaced by text "[Post title / content protected by 24 LoginRequirePress. Login to see the title / content.]" 20 Plugin will protect the titles and contents of login- 21 requiring posts in search result page listings when 22 the user is not logged in. The titles / contents 23 will be replaced by text "[Post title / content 24 protected by Login Require Press. Login to see the 25 title / content.]" 25 26 26 27 https://wordpress.org/plugins/loginrequirepress … … 30 31 Copyright (C) 2015-2016 Marat Nepomnyashy http://maratbn.com maratbn@gmail 31 32 32 Version: 1. 2.0-development_unreleased33 Version: 1.3.0-development_unreleased 33 34 34 35 Module: loginrequirepress/LICENSE 35 36 36 Description: License for Login RequirePress.37 Description: License for Login Require Press. 37 38 38 This file is part of Login RequirePress.39 This file is part of Login Require Press. 39 40 40 41 Licensed under the GNU General Public License Version 3. 41 42 42 Login RequirePress is free software: you can redistribute it and/or modify43 Login Require Press is free software: you can redistribute it and/or modify 43 44 it under the terms of the GNU General Public License as published by 44 45 the Free Software Foundation, either version 3 of the License, or 45 46 (at your option) any later version. 46 47 47 Login RequirePress is distributed in the hope that it will be useful,48 Login Require Press is distributed in the hope that it will be useful, 48 49 but WITHOUT ANY WARRANTY; without even the implied warranty of 49 50 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 51 52 52 53 You should have received a copy of the GNU General Public License 53 along with Login RequirePress. If not, see <http://www.gnu.org/licenses/>.54 along with Login Require Press. If not, see <http://www.gnu.org/licenses/>. -
loginrequirepress/trunk/LoginRequirePress.php
r1436214 r1478400 1 1 <?php 2 2 /* 3 Plugin Name: Login RequirePress3 Plugin Name: Login Require Press 4 4 Plugin URI: https://wordpress.org/plugins/loginrequirepress 5 5 Plugin URI: https://github.com/maratbn/LoginRequirePress 6 6 Plugin URI: http://www.maratbn.com/projects/login-require-press 7 Description: Allows site administrators to specifically designate arbitrary posts with any public post type as viewable only after user login. It is an easy way to require user login to view specific pages / posts. Unauthenticated site visitors attempting to view any page that includes any such specifically designated post will then be automatically redirected to the site's default login page, and then back to the original page after they login, thereby limiting access only to logged-in users with subscriber roles and above. Plugin will still allow unauthenticated downloading of site's feeds, but will filter out any login-requiring posts from the feed listings. Plugin will protect the titles and contents of login-requiring posts in search result page listings when the user is not logged in. The titles / contents will be replaced by text "[Post title / content protected by LoginRequirePress. Login to see the title / content.]"7 Description: Allows site administrators to specifically designate arbitrary posts with any public post type as viewable only after user login. 8 8 Author: Marat Nepomnyashy 9 9 Author URI: http://www.maratbn.com 10 10 License: GPL3 11 Version: 1. 2.0-development_unreleased11 Version: 1.3.0-development_unreleased 12 12 Text Domain: domain-plugin-LoginRequirePress 13 13 */ 14 14 15 15 /* 16 LoginRequirePress -- WordPress plugin that allows site administrators to 17 specifically designate arbitrary posts with any public 18 post type as viewable only after user login. 19 20 It is an easy way to require user login to view specific 21 pages / posts. 22 23 Unauthenticated site visitors attempting to view any 24 page that includes any such specifically designated 25 post will then be automatically redirected to the 26 site's default login page, and then back to the 27 original page after they login, thereby limiting access 28 only to logged-in users with subscriber roles and 29 above. 30 31 Plugin will still allow unauthenticated downloading of 32 site's feeds, but will filter out any login-requiring 33 posts from the feed listings. 34 35 Plugin will protect the titles and contents of login- 36 requiring posts in search result page listings when the 37 user is not logged in. The titles / contents will be 38 replaced by text "[Post title / content protected by 39 LoginRequirePress. Login to see the title / content.]" 16 Login Require Press -- WordPress plugin that allows site administrators to 17 specifically designate arbitrary posts with any 18 public post type as viewable only after user login. 19 20 It is an easy way to require user login to view 21 specific pages / posts. 22 23 Unauthenticated site visitors attempting to view any 24 page that includes any such specifically designated 25 post will then be automatically redirected to the 26 site's default login page, and then back to the 27 original page after they login, thereby limiting 28 access only to logged-in users with subscriber roles 29 and above. 30 31 Plugin will still allow unauthenticated downloading 32 of site's feeds, but will filter out any 33 login-requiring posts from the feed listings. 34 35 Plugin will protect the titles and contents of login- 36 requiring posts in search result page listings when 37 the user is not logged in. The titles / contents 38 will be replaced by text "[Post title / content 39 protected by Login Require Press. Login to see the 40 title / content.]" 40 41 41 42 https://wordpress.org/plugins/loginrequirepress … … 45 46 Copyright (C) 2015-2016 Marat Nepomnyashy http://maratbn.com maratbn@gmail 46 47 47 Version: 1. 2.0-development_unreleased48 Version: 1.3.0-development_unreleased 48 49 49 50 Module: LoginRequirePress.php 50 51 51 Description: Main PHP file for the WordPress plugin 'Login RequirePress'.52 53 This file is part of Login RequirePress.52 Description: Main PHP file for the WordPress plugin 'Login Require Press'. 53 54 This file is part of Login Require Press. 54 55 55 56 Licensed under the GNU General Public License Version 3. 56 57 57 Login RequirePress is free software: you can redistribute it and/or modify58 Login Require Press is free software: you can redistribute it and/or modify 58 59 it under the terms of the GNU General Public License as published by 59 60 the Free Software Foundation, either version 3 of the License, or 60 61 (at your option) any later version. 61 62 62 Login RequirePress is distributed in the hope that it will be useful,63 Login Require Press is distributed in the hope that it will be useful, 63 64 but WITHOUT ANY WARRANTY; without even the implied warranty of 64 65 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 66 67 67 68 You should have received a copy of the GNU General Public License 68 along with Login RequirePress. If not, see <http://www.gnu.org/licenses/>.69 along with Login Require Press. If not, see <http://www.gnu.org/licenses/>. 69 70 */ 70 71 … … 104 105 function action_add_meta_boxes() { 105 106 add_meta_box('plugin_LoginRequirePress_require_login', 106 __('Login RequirePress', 'domain-plugin-LoginRequirePress'),107 __('Login Require Press', 'domain-plugin-LoginRequirePress'), 107 108 '\\plugin_LoginRequirePress\\callbackMetaBox', 108 109 null); … … 110 111 111 112 function action_admin_menu() { 112 \add_options_page(\__('Login RequirePress Settings', 'domain-plugin-LoginRequirePress'),113 \__('Login RequirePress', 'domain-plugin-LoginRequirePress'),113 \add_options_page(\__('Login Require Press Settings', 'domain-plugin-LoginRequirePress'), 114 \__('Login Require Press', 'domain-plugin-LoginRequirePress'), 114 115 'manage_options', 115 116 'plugin_LoginRequirePress_settings', … … 168 169 if ($w_p_query->is_search) return; 169 170 171 // Need to obtain the site root directory: 172 $strSelf = $_SERVER['PHP_SELF']; 173 if ($strSelf == null) return; 174 $posIndexPHP = \strpos($strSelf, 'index.php'); 175 if ($posIndexPHP === false) return; // Not on regular site page. 176 $strSiteRoot = \substr($strSelf, 0, $posIndexPHP); 177 178 // Need to obtain the internal site path portion after the root directory: 179 $strRequestPath = $_SERVER['REQUEST_URI']; 180 if ($strRequestPath == null) return; 181 if (\strpos($strRequestPath, $strSiteRoot) !== 0) return; 182 $strInternalPath = \substr($strRequestPath, \strlen($strSiteRoot)); 183 170 184 global $post; 171 185 if ($w_p_query->have_posts()) { … … 173 187 $w_p_query->the_post(); 174 188 if (isLoginRequiredForPost($post)) { 175 \header('Location: ' . \wp_login_url(\home_url($ _SERVER['REQUEST_URI'])));189 \header('Location: ' . \wp_login_url(\home_url($strInternalPath))); 176 190 exit(0); 177 191 } … … 219 233 if (isLoginRequiredForPost($post)) { 220 234 if ($flagIsSearchNotLoggedIn) { 221 $post->post_content = \__('[Post content protected by Login RequirePress. Login to see the content.]',235 $post->post_content = \__('[Post content protected by Login Require Press. Login to see the content.]', 222 236 'domain-plugin-LoginRequirePress'); 223 $post->post_title = \__('[Post title protected by Login RequirePress. Login to see the title.]',237 $post->post_title = \__('[Post title protected by Login Require Press. Login to see the title.]', 224 238 'domain-plugin-LoginRequirePress'); 225 239 } else { … … 247 261 if (\version_compare(\strtolower(\PHP_VERSION), PHP_VERSION_MIN_SUPPORTED, '<')) { 248 262 \wp_die( 249 \sprintf(\__('Login RequirePress plugin cannot be activated because the currently active PHP version on this server is %s < %s and not supported. PHP version >= %s is required.',263 \sprintf(\__('Login Require Press plugin cannot be activated because the currently active PHP version on this server is %s < %s and not supported. PHP version >= %s is required.', 250 264 'domain-plugin-LoginRequirePress'), 251 265 \PHP_VERSION, … … 278 292 ?><li><?php 279 293 ?><a href='<?=\get_edit_post_link($objPost->ID)?>'><?php 280 ?><?=$objPost->post_name?><?php 294 ?><?=$objPost->post_name ? $objPost->post_name 295 : \sprintf( 296 \__('[no name %d]', 297 'domain-plugin-LoginRequirePress'), 298 $objPost->ID) 299 ?><?php 281 300 ?></a><?php 282 301 ?></li><?php -
loginrequirepress/trunk/readme.txt
r1436223 r1478400 1 === Login RequirePress ===1 === Login Require Press === 2 2 Contributors: maratbn 3 3 Tags: require login, password protect, security, limit access, control access, members, visitors, subscribers, require-login, password-protect, login-protect, limit-access 4 4 Requires at least: 3.8.1 5 Tested up to: 4. 5.26 Stable tag: 1. 1.05 Tested up to: 4.6 6 Stable tag: 1.2.0 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 14 14 Overview: 15 15 16 At the time of this writing, the latest version of WordPress, version 4. 5.2,16 At the time of this writing, the latest version of WordPress, version 4.6, 17 17 has 3 post visibility options, which are 'public', 'password protected', and 18 18 'private'. … … 23 23 deny access only to the unauthenticated users. 24 24 25 Login RequirePress is a WordPress plugin that allows site administrators to25 Login Require Press is a WordPress plugin that allows site administrators to 26 26 specifically designate arbitrary posts with any public post type as viewable 27 27 only after user login. … … 41 41 search result page listings when the user is not logged in. The titles / 42 42 contents will be replaced by text "[Post title / content protected by 43 Login RequirePress. Login to see the title / content.]"43 Login Require Press. Login to see the title / content.]" 44 44 45 45 Technical summary: … … 76 76 https://wordpress.org/plugins/display-php-version/ 77 77 78 = Where can I ask a question about Login RequirePress? =78 = Where can I ask a question about Login Require Press? = 79 79 80 80 Ask your questions at: https://wordpress.org/support/plugin/loginrequirepress … … 90 90 == Screenshots == 91 91 92 1. Login RequirePress configuration screen with the table used to specify which posts are to be92 1. Login Require Press configuration screen with the table used to specify which posts are to be 93 93 login-protected. 94 94 95 2. Login RequirePress configuration screen with the lists of private, non-private login-protected,95 2. Login Require Press configuration screen with the lists of private, non-private login-protected, 96 96 and passcode-protected posts. 97 97 98 3. Login RequirePress edit post meta box to enable or disable login protection.98 3. Login Require Press edit post meta box to enable or disable login protection. 99 99 100 100 == Changelog == 101 102 = 1.2.0 = 103 * Tested up to WordPress 4.6 104 * Changed the plugin name from 'LoginRequirePress' to 'Login Require Press'. 105 * Indicating posts without names by token [no name #] where # is the post ID number. 106 * Shortened the plugin description appearing on the admin dashboard plugins list to just one 107 sentence. 108 * Added support for WordPress instances nested inside subdirectories. 101 109 102 110 = 1.1.0 =
Note: See TracChangeset
for help on using the changeset viewer.