Plugin Directory

Changeset 1916342


Ignore:
Timestamp:
07/28/2018 10:13:19 PM (8 years ago)
Author:
thexerox
Message:

0.2.3

  • Fix: Fixed error when debug on
  • Feature: You can make a page only accessible for visitors
  • Feature: You can make a page only accessible to registered users
Location:
super-access-manager/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • super-access-manager/trunk/inc/admin/class-accessmanager.php

    r1916180 r1916342  
    163163            // get roles
    164164            $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
    165181            ?>
    166182
     
    171187                echo '<option value=""></option>';
    172188
     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>';
    173194
    174195                // check user roles
     
    264285    public function filter_posts($posts){
    265286
     287        $postarray = array();
     288
    266289        // Get the current user
    267290        $current_user = wp_get_current_user();
     
    316339        }else{ // Post has specific access settings
    317340
    318 
    319341            $rolecheck = false;
    320342            $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
    321371
    322372            // check for roles
  • super-access-manager/trunk/readme.txt

    r1916196 r1916342  
    77Requires PHP: 5.6
    88License: GPLv3
    9 Stable tag: 0.2.2
     9Stable tag: 0.2.3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
    1111
     
    1818- Control access to Posts, pages and custom post types
    1919- Make posts available on a user role base or grant access to specific users
     20- Make posts only available for visitors or registered users
    2021- Create personal pages
    2122- Auto hide pages in menu’s
     
    3637You can control access to post for every specic user and on a role base.
    3738
     39= What are visitors? =
     40Visitors are user that are not logged in to you website.
    3841
    39 = Where to find the super access manager control panel?? =
     42= What are registered users =
     43Users with an account, currently logged in to your website.
     44
     45= Can you control access by login status? =
     46You 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? =
    4049You can find the control panel under the users section
    4150
     
    4453
    4554== 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
    4660= 0.2.2 =
    47 * Feature: Admins can enable the option to automaticly remove unaccesable posts from menus.
     61* Feature: Admins can enable the option to automatically remove unaccessible posts from menus.
    4862
    4963= 0.2 =
     
    5569* Remove: Legacy updated removed
    5670* Tweak: the "xeweb_sam-allowed_users" key is replaced by "txsc_allowed_users"
    57 * Tweak: Admins can select to enable access management for diffrent post types
     71* Tweak: Admins can select to enable access management for different post types
    5872
    5973= 0.1.6.1 =
     
    6377* Tweak: the "txsc_allowed_users" key is replaced by "xeweb_sam-allowed_users"
    6478* Fix: Non available pages are filtert out category counters
    65 * Feature: Allow categorys to hide/Show automaticlly when no posts available
     79* Feature: Allow categorys to hide/Show automatically when no posts available
    6680
    6781= 0.1.5 =
     
    7488
    7589= 0.1.3 =
    76 * Tweak: Filter out non accessable pages in category counters
     90* Tweak: Filter out non accessible pages in category counters
    7791
    7892= 0.1.2 =
    79 * Base plugin relaese
     93* Base plugin release
  • super-access-manager/trunk/super-access-manager.php

    r1916180 r1916342  
    33* Plugin Name: Super Access Manager
    44* Description: Control post access on a role and userbased level.
    5 * Version:     0.2.2
     5* Version:     0.2.3
    66* Author:      Xeweb
    77* Author URI:  https://www.xeweb.be
Note: See TracChangeset for help on using the changeset viewer.