Changeset 2692638
- Timestamp:
- 03/11/2022 03:03:10 PM (4 years ago)
- Location:
- cc-god-user
- Files:
-
- 48 added
- 2 deleted
- 10 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/.gitignore (added)
-
tags/1.1.0/.htaccess (added)
-
tags/1.1.0/AUTHORS.txt (added)
-
tags/1.1.0/LICENSE.txt (added)
-
tags/1.1.0/README.txt (added)
-
tags/1.1.0/composer.json (added)
-
tags/1.1.0/composer.lock (added)
-
tags/1.1.0/includes (added)
-
tags/1.1.0/includes/God_User.php (added)
-
tags/1.1.0/includes/Profile.php (added)
-
tags/1.1.0/includes/Table.php (added)
-
tags/1.1.0/includes/index.html (added)
-
tags/1.1.0/index.html (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/languages/cc-god-user-pl_PL.mo (added)
-
tags/1.1.0/languages/cc-god-user-pl_PL.po (added)
-
tags/1.1.0/languages/index.html (added)
-
tags/1.1.0/plugin.php (added)
-
tags/1.1.0/screenshot-1.png (added)
-
tags/1.1.0/screenshot-2.png (added)
-
tags/1.1.0/templates (added)
-
tags/1.1.0/templates/code.php (added)
-
tags/1.1.0/templates/index.html (added)
-
tags/1.1.0/templates/link.php (added)
-
tags/1.1.0/templates/profile.php (added)
-
tags/1.1.0/templates/span.php (added)
-
tags/1.1.0/uninstall.php (added)
-
tags/1.1.0/vendor (added)
-
tags/1.1.0/vendor/autoload.php (added)
-
tags/1.1.0/vendor/classmap.php (added)
-
tags/1.1.0/vendor/clearcode (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/.gitignore (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/.htaccess (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/AUTHORS.txt (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/LICENSE.txt (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/README.md (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/composer.json (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/index.html (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/index.html (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/v3 (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/v3/Filterer.php (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/v3/Plugin.php (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/v3/Singleton.php (added)
-
tags/1.1.0/vendor/clearcode/wordpress-framework/src/v3/index.html (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/includes/God_User.php (modified) (3 diffs)
-
trunk/includes/Profile.php (modified) (5 diffs)
-
trunk/includes/Table.php (modified) (3 diffs)
-
trunk/plugin.php (modified) (4 diffs)
-
trunk/uninstall.php (modified) (1 diff)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/classmap.php (added)
-
trunk/vendor/clearcode/wordpress-framework/src/v3/Autoloader.php (deleted)
-
trunk/vendor/clearcode/wordpress-framework/src/v3/Filterer.php (modified) (2 diffs)
-
trunk/vendor/clearcode/wordpress-framework/src/v3/Plugin.php (modified) (2 diffs)
-
trunk/vendor/clearcode/wordpress-framework/src/v3/Singleton.php (modified) (3 diffs)
-
trunk/vendor/composer (deleted)
Legend:
- Unmodified
- Added
- Removed
-
cc-god-user/trunk/README.txt
r1925743 r2692638 4 4 Requires PHP: 7.0 5 5 Requires at least: 4.9.8 6 Tested up to: 4.9.86 Tested up to: 5.9.1 7 7 Stable tag: trunk 8 8 License: GPLv3 … … 45 45 == Changelog == 46 46 47 = 1.1.0 = 48 * Release date: 11.03.2022* 49 50 * Fixed Multisite support. 51 47 52 = 1.0.0 = 53 * Release date: 16.08.2018* 48 54 49 55 * First stable version of the plugin. -
cc-god-user/trunk/includes/God_User.php
r1925743 r2692638 2 2 3 3 /* 4 Copyright (C) 20 18by Clearcode <https://clearcode.cc> and associates4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> and associates 5 5 (see AUTHORS.txt file). 6 6 … … 24 24 namespace Clearcode; 25 25 26 use Clearcode\ Framework\v3\Plugin;26 use Clearcode\God_User\Vendor\Clearcode\Framework\v3\Plugin; 27 27 use Clearcode\God_User\Table; 28 28 use Clearcode\God_User\Profile; … … 63 63 64 64 static public function is_god() { 65 return ( current_user_can( self::ROLE ) && current_user_can( self::CAPABILITY ) ); 65 if ( ! $current_user = wp_get_current_user() ) return false; 66 return ( isset( $current_user->caps[ self::ROLE ] ) && isset( $current_user->caps[ self::CAPABILITY ] ) ); 66 67 } 67 68 -
cc-god-user/trunk/includes/Profile.php
r1925743 r2692638 2 2 3 3 /* 4 Copyright (C) 20 18by Clearcode <https://clearcode.cc> and associates4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> and associates 5 5 (see AUTHORS.txt file). 6 6 … … 23 23 24 24 namespace Clearcode\God_User; 25 use Clearcode\God_User; 25 26 26 use Clearcode\God_User; 27 use Clearcode\Framework\v3\Singleton; 28 use Clearcode\Framework\v3\Filterer; 27 use Clearcode\God_User\Vendor\Clearcode\Framework\v3\Singleton; 28 use Clearcode\God_User\Vendor\Clearcode\Framework\v3\Filterer; 29 29 use WP_User; 30 30 … … 39 39 40 40 public function action_edit_user_profile( $user ) { 41 if ( God_User::is_god() && $user->has_cap( God_User::ROLE) )41 if ( God_User::is_god() && isset( $user->caps[ God_User::ROLE ] ) ) 42 42 echo God_User::render( 'profile', [ 43 43 'title' => God_User::__( 'God User' ), … … 45 45 'content' => God_User::__( 'God User' ) 46 46 ] ) ), 47 'checked' => checked( $user->has_cap( God_User::CAPABILITY), true, false ),47 'checked' => checked( isset( $user->caps[ God_User::CAPABILITY ] ), true, false ), 48 48 'id' => God_User::CAPABILITY, 49 49 'name' => God_User::CAPABILITY … … 53 53 public function action_profile_update( $user_id ) { 54 54 if ( ! $user = new WP_User( $user_id ) ) return; 55 if ( ! $user->has_cap( God_User::ROLE) ) return;55 if ( ! isset( $user->caps[ God_User::ROLE ] ) ) return; 56 56 if ( God_User::is_god() ) 57 isset( $_POST[ God_User::CAPABILITY ] ) ? $user->add_cap( God_User::CAPABILITY ) : $user->remove_cap( God_User::CAPABILITY ); 57 isset( $_POST[ God_User::CAPABILITY ] ) 58 ? $user->add_cap( God_User::CAPABILITY ) 59 : $user->remove_cap( God_User::CAPABILITY ); 58 60 } 59 61 60 62 public function action_edit_user_profile_update( $user_id ) { 61 if ( ! $user = new WP_User( $user_id ) ) return;62 if ( $user->has_cap( God_User::CAPABILITY) && ! God_User::is_god() )63 if ( ! $user = new WP_User( $user_id ) ) return; 64 if ( isset( $user->caps[ God_User::CAPABILITY ] ) && ! God_User::is_god() ) 63 65 wp_die( God_User::__( 'Cheatin’ uh?' ) ); 64 66 } -
cc-god-user/trunk/includes/Table.php
r1925743 r2692638 2 2 3 3 /* 4 Copyright (C) 20 18by Clearcode <https://clearcode.cc> and associates4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> and associates 5 5 (see AUTHORS.txt file). 6 6 … … 23 23 24 24 namespace Clearcode\God_User; 25 use Clearcode\God_User; 25 26 26 use Clearcode\God_User; 27 use Clearcode\Framework\v3\Singleton; 28 use Clearcode\Framework\v3\Filterer; 27 use Clearcode\God_User\Vendor\Clearcode\Framework\v3\Singleton; 28 use Clearcode\God_User\Vendor\Clearcode\Framework\v3\Filterer; 29 29 30 30 if ( ! defined( 'ABSPATH' ) ) exit; … … 62 62 63 63 public function filter_get_role_list( $role, $user ) { 64 if ( array_key_exists( God_User::ROLE, $role ) and $user->has_cap( God_User::CAPABILITY) )64 if ( array_key_exists( God_User::ROLE, $role ) and isset( $user->caps[ God_User::CAPABILITY ] ) ) 65 65 $role[ God_User::ROLE ] = God_User::__( 'God User' ); 66 66 return $role; -
cc-god-user/trunk/plugin.php
r1925743 r2692638 7 7 * @author Nikodem Jankiewicz <http://nikodemjankiewicz.pl> 8 8 * @author PiotrPress <http://piotr.press> 9 * @copyright 20 18Clearcode9 * @copyright 2022 Clearcode 10 10 * @license GPL-3.0+ 11 11 * … … 14 14 * Plugin URI: https://wordpress.org/plugins/cc-god-user 15 15 * Description: This plugin allows to add the God Users capability, block the delete option and hide specific users on the users list. 16 * Version: 1. 0.016 * Version: 1.1.0 17 17 * Author: Clearcode 18 18 * Author URI: https://clearcode.cc … … 22 22 * License URI: http://www.gnu.org/licenses/gpl-3.0.txt 23 23 24 Copyright (C) 20 18by Clearcode <https://clearcode.cc> and associates24 Copyright (C) 2022 by Clearcode <https://clearcode.cc> and associates 25 25 (see AUTHORS.txt file). 26 26 … … 43 43 44 44 namespace Clearcode\God_User; 45 46 45 use Clearcode\God_User; 47 use Clearcode\Framework\v3\Autoloader;48 46 49 47 defined( 'ABSPATH' ) or exit; 50 48 51 49 try { 52 require __DIR__ . '/vendor/autoload.php'; 53 new Autoloader( [ __NAMESPACE__ . '\\' => __DIR__ . '/includes' ] ); 54 55 foreach( [ 'God_User' ] as $file ) 56 require_once( __DIR__ . "/includes/$file.php" ); 57 50 require __DIR__ . '/vendor/autoload.php'; 58 51 God_User::instance( __FILE__ ); 59 60 52 } catch ( Exception $exception ) { 61 53 if ( WP_DEBUG && WP_DEBUG_DISPLAY ) -
cc-god-user/trunk/uninstall.php
r1925743 r2692638 2 2 3 3 /* 4 Copyright (C) 20 18by Clearcode <https://clearcode.cc> and associates4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> and associates 5 5 (see AUTHORS.txt file). 6 6 -
cc-god-user/trunk/vendor/autoload.php
r1925743 r2692638 1 <?php 2 3 // autoload.php @generated by Composer 4 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 7 return ComposerAutoloaderInitcd6612990B4EBF424413DFEFB23EB54745::getLoader(); 1 <?php return spl_autoload_register( function( string $class ) { 2 $map = require __DIR__ . '/classmap.php'; 3 if ( isset( $map[ $class ] ) ) require dirname( __DIR__ ) . $map[ $class ]; 4 } ); -
cc-god-user/trunk/vendor/clearcode/wordpress-framework/src/v3/Filterer.php
r1925743 r2692638 2 2 3 3 /* 4 Copyright (C) 20 18by Clearcode <https://clearcode.cc>4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> 5 5 and associates (see AUTHORS.txt file). 6 6 … … 22 22 */ 23 23 24 namespace Clearcode\ Framework\v3;24 namespace Clearcode\God_User\Vendor\Clearcode\Framework\v3; 25 25 26 26 use ReflectionClass; -
cc-god-user/trunk/vendor/clearcode/wordpress-framework/src/v3/Plugin.php
r1925743 r2692638 2 2 3 3 /* 4 Copyright (C) 20 18by Clearcode <https://clearcode.cc>4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> 5 5 and associates (see AUTHORS.txt file). 6 6 … … 22 22 */ 23 23 24 namespace Clearcode\ Framework\v3;24 namespace Clearcode\God_User\Vendor\Clearcode\Framework\v3; 25 25 26 26 defined( 'ABSPATH' ) or exit; -
cc-god-user/trunk/vendor/clearcode/wordpress-framework/src/v3/Singleton.php
r1925743 r2692638 2 2 3 3 /* 4 Copyright (C) 20 18by Clearcode <https://clearcode.cc>4 Copyright (C) 2022 by Clearcode <https://clearcode.cc> 5 5 and associates (see AUTHORS.txt file). 6 6 … … 22 22 */ 23 23 24 namespace Clearcode\ Framework\v3;24 namespace Clearcode\God_User\Vendor\Clearcode\Framework\v3; 25 25 26 26 defined( 'ABSPATH' ) or exit; … … 28 28 if ( ! trait_exists( __NAMESPACE__ . '\Singleton' ) ) { 29 29 trait Singleton { 30 final private function __clone() {31 _doing_it_wrong( __METHOD__, __( 'Cheatin’ uh?' ), '' );32 }33 final private function __wakeup() {34 _doing_it_wrong( __METHOD__, __( 'Cheatin’ uh?' ), '' );35 }36 37 30 protected function __construct() { 38 31 _doing_it_wrong( __METHOD__, __( 'Cheatin’ uh?' ), '' );
Note: See TracChangeset
for help on using the changeset viewer.