PluginProbe ʕ •ᴥ•ʔ
File Manager Pro – Filester / trunk
File Manager Pro – Filester vtrunk
2.1.1 trunk 1.6.1 1.7.6 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 2.0 2.0.1 2.0.2 2.1.0
filester / views / pages / html-filemanager-settings.php
filester / views / pages Last commit date
html-filemanager-language.php 1 year ago html-filemanager-list-operations.php 1 year ago html-filemanager-settings.php 1 year ago html-filemanager-user-role-restrictions.php 1 year ago html-filemanager.php 1 month ago index.php 5 years ago
html-filemanager-settings.php
172 lines
1 <?php
2 defined('ABSPATH') || exit;
3 $viewPathLanguage = NJT_FS_BN_PLUGIN_PATH . 'views/pages/html-filemanager-language.php';
4 $viewUserRoleRestrictions = NJT_FS_BN_PLUGIN_PATH . 'views/pages/html-filemanager-user-role-restrictions.php';
5 global $wp_roles;
6 if( isset( $_POST ) && !empty( $_POST ) && !empty($_POST['njt-settings-form-submit'])){
7 if( ! wp_verify_nonce( $_POST['njt-fs-settings-security-token'] ,'njt-fs-settings-security-token')) wp_die();
8
9 $this->options['njt_fs_file_manager_settings']['root_folder_path'] = !empty($_POST['root_folder_path']) ? str_replace("\\\\", "/", trim(sanitize_text_field($_POST['root_folder_path']))) : '';
10 $this->options['njt_fs_file_manager_settings']['enable_htaccess'] = isset($_POST['enable_htaccess']) ? sanitize_text_field($_POST['enable_htaccess']) : 0;
11 $this->options['njt_fs_file_manager_settings']['enable_trash'] = isset($_POST['enable_trash']) ? sanitize_text_field($_POST['enable_trash']) : 0;
12 $this->options['njt_fs_file_manager_settings']['upload_max_size'] = !empty($_POST['upload_max_size']) ? sanitize_text_field(trim($_POST['upload_max_size'])) : 0;
13 $this->options['njt_fs_file_manager_settings']['fm_locale'] = !empty($_POST['fm_locale']) ? sanitize_text_field($_POST['fm_locale']) : 'en';
14 $this->options['njt_fs_file_manager_settings']['list_user_alow_access'] = !empty($_POST['list_user_alow_access']) ? explode(',', sanitize_text_field($_POST['list_user_alow_access'])) : array();
15 }
16
17 ?>
18 <div class="njt-fs-settings njt-fs-file-manager">
19 <h1 id="njt-plugin-tabs" class="nav-tab-wrapper hide-if-no-js">
20 <a href="javascript:void(0)" class="nav-tab nav-tab-active" data-tab="njt_fs_setting"><?php _e("Settings", 'filester'); ?></a>
21 <a href="javascript:void(0)" class="nav-tab" data-tab="njt_fs_roles"><?php _e("User Role Restrictions", 'filester'); ?></a>
22 </h1>
23 <div class="njt-fs-settings-content">
24 <form action="" class="njt-plugin-setting settings-form" method="POST">
25 <!-- creat token -->
26 <input type='hidden' name='njt-fs-settings-security-token'
27 value='<?php echo wp_create_nonce('njt-fs-settings-security-token'); ?>'>
28
29 <table class="form-table">
30 <tr>
31 <th><?php _e("Select User Roles to access", 'filester'); ?></th>
32 <td>
33 <div class="njt-fs-list-user njt-settting-width njt-fs-list-col4" style="line-height:2">
34 <?php foreach ( $wp_roles->roles as $key=>$value ): ?>
35 <?php if (is_multisite() && is_super_admin()) {?>
36 <span class="list-col4-item">
37 <input type="checkbox" class="fm-list-user-item" id="<?php echo $key; ?>" name="<?php echo $key; ?>"
38 data-name="<?php echo esc_attr($value['name']);?>" value="<?php echo $key; ?>">
39 <label for="<?php echo $key; ?>"> <?php echo esc_html($value['name']); ?></label>
40 </span>
41 <?php } else {
42 if ($key != 'administrator') {
43 ?>
44
45 <span class="list-col4-item">
46 <input type="checkbox" class="fm-list-user-item" id="<?php echo $key; ?>" name="<?php echo $key; ?>"
47 data-name="<?php echo esc_attr($value['name']);?>" value="<?php echo $key; ?>">
48 <label for="<?php echo $key; ?>"> <?php echo esc_html($value['name']); ?></label>
49 </span>
50 <?php }}?>
51 <?php endforeach; ?>
52 <!-- Value to submit data -->
53 <input type="hidden" name="list_user_alow_access" id="list_user_alow_access">
54 <!-- Data saved after submit -->
55 <input type="hidden" name="list_user_has_approved" id="list_user_has_approved"
56 value="<?php echo esc_attr(implode(",", !empty($this->options['njt_fs_file_manager_settings']['list_user_alow_access']) ? $this->options['njt_fs_file_manager_settings']['list_user_alow_access'] : array()));?>">
57 </div>
58 </td>
59 </tr>
60 <!-- root Path -->
61 <tr>
62 <th><?php _e("Root Path", 'filester'); ?></th>
63 <td>
64 <textarea type='text' name='root_folder_path' id='root_folder_path' class="njt-settting-width"
65 placeholder="ex: <?php echo (str_replace("\\", "/", ABSPATH)."wp-content");?>"> <?php if( isset( $this->options['njt_fs_file_manager_settings']['root_folder_path'] ) && !empty( $this->options['njt_fs_file_manager_settings']['root_folder_path'] ) ) echo str_replace("\\", "/",esc_attr($this->options['njt_fs_file_manager_settings']['root_folder_path'])); ?></textarea>
66 <div>
67 <p class="description njt-settting-width">
68 <?php _e("Default path is: "."<code>". str_replace("\\", "/", ABSPATH)."</code>", 'filester'); ?>
69 </p>
70 <p class="description njt-settting-width">
71 <?php _e("Eg: If you want to set root path access is ". "<strong>wp-content</strong>". " folder. Just enter ", 'filester'); ?>
72 <?php echo (str_replace("\\", "/", ABSPATH));?>wp-content
73 </p>
74 </div>
75 </td>
76 </tr>
77 <!-- url Path -->
78 <tr>
79 <th><?php _e("Files URL", 'filester'); ?></th>
80 <td>
81 <textarea type='text' name='root_folder_url' id='root_folder_url' class="njt-settting-width"
82 placeholder="ex: <?php echo (site_url());?>"> <?php if( isset( $this->options['njt_fs_file_manager_settings']['root_folder_url'] ) && !empty( $this->options['njt_fs_file_manager_settings']['root_folder_url'] ) ) echo str_replace("\\", "/",esc_attr($this->options['njt_fs_file_manager_settings']['root_folder_url'])); ?></textarea>
83 <div>
84 <p class="description njt-settting-width">
85 <?php _e("Default path is: "."<code>". str_replace("\\", "/", site_url())."</code>", 'filester'); ?>
86 </p>
87 </div>
88 </td>
89 </tr>
90 <!-- Maximum Upload Size -->
91 <tr>
92 <th><?php _e("Maximum Upload Size", 'filester'); ?></th>
93 <td>
94 <input type="number" name="upload_max_size" id="upload_max_size" class="njt-fs-settting-width-half"
95 value="<?php if( isset( $this->options['njt_fs_file_manager_settings']['upload_max_size'] ) && !empty( $this->options['njt_fs_file_manager_settings']['upload_max_size'] )) echo esc_attr($this->options['njt_fs_file_manager_settings']['upload_max_size']); ?>">
96 <strong><?php _e("MB", 'filester'); ?></strong>
97 <div class="des-path njt-settting-width">
98 <small>
99 <?php _e("Default:", 'filester'); ?>
100 <b><?php _e("0 means unlimited upload.", 'filester'); ?></b>
101 </small>
102 </div>
103 </td>
104 </tr>
105 <!-- Select language -->
106 <tr>
107 <th><?php _e("Select language", 'filester'); ?></th>
108 <td>
109 <?php include_once $viewPathLanguage; ?>
110 </td>
111 </tr>
112 <!-- .htaccess -->
113 <tr>
114 <th><?php _e("Hide .htaccess?", 'filester'); ?></th>
115 <td>
116 <label class="shortcode-switch" for="enable_htaccess">
117 <input name="enable_htaccess" type="checkbox" id="enable_htaccess" value="1"
118 <?php echo isset($this->options['njt_fs_file_manager_settings']['enable_htaccess']) && ($this->options['njt_fs_file_manager_settings']['enable_htaccess'] == '1') ? 'checked="checked"' : '';?>>
119
120 <div class="slider round"></div>
121 </label>
122
123
124 <p class="description njt-settting-width">
125 <?php _e("Will Hide .htaccess file (if exists) in file manager.", 'filester'); ?>
126 </p>
127 </td>
128 </tr>
129 <!-- Enable Trash? -->
130 <tr>
131 <th><?php _e("Enable Trash?", 'filester'); ?></th>
132 <td>
133 <label class="shortcode-switch" for="enable_trash">
134 <input name="enable_trash" type="checkbox" id="enable_trash" value="1"
135 <?php echo isset($this->options['njt_fs_file_manager_settings']['enable_trash']) && ($this->options['njt_fs_file_manager_settings']['enable_trash'] == '1') ? 'checked="checked"' : '';?>>
136 <div class="slider round"></div>
137 </label>
138
139 <p class="description njt-settting-width">
140 <?php _e("After enable trash, after delete your files will go to trash folder.", 'filester'); ?></p>
141 </td>
142 </tr>
143 <!-- Sensitive Files Protection -->
144 <tr>
145 <th><?php _e("Sensitive Files Protection", 'filester'); ?></th>
146 <td>
147 <label class="shortcode-switch" for="enable_sensitive_protection">
148 <input name="enable_sensitive_protection" type="checkbox" id="enable_sensitive_protection" value="1"
149 <?php echo isset($this->options['njt_fs_file_manager_settings']['enable_sensitive_protection']) && ($this->options['njt_fs_file_manager_settings']['enable_sensitive_protection'] == '1') ? 'checked="checked"' : '';?>>
150 <div class="slider round"></div>
151 </label>
152 <p class="description njt-settting-width">
153 <?php _e("Protect sensitive files like wp-config.php, .env, etc. Only administrators can access.", 'filester'); ?>
154 </p>
155 </td>
156 </tr>
157 <!-- button submit -->
158 <tr>
159 <td></td>
160 <td>
161 <p class="submit">
162 <button type="button" name="njt-settings-form-submit" id="submit"
163 class="button button-primary njt-settings-form-submit"><?php _e("Save Changes", 'filester'); ?></button>
164 </p>
165 </td>
166 </tr>
167 </table>
168 </form>
169 <!-- include html User Role Restrictions -->
170 <?php include_once $viewUserRoleRestrictions; ?>
171 </div>
172 </div>