Changeset 1916342
- Timestamp:
- 07/28/2018 10:13:19 PM (8 years ago)
- Location:
- super-access-manager/trunk
- Files:
-
- 3 edited
-
inc/admin/class-accessmanager.php (modified) (4 diffs)
-
readme.txt (modified) (7 diffs)
-
super-access-manager.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
super-access-manager/trunk/inc/admin/class-accessmanager.php
r1916180 r1916342 163 163 // get roles 164 164 $user_roles = get_editable_roles(); 165 166 $only_vistors_selected = ''; 167 $only_users_selected = ''; 168 169 if(is_array($post_meta)) { 170 // Add selected to only vistors if selected 171 if ( in_array( 'onlyvistors', $post_meta ) ) { 172 $only_vistors_selected = 'selected'; 173 } 174 175 // Add selected to only users if selected 176 if ( in_array( 'onlyusers', $post_meta ) ) { 177 $only_users_selected = 'selected'; 178 } 179 } 180 165 181 ?> 166 182 … … 171 187 echo '<option value=""></option>'; 172 188 189 190 // check user roles 191 echo '<option disabled><b>---- '.__('Authentication','xeweb_sam').' ----</b></option>'; 192 echo '<option value="onlyvistors" '.$only_vistors_selected.'>'.__('Only Visitors','xeweb_sam').'</option>'; 193 echo '<option value="onlyusers" '.$only_users_selected.'>'.__('Only registered Users','xeweb_sam').'</option>'; 173 194 174 195 // check user roles … … 264 285 public function filter_posts($posts){ 265 286 287 $postarray = array(); 288 266 289 // Get the current user 267 290 $current_user = wp_get_current_user(); … … 316 339 }else{ // Post has specific access settings 317 340 318 319 341 $rolecheck = false; 320 342 $usercheck = false; 343 344 // check if only available vistors 345 if(in_array('onlyvistors',$meta_array)){ 346 347 // Vistors can see or Admins - Not available for other users 348 if(!isset($current_user->ID) OR get_option('xeweb-sam_admin_see_all_pages') == "on" && current_user_can('manage_options')){ 349 return true; 350 } 351 352 // Not available for other users 353 return null; 354 355 } 356 357 // check if only registerd users 358 if(in_array('onlyusers',$meta_array)){ 359 360 // Check if user is set, if user, page is available 361 if(isset($current_user->ID)){ 362 return true; 363 } 364 365 // Not available for other users 366 return null; 367 368 } 369 370 321 371 322 372 // check for roles -
super-access-manager/trunk/readme.txt
r1916196 r1916342 7 7 Requires PHP: 5.6 8 8 License: GPLv3 9 Stable tag: 0.2. 29 Stable tag: 0.2.3 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html 11 11 … … 18 18 - Control access to Posts, pages and custom post types 19 19 - Make posts available on a user role base or grant access to specific users 20 - Make posts only available for visitors or registered users 20 21 - Create personal pages 21 22 - Auto hide pages in menu’s … … 36 37 You can control access to post for every specic user and on a role base. 37 38 39 = What are visitors? = 40 Visitors are user that are not logged in to you website. 38 41 39 = Where to find the super access manager control panel?? = 42 = What are registered users = 43 Users with an account, currently logged in to your website. 44 45 = Can you control access by login status? = 46 You can give access to a post to only registered users or to visitors only. 47 48 = Where to find the super access manager control panel? = 40 49 You can find the control panel under the users section 41 50 … … 44 53 45 54 == Changelog == 55 = 0.2.3 = 56 * Fix: Fixed error when debug on 57 * Feature: You can make a pagge only accessible for visitors 58 * Feature: You can make a page only accessible to registered users 59 46 60 = 0.2.2 = 47 * Feature: Admins can enable the option to automatic ly remove unaccesable posts from menus.61 * Feature: Admins can enable the option to automatically remove unaccessible posts from menus. 48 62 49 63 = 0.2 = … … 55 69 * Remove: Legacy updated removed 56 70 * Tweak: the "xeweb_sam-allowed_users" key is replaced by "txsc_allowed_users" 57 * Tweak: Admins can select to enable access management for diff rent post types71 * Tweak: Admins can select to enable access management for different post types 58 72 59 73 = 0.1.6.1 = … … 63 77 * Tweak: the "txsc_allowed_users" key is replaced by "xeweb_sam-allowed_users" 64 78 * Fix: Non available pages are filtert out category counters 65 * Feature: Allow categorys to hide/Show automatic lly when no posts available79 * Feature: Allow categorys to hide/Show automatically when no posts available 66 80 67 81 = 0.1.5 = … … 74 88 75 89 = 0.1.3 = 76 * Tweak: Filter out non access able pages in category counters90 * Tweak: Filter out non accessible pages in category counters 77 91 78 92 = 0.1.2 = 79 * Base plugin rel aese93 * Base plugin release -
super-access-manager/trunk/super-access-manager.php
r1916180 r1916342 3 3 * Plugin Name: Super Access Manager 4 4 * Description: Control post access on a role and userbased level. 5 * Version: 0.2. 25 * Version: 0.2.3 6 6 * Author: Xeweb 7 7 * Author URI: https://www.xeweb.be
Note: See TracChangeset
for help on using the changeset viewer.