Plugin Directory

Changeset 895872


Ignore:
Timestamp:
04/17/2014 08:20:29 AM (12 years ago)
Author:
belinde
Message:

Versione 0.5.2

Location:
autochmod
Files:
1 deleted
2 edited
12 copied

Legend:

Unmodified
Added
Removed
  • autochmod/tags/0.5.2/autochmod.php

    r881593 r895872  
    55  Description: Protect folders and files from unhautorized changes managing filesystem permissions.
    66  Author: Franco Traversaro
    7   Version: 0.5.1
     7  Version: 0.5.2
    88  Author URI: mailto:franco.traversaro@e2net.it
    99  Text Domain: autochmod
     
    2323            'd' => array( 'u' => 5, 'g' => 5, 'a' => 5 ),
    2424            'f' => array( 'u' => 4, 'g' => 4, 'a' => 4 ) ) );
    25     private $msgs = array();
    2625
    2726    private function __construct() {
     
    229228                    $this->keep_writable = $save;
    230229
    231                     $save = $this->perms;
    232230                    if ( isset( $_POST[ 'perms' ] ) and is_array( $_POST[ 'perms' ] ) )
    233231                        foreach ( $_POST[ 'perms' ] as $mode => $kind_data )
    234232                            foreach ( $kind_data as $kind => $perm_data )
    235233                                foreach ( $perm_data as $target => $permission )
    236                                     if ( isset( $this->perms[ $mode ][ $kind ][ $target ] ) and ( $permission = absint( $permission )) <= 7 )
    237                                         $this->perms[ $mode ][ $kind ][ $target ] = $permission;
     234                                    $this->maybe_set_perm( $mode, $kind, $target, $permission );
    238235
    239236                    $this->update_option( 'autochmod_perms', $this->perms );
     
    248245
    249246        load_plugin_textdomain( 'autochmod', false, 'autochmod/languages' );
     247    }
     248
     249    private function maybe_set_perm( $mode, $kind, $target, $permission ) {
     250        if ( $mode != '+' and $mode != '-' )
     251            return false;
     252        if ( $kind != 'd' and $kind != 'f' )
     253            return false;
     254        if ( $target != 'u' and $target != 'g' and $target != 'a' )
     255            return false;
     256        if ( ( $permission = absint( $permission )) > 7 )
     257            return false;
     258        $this->perms[ $mode ][ $kind ][ $target ] = $permission;
    250259    }
    251260
  • autochmod/tags/0.5.2/readme.txt

    r881593 r895872  
    44Tags: security, filesystem, permissions, chmod, folders, files
    55Requires at least: 3.1.0
    6 Tested up to: 3.8.1
    7 Stable tag: 0.5.1
     6Tested up to: 3.9
     7Stable tag: 0.5.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3838
    39391. The config page when protection is active.
    40 2. The config page when protection isn't active. Note the countdown on the admin button (refresh only when page loads).
     402. The config page when protection isn't active. Note the countdown on the admin button.
    41413. The alert on plugin installation page when protection is active. The same alert is shown also on edit plugin page and installation and edit theme pages.
    42424. The Help tab. Less text in the page, more comfort for the user.
     
    4848
    4949**0.5.1** Fixed the behaviour of the admin bar button on multisite installation: the option are now saved on site_meta
     50
     51**0.5.2** Fixed a bug who didn't permit saving permission options on some network installations
    5052
    5153= 0.4 =
  • autochmod/trunk/autochmod.php

    r881593 r895872  
    55  Description: Protect folders and files from unhautorized changes managing filesystem permissions.
    66  Author: Franco Traversaro
    7   Version: 0.5.1
     7  Version: 0.5.2
    88  Author URI: mailto:franco.traversaro@e2net.it
    99  Text Domain: autochmod
     
    2323            'd' => array( 'u' => 5, 'g' => 5, 'a' => 5 ),
    2424            'f' => array( 'u' => 4, 'g' => 4, 'a' => 4 ) ) );
    25     private $msgs = array();
    2625
    2726    private function __construct() {
     
    229228                    $this->keep_writable = $save;
    230229
    231                     $save = $this->perms;
    232230                    if ( isset( $_POST[ 'perms' ] ) and is_array( $_POST[ 'perms' ] ) )
    233231                        foreach ( $_POST[ 'perms' ] as $mode => $kind_data )
    234232                            foreach ( $kind_data as $kind => $perm_data )
    235233                                foreach ( $perm_data as $target => $permission )
    236                                     if ( isset( $this->perms[ $mode ][ $kind ][ $target ] ) and ( $permission = absint( $permission )) <= 7 )
    237                                         $this->perms[ $mode ][ $kind ][ $target ] = $permission;
     234                                    $this->maybe_set_perm( $mode, $kind, $target, $permission );
    238235
    239236                    $this->update_option( 'autochmod_perms', $this->perms );
     
    248245
    249246        load_plugin_textdomain( 'autochmod', false, 'autochmod/languages' );
     247    }
     248
     249    private function maybe_set_perm( $mode, $kind, $target, $permission ) {
     250        if ( $mode != '+' and $mode != '-' )
     251            return false;
     252        if ( $kind != 'd' and $kind != 'f' )
     253            return false;
     254        if ( $target != 'u' and $target != 'g' and $target != 'a' )
     255            return false;
     256        if ( ( $permission = absint( $permission )) > 7 )
     257            return false;
     258        $this->perms[ $mode ][ $kind ][ $target ] = $permission;
    250259    }
    251260
  • autochmod/trunk/readme.txt

    r881593 r895872  
    44Tags: security, filesystem, permissions, chmod, folders, files
    55Requires at least: 3.1.0
    6 Tested up to: 3.8.1
    7 Stable tag: 0.5.1
     6Tested up to: 3.9
     7Stable tag: 0.5.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3838
    39391. The config page when protection is active.
    40 2. The config page when protection isn't active. Note the countdown on the admin button (refresh only when page loads).
     402. The config page when protection isn't active. Note the countdown on the admin button.
    41413. The alert on plugin installation page when protection is active. The same alert is shown also on edit plugin page and installation and edit theme pages.
    42424. The Help tab. Less text in the page, more comfort for the user.
     
    4848
    4949**0.5.1** Fixed the behaviour of the admin bar button on multisite installation: the option are now saved on site_meta
     50
     51**0.5.2** Fixed a bug who didn't permit saving permission options on some network installations
    5052
    5153= 0.4 =
Note: See TracChangeset for help on using the changeset viewer.