Changeset 2038744
- Timestamp:
- 02/25/2019 10:56:24 AM (7 years ago)
- Location:
- secure-file-manager
- Files:
-
- 6 edited
-
assets/screenshot-3.png (modified) (previous)
-
trunk/assets/admin/css/cosmostrap.css (modified) (2 diffs)
-
trunk/includes/activation.php (modified) (1 diff)
-
trunk/includes/admin.php (modified) (8 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/secure-file-manager.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
secure-file-manager/trunk/assets/admin/css/cosmostrap.css
r2034959 r2038744 1591 1591 .tx_wrap .form-check-label { 1592 1592 margin-bottom: 0; 1593 margin-left: 20px; 1593 1594 } 1594 1595 .tx_wrap .form-check-inline { … … 7320 7321 height: auto; 7321 7322 width: auto; 7323 margin-left: 0px; 7322 7324 } 7323 7325 .tx_wrap input[type=radio] { -
secure-file-manager/trunk/includes/activation.php
r2034959 r2038744 3 3 * Execute the following code during plugin activation 4 4 * 5 * @since 1.05 * @since 2.0 6 6 * @package Secure File Manager 7 7 * @author Themexa 8 8 */ 9 10 if ( empty( get_option( 'sfm_auth_roles' ) ) ) { 11 update_option ( 'sfm_auth_roles', explode( ',', 'administrator' ) ); 12 } -
secure-file-manager/trunk/includes/admin.php
r2035139 r2038744 3 3 * Code for Admin Options 4 4 * 5 * @since 1.05 * @since 2.0 6 6 * @package Secure File Manager 7 7 * @author Themexa … … 12 12 $page_title = __( 'Secure File Manager', 'secure-file-manager' ); 13 13 $menu_title = __( 'Secure File Manager', 'secure-file-manager' ); 14 $capability = ' manage_options';14 $capability = 'read'; 15 15 $menu_slug = 'sfm_file_manager'; 16 16 $function = 'sfm_file_manager_display'; … … 26 26 __( 'Settings', 'secure-file-manager' ), 27 27 __( 'Settings', 'secure-file-manager' ), 28 ' manage_options',28 'read', 29 29 'sfm_settings', 30 30 'sfm_settings_display' … … 34 34 function sfm_file_manager_display() { 35 35 36 if ( ! current_user_can( 'manage_options' ) ) { 37 wp_die( 'Unauthorized user' ); 38 } elseif ( get_option( 'scp_auth_user' ) ) { 39 $userID = intval( get_option( 'scp_auth_user' ) ); 36 if ( get_option( 'sfm_auth_user' ) ) { 40 37 $currentUser = get_current_user_id(); 41 if ( $currentUser != $userID ) { 38 $currentUserRole = wp_get_current_user(); 39 $roles = ( array ) $currentUserRole->roles; 40 41 if ( ! (current_user_can('update_core') || in_array( $currentUser, get_option( 'sfm_auth_user' ) ) || array_intersect( get_option( 'sfm_auth_roles' ), $roles ) ) ) { 42 42 wp_die( '<h1>Unauthorized Access. Please contact Site Administrator.</h1>' ); 43 43 } 44 44 } 45 46 45 47 46 ?> … … 50 49 <div class="row"> 51 50 <div class="col-lg-12"> 52 <div class="jumbotron" style="background-image: url( <?php echo plugin_dir_url( dirname( __FILE__ ) ); ?>assets/images/tinypixi_pluginman_head.png); ">51 <div class="jumbotron" style="background-image: url( <?php echo plugin_dir_url( dirname( __FILE__ ) ); ?>assets/images/tinypixi_pluginman_head.png ); "> 53 52 <h1 class="display-3"><?php _e( 'Secure File Manager', 'secure-file-manager' ); ?></h1> 54 53 <p class="lead"><?php _e( 'WordPress file editing made easy (and secure)', 'bwpse' ); ?></p> … … 67 66 68 67 if ( ! current_user_can( 'manage_options' ) ) { 69 wp_die( 'Unauthorized user' ); 70 } elseif ( get_option( 'scp_auth_user' ) ) { 71 $userID = intval( get_option( 'scp_auth_user' ) ); 72 $currentUser = get_current_user_id(); 73 if ( $currentUser != $userID ) { 74 wp_die( '<h1>Unauthorized Access. Please contact Site Administrator.</h1>' ); 75 } 68 wp_die( '<h1>Unauthorized Access. Please contact Site Administrator.</h1>' ); 76 69 } 77 70 … … 82 75 <div class="row"> 83 76 <div class="col-lg-12"> 84 <div class="jumbotron" style="background-image: url( <?php echo plugin_dir_url( dirname( __FILE__ ) ); ?>assets/images/tinypixi_pluginman_head.png); ">77 <div class="jumbotron" style="background-image: url( <?php echo plugin_dir_url( dirname( __FILE__ ) ); ?>assets/images/tinypixi_pluginman_head.png ); "> 85 78 <h1 class="display-3"><?php _e( 'Secure File Manager', 'secure-file-manager' ); ?></h1> 86 79 <p class="lead"><?php _e( 'Settings', 'bwpse' ); ?></p> … … 88 81 </div> 89 82 </div> 90 <form method="post"> 91 <h1><?php _e( 'Security', 'secure-file-manager' ); ?></h1> 92 <fieldset id="scp_auth_user"> 93 <div class="form-group"> 94 <?php 95 if ( isset( $_POST[ 'scp_auth_user' ] ) ) { 96 update_option( 'scp_auth_user', intval($_POST['scp_auth_user']) ); 97 } 98 ?> 99 <label><?php _e( 'Which user should have access to the File Manager?', 'secure-file-manager' ); ?></label> 100 <input type="number" name="scp_auth_user" id="scp_auth_user" placeholder="e.g. 1" class="form-control" value="<?php echo get_option( 'scp_auth_user' ); ?>"> 101 <small class="form-text text-muted"><?php _e( 'Enter specific user ID', 'secure-file-manager' ); ?></small> 102 </div> 103 </fieldset> 104 <fieldset> 105 <input type="hidden" name="action" value="update" /> 106 <?php wp_nonce_field('scp_update_action'); ?> 107 <button type="submit" class="btn btn-primary"><?php _e( 'Save Changes', 'secure-file-manager' ); ?></button> 108 </fieldset> 109 </form> 83 <div class="row"> 84 <div class="col-md-6"> 85 <form method="post"> 86 <h1><?php _e( 'Limit with User ID(s)', 'secure-file-manager' ); ?></h1> 87 <fieldset id="sfm_auth_user"> 88 <div class="form-group"> 89 <?php 90 if ( isset( $_POST[ 'sfm_auth_user' ] ) ) { 91 update_option( 'sfm_auth_user', preg_replace( array( '/[^\d,]/', '/(?<=,),+/', '/^,+/', '/,+$/' ), '', explode( ',', $_POST[ 'sfm_auth_user' ] ) ) ); 92 } 93 ?> 94 <strong><label><?php _e( 'Which user should have access to the File Manager?', 'secure-file-manager' ); ?></label></strong> 95 <input type="text" name="sfm_auth_user" id="sfm_auth_user" placeholder="e.g. 1, 2, 3" class="form-control" value="<?php echo implode(', ',get_option( 'sfm_auth_user' )); ?>"> 96 <small class="form-text text-muted"><?php _e( 'Enter specific user ID. Enter comma ( , ) between IDs if there are more than one.', 'secure-file-manager' ); ?></small> 97 </div> 98 </fieldset> 99 <fieldset> 100 <input type="hidden" name="action" value="update" /> 101 <?php wp_nonce_field('sfm_update_action'); ?> 102 <button type="submit" class="btn btn-primary"><?php _e( 'Save Changes', 'secure-file-manager' ); ?></button> 103 </fieldset> 104 </form> 105 </div> 106 <div class="col-md-5 offset-md-1"> 107 <form method="post"> 108 <fieldset id="sfm_auth_roles"> 109 <?php 110 if( isset( $_POST[ 'sfm_auth_roles' ] ) ) { 111 update_option ( 'sfm_auth_roles', $_POST[ 'sfm_auth_roles' ]); 112 } 113 ?> 114 <h1><?php _e( 'Specify User Role(s)', 'secure-file-manager' ); ?></h1> 115 <strong><label><?php _e( 'Which user role(s) should have access to the File Manager?', 'secure-file-manager' ); ?></label></strong> 116 <p></p> 117 <div class="row"> 118 <?php foreach ( get_editable_roles() as $role_name => $role_info ): ?> 119 <div class="form-group col-md-6"> 120 <input class="form-check-input" type="checkbox" value="<?php echo $role_name; ?>" id="<?php echo $role_name; ?>" name="sfm_auth_roles[]" <?php echo in_array( $role_name, get_option( 'sfm_auth_roles' ) ) ? 'checked' : ''; ?> > 121 <label class="form-check-label" for="<?php echo $role_name; ?>"><span class="checkbox_role"><?php echo $role_info['name']; ?></span></label> 122 </div> 123 <?php endforeach; ?> 124 </div> 125 </fieldset> 126 <fieldset> 127 <input type="hidden" name="action" value="update" /> 128 <?php wp_nonce_field( 'sfm_update_action' ); ?> 129 <button type="submit" class="btn btn-primary"><?php _e( 'Save Changes', 'secure-file-manager' ); ?></button> 130 </fieldset> 131 </form> 132 </div> 133 </div> 134 <div> 135 136 </div> 110 137 </div> 111 138 </div> -
secure-file-manager/trunk/readme.txt
r2037785 r2038744 6 6 Tested up to: 5.1 7 7 Requires PHP: 5.6 8 Stable tag: 1.38 Stable tag: 2.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 12 Highly Secure and Powerful WordPress File Manage with Multiple Stunning Designs. You can Create, Delete, Edit, Download, Upload, Compress (Zip) files without any FTP software. You can also connect remove FTP location and copy files/folders from there to your server without any trouble.12 Highly Secure and Powerful WordPress File Manager with Multiple Stunning Designs. You can Create, Delete, Edit, Download, Upload, Compress (Zip) files without any FTP software. You can also connect remove FTP location and copy files/folders from there to your server without any trouble. 13 13 14 14 == Description == … … 58 58 YES! Your server files are your property. So is this plugin after you install it. 59 59 60 = Can I allow users with specific Role(s)? = 61 YES! Now you can select the roles who will 62 60 63 = Can I get support for this plugin? = 61 64 Definitely! We provide support for anything related to WordPress. 62 65 63 66 = Can I change file manager design easily? == 64 Yes! Simply go to plugin settings and select the design you want and save. That \'s it!67 Yes! Simply go to plugin settings and select the design you want and save. That's it! 65 68 66 69 = Can I set custom path to start? = … … 86 89 * WordPress 5.1 Compatibility. 87 90 91 = 2.0 = 92 * Restrict with User Role Feature Added. 93 88 94 == Upgrade Notice == 89 95 = 1.0 = -
secure-file-manager/trunk/secure-file-manager.php
r2037784 r2038744 3 3 /** 4 4 * @package Secure File Manager 5 * @version 1.15 * @version 2.0 6 6 */ 7 7 … … 11 11 Description: Most Beautiful and Secure WordPress File Manager 12 12 Author: Themexa 13 Version: 1.313 Version: 2.0 14 14 Author URI: https://www.themexa.com 15 15 License: GPL2 … … 25 25 * Current plugin version. 26 26 */ 27 define( 'secure-file-manager', ' 1.0' );27 define( 'secure-file-manager', '2.0' ); 28 28 29 29 /**
Note: See TracChangeset
for help on using the changeset viewer.