WordPress.org

Plugin Directory


Ignore:
Location:
user-role-editor/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • user-role-editor/trunk/includes/class-role-additional-options.php

    r1372878 r1384761  
    9191            foreach(array_keys($this->active_items[$role]) as $item_id) { 
    9292                if (isset($this->items[$item_id])) { 
    93                     add_action($this->items[$item_id]->hook, $this->items[$item_id]->routine); 
     93                    add_action($this->items[$item_id]->hook, $this->items[$item_id]->routine, 99); 
    9494                } 
    9595            }             
  • user-role-editor/trunk/includes/class-user-other-roles.php

    r1372878 r1384761  
    243243    public function update($user_id) { 
    244244 
     245        global $wp_roles; 
     246         
     247        if (!current_user_can('edit_users')) { 
     248            return false; 
     249        } 
    245250        if (!current_user_can('edit_user', $user_id)) { 
    246251            return false; 
     
    252257        } 
    253258         
    254         $ure_other_roles = explode(',', str_replace(' ', '', $_POST['ure_other_roles'])); 
    255         $new_roles = array_intersect($user->roles, $ure_other_roles); 
    256         $skip_roles = array(); 
    257         foreach ($new_roles as $role) { 
    258             $skip_roles['$role'] = 1; 
    259         } 
    260         unset($new_roles); 
     259        $data = explode(',', str_replace(' ', '', $_POST['ure_other_roles'])); 
     260        $ure_other_roles = array(); 
     261        foreach($data as $role_id) { 
     262            if (!isset($wp_roles->roles[$role_id])) {   // skip unexisted roles 
     263                continue; 
     264            } 
     265            if (is_array($user->roles) && !in_array($role_id, $user->roles)) { 
     266                $ure_other_roles[] = $role_id; 
     267            } 
     268        } 
    261269        foreach ($ure_other_roles as $role) { 
    262             if (!isset($skip_roles[$role])) { 
    263                 $user->add_role($role); 
    264             } 
     270            $user->add_role($role); 
    265271        } 
    266272         
  • user-role-editor/trunk/includes/class-user-role-editor.php

    r1372878 r1384761  
    207207                        value="Without role (<?php echo $users_quant;?>)" onclick="ure_move_users_from_no_role_dialog()"> 
    208208        <div id="move_from_no_role_dialog" class="ure-dialog"> 
    209             <div id="move_from_no_role_content" style="padding: 10px;"> 
    210                 To: <select name="ure_new_role" id="ure_new_role"> 
    211                     <option value="no_rights">No rights</option> 
    212                 </select><br>     
    213             </div>                 
     209            <div id="move_from_no_role_content" style="padding: 10px;"></div>                 
    214210        </div> 
    215211<?php         
     
    250246        'wp_nonce' => wp_create_nonce('user-role-editor'), 
    251247        'move_from_no_role_title' => esc_html__('Change role for users without role', 'user-role-editor'), 
     248        'to' => esc_html__('To:', 'user-role-editor'),   
    252249        'no_rights_caption' => esc_html__('No rights', 'user-role-editor'),   
    253250        'provide_new_role_caption' => esc_html__('Provide new role', 'user-role-editor') 
  • user-role-editor/trunk/includes/classes/ure-lib.php

    r1372878 r1384761  
    385385<div class="wrap"> 
    386386          <div id="ure-icon" class="icon32"><br/></div> 
    387     <h2><?php _e('User Role Editor', 'user-role-editor'); ?></h2> 
     387    <h1><?php _e('User Role Editor', 'user-role-editor'); ?></h1> 
    388388    <div id="ure_container" style="min-width: <?php echo $container_width;?>px;"> 
    389389        <div class="ure-sidebar" > 
  • user-role-editor/trunk/includes/settings-template.php

    r1372878 r1384761  
    1515        <div id="ure-icon" class="icon32"><br></div>         
    1616    </a>     
    17     <h2><?php esc_html_e('User Role Editor - Options', 'user-role-editor'); ?></h2>             
     17    <h1><?php esc_html_e('User Role Editor - Options', 'user-role-editor'); ?></h1> 
    1818 
    1919    <div id="ure_tabs" style="clear: left;"> 
  • user-role-editor/trunk/js/ure-users.js

    r1372878 r1384761  
    11/* User Role Editor for users.php */ 
    22 
    3 jQuery(document).ready(function() { 
     3jQuery(document).ready(function() {         
     4    jQuery('#move_from_no_role_content').append(ure_users_data.to +' <select id="ure_new_role" name="ure_new_role"></select>'); 
     5    var ure_new_role = jQuery('#ure_new_role'); 
    46    var options = jQuery("#new_role > option").clone(); 
    57    jQuery('#ure_new_role').empty().append(options); 
     
    911 
    1012    // Exclude change role to 
    11     jQuery('#selectBox option[value=""]').remove(); 
     13    jQuery('#ure_new_role option[value=""]').remove(); 
    1214    var new_role = jQuery('#new_role').find(":selected").val(); 
    1315    if (new_role.length > 0) { 
    14         jQuery("#ure_new_role").val(new_role); 
     16        ure_new_role.val(new_role); 
    1517    } 
    16     jQuery('#ure_new_role').trigger('updated'); 
     18    ure_new_role.trigger('updated');     
    1719}); 
    1820 
     
    2022 
    2123function ure_move_users_from_no_role_dialog() {     
    22  
     24     
    2325    jQuery('#move_from_no_role_dialog').dialog({ 
    2426        dialogClass: 'wp-dialog', 
     
    3335            'OK': function () { 
    3436                ure_move_users_from_no_role(); 
    35  
     37                jQuery(this).dialog('close'); 
    3638            }, 
    3739            Cancel: function () { 
     
    4648   
    4749function ure_move_users_from_no_role() { 
    48     new_role = jQuery('#ure_new_role').find(":selected").val(); 
     50    var new_role = jQuery('#ure_new_role').find(":selected").val(); 
    4951    if (new_role.length==0) { 
    5052        alert(ure_users_data.provide_new_role_caption); 
  • user-role-editor/trunk/readme.txt

    r1372878 r1384761  
    55Requires at least: 4.0 
    66Tested up to: 4.5 
    7 Stable tag: 4.24 
     7Stable tag: 4.25 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    3737<li>Roles and Users permissions management via Network Admin  for multisite configuration. One click Synchronization to the whole network.</li> 
    3838<li>"Other roles access" module allows to define which other roles user with current role may see at WordPress: dropdown menus, e.g assign role to user editing user profile, etc.</li> 
    39 <li>Per posts/pages users access management to post/page editing functionality.</li> 
     39<li>Manage user access to editing posts/pages/custom post type using posts/pages, authors, taxonomies ID list.</li> 
    4040<li>Per plugin users access management for plugins activate/deactivate operations.</li> 
    4141<li>Per form users access management for Gravity Forms plugin.</li> 
     
    7777 
    7878== Changelog == 
     79= [4.25] 02.04.2016 = 
     80* Important security update: Any registered user could get an administrator access. Thanks to [John Muncaster](http://johnmuncaster.com/) for discovering and wisely reporting it. 
     81* URE pages title tag was replaced from h2 to h1, for compatibility with other WordPress pages. 
     82* Fix: "Assign role to the users without role" feature ignored role selected by user. 
     83* Fix: PHP fatal error (line 34) was raised at uninstall.php for WordPress multisite. 
     84* Update: action priority 99 was added for role additional options hook action setup. 
     85 
    7986= [4.24] 17.03.2016 = 
    8087* Fix: PHP notice was generated by class-role-additional-options.php in case when some option does not exist anymore 
    8188* Enhance: 'Add Capability' button have added capability to the WordPress built-in administrator role by default. It did not work, if 'administrator' role did not exist. 
    8289  Now script selects automatically as an admin role a role with the largest quant of capabilities and adds new capability to the selected role. 
    83 * New: User capabilities page was integrated with "[User Switching](https://wordpress.org/plugins/user-switching/)" plugin - "Switch To" the editing user link is added if "User Switching" plugin is available. 
     90* New: User capabilities page was integrated with "[User Switching](https://wordpress.org/plugins/user-switching/)" plugin - "Switch To" the editing user link iss added if "User Switching" plugin is available. 
    8491* Marked as compatible with WordPress 4.5. 
    8592 
  • user-role-editor/trunk/uninstall.php

    r1372878 r1384761  
    66 */ 
    77 
     8global $wpdb; 
    89 
    910if (!defined('ABSPATH') || !defined('WP_UNINSTALL_PLUGIN')) { 
  • user-role-editor/trunk/user-role-editor.php

    r1372878 r1384761  
    44Plugin URI: https://www.role-editor.com 
    55Description: Change/add/delete WordPress user roles and capabilities. 
    6 Version: 4.24 
     6Version: 4.25 
    77Author: Vladimir Garagulya 
    88Author URI: https://www.role-editor.com 
     
    2424} 
    2525 
    26 define('URE_VERSION', '4.24'); 
     26define('URE_VERSION', '4.25'); 
    2727define('URE_PLUGIN_URL', plugin_dir_url(__FILE__)); 
    2828define('URE_PLUGIN_DIR', plugin_dir_path(__FILE__)); 
Note: See TracChangeset for help on using the changeset viewer.