WPFront User Role Editor - Version 2.0

Version Description

  • Removed 'wpfront_' from role capabilities.
  • Removed 'Add role capabilities'. It is enabled by default.
  • Assign/Migrate users.
  • Bug fixes.
Download this release

Release Info

Developer syammohanm
Plugin Icon 128x128 WPFront User Role Editor
Version 2.0
Comparing to
See all releases

Code changes from version 1.2 to 2.0

classes/base/class-wpfront-base.php CHANGED
@@ -22,10 +22,10 @@
22
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
  */
24
 
25
- require_once("class-wpfront-static.php");
26
- require_once("class-wpfront-base-menu.php");
27
 
28
- if (!class_exists('WPFront_Base')) {
29
 
30
  /**
31
  * Plugin framework base class
@@ -33,7 +33,7 @@ if (!class_exists('WPFront_Base')) {
33
  * @author Syam Mohan <syam@wpfront.com>
34
  * @copyright 2013 WPFront.com
35
  */
36
- class WPFront_Base {
37
 
38
  private $plugin_slug;
39
  private $options_page_slug;
@@ -47,8 +47,8 @@ if (!class_exists('WPFront_Base')) {
47
  if ($wpfrontBaseMenu == NULL)
48
  $wpfrontBaseMenu = new WPFront_Base_Menu($this);
49
 
50
- $this->pluginURLRoot = plugins_url() . '/' . $this->plugin_slug . '/';
51
  $this->pluginDIRRoot = dirname($file) . '/../';
 
52
 
53
  add_action('init', array(&$this, 'init'));
54
  add_action('plugins_loaded', array(&$this, 'plugins_loaded_base'));
@@ -63,6 +63,10 @@ if (!class_exists('WPFront_Base')) {
63
  add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
64
  }
65
  }
 
 
 
 
66
 
67
  protected function add_menu($title, $link) {
68
  self::$menu_data[] = array(
@@ -101,12 +105,16 @@ if (!class_exists('WPFront_Base')) {
101
  }
102
 
103
  public function action_links($links, $file) {
104
- if ($file == $this->plugin_slug . '/' . $this->plugin_slug . '.php') {
105
  $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=' . $this->options_page_slug . '">' . $this->__('Settings') . '</a>';
106
  array_unshift($links, $settings_link);
107
  }
108
  return $links;
109
  }
 
 
 
 
110
 
111
  public function enqueue_styles() {
112
 
@@ -136,7 +144,7 @@ if (!class_exists('WPFront_Base')) {
136
 
137
  protected function options_page_header($title, $optionsGroupName) {
138
  echo '<div class="wrap">';
139
- @screen_icon($this->options_page_slug);
140
  echo '<h2>' . $title . '</h2>';
141
  echo '<div id="' . $this->options_page_slug . '-options" class="inside">';
142
  echo '<form method="post" action="options.php">';
@@ -157,28 +165,28 @@ if (!class_exists('WPFront_Base')) {
157
  protected function options_page_footer($settingsLink, $FAQLink, $extraLinks = NULL) {
158
  @$this->submit_button();
159
 
160
- if ($extraLinks != NULL) {
161
- foreach ($extraLinks as $value) {
162
- echo '<a href="' . $value['href'] . '" target="' . $value['target'] . '">' . $value['text'] . '</a>';
163
- echo ' | ';
164
- }
165
- }
166
-
167
- echo '
168
- <a href="http://wpfront.com/' . $settingsLink . '" target="_blank">' . $this->__('Settings Description') . '</a>
169
- |
170
- <a href="http://wpfront.com/' . $FAQLink . '" target="_blank">' . $this->__('Plugin FAQ') . '</a>
171
- |
172
- <a href="http://wpfront.com/contact/" target="_blank">' . $this->__('Feature Request') . '</a>
173
- |
174
- <a href="http://wpfront.com/contact/" target="_blank">' . $this->__('Report Bug') . '</a>
175
- |
176
- <a href="http://wordpress.org/support/view/plugin-reviews/' . $this->plugin_slug . '" target="_blank">' . $this->__('Write Review') . '</a>
177
- |
178
- <a href="http://wpfront.com/contact/" target="_blank">' . $this->__('Contact Me') . '</a>
179
- |
180
- <a href="http://wpfront.com/donate/" target="_blank">' . $this->__('Buy me a Beer or Coffee') . '</a>
181
- ';
182
  echo '</form>';
183
  echo '</div>';
184
  echo '</div>';
22
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
  */
24
 
25
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-static.php");
26
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-base-menu.php");
27
 
28
+ if (!class_exists('WPFront_Base_URE')) {
29
 
30
  /**
31
  * Plugin framework base class
33
  * @author Syam Mohan <syam@wpfront.com>
34
  * @copyright 2013 WPFront.com
35
  */
36
+ class WPFront_Base_URE {
37
 
38
  private $plugin_slug;
39
  private $options_page_slug;
47
  if ($wpfrontBaseMenu == NULL)
48
  $wpfrontBaseMenu = new WPFront_Base_Menu($this);
49
 
 
50
  $this->pluginDIRRoot = dirname($file) . '/../';
51
+ $this->pluginURLRoot = plugins_url() . '/' . $this->plugin_slug . $this->plugin_dir_suffix() . '/';
52
 
53
  add_action('init', array(&$this, 'init'));
54
  add_action('plugins_loaded', array(&$this, 'plugins_loaded_base'));
63
  add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
64
  }
65
  }
66
+
67
+ protected function plugin_dir_suffix() {
68
+ return '';
69
+ }
70
 
71
  protected function add_menu($title, $link) {
72
  self::$menu_data[] = array(
105
  }
106
 
107
  public function action_links($links, $file) {
108
+ if ($file == $this->plugin_action_links_file()) {
109
  $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=' . $this->options_page_slug . '">' . $this->__('Settings') . '</a>';
110
  array_unshift($links, $settings_link);
111
  }
112
  return $links;
113
  }
114
+
115
+ protected function plugin_action_links_file() {
116
+ return $this->plugin_slug . $this->plugin_dir_suffix() . '/' . $this->plugin_slug . '.php';
117
+ }
118
 
119
  public function enqueue_styles() {
120
 
144
 
145
  protected function options_page_header($title, $optionsGroupName) {
146
  echo '<div class="wrap">';
147
+ //@screen_icon($this->options_page_slug);
148
  echo '<h2>' . $title . '</h2>';
149
  echo '<div id="' . $this->options_page_slug . '-options" class="inside">';
150
  echo '<form method="post" action="options.php">';
165
  protected function options_page_footer($settingsLink, $FAQLink, $extraLinks = NULL) {
166
  @$this->submit_button();
167
 
168
+ // if ($extraLinks != NULL) {
169
+ // foreach ($extraLinks as $value) {
170
+ // echo '<a href="' . $value['href'] . '" target="' . $value['target'] . '">' . $value['text'] . '</a>';
171
+ // echo ' | ';
172
+ // }
173
+ // }
174
+ //
175
+ // echo '
176
+ // <a href="http://wpfront.com/' . $settingsLink . '" target="_blank">' . $this->__('Settings Description') . '</a>
177
+ // |
178
+ // <a href="http://wpfront.com/' . $FAQLink . '" target="_blank">' . $this->__('Plugin FAQ') . '</a>
179
+ // |
180
+ // <a href="http://wpfront.com/contact/" target="_blank">' . $this->__('Feature Request') . '</a>
181
+ // |
182
+ // <a href="http://wpfront.com/contact/" target="_blank">' . $this->__('Report Bug') . '</a>
183
+ // |
184
+ // <a href="http://wordpress.org/support/view/plugin-reviews/' . $this->plugin_slug . '" target="_blank">' . $this->__('Write Review') . '</a>
185
+ // |
186
+ // <a href="http://wpfront.com/contact/" target="_blank">' . $this->__('Contact Me') . '</a>
187
+ // |
188
+ // <a href="http://wpfront.com/donate/" target="_blank">' . $this->__('Buy me a Beer or Coffee') . '</a>
189
+ // ';
190
  echo '</form>';
191
  echo '</div>';
192
  echo '</div>';
classes/base/class-wpfront-entity-base.php ADDED
@@ -0,0 +1,337 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ WPFront Plugins Entity Base
5
+ Copyright (C) 2013, WPFront.com
6
+ Website: wpfront.com
7
+ Contact: syam@wpfront.com
8
+
9
+ WPFront Plugins are distributed under the GNU General Public License, Version 3,
10
+ June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
11
+ St, Fifth Floor, Boston, MA 02110, USA
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ */
24
+
25
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-static.php");
26
+
27
+ if (!class_exists('WPFront_Entity_Base')) {
28
+
29
+ /**
30
+ * Plugin entity framework base class
31
+ *
32
+ * @author Syam Mohan <syam@wpfront.com>
33
+ * @copyright 2013 WPFront.com
34
+ */
35
+ abstract class WPFront_Entity_Base {
36
+
37
+ private static $DB_STATUS = array();
38
+ protected static $UNINSTALL = FALSE;
39
+ private $slug;
40
+ private $version;
41
+ private $options;
42
+ private $tablename;
43
+ private $func_data = array();
44
+ protected $db_data;
45
+
46
+ public function __construct($slug, $version, $options, $tablename) {
47
+ $this->slug = $slug;
48
+ $this->version = $version;
49
+ $this->options = $options;
50
+ $this->tablename = $tablename;
51
+
52
+ if (!self::$UNINSTALL) {
53
+ $this->prepare_db_data();
54
+ $this->db_delta();
55
+ }
56
+ }
57
+
58
+ private function sql_type($type) {
59
+ switch ($type) {
60
+ case 'bit':
61
+ return 'tinyint(1)';
62
+ default:
63
+ return $type;
64
+ }
65
+ }
66
+
67
+ private function prepare_db_data() {
68
+ $obj = (OBJECT) array(
69
+ 'key' => 'id',
70
+ 'type' => 'bigint(20)',
71
+ 'sql' => 'id bigint(20) NOT NULL AUTO_INCREMENT',
72
+ 'data' => 0
73
+ );
74
+ $this->db_data = array(
75
+ 'id' => $obj
76
+ );
77
+ $this->func_data["get_id"] = (OBJECT) array(
78
+ 'type' => 'get',
79
+ 'data' => $obj
80
+ );
81
+
82
+ foreach ($this->_db_data() as $value) {
83
+ $key = $value->name;
84
+ $obj = (OBJECT) array(
85
+ 'key' => $key,
86
+ 'type' => strtolower($value->type),
87
+ 'default' => (isset($value->default) ? $value->default : NULL)
88
+ );
89
+ $obj->sql = "$key {$this->sql_type($obj->type)} " . ($obj->default === NULL ? "DEFAULT NULL" : "DEFAULT $obj->default NOT NULL");
90
+ $obj->data = $obj->default;
91
+ $this->db_data[$key] = $obj;
92
+
93
+ $this->func_data["get_$key"] = (OBJECT) array(
94
+ 'data' => $obj
95
+ );
96
+ $this->func_data["set_$key"] = (OBJECT) array(
97
+ 'data' => $obj
98
+ );
99
+
100
+ $this->func_data["get_by_$key"] = (OBJECT) array(
101
+ 'data' => $obj
102
+ );
103
+ $this->func_data["get_all_by_$key"] = (OBJECT) array(
104
+ 'data' => $obj
105
+ );
106
+ $this->func_data["delete_by_$key"] = (OBJECT) array(
107
+ 'data' => $obj
108
+ );
109
+ }
110
+ }
111
+
112
+ public function table_name() {
113
+ global $wpdb;
114
+
115
+ return $wpdb->prefix . 'wpfront_' . $this->tablename;
116
+ }
117
+
118
+ private function db_delta() {
119
+ $table_name = $this->table_name();
120
+ if (isset(self::$DB_STATUS[$table_name]))
121
+ return;
122
+
123
+ self::$DB_STATUS[$table_name] = TRUE;
124
+
125
+ $option_key = $this->get_db_version_option_name();
126
+ $db_version = get_option($option_key);
127
+ if ($db_version === FALSE)
128
+ $db_version = '0.0';
129
+
130
+ $table_key = $table_name . '-db-version';
131
+
132
+ if (version_compare($db_version, $this->version, '>=')) {
133
+ $db_version = $this->options->get_option($table_key);
134
+ if ($db_version === NULL)
135
+ $db_version = '0.0';
136
+
137
+ if (version_compare($db_version, $this->version, '>='))
138
+ return;
139
+ }
140
+
141
+ global $wpdb;
142
+
143
+ $sql = "CREATE TABLE $table_name (";
144
+
145
+ foreach ($this->db_data as $key => $value) {
146
+ $sql .= "$value->sql, \n";
147
+ }
148
+
149
+ $sql .= "UNIQUE KEY id (id)\n);";
150
+
151
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
152
+
153
+ dbDelta($sql);
154
+
155
+ update_option($option_key, $this->version);
156
+ $this->options->update_option($table_key, $this->version);
157
+ }
158
+
159
+ abstract protected function _db_data();
160
+
161
+ protected function db_data_field($name, $type) {
162
+ return (OBJECT) array(
163
+ 'name' => $name,
164
+ 'type' => $type
165
+ );
166
+ }
167
+
168
+ public function __call($name, array $args) {
169
+ if (!array_key_exists($name, $this->func_data)) {
170
+ throw new Exception("$name function not found");
171
+ }
172
+
173
+ return call_user_func_array(array($this, preg_replace('/_' . $this->func_data[$name]->data->key . '$/', '', $name)), array($this->func_data[$name]->data, $args));
174
+ }
175
+
176
+ private function format($data) {
177
+ $format = array(
178
+ 'int' => '%d',
179
+ 'bigint' => '%d',
180
+ 'varchar' => '%s',
181
+ 'longtext' => '%s',
182
+ 'bit' => '%d'
183
+ );
184
+
185
+ foreach ($format as $key => $value) {
186
+ if (strpos($data->type, $key) === 0) {
187
+ return $value;
188
+ }
189
+ }
190
+
191
+ throw new Exception("$data->type format not specified");
192
+ }
193
+
194
+ private function convert($data) {
195
+ switch ($data->type) {
196
+ case 'bit':
197
+ return (BOOL) $data->data;
198
+ case 'int':
199
+ case 'bigint':
200
+ return intval($data->data);
201
+ default:
202
+ return strval($data->data);
203
+ }
204
+ }
205
+
206
+ private function get($data) {
207
+ return $this->convert($data);
208
+ }
209
+
210
+ private function set($data, $args) {
211
+ $data->data = $args[0];
212
+ }
213
+
214
+ protected function get_object($result) {
215
+ $class = get_class($this);
216
+ $class = new $class();
217
+
218
+ foreach ($class->db_data as $key => $value) {
219
+ $value->data = $result[$key];
220
+ }
221
+
222
+ return $class;
223
+ }
224
+
225
+ private function get_by($data, $args) {
226
+ global $wpdb;
227
+
228
+ $table_name = $this->table_name();
229
+
230
+ $result = $wpdb->get_row(
231
+ $wpdb->prepare(
232
+ "SELECT * FROM $table_name "
233
+ . "WHERE $data->key = " . $this->format($data), $args[0]
234
+ ), ARRAY_A
235
+ );
236
+
237
+ if ($result === NULL)
238
+ return NULL;
239
+
240
+ return $this->get_object($result);
241
+ }
242
+
243
+ private function get_all_by($data, $args) {
244
+ global $wpdb;
245
+
246
+ $table_name = $this->table_name();
247
+
248
+ $result = $wpdb->get_results(
249
+ $wpdb->prepare(
250
+ "SELECT * FROM $table_name "
251
+ . "WHERE $data->key = " . $this->format($data), $args[0]
252
+ ), ARRAY_A
253
+ );
254
+
255
+ $data = array();
256
+ $class = get_class($this);
257
+
258
+ foreach ($result as $row) {
259
+ $data[] = $this->get_object($row);
260
+ }
261
+
262
+ return $data;
263
+ }
264
+
265
+ public function add() {
266
+ $values = array();
267
+ $format = array();
268
+
269
+ foreach ($this->db_data as $key => $value) {
270
+ if ($key === 'id')
271
+ continue;
272
+ $values[$key] = $value->data;
273
+ $format[] = $this->format($value);
274
+ }
275
+
276
+ global $wpdb;
277
+
278
+ $wpdb->insert($this->table_name(), $values, $format);
279
+ $this->db_data['id']->data = $wpdb->insert_id;
280
+
281
+ return $wpdb->insert_id;
282
+ }
283
+
284
+ public function update() {
285
+ $values = array();
286
+ $format = array();
287
+
288
+ foreach ($this->db_data as $key => $value) {
289
+ if ($key === 'id')
290
+ continue;
291
+ $values[$key] = $value->data;
292
+ $format[] = $this->format($value);
293
+ }
294
+
295
+ global $wpdb;
296
+
297
+ $wpdb->update($this->table_name(), $values, array('id' => $this->db_data['id']->data), $format, array('%d'));
298
+ return $this->db_data['id']->data;
299
+ }
300
+
301
+ public function save() {
302
+ if ($this->db_data['id']->data === 0)
303
+ return $this->add();
304
+ else
305
+ return $this->update();
306
+ }
307
+
308
+ public function delete() {
309
+ if ($this->db_data['id']->data === 0)
310
+ return;
311
+
312
+ global $wpdb;
313
+ $wpdb->delete($this->table_name(), array('id' => $this->db_data['id']->data), array('%d'));
314
+ }
315
+
316
+ public function delete_by($data) {
317
+ global $wpdb;
318
+ $wpdb->delete($this->table_name(), array($data->key => $data->data), $this->format($data));
319
+ }
320
+
321
+ private function get_db_version_option_name() {
322
+ return $this->slug . '-db-version';
323
+ }
324
+
325
+ protected function uninstall_action() {
326
+ delete_option($this->get_db_version_option_name());
327
+
328
+ global $wpdb;
329
+ $table_name = $this->table_name();
330
+
331
+ $sql = "DROP TABLE IF EXISTS $table_name;";
332
+ $wpdb->query($sql);
333
+ }
334
+
335
+ }
336
+
337
+ }
classes/base/class-wpfront-static.php CHANGED
@@ -51,6 +51,10 @@ if (!class_exists('WPFront_Static')) {
51
  if (defined('DOING_AJAX') && DOING_AJAX) {
52
  return TRUE;
53
  }
 
 
 
 
54
 
55
  if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
56
  return TRUE;
51
  if (defined('DOING_AJAX') && DOING_AJAX) {
52
  return TRUE;
53
  }
54
+
55
+ if (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST) {
56
+ return TRUE;
57
+ }
58
 
59
  if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
60
  return TRUE;
classes/class-wpfront-user-role-editor-add-edit.php CHANGED
@@ -31,22 +31,20 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
31
  * @author Syam Mohan <syam@wpfront.com>
32
  * @copyright 2014 WPFront.com
33
  */
34
- class WPFront_User_Role_Editor_Add_Edit {
35
 
36
  const MENU_SLUG = 'wpfront-user-role-editor-add-new';
37
 
38
- private $main;
39
- private $role = null;
40
- private $is_editable = FALSE;
41
- private $role_exists = FALSE;
42
- private $error = FALSE;
43
 
44
  function __construct($main) {
45
- $this->main = $main;
46
- }
47
 
48
- public function ajax_register() {
49
- add_action('wp_ajax_wpfront_user_role_editor_copy_capabilities', array($this, 'copy_capabilities_callback'));
50
  }
51
 
52
  public function add_edit_role($role_name) {
@@ -72,12 +70,20 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
72
  if ($this->role == NULL) {
73
  $this->is_editable = TRUE;
74
  } else if ($role_name != 'administrator') {
75
- $this->is_editable = array_key_exists($role_name, get_editable_roles());
 
 
 
76
  }
77
 
78
  $success = FALSE;
79
  if (!empty($_POST['createrole'])) {
80
  while (TRUE) {
 
 
 
 
 
81
  if (!$this->is_display_name_valid())
82
  break;
83
  if ($this->role == NULL && !$this->is_role_name_valid())
@@ -102,14 +108,16 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
102
  break;
103
  }
104
  } else {
105
- global $wp_roles;
106
- $wp_roles->roles[$this->role->name] = array(
107
- 'name' => $this->get_display_name(),
108
- 'capabilities' => $capabilities
109
- );
110
- update_option($wp_roles->role_key, $wp_roles->roles);
111
- $wp_roles->role_objects[$this->role->name] = new WP_Role($this->role->name, $capabilities);
112
- $wp_roles->role_names[$this->role->name] = $this->get_display_name();
 
 
113
  }
114
 
115
  $success = TRUE;
@@ -118,33 +126,17 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
118
  }
119
 
120
  if ($success) {
121
- printf('<script type="text/javascript">document.location="%s";</script>', $this->list_roles_url());
122
  } else {
123
- include($this->main->pluginDIR() . 'templates/add-edit-role.php');
124
  }
125
  }
126
 
127
- private function can_create() {
128
- return $this->main->current_user_can('create_roles');
129
- }
130
-
131
- private function can_edit() {
132
- return $this->main->current_user_can('edit_roles');
133
  }
134
 
135
- private function __($s) {
136
- return $this->main->__($s);
137
- }
138
-
139
- private function add_new_url() {
140
- return admin_url('admin.php') . '?page=' . self::MENU_SLUG;
141
- }
142
-
143
- private function list_roles_url() {
144
- return admin_url('admin.php') . '?page=' . WPFront_User_Role_Editor_List::MENU_SLUG;
145
- }
146
-
147
- private function is_display_name_valid() {
148
  if (empty($_POST['createrole']))
149
  return TRUE;
150
 
@@ -154,16 +146,16 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
154
  return TRUE;
155
  }
156
 
157
- private function is_display_name_disabled() {
158
  return !$this->is_editable;
159
  }
160
 
161
- private function get_display_name() {
162
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
163
  if (empty($_POST['display_name']))
164
  return '';
165
 
166
- return trim($_POST['display_name']);
167
  }
168
 
169
  if ($this->role == NULL)
@@ -172,7 +164,7 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
172
  return $wp_roles->role_names[$this->role->name];
173
  }
174
 
175
- private function is_role_name_valid() {
176
  if (empty($_POST['createrole']))
177
  return TRUE;
178
 
@@ -182,7 +174,7 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
182
  return TRUE;
183
  }
184
 
185
- private function is_role_name_disabled() {
186
  if ($this->role != NULL)
187
  return TRUE;
188
  if (!$this->is_editable)
@@ -190,7 +182,7 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
190
  return FALSE;
191
  }
192
 
193
- private function get_role_name() {
194
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
195
  if (empty($_POST['role_name']))
196
  return '';
@@ -203,13 +195,13 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
203
  return $this->role->name;
204
  }
205
 
206
- private function is_submit_disabled() {
207
  if (!$this->is_editable)
208
  return TRUE;
209
  return FALSE;
210
  }
211
 
212
- private function get_capability_groups() {
213
  $caps_group = array();
214
 
215
  foreach ($this->main->get_capabilities() as $key => $value) {
@@ -230,7 +222,7 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
230
  return $caps_group;
231
  }
232
 
233
- private function get_copy_from() {
234
  if (!$this->is_editable)
235
  return array();
236
 
@@ -240,15 +232,22 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
240
  return $roles;
241
  }
242
 
243
- private function is_role_exists() {
244
  return $this->role_exists;
245
  }
246
 
247
- private function is_error() {
248
  return $this->error;
249
  }
250
 
251
  public function copy_capabilities_callback() {
 
 
 
 
 
 
 
252
  if (empty($_POST['role'])) {
253
  echo '{}';
254
  die();
@@ -266,7 +265,7 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
266
  die();
267
  }
268
 
269
- private function capability_checked($cap) {
270
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
271
  if (empty($_POST['capabilities']))
272
  return FALSE;
@@ -282,16 +281,64 @@ if (!class_exists('WPFront_User_Role_Editor_Add_Edit')) {
282
  return FALSE;
283
  }
284
 
285
- private function footer() {
286
- $this->main->footer();
287
  }
288
 
289
- private function image_url() {
290
- return $this->main->pluginURL() . 'images/';
 
 
 
 
 
 
 
291
  }
292
 
293
- private function get_help_url($cap) {
294
- return 'http://wpfront.com/wordpress-capabilities/#' . $cap;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  }
296
 
297
  }
31
  * @author Syam Mohan <syam@wpfront.com>
32
  * @copyright 2014 WPFront.com
33
  */
34
+ class WPFront_User_Role_Editor_Add_Edit extends WPFront_User_Role_Editor_Controller_Base {
35
 
36
  const MENU_SLUG = 'wpfront-user-role-editor-add-new';
37
 
38
+ protected static $copy_capabilities_action = NULL;
39
+ protected $role = null;
40
+ protected $is_editable = FALSE;
41
+ protected $role_exists = FALSE;
42
+ protected $error = FALSE;
43
 
44
  function __construct($main) {
45
+ parent::__construct($main);
 
46
 
47
+ $this->ajax_register('wp_ajax_wpfront_user_role_editor_copy_capabilities', array($this, 'copy_capabilities_callback'));
 
48
  }
49
 
50
  public function add_edit_role($role_name) {
70
  if ($this->role == NULL) {
71
  $this->is_editable = TRUE;
72
  } else if ($role_name != 'administrator') {
73
+ $editable_roles = get_editable_roles();
74
+ if ($this->main->override_edit_permissions())
75
+ $editable_roles = $wp_roles->get_names();
76
+ $this->is_editable = array_key_exists($role_name, $editable_roles);
77
  }
78
 
79
  $success = FALSE;
80
  if (!empty($_POST['createrole'])) {
81
  while (TRUE) {
82
+ $this->main->verify_nonce();
83
+
84
+ if (!$this->is_editable)
85
+ break;
86
+
87
  if (!$this->is_display_name_valid())
88
  break;
89
  if ($this->role == NULL && !$this->is_role_name_valid())
108
  break;
109
  }
110
  } else {
111
+ // global $wp_roles;
112
+ // $wp_roles->roles[$this->role->name] = array(
113
+ // 'name' => $this->get_display_name(),
114
+ // 'capabilities' => $capabilities
115
+ // );
116
+ // update_option($wp_roles->role_key, $wp_roles->roles);
117
+ // $wp_roles->role_objects[$this->role->name] = new WP_Role($this->role->name, $capabilities);
118
+ // $wp_roles->role_names[$this->role->name] = $this->get_display_name();
119
+
120
+ self::update_role($this->role->name, $this->get_display_name(), $capabilities);
121
  }
122
 
123
  $success = TRUE;
126
  }
127
 
128
  if ($success) {
129
+ printf('<script type="text/javascript">window.location.replace("%s");</script>', $this->list_url());
130
  } else {
131
+ $this->include_template();
132
  }
133
  }
134
 
135
+ protected function include_template() {
136
+ include($this->main->pluginDIR() . 'templates/add-edit-role.php');
 
 
 
 
137
  }
138
 
139
+ protected function is_display_name_valid() {
 
 
 
 
 
 
 
 
 
 
 
 
140
  if (empty($_POST['createrole']))
141
  return TRUE;
142
 
146
  return TRUE;
147
  }
148
 
149
+ protected function is_display_name_disabled() {
150
  return !$this->is_editable;
151
  }
152
 
153
+ protected function get_display_name() {
154
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
155
  if (empty($_POST['display_name']))
156
  return '';
157
 
158
+ return esc_html(trim($_POST['display_name']));
159
  }
160
 
161
  if ($this->role == NULL)
164
  return $wp_roles->role_names[$this->role->name];
165
  }
166
 
167
+ protected function is_role_name_valid() {
168
  if (empty($_POST['createrole']))
169
  return TRUE;
170
 
174
  return TRUE;
175
  }
176
 
177
+ protected function is_role_name_disabled() {
178
  if ($this->role != NULL)
179
  return TRUE;
180
  if (!$this->is_editable)
182
  return FALSE;
183
  }
184
 
185
+ protected function get_role_name() {
186
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
187
  if (empty($_POST['role_name']))
188
  return '';
195
  return $this->role->name;
196
  }
197
 
198
+ protected function is_submit_disabled() {
199
  if (!$this->is_editable)
200
  return TRUE;
201
  return FALSE;
202
  }
203
 
204
+ protected function get_capability_groups() {
205
  $caps_group = array();
206
 
207
  foreach ($this->main->get_capabilities() as $key => $value) {
222
  return $caps_group;
223
  }
224
 
225
+ protected function get_copy_from() {
226
  if (!$this->is_editable)
227
  return array();
228
 
232
  return $roles;
233
  }
234
 
235
+ protected function is_role_exists() {
236
  return $this->role_exists;
237
  }
238
 
239
+ protected function is_error() {
240
  return $this->error;
241
  }
242
 
243
  public function copy_capabilities_callback() {
244
+ if (self::$copy_capabilities_action !== NULL) {
245
+ call_user_func(self::$copy_capabilities_action);
246
+ die();
247
+ }
248
+
249
+ check_ajax_referer($_POST['referer'], 'nonce');
250
+
251
  if (empty($_POST['role'])) {
252
  echo '{}';
253
  die();
265
  die();
266
  }
267
 
268
+ protected function capability_checked($cap) {
269
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
270
  if (empty($_POST['capabilities']))
271
  return FALSE;
281
  return FALSE;
282
  }
283
 
284
+ protected function get_help_url($cap) {
285
+ return 'http://wpfront.com/wordpress-capabilities/#' . $cap;
286
  }
287
 
288
+ public static function update_role($name, $display_name, $capabilities) {
289
+ global $wp_roles;
290
+ $wp_roles->roles[$name] = array(
291
+ 'name' => $display_name,
292
+ 'capabilities' => $capabilities
293
+ );
294
+ update_option($wp_roles->role_key, $wp_roles->roles);
295
+ $wp_roles->role_objects[$name] = new WP_Role($name, $capabilities);
296
+ $wp_roles->role_names[$name] = $display_name;
297
  }
298
 
299
+ protected function add_help_tab() {
300
+ return array(
301
+ array(
302
+ 'id' => 'overview',
303
+ 'title' => $this->__('Overview'),
304
+ 'content' => '<p>'
305
+ . $this->__('This screen allows you to add a new role within your site.')
306
+ . '</p>'
307
+ . '<p>'
308
+ . $this->__('You can copy capabilities from existing roles using the Copy from drop down list. Select the role you want to copy from, then click Apply to copy the capabilities. You can select or deselect capabilities even after you copy.')
309
+ . '</p>'
310
+ ),
311
+ array(
312
+ 'id' => 'displayname',
313
+ 'title' => $this->__('Display Name'),
314
+ 'content' => '<p>'
315
+ . $this->__('Use the Display Name field to set the display name for the new role. WordPress uses display name to display this role within your site. This field is required.')
316
+ . '</p>'
317
+ ),
318
+ array(
319
+ 'id' => 'rolename',
320
+ 'title' => $this->__('Role Name'),
321
+ 'content' => '<p>'
322
+ . $this->__('Use the Role Name field to set the role name for the new role. WordPress uses role name to identify this role within your site. Once set role name cannot be changed. This field is required. This plugin will auto populate role name from the display name you have given, but you can change it.')
323
+ . '</p>'
324
+ ),
325
+ array(
326
+ 'id' => 'capabilities',
327
+ 'title' => $this->__('Capabilities'),
328
+ 'content' => '<p>'
329
+ . $this->__('Capabilities are displayed as different groups for easy access. The Roles section displays capabilities created by this plugin. The Other Capabilities section displays non-standard capabilities within your site. These are usually created by plugins and themes. Use the check boxes to select the capabilities required for this new role.')
330
+ . '</p>'
331
+ )
332
+ );
333
+ }
334
+
335
+ protected function set_help_sidebar() {
336
+ return array(
337
+ array(
338
+ $this->__('Documentation on Add New Role'),
339
+ 'add-role/'
340
+ )
341
+ );
342
  }
343
 
344
  }
classes/class-wpfront-user-role-editor-assign-roles.php ADDED
@@ -0,0 +1,332 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ WPFront User Role Editor Plugin
4
+ Copyright (C) 2014, WPFront.com
5
+ Website: wpfront.com
6
+ Contact: syam@wpfront.com
7
+
8
+ WPFront User Role Editor Plugin is distributed under the GNU General Public License, Version 3,
9
+ June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
10
+ St, Fifth Floor, Boston, MA 02110, USA
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
16
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
+ */
23
+
24
+
25
+ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
26
+
27
+ /**
28
+ * Assign Roles
29
+ *
30
+ * @author Syam Mohan <syam@wpfront.com>
31
+ * @copyright 2014 WPFront.com
32
+ */
33
+ class WPFront_User_Role_Editor_Assign_Roles extends WPFront_User_Role_Editor_Controller_Base {
34
+
35
+ const MENU_SLUG = 'wpfront-user-role-editor-assign-roles';
36
+ const SECONDARY_ROLE_COLUMN_KEY = 'secondary_roles';
37
+
38
+ private $user = NULL;
39
+ private $userPrimaryRole = '';
40
+ private $userSecondaryRoles = array();
41
+ private $users;
42
+ private $migrateFromPrimaryRole = NULL;
43
+ private $migrateToPrimaryRole = NULL;
44
+ private $migrateToSecondaryRoles = array();
45
+ private $primary_roles;
46
+ private $secondary_roles;
47
+ private $result = NULL;
48
+
49
+ function __construct($main) {
50
+ parent::__construct($main);
51
+
52
+ add_filter('manage_users_columns', array($this, 'manage_users_columns'), 10, 1);
53
+ add_filter('manage_users_custom_column', array($this, 'manage_users_columns_content'), 10, 3);
54
+
55
+ add_filter('user_row_actions', array($this, 'user_row_actions'), 10, 2);
56
+ }
57
+
58
+ public function manage_users_columns($columns) {
59
+ $columns[self::SECONDARY_ROLE_COLUMN_KEY] = $this->__('Secondary Roles');
60
+
61
+ return $columns;
62
+ }
63
+
64
+ public function manage_users_columns_content($value, $column_name, $user_id) {
65
+ if ($column_name == self::SECONDARY_ROLE_COLUMN_KEY) {
66
+ $user = get_userdata($user_id);
67
+ return $this->get_secondary_role_list($user->roles);
68
+ }
69
+ return $value;
70
+ }
71
+
72
+ public function user_row_actions($actions, $user_object) {
73
+ if ($this->can_assign_roles() && $user_object->ID !== wp_get_current_user()->ID)
74
+ $actions['assign_roles'] = sprintf('<a href="%s">%s</a>', $this->get_assign_role_url($user_object), $this->__('Assign Roles'));
75
+ return $actions;
76
+ }
77
+
78
+ private function get_assign_role_url($user_object = NULL) {
79
+ if ($user_object == NULL)
80
+ return admin_url('users.php') . '?page=' . self::MENU_SLUG . '&assign_roles=';
81
+ return $this->get_assign_role_url() . $user_object->ID;
82
+ }
83
+
84
+ private function get_secondary_role_list($roles) {
85
+ $names = array();
86
+
87
+ global $wp_roles;
88
+
89
+ foreach ($roles as $value) {
90
+ if (array_key_exists($value, $wp_roles->role_names)) {
91
+ $names[] = $wp_roles->role_names[$value];
92
+ }
93
+ }
94
+
95
+ array_shift($names);
96
+ return implode(', ', $names);
97
+ }
98
+
99
+ public function assign_roles() {
100
+ if (!$this->can_assign_roles()) {
101
+ $this->main->permission_denied();
102
+ return;
103
+ }
104
+
105
+ $this->users = get_users(array('exclude' => array(wp_get_current_user()->ID)));
106
+
107
+ global $wp_roles;
108
+ $roles = $wp_roles->get_names();
109
+
110
+ $this->primary_roles = $roles;
111
+ $this->primary_roles[''] = '&mdash;' . $this->__('No role for this site') . '&mdash;';
112
+
113
+ $this->secondary_roles = array();
114
+ foreach ($roles as $key => $value) {
115
+ if ($key != 'administrator')
116
+ $this->secondary_roles[$key] = $value;
117
+ }
118
+
119
+ if (!empty($_POST['assignroles']) && !empty($_POST['assign-user'])) {
120
+ $this->main->verify_nonce();
121
+
122
+ $this->result = (OBJECT) array("success" => FALSE);
123
+
124
+ $this->user = get_userdata($_POST['assign-user']);
125
+ if ($this->user === FALSE || $this->user->ID === wp_get_current_user()->ID) {
126
+ $this->user = NULL;
127
+ $this->result->message = $this->__('Invalid user.');
128
+ }
129
+
130
+ if ($this->user != NULL) {
131
+ $primary_role = NULL;
132
+ if (isset($_POST['assign-primary-role'])) {
133
+ $primary_role = $_POST['assign-primary-role'];
134
+ if (!array_key_exists($primary_role, $this->primary_roles))
135
+ $primary_role = NULL;
136
+ }
137
+
138
+ if ($primary_role !== NULL) {
139
+ $secondary_roles = array();
140
+ if (!empty($_POST['assign-secondary-roles'])) {
141
+ $secondary_roles = $_POST['assign-secondary-roles'];
142
+ }
143
+ if (is_array($secondary_roles))
144
+ $secondary_roles = array_keys($secondary_roles);
145
+ else
146
+ $secondary_roles = array();
147
+
148
+ $this->user->set_role($primary_role);
149
+
150
+ foreach ($secondary_roles as $role) {
151
+ $this->user->add_role($role);
152
+ }
153
+
154
+ $this->result->success = TRUE;
155
+ $this->result->message = $this->__('Roles updated successfully.');
156
+ } else {
157
+ $this->result->message = $this->__('Invalid primary role specified.');
158
+ }
159
+ }
160
+ }
161
+
162
+ if (!empty($_POST['migrateroles'])) {
163
+ $this->main->verify_nonce();
164
+
165
+ $this->result = (OBJECT) array("success" => FALSE);
166
+
167
+ if (isset($_POST['migrate-from-primary-role'])) {
168
+ $this->migrateFromPrimaryRole = $_POST['migrate-from-primary-role'];
169
+ if (!array_key_exists($this->migrateFromPrimaryRole, $this->primary_roles)) {
170
+ $this->migrateFromPrimaryRole = NULL;
171
+ }
172
+ }
173
+
174
+ if ($this->migrateFromPrimaryRole === NULL) {
175
+ $this->result->message = $this->__('Invalid primary role.');
176
+ } else {
177
+ if (isset($_POST['migrate-primary-role'])) {
178
+ $this->migrateToPrimaryRole = $_POST['migrate-primary-role'];
179
+ if (!array_key_exists($this->migrateToPrimaryRole, $this->primary_roles)) {
180
+ $this->migrateToPrimaryRole = NULL;
181
+ }
182
+ }
183
+
184
+ if ($this->migrateToPrimaryRole === NULL) {
185
+ $this->result->message = $this->__('Invalid primary role.');
186
+ } else {
187
+ if (!empty($_POST['migrate-secondary-roles'])) {
188
+ $this->migrateToSecondaryRoles = $_POST['migrate-secondary-roles'];
189
+ if (is_array($this->migrateToSecondaryRoles))
190
+ $this->migrateToSecondaryRoles = array_keys($this->migrateToSecondaryRoles);
191
+ else
192
+ $this->migrateToSecondaryRoles = array();
193
+ }
194
+
195
+ $users = get_users(array('exclude' => array(wp_get_current_user()->ID), 'role' => $this->migrateFromPrimaryRole));
196
+ $users = array_filter($users, array($this, 'array_filter_user'));
197
+
198
+ foreach ($users as $user) {
199
+ $user->set_role($this->migrateToPrimaryRole);
200
+
201
+ foreach ($this->migrateToSecondaryRoles as $role) {
202
+ $user->add_role($role);
203
+ }
204
+ }
205
+
206
+ $this->result->success = TRUE;
207
+ $this->result->message = sprintf($this->__('%d user(s) migrated.'), count($users));
208
+ }
209
+ }
210
+ }
211
+
212
+ if ($this->user == NULL && !empty($_GET['assign_roles'])) {
213
+ $this->user = get_userdata($_GET['assign_roles']);
214
+ if ($this->user === FALSE || $this->user->ID === wp_get_current_user()->ID)
215
+ $this->user = NULL;
216
+ }
217
+
218
+ if ($this->user == NULL) {
219
+ if (!empty($this->users))
220
+ $this->user = $this->users[0];
221
+ }
222
+
223
+ if ($this->user != NULL) {
224
+ $roles = $this->user->roles;
225
+ $this->userPrimaryRole = array_shift($roles);
226
+ if ($this->userPrimaryRole === NULL)
227
+ $this->userPrimaryRole = '';
228
+ $this->userSecondaryRoles = $roles;
229
+ }
230
+
231
+ include($this->main->pluginDIR() . 'templates/assign-roles.php');
232
+ }
233
+
234
+ private function array_filter_user($user) {
235
+ if ($this->migrateFromPrimaryRole === '') {
236
+ if (empty($user->roles))
237
+ return TRUE;
238
+ }
239
+
240
+ if (empty($user->roles))
241
+ return FALSE;
242
+
243
+ $roles = $user->roles;
244
+ $role = array_shift($roles);
245
+ return $role === $this->migrateFromPrimaryRole;
246
+ }
247
+
248
+ private function primary_secondary_section($prefix, $selectPrimaryRole = NULL, $selectSecondaryRoles = array()) {
249
+ ?>
250
+ <tr>
251
+ <th scope="row">
252
+ <?php echo $this->__('Primary Role'); ?>
253
+ </th>
254
+ <td>
255
+ <select id="<?php echo $prefix; ?>_roles_list" name="<?php echo $prefix; ?>-primary-role">
256
+ <?php
257
+ foreach ($this->primary_roles as $key => $role) {
258
+ ?>
259
+ <option value="<?php echo $key; ?>" <?php echo $selectPrimaryRole === $key ? 'selected' : ''; ?>>
260
+ <?php echo $role; ?>
261
+ </option>
262
+ <?php
263
+ }
264
+ ?>
265
+ </select>
266
+ </td>
267
+ </tr>
268
+ <tr>
269
+ <th scope="row">
270
+ <?php echo $this->__('Secondary Roles'); ?>
271
+ </th>
272
+ <td>
273
+ <div class="role-list">
274
+ <?php
275
+ foreach ($this->secondary_roles as $key => $role) {
276
+ ?>
277
+ <div class="role-list-item">
278
+ <label>
279
+ <input type="checkbox" name="<?php echo $prefix; ?>-secondary-roles[<?php echo $key; ?>]" <?php echo in_array($key, $selectSecondaryRoles) ? 'checked' : ''; ?> />
280
+ <?php echo $role; ?>
281
+ </label>
282
+ </div>
283
+ <?php
284
+ }
285
+ ?>
286
+ </div>
287
+ </td>
288
+ </tr>
289
+ <?php
290
+ }
291
+
292
+ protected function add_help_tab() {
293
+ return array(
294
+ array(
295
+ 'id' => 'overview',
296
+ 'title' => $this->__('Overview'),
297
+ 'content' => '<p>'
298
+ . $this->__('This screen allows you to assign multiple roles to a user and also allows you to migrate users from a role to another role.')
299
+ . '</p>'
300
+ ),
301
+ array(
302
+ 'id' => 'assignroles',
303
+ 'title' => $this->__('Assign Roles'),
304
+ 'content' => '<p>'
305
+ . $this->__('To assign multiple roles to a user, select that user within the User drop down list and select the primary role you want for that user using the Primary Role drop down list. Select the secondary roles using the check boxes below, then click Assign Roles.')
306
+ . '</p>'
307
+ ),
308
+ array(
309
+ 'id' => 'migrateusers',
310
+ 'title' => $this->__('Migrate Users'),
311
+ 'content' => '<p>'
312
+ . $this->__('To migrate users from one role to another role or to add secondary roles to users belonging to a particular primary role, use the migrate users functionality.')
313
+ . '</p>'
314
+ . '<p>'
315
+ . $this->__('Select the users using the From Primary Role drop down, to primary role using the Primary Role drop down and secondary roles using the check boxes then click Migrate Users.')
316
+ . '</p>'
317
+ )
318
+ );
319
+ }
320
+
321
+ protected function set_help_sidebar() {
322
+ return array(
323
+ array(
324
+ $this->__('Documentation on Assign / Migrate Users'),
325
+ 'assign-migrate-users/'
326
+ )
327
+ );
328
+ }
329
+
330
+ }
331
+
332
+ }
classes/class-wpfront-user-role-editor-controller-base.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ WPFront User Role Editor Plugin
5
+ Copyright (C) 2014, WPFront.com
6
+ Website: wpfront.com
7
+ Contact: syam@wpfront.com
8
+
9
+ WPFront User Role Editor Plugin is distributed under the GNU General Public License, Version 3,
10
+ June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
11
+ St, Fifth Floor, Boston, MA 02110, USA
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ */
24
+
25
+ if (!class_exists('WPFront_User_Role_Editor_Controller_Base')) {
26
+
27
+ /**
28
+ * Base class of WPFront User Role Editor Controllers
29
+ *
30
+ * @author Syam Mohan <syam@wpfront.com>
31
+ * @copyright 2014 WPFront.com
32
+ */
33
+ class WPFront_User_Role_Editor_Controller_Base {
34
+
35
+ protected $main;
36
+ protected $page_hook;
37
+ protected $multisite = FALSE;
38
+ private static $ajax_handlers = array();
39
+
40
+ public function __construct($main) {
41
+ $this->main = $main;
42
+
43
+ add_action('admin_init', array($this, 'check_multisite'));
44
+ }
45
+
46
+ public function set_page_hook($page_hook) {
47
+ $this->page_hook = $page_hook;
48
+ add_action("load-{$this->page_hook}", array($this, 'set_help_tab'));
49
+ }
50
+
51
+ public static function register_ajax_handlers() {
52
+ foreach (self::$ajax_handlers as $key => $value) {
53
+ add_action($key, $value);
54
+ }
55
+ }
56
+
57
+ protected function ajax_register($key, $func) {
58
+ self::$ajax_handlers[$key] = $func;
59
+ }
60
+
61
+ public function check_multisite() {
62
+ $this->multisite = is_network_admin();
63
+ }
64
+
65
+ public function set_multisite($multisite) {
66
+ $this->multisite = $multisite;
67
+ }
68
+
69
+ public function set_help_tab() {
70
+ $screen = get_current_screen();
71
+
72
+ $tabs = $this->add_help_tab();
73
+ if ($tabs !== NULL) {
74
+ foreach ($tabs as $value) {
75
+ $screen->add_help_tab($value);
76
+ }
77
+ }
78
+
79
+ $sidebar = $this->set_help_sidebar();
80
+ if ($sidebar !== NULL) {
81
+ $s = '<p><strong>' . $this->__('Links:') . '</strong></p>';
82
+
83
+ foreach ($sidebar as $value) {
84
+ $s .= '<p><a target="_blank" href="http://wpfront.com/user-role-editor-pro/' . $value[1] . '">' . $value[0] . '</a></p>';
85
+ }
86
+
87
+ $s .= '<p><a target="_blank" href="http://wpfront.com/user-role-editor-pro/faq/">' . $this->__('FAQ') . '</a></p>';
88
+ $s .= '<p><a target="_blank" href="http://wpfront.com/support/">' . $this->__('Support') . '</a></p>';
89
+ $s .= '<p><a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/wpfront-user-role-editor">' . $this->__('Review') . '</a></p>';
90
+ $s .= '<p><a target="_blank" href="http://wpfront.com/contact/">' . $this->__('Contact') . '</a></p>';
91
+
92
+
93
+
94
+ $screen->set_help_sidebar($s);
95
+ }
96
+ }
97
+
98
+ protected function add_help_tab() {
99
+ return NULL;
100
+ }
101
+
102
+ protected function set_help_sidebar() {
103
+ return NULL;
104
+ }
105
+
106
+ public function can_list() {
107
+ return $this->main->current_user_can('list_roles');
108
+ }
109
+
110
+ public function can_create() {
111
+ return $this->main->current_user_can('create_roles');
112
+ }
113
+
114
+ public function can_edit() {
115
+ return $this->main->current_user_can('edit_roles');
116
+ }
117
+
118
+ public function can_delete() {
119
+ return $this->main->current_user_can('delete_roles');
120
+ }
121
+
122
+ public function can_assign_roles() {
123
+ return current_user_can('promote_users') && current_user_can('list_users');
124
+ }
125
+
126
+ public function __($s) {
127
+ return $this->main->__($s);
128
+ }
129
+
130
+ public function image_url() {
131
+ return $this->main->pluginURL() . 'images/';
132
+ }
133
+
134
+ protected function footer() {
135
+ $this->main->footer();
136
+ }
137
+
138
+ public function list_url() {
139
+ return admin_url('admin.php') . '?page=' . WPFront_User_Role_Editor_List::MENU_SLUG;
140
+ }
141
+
142
+ public function add_new_url() {
143
+ return admin_url('admin.php') . '?page=' . WPFront_User_Role_Editor_Add_Edit::MENU_SLUG;
144
+ }
145
+
146
+ public function edit_url() {
147
+ return admin_url('admin.php') . '?page=' . WPFront_User_Role_Editor_List::MENU_SLUG . '&edit_role=';
148
+ }
149
+
150
+ public function delete_url() {
151
+ return admin_url('admin.php') . '?page=' . WPFront_User_Role_Editor_List::MENU_SLUG . '&delete_role=';
152
+ }
153
+
154
+ public function set_default_url() {
155
+ return admin_url('admin.php') . '?page=' . WPFront_User_Role_Editor_List::MENU_SLUG . '&nonce=' . wp_create_nonce($this->list_url()) . '&set_default_role=';
156
+ }
157
+
158
+ public function cache_add($key, $data) {
159
+ wp_cache_set($key, $data, WPFront_User_Role_Editor::PLUGIN_SLUG);
160
+ }
161
+
162
+ public function cache_get($key) {
163
+ $data = wp_cache_get($key, WPFront_User_Role_Editor::PLUGIN_SLUG);
164
+ if ($data === FALSE)
165
+ return NULL;
166
+
167
+ return $data;
168
+ }
169
+
170
+ }
171
+
172
+ add_action('admin_init', 'WPFront_User_Role_Editor_Controller_Base::register_ajax_handlers');
173
+ wp_cache_add_non_persistent_groups(WPFront_User_Role_Editor::PLUGIN_SLUG);
174
+ }
classes/class-wpfront-user-role-editor-delete.php CHANGED
@@ -31,19 +31,43 @@ if (!class_exists('WPFront_User_Role_Editor_Delete')) {
31
  * @author Syam Mohan <syam@wpfront.com>
32
  * @copyright 2014 WPFront.com
33
  */
34
- class WPFront_User_Role_Editor_Delete {
35
 
36
- private $main;
37
- private $roles;
38
 
39
  function __construct($main) {
40
- $this->main = $main;
41
  }
42
 
43
  public function delete_role($delete_roles) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  $this->roles = array();
 
45
  $editable_roles = get_editable_roles();
46
  global $wp_roles;
 
 
47
 
48
  foreach ($delete_roles as $value) {
49
  if (array_key_exists($value, $wp_roles->role_names)) {
@@ -71,23 +95,21 @@ if (!class_exists('WPFront_User_Role_Editor_Delete')) {
71
  );
72
  }
73
  }
74
-
75
- if(!empty($_POST['confirm-delete'])) {
76
- $this->main->verify_nonce();
77
- foreach ($this->roles as $key => $value) {
78
- if($value->is_deletable) {
79
- remove_role($key);
80
- }
81
- }
82
- printf('<script type="text/javascript">document.location="%s";</script>', $this->list_roles_url());
83
  return;
84
- }
85
 
86
- include($this->main->pluginDIR() . 'templates/delete-role.php');
 
 
 
 
87
  }
88
-
89
  public function is_pending_action() {
90
- if(!empty($_POST['confirm-delete']) && !empty($_POST['delete-roles'])) {
91
  $this->delete_role(array_keys($_POST['delete-roles']));
92
  return TRUE;
93
  }
@@ -97,22 +119,14 @@ if (!class_exists('WPFront_User_Role_Editor_Delete')) {
97
  private function get_deleting_roles() {
98
  return $this->roles;
99
  }
100
-
101
  private function is_submit_allowed() {
102
  foreach ($this->roles as $key => $value) {
103
- if($value->is_deletable)
104
  return TRUE;
105
  }
106
-
107
- return FALSE;
108
- }
109
-
110
- private function list_roles_url() {
111
- return admin_url('admin.php') . '?page=' . WPFront_User_Role_Editor_List::MENU_SLUG;
112
- }
113
 
114
- private function __($s) {
115
- return $this->main->__($s);
116
  }
117
 
118
  }
31
  * @author Syam Mohan <syam@wpfront.com>
32
  * @copyright 2014 WPFront.com
33
  */
34
+ class WPFront_User_Role_Editor_Delete extends WPFront_User_Role_Editor_Controller_Base {
35
 
36
+ protected $roles;
 
37
 
38
  function __construct($main) {
39
+ parent::__construct($main);
40
  }
41
 
42
  public function delete_role($delete_roles) {
43
+ if (!$this->can_delete()) {
44
+ $this->main->permission_denied();
45
+ return;
46
+ }
47
+
48
+ $this->prepare_data($delete_roles);
49
+
50
+ if (!empty($_POST['confirm-delete'])) {
51
+ $this->main->verify_nonce();
52
+ $this->delete();
53
+ printf('<script type="text/javascript">window.location.replace("%s");</script>', $this->list_url());
54
+ return;
55
+ }
56
+
57
+ $this->include_template();
58
+ }
59
+
60
+ protected function include_template() {
61
+ include($this->main->pluginDIR() . 'templates/delete-role.php');
62
+ }
63
+
64
+ protected function prepare_data($delete_roles) {
65
  $this->roles = array();
66
+
67
  $editable_roles = get_editable_roles();
68
  global $wp_roles;
69
+ if ($this->main->override_edit_permissions())
70
+ $editable_roles = $wp_roles->get_names();
71
 
72
  foreach ($delete_roles as $value) {
73
  if (array_key_exists($value, $wp_roles->role_names)) {
95
  );
96
  }
97
  }
98
+ }
99
+
100
+ protected function delete() {
101
+ if (!$this->can_delete())
 
 
 
 
 
102
  return;
 
103
 
104
+ foreach ($this->roles as $key => $value) {
105
+ if ($value->is_deletable) {
106
+ remove_role($key);
107
+ }
108
+ }
109
  }
110
+
111
  public function is_pending_action() {
112
+ if (!empty($_POST['confirm-delete']) && !empty($_POST['delete-roles'])) {
113
  $this->delete_role(array_keys($_POST['delete-roles']));
114
  return TRUE;
115
  }
119
  private function get_deleting_roles() {
120
  return $this->roles;
121
  }
122
+
123
  private function is_submit_allowed() {
124
  foreach ($this->roles as $key => $value) {
125
+ if ($value->is_deletable)
126
  return TRUE;
127
  }
 
 
 
 
 
 
 
128
 
129
+ return FALSE;
 
130
  }
131
 
132
  }
classes/class-wpfront-user-role-editor-entity-base.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once(plugin_dir_path(__FILE__) . "base/class-wpfront-entity-base.php");
4
+
5
+ if (!class_exists('WPFront_User_Role_Editor_Entity_Base')) {
6
+
7
+ /**
8
+ * User Role Editor Entity Base
9
+ *
10
+ * @author Syam Mohan <syam@wpfront.com>
11
+ * @copyright 2014 WPFront.com
12
+ */
13
+ abstract class WPFront_User_Role_Editor_Entity_Base extends WPFront_Entity_Base {
14
+
15
+ public function __construct($table_name) {
16
+ parent::__construct(
17
+ WPFront_User_Role_Editor::PLUGIN_SLUG,
18
+ WPFront_User_Role_Editor::VERSION,
19
+ $this instanceof WPFront_User_Role_Editor_Entity_Options ? $this : new WPFront_User_Role_Editor_Entity_Options(),
20
+ 'ure_' . $table_name
21
+ );
22
+ }
23
+
24
+ }
25
+
26
+ }
classes/class-wpfront-user-role-editor-go-pro.php ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ WPFront User Role Editor Plugin
5
+ Copyright (C) 2014, WPFront.com
6
+ Website: wpfront.com
7
+ Contact: syam@wpfront.com
8
+
9
+ WPFront User Role Editor Plugin is distributed under the GNU General Public License, Version 3,
10
+ June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
11
+ St, Fifth Floor, Boston, MA 02110, USA
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ */
24
+
25
+ if (!class_exists('WPFront_User_Role_Editor_Go_Pro')) {
26
+
27
+ /**
28
+ * Go Pro
29
+ *
30
+ * @author Syam Mohan <syam@wpfront.com>
31
+ * @copyright 2014 WPFront.com
32
+ */
33
+ class WPFront_User_Role_Editor_Go_Pro extends WPFront_User_Role_Editor_Controller_Base {
34
+
35
+ const MENU_SLUG = 'wpfront-user-role-editor-go-pro';
36
+
37
+ private static $go_pro_html_url = 'https://wpfront.com/syam/wordpress-plugins/wpfront-user-role-editor/pro/comparison/';
38
+ private static $store_url = 'https://wpfront.com/';
39
+ private $pro_html = '';
40
+ private $has_license = FALSE;
41
+ private $need_license = FALSE;
42
+ private $license_key = NULL;
43
+ private $license_key_k = NULL;
44
+ private $license_expires = NULL;
45
+ private $license_expired = FALSE;
46
+ private $product = NULL;
47
+ private $error = NULL;
48
+
49
+ public function __construct($main) {
50
+ parent::__construct($main);
51
+
52
+ $this->ajax_register('wp_ajax_wpfront_user_role_editor_license_functions', array($this, 'license_functions'));
53
+ }
54
+
55
+ public function go_pro() {
56
+ $this->main->verify_nonce();
57
+
58
+ if (!current_user_can('manage_options')) {
59
+ $this->main->permission_denied();
60
+ return;
61
+ }
62
+
63
+ if (!empty($_POST['license_key']) && !empty($_POST['activate'])) {
64
+ $this->activate_license($_POST['license_key']);
65
+ }
66
+
67
+ if (!empty($_POST['deactivate'])) {
68
+ $this->deactivate_license();
69
+ }
70
+
71
+ $options = new WPFront_User_Role_Editor_Entity_Options();
72
+
73
+ $time_key = self::MENU_SLUG . '-html-last-update';
74
+ $html_key = self::MENU_SLUG . '-html';
75
+
76
+ $time = $options->get_option($time_key);
77
+
78
+ if ($time === NULL || $time < time() - 24 * 3600) {
79
+ $options->update_option($time_key, time());
80
+ $result = wp_remote_get(self::$go_pro_html_url, array('timeout' => 15, 'sslverify' => false));
81
+ if (!is_wp_error($result) && wp_remote_retrieve_response_code($result) == 200) {
82
+ $this->pro_html = wp_remote_retrieve_body($result);
83
+ $options->update_option($html_key, $this->pro_html);
84
+ }
85
+ }
86
+
87
+ if ($this->pro_html === '') {
88
+ $key = self::MENU_SLUG . '-html';
89
+ $this->pro_html = $options->get_option($key);
90
+ if ($this->pro_html === NULL)
91
+ $this->pro_html = '';
92
+ }
93
+
94
+ if($this->pro_html === '') {
95
+ $this->pro_html = file_get_contents($this->main->pluginDIR() . 'templates/go-pro-table');
96
+ }
97
+
98
+ include($this->main->pluginDIR() . 'templates/go-pro.php');
99
+ }
100
+
101
+ public function set_license($key = NULL, $product = NULL) {
102
+ if ($key === NULL && $this->license_key_k === NULL)
103
+ return;
104
+
105
+ if ($key !== NULL) {
106
+ $this->need_license = TRUE;
107
+ $this->license_key_k = $key . '-license-key';
108
+ $this->product = $product;
109
+ }
110
+
111
+ if (is_multisite()) {
112
+ $options = new WPFront_User_Role_Editor_Options($this->main);
113
+ switch_to_blog($options->ms_options_blog_id());
114
+ }
115
+
116
+ $entity = new WPFront_User_Role_Editor_Entity_Options();
117
+ $this->license_key = $entity->get_option($this->license_key_k);
118
+ if ($this->license_key !== NULL) {
119
+ $last_checked = $entity->get_option($this->license_key_k . '-last-checked');
120
+ if ($last_checked < time() - 24 * 3600) {
121
+ $entity->update_option($this->license_key_k . '-last-checked', time());
122
+ $result = $this->remote_get('check_license', $this->license_key);
123
+ if (($result->activations_left === 'unlimited' || $result->activations_left >= 0) && ($result->license === 'valid' || $result->license === 'expired')) {
124
+ $entity->update_option($this->license_key_k . '-status', $result->license);
125
+ $entity->update_option($this->license_key_k . '-expires', $result->expires);
126
+ } else {
127
+ $this->deactivate_license(TRUE);
128
+ return;
129
+ }
130
+ }
131
+ $this->has_license = TRUE;
132
+ $this->license_expired = $entity->get_option($this->license_key_k . '-status') === 'expired';
133
+ $this->license_expires = date('F d, Y', strtotime($entity->get_option($this->license_key_k . '-expires')));
134
+
135
+ for ($i = 0; $i < strlen($this->license_key) - 4; $i++) {
136
+ $this->license_key = substr_replace($this->license_key, 'X', $i, 1);
137
+ }
138
+
139
+ add_action('admin_init', array($this, 'edd_plugin_update'));
140
+ } else {
141
+ $this->license_key = '';
142
+ $this->has_license = FALSE;
143
+ $this->license_expires = NULL;
144
+ }
145
+
146
+ if (is_multisite()) {
147
+ restore_current_blog();
148
+ }
149
+ }
150
+
151
+ private function activate_license($license) {
152
+ if ($this->license_key_k === NULL)
153
+ return;
154
+
155
+ $this->license_key = $license;
156
+
157
+ $result = $this->remote_get('activate_license', $license);
158
+ if ($result === NULL)
159
+ return;
160
+
161
+ $entity = new WPFront_User_Role_Editor_Entity_Options();
162
+ $entity->delete_option($this->license_key_k);
163
+ $entity->delete_option($this->license_key_k . '-expires');
164
+ $entity->delete_option($this->license_key_k . '-last-checked');
165
+
166
+ if ($result->license === 'valid' || $result->error === 'expired') {
167
+ $entity->update_option($this->license_key_k, $license);
168
+ $entity->update_option($this->license_key_k . '-status', $result->license === 'valid' ? 'valid' : 'expired');
169
+ $entity->update_option($this->license_key_k . '-expires', $result->expires);
170
+ $entity->update_option($this->license_key_k . '-last-checked', time());
171
+
172
+ $this->set_license();
173
+ } elseif ($result->error === 'no_activations_left') {
174
+ $this->error = $this->__('ERROR') . ': ' . $this->__('License key activation limit reached');
175
+ } else {
176
+ $this->error = $this->__('ERROR') . ': ' . $this->__('Invalid license key');
177
+ }
178
+ }
179
+
180
+ private function deactivate_license($forced = TRUE) {
181
+ if ($this->license_key_k === NULL)
182
+ return;
183
+
184
+ $entity = new WPFront_User_Role_Editor_Entity_Options();
185
+ $this->license_key = $entity->get_option($this->license_key_k);
186
+
187
+ $result = $this->remote_get('deactivate_license', $this->license_key);
188
+ if ($result === NULL)
189
+ return;
190
+
191
+ if ($result->license === 'deactivated' || $forced) {
192
+ $entity->delete_option($this->license_key_k);
193
+ $entity->delete_option($this->license_key_k . '-expires');
194
+ $entity->delete_option($this->license_key_k . '-last-checked');
195
+ } else {
196
+ $this->error = $this->__('ERROR') . ': ' . $this->__('Unable to deactivate, expired license?');
197
+ }
198
+
199
+ $this->set_license();
200
+ }
201
+
202
+ private function remote_get($action, $license) {
203
+ if ($this->product === NULL)
204
+ return NULL;
205
+
206
+ $api_params = array(
207
+ 'edd_action' => $action,
208
+ 'license' => urlencode($license),
209
+ 'item_name' => urlencode($this->product),
210
+ 'url' => urlencode(home_url())
211
+ );
212
+
213
+ $response = wp_remote_get(add_query_arg($api_params, self::$store_url), array('timeout' => 15, 'sslverify' => false));
214
+ if (is_wp_error($response)) {
215
+ $this->error = $this->__('ERROR') . ': ' . $this->__('Unable to contact wpfront.com')
216
+ . '<br />'
217
+ . $this->__('Details') . ': ' . $response->get_error_message();
218
+ return NULL;
219
+ }
220
+
221
+ $result = json_decode(wp_remote_retrieve_body($response));
222
+
223
+ if (!is_object($result)) {
224
+ $this->error = $this->__('ERROR') . ': ' . $this->__('Unable to parse response');
225
+ return NULL;
226
+ }
227
+
228
+ return $result;
229
+ }
230
+
231
+ public function edd_plugin_update() {
232
+ $entity = new WPFront_User_Role_Editor_Entity_Options();
233
+
234
+ new EDD_SL_Plugin_Updater(self::$store_url, WPFRONT_USER_ROLE_EDITOR_PLUGIN_FILE, array(
235
+ 'version' => WPFront_User_Role_Editor::VERSION,
236
+ 'license' => $entity->get_option($this->license_key_k),
237
+ 'item_name' => $this->product,
238
+ 'author' => 'Syam Mohan'
239
+ ));
240
+ }
241
+
242
+ public function license_functions() {
243
+ if (!wp_verify_nonce($_POST['_wpnonce'], $_POST['_wp_http_referer'])) {
244
+ echo 'true';
245
+ die();
246
+ }
247
+
248
+ if (!current_user_can('manage_options')) {
249
+ echo 'true';
250
+ die();
251
+ }
252
+
253
+ if (!empty($_POST['license_key']) && !empty($_POST['activate'])) {
254
+ $this->activate_license($_POST['license_key']);
255
+ }
256
+
257
+ if (!empty($_POST['deactivate'])) {
258
+ $this->deactivate_license();
259
+ }
260
+
261
+ if ($this->error === NULL)
262
+ echo 'true';
263
+ else
264
+ echo 'false';
265
+ die();
266
+ }
267
+
268
+ public function has_license() {
269
+ if ($this->need_license)
270
+ return $this->has_license;
271
+
272
+ return TRUE;
273
+ }
274
+
275
+ }
276
+
277
+ }
classes/class-wpfront-user-role-editor-list.php CHANGED
@@ -21,7 +21,7 @@
21
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
  */
23
 
24
- require_once("class-wpfront-user-role-editor-add-edit.php");
25
 
26
  if (!class_exists('WPFront_User_Role_Editor_List')) {
27
 
@@ -31,42 +31,28 @@ if (!class_exists('WPFront_User_Role_Editor_List')) {
31
  * @author Syam Mohan <syam@wpfront.com>
32
  * @copyright 2014 WPFront.com
33
  */
34
- class WPFront_User_Role_Editor_List {
35
 
36
  const MENU_SLUG = 'wpfront-user-role-editor-all-roles';
37
 
38
- private $main;
39
  private $role_data = NULL;
 
40
 
41
  function __construct($main) {
42
- $this->main = $main;
43
  }
44
 
45
- public function list_roles() {
46
- if (!$this->can_list())
47
- $this->main->permission_denied();
48
-
49
  if (!empty($_GET['edit_role'])) {
50
- $obj = new WPFront_User_Role_Editor_Add_Edit($this->main);
51
- $obj->add_edit_role(trim($_GET['edit_role']));
52
- return;
53
  }
54
 
55
  if (!empty($_GET['delete_role'])) {
56
- $obj = new WPFront_User_Role_Editor_Delete($this->main);
57
- $obj->delete_role(array(trim($_GET['delete_role'])));
58
- return;
59
  }
60
 
61
  if (!empty($_GET['set_default_role'])) {
62
- $this->set_default_role($_GET['set_default_role']);
63
- printf('<script type="text/javascript">document.location="%s";</script>', $this->list_url());
64
- return;
65
- }
66
-
67
- $obj = new WPFront_User_Role_Editor_Delete($this->main);
68
- if ($obj->is_pending_action()) {
69
- return;
70
  }
71
 
72
  $action = '';
@@ -78,53 +64,39 @@ if (!class_exists('WPFront_User_Role_Editor_List')) {
78
 
79
  if ($action == 'delete') {
80
  if (!empty($_POST['selected-roles'])) {
81
- $obj = new WPFront_User_Role_Editor_Delete($this->main);
82
- $obj->delete_role(array_keys($_POST['selected-roles']));
83
- return;
84
  }
85
  }
86
 
87
- include($this->main->pluginDIR() . 'templates/list-roles.php');
88
- }
89
-
90
- private function __($s) {
91
- return $this->main->__($s);
92
  }
93
 
94
- private function can_list() {
95
- return $this->main->current_user_can('list_roles');
96
- }
97
-
98
- private function can_create() {
99
- return $this->main->current_user_can('create_roles');
100
- }
101
-
102
- private function can_edit() {
103
- return $this->main->current_user_can('edit_roles');
104
- }
105
-
106
- private function can_delete() {
107
- return $this->main->current_user_can('delete_roles');
108
- }
109
-
110
- private function list_url() {
111
- return admin_url('admin.php') . '?page=' . self::MENU_SLUG;
112
- }
113
-
114
- private function add_new_url() {
115
- return admin_url('admin.php') . '?page=' . WPFront_User_Role_Editor_Add_Edit::MENU_SLUG;
116
- }
117
 
118
- private function edit_url() {
119
- return admin_url('admin.php') . '?page=' . WPFront_User_Role_Editor_List::MENU_SLUG . '&edit_role=';
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
121
 
122
- private function delete_url() {
123
- return admin_url('admin.php') . '?page=' . WPFront_User_Role_Editor_List::MENU_SLUG . '&delete_role=';
124
- }
 
125
 
126
- private function set_default_url() {
127
- return admin_url('admin.php') . '?page=' . WPFront_User_Role_Editor_List::MENU_SLUG . '&nonce=' . wp_create_nonce($this->list_url()) . '&set_default_role=';
128
  }
129
 
130
  private function set_default_role($default_role) {
@@ -152,6 +124,8 @@ if (!class_exists('WPFront_User_Role_Editor_List')) {
152
  asort($roles, SORT_STRING);
153
 
154
  $editable_roles = get_editable_roles();
 
 
155
 
156
  $user_default = get_option('default_role');
157
 
@@ -232,13 +206,15 @@ if (!class_exists('WPFront_User_Role_Editor_List')) {
232
  }
233
 
234
  private function table_header() {
 
 
235
  ?>
236
  <tr>
237
  <th scope="col" id="cb" class="manage-column column-cb check-column">
238
  <label class="screen-reader-text" for="cb-select-all-1"><?php echo $this->__('Select All'); ?></label>
239
  <input id="cb-select-all-1" type="checkbox" />
240
  </th>
241
- <th scope="col" id="rolename" class="manage-column column-rolename">
242
  <a><span><?php echo $this->__('Display Name'); ?></span></a>
243
  </th>
244
  <th scope="col" id="rolename" class="manage-column column-rolename">
@@ -256,6 +232,13 @@ if (!class_exists('WPFront_User_Role_Editor_List')) {
256
  <th scope="col" id="capscount" class="manage-column column-capscount num">
257
  <a><span><?php echo $this->__('Capabilities'); ?></span></a>
258
  </th>
 
 
 
 
 
 
 
259
  </tr>
260
  <?php
261
  }
@@ -280,10 +263,10 @@ if (!class_exists('WPFront_User_Role_Editor_List')) {
280
  }
281
 
282
  private function get_search_term() {
283
- if (empty($_POST['search']))
284
  return '';
285
 
286
- return $_POST['search'];
287
  }
288
 
289
  private function get_list_filters() {
@@ -358,12 +341,171 @@ if (!class_exists('WPFront_User_Role_Editor_List')) {
358
  return $list;
359
  }
360
 
361
- private function footer() {
362
- $this->main->footer();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
  }
364
 
365
- private function image_url() {
366
- return $this->main->pluginURL() . 'images/';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
367
  }
368
 
369
  }
21
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
  */
23
 
24
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-add-edit.php");
25
 
26
  if (!class_exists('WPFront_User_Role_Editor_List')) {
27
 
31
  * @author Syam Mohan <syam@wpfront.com>
32
  * @copyright 2014 WPFront.com
33
  */
34
+ class WPFront_User_Role_Editor_List extends WPFront_User_Role_Editor_Controller_Base {
35
 
36
  const MENU_SLUG = 'wpfront-user-role-editor-all-roles';
37
 
 
38
  private $role_data = NULL;
39
+ private $custom_columns = NULL;
40
 
41
  function __construct($main) {
42
+ parent::__construct($main);
43
  }
44
 
45
+ private function get_mode() {
 
 
 
46
  if (!empty($_GET['edit_role'])) {
47
+ return array('EDIT', trim($_GET['edit_role']));
 
 
48
  }
49
 
50
  if (!empty($_GET['delete_role'])) {
51
+ return array('DELETE', array(trim($_GET['delete_role'])));
 
 
52
  }
53
 
54
  if (!empty($_GET['set_default_role'])) {
55
+ return array('DEFAULT_ROLE', $_GET['set_default_role']);
 
 
 
 
 
 
 
56
  }
57
 
58
  $action = '';
64
 
65
  if ($action == 'delete') {
66
  if (!empty($_POST['selected-roles'])) {
67
+ return array('DELETE', array_keys($_POST['selected-roles']));
 
 
68
  }
69
  }
70
 
71
+ return array('LIST');
 
 
 
 
72
  }
73
 
74
+ public function list_roles() {
75
+ if (!$this->can_list())
76
+ $this->main->permission_denied();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
+ $mode = $this->get_mode();
79
+ switch ($mode[0]) {
80
+ case 'EDIT':
81
+ $obj = new WPFront_User_Role_Editor_Add_Edit($this->main);
82
+ $obj->add_edit_role($mode[1]);
83
+ return;
84
+ case 'DELETE':
85
+ $obj = new WPFront_User_Role_Editor_Delete($this->main);
86
+ $obj->delete_role($mode[1]);
87
+ return;
88
+ case 'DEFAULT_ROLE':
89
+ $this->set_default_role($mode[1]);
90
+ printf('<script type="text/javascript">window.location.replace("%s");</script>', $this->list_url());
91
+ return;
92
+ }
93
 
94
+ $obj = new WPFront_User_Role_Editor_Delete($this->main);
95
+ if ($obj->is_pending_action()) {
96
+ return;
97
+ }
98
 
99
+ include($this->main->pluginDIR() . 'templates/list-roles.php');
 
100
  }
101
 
102
  private function set_default_role($default_role) {
124
  asort($roles, SORT_STRING);
125
 
126
  $editable_roles = get_editable_roles();
127
+ if ($this->main->override_edit_permissions())
128
+ $editable_roles = $wp_roles->get_names();
129
 
130
  $user_default = get_option('default_role');
131
 
206
  }
207
 
208
  private function table_header() {
209
+ if ($this->custom_columns === NULL)
210
+ $this->custom_columns = apply_filters('manage_roles_columns', array());
211
  ?>
212
  <tr>
213
  <th scope="col" id="cb" class="manage-column column-cb check-column">
214
  <label class="screen-reader-text" for="cb-select-all-1"><?php echo $this->__('Select All'); ?></label>
215
  <input id="cb-select-all-1" type="checkbox" />
216
  </th>
217
+ <th scope="col" id="displayname" class="manage-column column-displayname">
218
  <a><span><?php echo $this->__('Display Name'); ?></span></a>
219
  </th>
220
  <th scope="col" id="rolename" class="manage-column column-rolename">
232
  <th scope="col" id="capscount" class="manage-column column-capscount num">
233
  <a><span><?php echo $this->__('Capabilities'); ?></span></a>
234
  </th>
235
+ <?php
236
+ foreach ($this->custom_columns as $key => $value) {
237
+ echo "<th scope='col' id='$key' class='manage-column column-$key num'>"
238
+ . "<a><span>$value</span></a>"
239
+ . "</th>";
240
+ }
241
+ ?>
242
  </tr>
243
  <?php
244
  }
263
  }
264
 
265
  private function get_search_term() {
266
+ if (empty($_POST['s']))
267
  return '';
268
 
269
+ return esc_html($_POST['s']);
270
  }
271
 
272
  private function get_list_filters() {
341
  return $list;
342
  }
343
 
344
+ protected function add_help_tab() {
345
+ $mode = $this->get_mode();
346
+ switch ($mode[0]) {
347
+ case 'EDIT':
348
+ return array(
349
+ array(
350
+ 'id' => 'overview',
351
+ 'title' => $this->__('Overview'),
352
+ 'content' => '<p>'
353
+ . $this->__('This screen allows you to edit a role within your site.')
354
+ . '</p>'
355
+ . '<p>'
356
+ . $this->__('You can copy capabilities from existing roles using the Copy from drop down list. Select the role you want to copy from, then click Apply to copy the capabilities. You can select or deselect capabilities even after you copy.')
357
+ . '</p>'
358
+ ),
359
+ array(
360
+ 'id' => 'displayname',
361
+ 'title' => $this->__('Display Name'),
362
+ 'content' => '<p>'
363
+ . $this->__('Use the Display Name field to edit display name of the role. WordPress uses display name to display this role within your site. This field is required.')
364
+ . '</p>'
365
+ ),
366
+ array(
367
+ 'id' => 'rolename',
368
+ 'title' => $this->__('Role Name'),
369
+ 'content' => '<p>'
370
+ . $this->__('Role Name is read only. WordPress uses role name to identify this role within your site.')
371
+ . '</p>'
372
+ ),
373
+ array(
374
+ 'id' => 'capabilities',
375
+ 'title' => $this->__('Capabilities'),
376
+ 'content' => '<p>'
377
+ . $this->__('Capabilities are displayed as different groups for easy access. The Roles section displays capabilities created by this plugin. The Other Capabilities section displays non-standard capabilities within your site. These are usually created by plugins and themes. Use the check boxes to select the capabilities required.')
378
+ . '</p>'
379
+ )
380
+ );
381
+ case 'DELETE':
382
+ return array(
383
+ array(
384
+ 'id' => 'overview',
385
+ 'title' => $this->__('Overview'),
386
+ 'content' => '<p>'
387
+ . $this->__('This screen allows you to delete roles from your WordPress site.')
388
+ . '</p>'
389
+ . '<p>'
390
+ . $this->__('Use the Roles List screen to select the roles you want to delete. You can delete individual roles using the Delete row action link or delete multiple roles at the same time using the bulk action.')
391
+ . '</p>'
392
+ . '<p>'
393
+ . $this->__('You cannot delete administrator role, current user’s role and roles you do not have permission to.')
394
+ . '</p>'
395
+ )
396
+ );
397
+ }
398
+
399
+ return array(
400
+ array(
401
+ 'id' => 'overview',
402
+ 'title' => $this->__('Overview'),
403
+ 'content' => '<p>'
404
+ . $this->__('This screen lists all the existing roles within your site.')
405
+ . '</p>'
406
+ . '<p>'
407
+ . $this->__('To add a new role, click the Add New button at the top of the screen or Add New in the Roles menu section.')
408
+ . '</p>'
409
+ ),
410
+ array(
411
+ 'id' => 'columns',
412
+ 'title' => $this->__('Columns'),
413
+ 'content' => '<p><strong>'
414
+ . $this->__('Display Name')
415
+ . '</strong>: '
416
+ . $this->__('Used to display this role within this site.')
417
+ . '</p>'
418
+ . '<p><strong>'
419
+ . $this->__('Role Name')
420
+ . '</strong>: '
421
+ . $this->__('Is used by WordPress to identify this role.')
422
+ . '</p>'
423
+ . '<p><strong>'
424
+ . $this->__('Type')
425
+ . '</strong>: '
426
+ . $this->__('Says whether the role is a WordPress built-in role or not. There are five built-in roles.')
427
+ . '</p>'
428
+ . '<p><strong>'
429
+ . $this->__('User Default')
430
+ . '</strong>: '
431
+ . $this->__('Displays whether a role is the default role of a new user.')
432
+ . '</p>'
433
+ . '<p><strong>'
434
+ . $this->__('Users')
435
+ . '</strong>: '
436
+ . $this->__('Number of users in that role.')
437
+ . '</p>'
438
+ . '<p><strong>'
439
+ . $this->__('Capabilities')
440
+ . '</strong>: '
441
+ . $this->__('Number of capabilities that role have.')
442
+ . '</p>'
443
+ . '<p><strong>'
444
+ . $this->__('Menu Edited')
445
+ . '</strong>: '
446
+ . $this->__('Displays whether the menu has been edited for this role. This is a pro feature.')
447
+ . '</p>'
448
+ ),
449
+ array(
450
+ 'id' => 'actions',
451
+ 'title' => $this->__('Actions'),
452
+ 'content' => '<p>'
453
+ . $this->__('Hovering over a row in the roles list will display action links that allow you to manage roles. You can perform the following actions:')
454
+ . '</p>'
455
+ . '<p><strong>'
456
+ . $this->__('View')
457
+ . '</strong>: '
458
+ . $this->__('Display details about the role. You can see the capabilities assigned for that role. View link will only appear when you do not have permission to edit that role.')
459
+ . '</p>'
460
+ . '<p><strong>'
461
+ . $this->__('Edit')
462
+ . '</strong>: '
463
+ . $this->__('Allows you to edit that role. You can see the capabilities assigned for that role and also edit them. Edit link will only appear when you have permission to edit that role.')
464
+ . '</p>'
465
+ . '<p><strong>'
466
+ . $this->__('Delete')
467
+ . '</strong>: '
468
+ . $this->__('Allows you to delete that role. Delete action will not appear if you do not have permission to delete that role.')
469
+ . '</p>'
470
+ . '<p><strong>'
471
+ . $this->__('Default')
472
+ . '</strong>: '
473
+ . $this->__('Allows you to set that role as the default role for new user registration.')
474
+ . '</p>'
475
+ . '<p><strong>'
476
+ . $this->__('Edit Menu')
477
+ . '</strong>: '
478
+ . $this->__('Takes you to the menu editor screen for that role. You need "edit_role_menus" capability for this link to appear. This is a pro feature.')
479
+ . '</p>'
480
+ )
481
+ );
482
  }
483
 
484
+ protected function set_help_sidebar() {
485
+ $mode = $this->get_mode();
486
+ switch ($mode[0]) {
487
+ case 'EDIT':
488
+ return array(
489
+ array(
490
+ $this->__('Documentation on Edit Role'),
491
+ 'edit-role/'
492
+ )
493
+ );
494
+ case 'DELETE':
495
+ return array(
496
+ array(
497
+ $this->__('Documentation on Delete Roles'),
498
+ 'delete-role/'
499
+ )
500
+ );
501
+ }
502
+
503
+ return array(
504
+ array(
505
+ $this->__('Documentation on Roles'),
506
+ 'list-roles/'
507
+ )
508
+ );
509
  }
510
 
511
  }
classes/class-wpfront-user-role-editor-options.php CHANGED
@@ -22,7 +22,7 @@
22
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
  */
24
 
25
- require_once("base/class-wpfront-options-base.php");
26
 
27
  if (!class_exists('WPFront_User_Role_Editor_Options')) {
28
 
@@ -32,17 +32,248 @@ if (!class_exists('WPFront_User_Role_Editor_Options')) {
32
  * @author Syam Mohan <syam@wpfront.com>
33
  * @copyright 2014 WPFront.com
34
  */
35
- class WPFront_User_Role_Editor_Options extends WPFront_Options_Base {
36
 
37
- function __construct($optionName, $pluginSlug) {
38
- parent::__construct($optionName, $pluginSlug);
39
 
40
- //add the options required for this plugin
41
- $this->addOption('display_deprecated', 'bit', FALSE)->__('Display Deprecated Capabilities');
42
- $this->addOption('enable_role_capabilities', 'bit', FALSE)->__('Add Role Capabilities');
43
- $this->addOption('remove_nonstandard_capabilities_restore', 'bit', FALSE)->__('Remove Non-Standard Capabilities on Restore');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  }
47
 
48
  }
22
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
  */
24
 
25
+ require_once(plugin_dir_path(__FILE__) . "entities/class-wpfront-user-role-editor-entity-options.php");
26
 
27
  if (!class_exists('WPFront_User_Role_Editor_Options')) {
28
 
32
  * @author Syam Mohan <syam@wpfront.com>
33
  * @copyright 2014 WPFront.com
34
  */
35
+ class WPFront_User_Role_Editor_Options extends WPFront_User_Role_Editor_Controller_Base {
36
 
37
+ const MENU_SLUG = WPFront_User_Role_Editor::PLUGIN_SLUG;
 
38
 
39
+ function __construct($main) {
40
+ parent::__construct($main);
41
+
42
+ $this->ajax_register('wp_ajax_wpfront_user_role_editor_update_options', array($this, 'update_options_callback'));
43
+ }
44
+
45
+ public function settings() {
46
+ include($this->main->pluginDIR() . 'templates/options-template.php');
47
+ }
48
+
49
+ public function update_options_callback() {
50
+ check_ajax_referer($_POST['referer'], 'nonce');
51
+
52
+ if (isset($_POST['multisite']))
53
+ $this->multisite = TRUE;
54
+
55
+ $this->update_option_boolean('display_deprecated');
56
+ $this->update_option_boolean('remove_nonstandard_capabilities_restore');
57
+ $this->update_option_boolean('override_edit_permissions');
58
+ if ($this->multisite && wp_is_large_network()) {
59
+ $this->update_option_boolean('enable_large_network_functionalities');
60
+ }
61
+ if($this->main->enable_multisite_only_options($this->multisite)) {
62
+ $this->update_option_boolean('remove_data_on_uninstall', TRUE);
63
+ }
64
+
65
+ if ($this->multisite)
66
+ echo network_admin_url('admin.php?page=' . self::MENU_SLUG . '&settings-updated=true');
67
+ else
68
+ echo admin_url('admin.php?page=' . self::MENU_SLUG . '&settings-updated=true');
69
+ die();
70
+ }
71
+
72
+ private function update_option_boolean($key, $clone = FALSE) {
73
+ if (!empty($_POST[$key])) {
74
+ $value = $_POST[$key];
75
+ if ($value === 'true') {
76
+ $value = 1;
77
+ } else if ($value === 'false') {
78
+ $value = 0;
79
+ }
80
+
81
+ $prefix = '';
82
+ if ($this->multisite) {
83
+ $prefix = 'ms_';
84
+ switch_to_blog($this->ms_options_blog_id());
85
+ }
86
+
87
+ $entity = new WPFront_User_Role_Editor_Entity_Options();
88
+ $entity->update_option($prefix . $key, $value);
89
+ if($clone)
90
+ $entity->update_option($key, $value);
91
+
92
+ if ($this->multisite)
93
+ restore_current_blog();
94
+ }
95
+ }
96
+
97
+ public function enable_role_capabilities() {
98
+ return TRUE;
99
+ }
100
+
101
+ private function get_boolean_option($key, $ms = FALSE) {
102
+ $prefix = '';
103
+ if ($ms) {
104
+ $prefix = 'ms_';
105
+ switch_to_blog($this->ms_options_blog_id());
106
+ }
107
+
108
+ $entity = new WPFront_User_Role_Editor_Entity_Options();
109
+ $value = $entity->get_option($prefix . $key);
110
+ if ($value === NULL) {
111
+ if ($ms === FALSE && is_multisite()) {
112
+ return $this->get_boolean_option($key, TRUE);
113
+ }
114
+ }
115
+
116
+ if ($ms)
117
+ restore_current_blog();
118
+
119
+ return $value === '1' ? TRUE : FALSE;
120
+ }
121
+
122
+ public function display_deprecated() {
123
+ if ($this->multisite)
124
+ return $this->ms_display_deprecated();
125
+
126
+ return $this->get_boolean_option('display_deprecated');
127
+ }
128
+
129
+ public function remove_nonstandard_capabilities_restore() {
130
+ if ($this->multisite)
131
+ return $this->ms_remove_nonstandard_capabilities_restore();
132
+
133
+ return $this->get_boolean_option('remove_nonstandard_capabilities_restore');
134
+ }
135
+
136
+ public function override_edit_permissions() {
137
+ if ($this->multisite)
138
+ return $this->ms_override_edit_permissions();
139
+
140
+ return $this->get_boolean_option('override_edit_permissions');
141
+ }
142
+
143
+ public function remove_data_on_uninstall() {
144
+ if ($this->multisite)
145
+ return $this->ms_remove_data_on_uninstall();
146
+
147
+ return $this->get_boolean_option('remove_data_on_uninstall');
148
+ }
149
+
150
+ public static function get_ms_options_blog_id() {
151
+ if (!is_multisite()) {
152
+ throw new Exception('Invalid call');
153
+ }
154
+
155
+ $blog_id = 1;
156
+ if (defined('BLOG_ID_CURRENT_SITE')) {
157
+ $blog_id = BLOG_ID_CURRENT_SITE;
158
+ }
159
+ return $blog_id;
160
  }
161
 
162
+ public function ms_options_blog_id() {
163
+ return self::get_ms_options_blog_id();
164
+ }
165
+
166
+ public function ms_display_deprecated() {
167
+ return $this->get_boolean_option('display_deprecated', TRUE);
168
+ }
169
+
170
+ public function ms_remove_nonstandard_capabilities_restore() {
171
+ return $this->get_boolean_option('remove_nonstandard_capabilities_restore', TRUE);
172
+ }
173
+
174
+ public function ms_enable_large_network_functionalities() {
175
+ return $this->get_boolean_option('enable_large_network_functionalities', TRUE);
176
+ }
177
+
178
+ public function ms_override_edit_permissions() {
179
+ return $this->get_boolean_option('override_edit_permissions', TRUE);
180
+ }
181
+
182
+ public function ms_remove_data_on_uninstall() {
183
+ return $this->get_boolean_option('remove_data_on_uninstall', TRUE);
184
+ }
185
+
186
+ protected function add_help_tab() {
187
+ if ($this->multisite) {
188
+ return array(
189
+ array(
190
+ 'id' => 'overview',
191
+ 'title' => $this->__('Overview'),
192
+ 'content' => '<p>'
193
+ . $this->__('These settings are applicable for the network admin dashboard. Also these settings will propagate to the individual sites unless its overridden within that site’s settings.')
194
+ . '</p>'
195
+ ),
196
+ array(
197
+ 'id' => 'settings',
198
+ 'title' => $this->__('Settings'),
199
+ 'content' => '<p><strong>'
200
+ . $this->__('Enable Large Network Functionalities')
201
+ . '</strong>: '
202
+ . $this->__('This setting is only visible when you have a large network.')
203
+ . ' <a href="http://wpfront.com/user-role-editor-pro/multisite-settings/" target="_blank">'
204
+ . $this->__('More details')
205
+ . '</a>'
206
+ . '</p>'
207
+ . '<p><strong>'
208
+ . $this->__('Display Deprecated Capabilities')
209
+ . '</strong>: '
210
+ . $this->__('If enabled, deprecated capabilities will be displayed within the add/edit screens.')
211
+ . '</p>'
212
+ . '<p><strong>'
213
+ . $this->__('Remove Non-Standard Capabilities on Restore')
214
+ . '</strong>: '
215
+ . $this->__('If enabled, while restoring WordPress built-in capabilities non-standard capabilities will be removed.')
216
+ . '</p>'
217
+ . '<p><strong>'
218
+ . $this->__('Override Edit Permissions')
219
+ . '</strong>: '
220
+ . $this->__('If enabled, ignores the check to the function get_editable_roles.')
221
+ . '</p>'
222
+ . '<p><strong>'
223
+ . $this->__('Remove Data on Uninstall')
224
+ . '</strong>: '
225
+ . $this->__('If enabled, removes all data related to this plugin from database (except roles data) including license information if any. This will not deactivate the license automatically.')
226
+ . '</p>'
227
+ )
228
+ );
229
+ } else {
230
+ return array(
231
+ array(
232
+ 'id' => 'overview',
233
+ 'title' => $this->__('Overview'),
234
+ 'content' => '<p><strong>'
235
+ . $this->__('Display Deprecated Capabilities')
236
+ . '</strong>: '
237
+ . $this->__('If enabled, deprecated capabilities will be displayed within the add/edit screens.')
238
+ . '</p>'
239
+ . '<p><strong>'
240
+ . $this->__('Remove Non-Standard Capabilities on Restore')
241
+ . '</strong>: '
242
+ . $this->__('If enabled, while restoring WordPress built-in capabilities non-standard capabilities will be removed.')
243
+ . '</p>'
244
+ . '<p><strong>'
245
+ . $this->__('Override Edit Permissions')
246
+ . '</strong>: '
247
+ . $this->__('If enabled, ignores the check to the function get_editable_roles.')
248
+ . '</p>'
249
+ . '<p><strong>'
250
+ . $this->__('Remove Data on Uninstall')
251
+ . '</strong>: '
252
+ . $this->__('If enabled, removes all data related to this plugin from database (except roles data) including license information if any. This will not deactivate the license automatically.')
253
+ . '</p>'
254
+ )
255
+ );
256
+ }
257
+ }
258
+
259
+ protected function set_help_sidebar() {
260
+ if ($this->multisite) {
261
+ return array(
262
+ array(
263
+ $this->__('Documentation on Multisite Settings'),
264
+ 'multisite-settings/'
265
+ )
266
+ );
267
+ } else {
268
+ return array(
269
+ array(
270
+ $this->__('Documentation on Settings'),
271
+ 'settings/'
272
+ )
273
+ );
274
+ }
275
+ }
276
+
277
  }
278
 
279
  }
classes/class-wpfront-user-role-editor-restore.php CHANGED
@@ -31,23 +31,17 @@ if (!class_exists('WPFront_User_Role_Editor_Restore')) {
31
  * @author Syam Mohan <syam@wpfront.com>
32
  * @copyright 2014 WPFront.com
33
  */
34
- class WPFront_User_Role_Editor_Restore {
35
 
36
  const MENU_SLUG = 'wpfront-user-role-editor-restore';
37
 
38
- private $main;
39
- private $roles;
40
 
41
  function __construct($main) {
42
- $this->main = $main;
43
- }
44
-
45
- public function ajax_register() {
46
- add_action('wp_ajax_wpfront_user_role_editor_restore_role', array($this, 'restore_role_callback'));
47
- }
48
 
49
- private function can_edit() {
50
- return $this->main->current_user_can('edit_roles');
51
  }
52
 
53
  public function restore_role() {
@@ -56,21 +50,42 @@ if (!class_exists('WPFront_User_Role_Editor_Restore')) {
56
  return;
57
  }
58
 
 
 
 
 
 
59
  global $wp_roles;
60
  $site_roles = $wp_roles->role_names;
61
 
62
  foreach (WPFront_User_Role_Editor::$DEFAULT_ROLES as $value) {
63
  $text = $this->__(ucfirst($value));
64
- if (array_key_exists($value, $site_roles))
65
  $text = $site_roles[$value];
66
 
67
  $this->roles[$value] = $text;
68
  }
 
69
 
 
70
  include($this->main->pluginDIR() . 'templates/restore-role.php');
71
  }
72
 
73
  public function restore_role_callback() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  $result = FALSE;
75
  $message = 'Unexpected error while restoring role.';
76
 
@@ -117,6 +132,15 @@ if (!class_exists('WPFront_User_Role_Editor_Restore')) {
117
  $role->remove_cap($cap);
118
  }
119
  }
 
 
 
 
 
 
 
 
 
120
  }
121
 
122
  if ($role->name == 'administrator' && $this->main->enable_role_capabilities()) {
@@ -124,23 +148,38 @@ if (!class_exists('WPFront_User_Role_Editor_Restore')) {
124
  $role->add_cap($value);
125
  }
126
  }
127
-
128
  $result = TRUE;
129
  $message = '';
130
  }
131
  }
132
  }
133
 
134
- echo sprintf('{ "result": %s, "message": "%s" }', $result ? 'true' : 'false', $this->__('ERROR') . ': ' . $this->__($message));
135
- die();
136
  }
137
 
138
- private function __($s) {
139
- return $this->main->__($s);
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
 
142
- private function image_url() {
143
- return $this->main->pluginURL() . 'images/';
 
 
 
 
 
144
  }
145
 
146
  }
31
  * @author Syam Mohan <syam@wpfront.com>
32
  * @copyright 2014 WPFront.com
33
  */
34
+ class WPFront_User_Role_Editor_Restore extends WPFront_User_Role_Editor_Controller_Base {
35
 
36
  const MENU_SLUG = 'wpfront-user-role-editor-restore';
37
 
38
+ static protected $restore_action = NULL;
39
+ protected $roles;
40
 
41
  function __construct($main) {
42
+ parent::__construct($main);
 
 
 
 
 
43
 
44
+ $this->ajax_register('wp_ajax_wpfront_user_role_editor_restore_role', array($this, 'restore_role_callback'));
 
45
  }
46
 
47
  public function restore_role() {
50
  return;
51
  }
52
 
53
+ $this->prepare_data(FALSE);
54
+ $this->include_template();
55
+ }
56
+
57
+ protected function prepare_data($usename) {
58
  global $wp_roles;
59
  $site_roles = $wp_roles->role_names;
60
 
61
  foreach (WPFront_User_Role_Editor::$DEFAULT_ROLES as $value) {
62
  $text = $this->__(ucfirst($value));
63
+ if (!$usename && array_key_exists($value, $site_roles))
64
  $text = $site_roles[$value];
65
 
66
  $this->roles[$value] = $text;
67
  }
68
+ }
69
 
70
+ protected function include_template() {
71
  include($this->main->pluginDIR() . 'templates/restore-role.php');
72
  }
73
 
74
  public function restore_role_callback() {
75
+ if (self::$restore_action !== NULL) {
76
+ call_user_func(self::$restore_action);
77
+ die();
78
+ }
79
+
80
+ check_ajax_referer($_POST['referer'], 'nonce');
81
+
82
+ $result = $this->action_restore();
83
+
84
+ echo sprintf('{ "result": %s, "message": "%s" }', $result[0] ? 'true' : 'false', $this->__('ERROR') . ': ' . $this->__($result[1]));
85
+ die();
86
+ }
87
+
88
+ protected function action_restore() {
89
  $result = FALSE;
90
  $message = 'Unexpected error while restoring role.';
91
 
132
  $role->remove_cap($cap);
133
  }
134
  }
135
+ } else {
136
+ if ($role->name == 'administrator') {
137
+ $this->main->get_capabilities();
138
+ foreach (WPFront_User_Role_Editor::$OTHER_CAPABILITIES as $group => $caps) {
139
+ foreach ($caps as $cap) {
140
+ $role->add_cap($cap);
141
+ }
142
+ }
143
+ }
144
  }
145
 
146
  if ($role->name == 'administrator' && $this->main->enable_role_capabilities()) {
148
  $role->add_cap($value);
149
  }
150
  }
151
+
152
  $result = TRUE;
153
  $message = '';
154
  }
155
  }
156
  }
157
 
158
+ return array($result, $message);
 
159
  }
160
 
161
+ protected function add_help_tab() {
162
+ return array(
163
+ array(
164
+ 'id' => 'overview',
165
+ 'title' => $this->__('Overview'),
166
+ 'content' => '<p>'
167
+ . $this->__('This screen allow you to restore WordPress built-in roles to its standard capability settings.')
168
+ . '</p>'
169
+ . '<p>'
170
+ . $this->__('To restore a role, click the Restore button then Confirm.')
171
+ . '</p>'
172
+ )
173
+ );
174
  }
175
 
176
+ protected function set_help_sidebar() {
177
+ return array(
178
+ array(
179
+ $this->__('Documentation on Restore'),
180
+ 'restore-role/'
181
+ )
182
+ );
183
  }
184
 
185
  }
classes/class-wpfront-user-role-editor.php CHANGED
@@ -21,12 +21,7 @@
21
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
  */
23
 
24
- require_once("base/class-wpfront-base.php");
25
- require_once("class-wpfront-user-role-editor-options.php");
26
- require_once("class-wpfront-user-role-editor-list.php");
27
- require_once("class-wpfront-user-role-editor-add-edit.php");
28
- require_once("class-wpfront-user-role-editor-delete.php");
29
- require_once("class-wpfront-user-role-editor-restore.php");
30
 
31
  if (!class_exists('WPFront_User_Role_Editor')) {
32
 
@@ -36,15 +31,15 @@ if (!class_exists('WPFront_User_Role_Editor')) {
36
  * @author Syam Mohan <syam@wpfront.com>
37
  * @copyright 2014 WPFront.com
38
  */
39
- class WPFront_User_Role_Editor extends WPFront_Base {
40
 
41
  //Constants
42
- const VERSION = '1.2';
43
  const OPTIONS_GROUP_NAME = 'wpfront-user-role-editor-options-group';
44
  const OPTION_NAME = 'wpfront-user-role-editor-options';
45
  const PLUGIN_SLUG = 'wpfront-user-role-editor';
46
 
47
- public static $ROLE_CAPS = array('wpfront_list_roles', 'wpfront_create_roles', 'wpfront_edit_roles', 'wpfront_delete_roles');
48
  public static $DEFAULT_ROLES = array('administrator', 'editor', 'author', 'contributor', 'subscriber');
49
  public static $STANDARD_CAPABILITIES = array(
50
  'Dashboard' => array(
@@ -143,52 +138,91 @@ if (!class_exists('WPFront_User_Role_Editor')) {
143
  );
144
  private static $CAPABILITIES = NULL;
145
  //Variables
 
146
  protected $options;
 
 
 
 
 
147
 
148
  function __construct() {
149
  parent::__construct(__FILE__, self::PLUGIN_SLUG);
150
 
151
- $this->add_menu($this->__('WPFront User Role Editor'), $this->__('User Role Editor'));
152
- }
153
 
154
- public function plugins_loaded() {
155
- //load plugin options
156
- $this->reload_option();
 
 
 
 
 
 
157
  }
158
 
159
- private function reload_option() {
160
- $this->options = new WPFront_User_Role_Editor_Options(self::OPTION_NAME, self::PLUGIN_SLUG);
161
  }
162
 
163
  public function admin_init() {
164
  register_setting(self::OPTIONS_GROUP_NAME, self::OPTION_NAME);
165
 
166
- add_action('wp_ajax_wpfront_user_role_editor_update_options', array($this, 'update_options_callback'));
 
167
 
168
- $add_new = new WPFront_User_Role_Editor_Add_Edit($this);
169
- $add_new->ajax_register();
170
-
171
- $restore = new WPFront_User_Role_Editor_Restore($this);
172
- $restore->ajax_register();
 
 
 
 
 
 
 
 
 
173
  }
174
 
175
  public function admin_menu() {
176
- parent::admin_menu();
 
 
 
 
 
 
 
177
 
178
- $menu_slug = WPFront_User_Role_Editor_List::MENU_SLUG;
179
- add_menu_page($this->__('Roles'), $this->__('Roles'), $this->get_capability_string('list'), $menu_slug, null, $this->pluginURL() . 'images/roles_menu.png', '69.9999');
 
 
 
 
180
 
181
- $page_hook_suffix = add_submenu_page($menu_slug, $this->__('Roles'), $this->__('All Roles'), $this->get_capability_string('list'), $menu_slug, array(new WPFront_User_Role_Editor_List($this), 'list_roles'));
182
- add_action('admin_print_scripts-' . $page_hook_suffix, array($this, 'enqueue_role_scripts'));
183
- add_action('admin_print_styles-' . $page_hook_suffix, array($this, 'enqueue_role_styles'));
184
 
185
- $page_hook_suffix = add_submenu_page($menu_slug, $this->__('Add New Role'), $this->__('Add New'), $this->get_capability_string('create'), WPFront_User_Role_Editor_Add_Edit::MENU_SLUG, array(new WPFront_User_Role_Editor_Add_Edit($this), 'add_edit_role'));
186
- add_action('admin_print_scripts-' . $page_hook_suffix, array($this, 'enqueue_role_scripts'));
187
- add_action('admin_print_styles-' . $page_hook_suffix, array($this, 'enqueue_role_styles'));
 
 
 
 
 
188
 
189
- $page_hook_suffix = add_submenu_page($menu_slug, $this->__('Restore Role'), $this->__('Restore'), $this->get_capability_string('edit'), WPFront_User_Role_Editor_Restore::MENU_SLUG, array(new WPFront_User_Role_Editor_Restore($this), 'restore_role'));
190
- add_action('admin_print_scripts-' . $page_hook_suffix, array($this, 'enqueue_role_scripts'));
191
- add_action('admin_print_styles-' . $page_hook_suffix, array($this, 'enqueue_role_styles'));
 
 
 
192
  }
193
 
194
  //add scripts
@@ -200,7 +234,7 @@ if (!class_exists('WPFront_User_Role_Editor')) {
200
 
201
  //add styles
202
  public function enqueue_role_styles() {
203
- wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css', array(), '4.1.0');
204
  $styleRoot = $this->pluginURLRoot . 'css/';
205
  wp_enqueue_style('wpfront-user-role-editor-styles', $styleRoot . 'style.css', array(), self::VERSION);
206
  }
@@ -218,37 +252,9 @@ if (!class_exists('WPFront_User_Role_Editor')) {
218
  wp_enqueue_style('wpfront-user-role-editor-options', $styleRoot . 'options.css', array(), self::VERSION);
219
  }
220
 
221
- public function update_options_callback() {
222
- check_ajax_referer($_POST['referer'], 'nonce');
223
-
224
- $options = array();
225
- if (!empty($_POST[self::OPTION_NAME]))
226
- $options = $_POST[self::OPTION_NAME];
227
- update_option(self::OPTION_NAME, $options);
228
-
229
- $this->reload_option();
230
-
231
- if ($this->options->enable_role_capabilities()) {
232
- $role_admin = get_role('administrator');
233
- foreach (self::$ROLE_CAPS as $value) {
234
- $role_admin->add_cap($value, TRUE);
235
- }
236
- } else {
237
- global $wp_roles;
238
- foreach ($wp_roles->role_objects as $key => $role) {
239
- foreach (self::$ROLE_CAPS as $value) {
240
- $role->remove_cap($value);
241
- }
242
- }
243
- }
244
-
245
- echo admin_url('admin.php?page=' . self::PLUGIN_SLUG . '&settings-updated=true');
246
- die();
247
- }
248
-
249
  public function get_capability_string($capability) {
250
- if ($this->options->enable_role_capabilities())
251
- return 'wpfront_' . $capability . '_roles';
252
 
253
  return $capability . '_users';
254
  }
@@ -302,6 +308,7 @@ if (!class_exists('WPFront_User_Role_Editor')) {
302
  }
303
 
304
  public function footer() {
 
305
  ?>
306
  <div class="footer">
307
  <a target="_blank" href="http://wpfront.com/contact/"><?php echo $this->__('Feedback'); ?></a>
@@ -311,6 +318,14 @@ if (!class_exists('WPFront_User_Role_Editor')) {
311
  <?php
312
  }
313
 
 
 
 
 
 
 
 
 
314
  public function get_capabilities() {
315
  if (self::$CAPABILITIES != NULL)
316
  return self::$CAPABILITIES;
@@ -331,24 +346,26 @@ if (!class_exists('WPFront_User_Role_Editor')) {
331
  }
332
  }
333
 
334
- if ($this->options->enable_role_capabilities())
335
  self::$CAPABILITIES['Roles (WPFront)'] = self::$ROLE_CAPS;
336
 
337
  reset(self::$OTHER_CAPABILITIES);
338
  $other_key = key(self::$OTHER_CAPABILITIES);
339
 
340
  global $wp_roles;
341
- foreach ($wp_roles->roles as $key => $role) {
342
- foreach ($role['capabilities'] as $cap => $value) {
343
- $found = FALSE;
344
- foreach (self::$CAPABILITIES as $g => $wcaps) {
345
- if (in_array($cap, $wcaps)) {
346
- $found = TRUE;
347
- break;
 
 
 
 
 
348
  }
349
- }
350
- if (!$found && !in_array($cap, self::$OTHER_CAPABILITIES[$other_key])) {
351
- self::$OTHER_CAPABILITIES[$other_key][] = $cap;
352
  }
353
  }
354
  }
@@ -361,18 +378,103 @@ if (!class_exists('WPFront_User_Role_Editor')) {
361
  return self::$CAPABILITIES;
362
  }
363
 
 
 
 
 
 
 
 
 
364
  public function display_deprecated() {
365
  return $this->options->display_deprecated();
366
  }
367
-
368
  public function enable_role_capabilities() {
369
- return $this->options->enable_role_capabilities();
 
370
  }
371
-
372
  public function remove_nonstandard_capabilities_restore() {
373
  return $this->options->remove_nonstandard_capabilities_restore();
374
  }
375
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
376
  }
377
 
378
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
  */
23
 
24
+ require_once(plugin_dir_path(__FILE__) . "base/class-wpfront-base.php");
 
 
 
 
 
25
 
26
  if (!class_exists('WPFront_User_Role_Editor')) {
27
 
31
  * @author Syam Mohan <syam@wpfront.com>
32
  * @copyright 2014 WPFront.com
33
  */
34
+ class WPFront_User_Role_Editor extends WPFront_Base_URE {
35
 
36
  //Constants
37
+ const VERSION = '2.0';
38
  const OPTIONS_GROUP_NAME = 'wpfront-user-role-editor-options-group';
39
  const OPTION_NAME = 'wpfront-user-role-editor-options';
40
  const PLUGIN_SLUG = 'wpfront-user-role-editor';
41
 
42
+ public static $ROLE_CAPS = array('list_roles', 'create_roles', 'edit_roles', 'delete_roles', 'edit_role_menus', 'edit_posts_role_permissions', 'edit_pages_role_permissions');
43
  public static $DEFAULT_ROLES = array('administrator', 'editor', 'author', 'contributor', 'subscriber');
44
  public static $STANDARD_CAPABILITIES = array(
45
  'Dashboard' => array(
138
  );
139
  private static $CAPABILITIES = NULL;
140
  //Variables
141
+ protected $admin_menu = array();
142
  protected $options;
143
+ protected $objList;
144
+ protected $objAddEdit;
145
+ protected $objRestore;
146
+ protected $objAssignUsers;
147
+ protected $objGoPro;
148
 
149
  function __construct() {
150
  parent::__construct(__FILE__, self::PLUGIN_SLUG);
151
 
152
+ //$this->add_menu($this->__('WPFront User Role Editor'), $this->__('User Role Editor'));
 
153
 
154
+ $this->options = new WPFront_User_Role_Editor_Options($this);
155
+ $this->objGoPro = new WPFront_User_Role_Editor_Go_Pro($this);
156
+
157
+ if ($this->objGoPro->has_license()) {
158
+ $this->objList = new WPFront_User_Role_Editor_List($this);
159
+ $this->objAddEdit = new WPFront_User_Role_Editor_Add_Edit($this);
160
+ $this->objRestore = new WPFront_User_Role_Editor_Restore($this);
161
+ $this->objAssignUsers = new WPFront_User_Role_Editor_Assign_Roles($this);
162
+ }
163
  }
164
 
165
+ public function plugins_loaded() {
166
+
167
  }
168
 
169
  public function admin_init() {
170
  register_setting(self::OPTIONS_GROUP_NAME, self::OPTION_NAME);
171
 
172
+ $this->rename_role_capabilities();
173
+ }
174
 
175
+ protected function add_submenu_page($position, $title, $name, $capability, $slug, $func, $scripts = NULL, $styles = NULL, $controller = NULL) {
176
+ if ($scripts === NULL)
177
+ $scripts = 'enqueue_role_scripts';
178
+ if ($styles === NULL)
179
+ $styles = 'enqueue_role_styles';
180
+
181
+ $this->admin_menu[$position] = array($title, $name, $capability, $slug, $func, $scripts, $styles, $controller);
182
+ }
183
+
184
+ protected function add_pro_page() {
185
+ if (isset($this->admin_menu[1000]))
186
+ return;
187
+
188
+ $this->add_submenu_page(1000, $this->__('Go Pro'), '<span class="wpfront-go-pro">' . $this->__('Go Pro') . '</span>', 'manage_options', WPFront_User_Role_Editor_Go_Pro::MENU_SLUG, array($this->objGoPro, 'go_pro'));
189
  }
190
 
191
  public function admin_menu() {
192
+ //parent::admin_menu();
193
+
194
+ $this->add_pro_page();
195
+
196
+ if ($this->objGoPro->has_license())
197
+ $menu_slug = WPFront_User_Role_Editor_List::MENU_SLUG;
198
+ else
199
+ $menu_slug = WPFront_User_Role_Editor_Go_Pro::MENU_SLUG;
200
 
201
+ if ($this->objGoPro->has_license()) {
202
+ $this->add_submenu_page(10, $this->__('Roles'), $this->__('All Roles'), $this->get_capability_string('list'), WPFront_User_Role_Editor_List::MENU_SLUG, array($this->objList, 'list_roles'), NULL, NULL, $this->objList);
203
+ $this->add_submenu_page(20, $this->__('Add New Role'), $this->__('Add New'), $this->get_capability_string('create'), WPFront_User_Role_Editor_Add_Edit::MENU_SLUG, array($this->objAddEdit, 'add_edit_role'), NULL, NULL, $this->objAddEdit);
204
+ $this->add_submenu_page(30, $this->__('Restore Role'), $this->__('Restore'), $this->get_capability_string('edit'), WPFront_User_Role_Editor_Restore::MENU_SLUG, array($this->objRestore, 'restore_role'), NULL, NULL, $this->objRestore);
205
+ $this->add_submenu_page(100, $this->__('Settings'), $this->__('Settings'), 'manage_options', WPFront_User_Role_Editor_Options::MENU_SLUG, array($this->options, 'settings'), NULL, NULL, $this->options);
206
+ }
207
 
208
+ if (!empty($this->admin_menu))
209
+ add_menu_page($this->__('Roles'), $this->__('Roles'), $this->get_capability_string('list'), $menu_slug, null, $this->pluginURL() . 'images/roles_menu.png', '69.999999');
 
210
 
211
+ ksort($this->admin_menu);
212
+ foreach ($this->admin_menu as $key => $value) {
213
+ $page_hook_suffix = add_submenu_page($menu_slug, $value[0], $value[1], $value[2], $value[3], $value[4]);
214
+ add_action('admin_print_scripts-' . $page_hook_suffix, array($this, $value[5]));
215
+ add_action('admin_print_styles-' . $page_hook_suffix, array($this, $value[6]));
216
+ if ($value[7] !== NULL)
217
+ $value[7]->set_page_hook($page_hook_suffix);
218
+ }
219
 
220
+ if ($this->objGoPro->has_license()) {
221
+ $page_hook_suffix = add_users_page($this->__('Assign Roles | Migrate Users'), $this->__('Assign / Migrate'), 'promote_users', WPFront_User_Role_Editor_Assign_Roles::MENU_SLUG, array($this->objAssignUsers, 'assign_roles'));
222
+ $this->objAssignUsers->set_page_hook($page_hook_suffix);
223
+ add_action('admin_print_scripts-' . $page_hook_suffix, array($this, 'enqueue_role_scripts'));
224
+ add_action('admin_print_styles-' . $page_hook_suffix, array($this, 'enqueue_role_styles'));
225
+ }
226
  }
227
 
228
  //add scripts
234
 
235
  //add styles
236
  public function enqueue_role_styles() {
237
+ wp_enqueue_style('font-awesome-410', '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css', array(), '4.1.0');
238
  $styleRoot = $this->pluginURLRoot . 'css/';
239
  wp_enqueue_style('wpfront-user-role-editor-styles', $styleRoot . 'style.css', array(), self::VERSION);
240
  }
252
  wp_enqueue_style('wpfront-user-role-editor-options', $styleRoot . 'options.css', array(), self::VERSION);
253
  }
254
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  public function get_capability_string($capability) {
256
+ if ($this->enable_role_capabilities())
257
+ return $capability . '_roles';
258
 
259
  return $capability . '_users';
260
  }
308
  }
309
 
310
  public function footer() {
311
+ return;
312
  ?>
313
  <div class="footer">
314
  <a target="_blank" href="http://wpfront.com/contact/"><?php echo $this->__('Feedback'); ?></a>
318
  <?php
319
  }
320
 
321
+ public function options_page_header($title, $optionsGroupName = self::OPTIONS_GROUP_NAME) {
322
+ parent::options_page_header($title, $optionsGroupName);
323
+ }
324
+
325
+ public function options_page_footer($settingsLink, $FAQLink, $extraLinks = NULL) {
326
+ parent::options_page_footer($settingsLink, $FAQLink, $extraLinks);
327
+ }
328
+
329
  public function get_capabilities() {
330
  if (self::$CAPABILITIES != NULL)
331
  return self::$CAPABILITIES;
346
  }
347
  }
348
 
349
+ if ($this->enable_role_capabilities())
350
  self::$CAPABILITIES['Roles (WPFront)'] = self::$ROLE_CAPS;
351
 
352
  reset(self::$OTHER_CAPABILITIES);
353
  $other_key = key(self::$OTHER_CAPABILITIES);
354
 
355
  global $wp_roles;
356
+ if (isset($wp_roles->roles) && is_array($wp_roles->roles)) {
357
+ foreach ($wp_roles->roles as $key => $role) {
358
+ foreach ($role['capabilities'] as $cap => $value) {
359
+ $found = FALSE;
360
+ foreach (self::$CAPABILITIES as $g => $wcaps) {
361
+ if (in_array($cap, $wcaps)) {
362
+ $found = TRUE;
363
+ break;
364
+ }
365
+ }
366
+ if (!$found && !in_array($cap, self::$OTHER_CAPABILITIES[$other_key])) {
367
+ self::$OTHER_CAPABILITIES[$other_key][] = $cap;
368
  }
 
 
 
369
  }
370
  }
371
  }
378
  return self::$CAPABILITIES;
379
  }
380
 
381
+ public function reset_capabilities() {
382
+ self::$CAPABILITIES = NULL;
383
+
384
+ foreach (self::$OTHER_CAPABILITIES as $key => $value) {
385
+ self::$OTHER_CAPABILITIES[$key] = array();
386
+ }
387
+ }
388
+
389
  public function display_deprecated() {
390
  return $this->options->display_deprecated();
391
  }
392
+
393
  public function enable_role_capabilities() {
394
+ return TRUE;
395
+ //return $this->options->enable_role_capabilities();
396
  }
397
+
398
  public function remove_nonstandard_capabilities_restore() {
399
  return $this->options->remove_nonstandard_capabilities_restore();
400
  }
401
 
402
+ public function override_edit_permissions() {
403
+ return $this->options->override_edit_permissions();
404
+ }
405
+
406
+ public function enable_multisite_only_options($multisite) {
407
+ return TRUE;
408
+ }
409
+
410
+ private function rename_role_capabilities() {
411
+ global $wp_roles;
412
+ foreach ($wp_roles->role_objects as $key => $role) {
413
+ foreach (self::$ROLE_CAPS as $value) {
414
+ if ($role->has_cap('wpfront_' . $value)) {
415
+ $role->add_cap($value);
416
+ $role->remove_cap('wpfront_' . $value);
417
+ }
418
+ }
419
+ }
420
+
421
+ $role_admin = $wp_roles->role_objects['administrator'];
422
+ foreach (self::$ROLE_CAPS as $value) {
423
+ $role_admin->add_cap($value);
424
+ }
425
+ }
426
+
427
+ public static function Instanciate($file) {
428
+ if (defined('WPFRONT_USER_ROLE_EDITOR_PLUGIN_FILE'))
429
+ return;
430
+
431
+ $f = 'wpfront-user-role-editor.php';
432
+ $current_folder = strtolower(basename(dirname($file)));
433
+
434
+ $folder = 'wpfront-user-role-editor-business-pro';
435
+ if ($current_folder === $folder) {
436
+ define('WPFRONT_USER_ROLE_EDITOR_PLUGIN_FILE', $file);
437
+ new WPFront_User_Role_Editor_Business_Pro_Base();
438
+ return;
439
+ }
440
+
441
+ if (!function_exists('is_plugin_active'))
442
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
443
+
444
+ if (is_plugin_active($folder . '/' . $f))
445
+ return;
446
+
447
+ $folder = 'wpfront-user-role-editor-personal-pro';
448
+ if ($current_folder === $folder) {
449
+ define('WPFRONT_USER_ROLE_EDITOR_PLUGIN_FILE', $file);
450
+ new WPFront_User_Role_Editor_Personal_Pro_Base();
451
+ return;
452
+ }
453
+
454
+ if (is_plugin_active($folder . '/' . $f))
455
+ return;
456
+
457
+ define('WPFRONT_USER_ROLE_EDITOR_PLUGIN_FILE', $file);
458
+ new WPFront_User_Role_Editor();
459
+ }
460
+
461
  }
462
 
463
+ }
464
+
465
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-controller-base.php");
466
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-options.php");
467
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-list.php");
468
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-add-edit.php");
469
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-delete.php");
470
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-restore.php");
471
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-assign-roles.php");
472
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-go-pro.php");
473
+
474
+
475
+
476
+ if (file_exists(plugin_dir_path(__FILE__) . "personal-pro/class-wpfront-user-role-editor-personal-pro.php"))
477
+ require_once(plugin_dir_path(__FILE__) . "personal-pro/class-wpfront-user-role-editor-personal-pro.php");
478
+
479
+ if (file_exists(plugin_dir_path(__FILE__) . "business-pro/class-wpfront-user-role-editor-business-pro.php"))
480
+ require_once(plugin_dir_path(__FILE__) . "business-pro/class-wpfront-user-role-editor-business-pro.php");
classes/entities/class-wpfront-user-role-editor-entity-options.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once(plugin_dir_path(__FILE__) . "../class-wpfront-user-role-editor-entity-base.php");
4
+
5
+ if (!class_exists('WPFront_User_Role_Editor_Entity_Options')) {
6
+
7
+ /**
8
+ * Options Entity
9
+ *
10
+ * @author Syam Mohan <syam@wpfront.com>
11
+ * @copyright 2014 WPFront.com
12
+ */
13
+ class WPFront_User_Role_Editor_Entity_Options extends WPFront_User_Role_Editor_Entity_Base {
14
+
15
+ public function __construct() {
16
+ parent::__construct('options');
17
+ }
18
+
19
+ protected function _db_data() {
20
+ return array(
21
+ $this->db_data_field('option_name', 'varchar(250)'),
22
+ $this->db_data_field('option_value', 'longtext'),
23
+ );
24
+ }
25
+
26
+ public function get_option($key) {
27
+ $entity = $this->get_by_option_name($key);
28
+ if($entity === NULL)
29
+ return NULL;
30
+
31
+ return $entity->get_option_value();
32
+ }
33
+
34
+ public function update_option($key, $value) {
35
+ $entity = $this->get_by_option_name($key);
36
+ if($entity === NULL) {
37
+ $entity = new WPFront_User_Role_Editor_Entity_Options();
38
+ $entity->set_option_name($key);
39
+ }
40
+ $entity->set_option_value($value);
41
+ $entity->save();
42
+ }
43
+
44
+ public function delete_option($key) {
45
+ $entity = $this->get_by_option_name($key);
46
+ if($entity !== NULL)
47
+ $entity->delete();
48
+ }
49
+
50
+ public static function uninstall() {
51
+ self::$UNINSTALL = TRUE;
52
+
53
+ $entity = new WPFront_User_Role_Editor_Entity_Options();
54
+ $entity->uninstall_action();
55
+ }
56
+ }
57
+
58
+ }
css/style.css CHANGED
@@ -20,17 +20,25 @@
20
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21
  */
22
 
 
 
 
 
 
 
 
 
23
  div.wrap div.footer {
24
  text-align: center;
25
  }
26
 
27
- div.list-roles td.column-userdefault img.user-default {
28
  width: 16px;
29
  height: 16px;
30
  }
31
 
32
  div.list-roles table div.row-actions {
33
- white-space: nowrap;
34
  }
35
 
36
  div.role-add-new form#createuser table.sub-head {
@@ -103,3 +111,19 @@ div.role-restore table.form-table td div.restore-role-success {
103
  display: none;
104
  }
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21
  */
22
 
23
+ #adminmenu ul.wp-submenu li a span.wpfront-go-pro {
24
+ color: #2EA2CC;
25
+ }
26
+
27
+ #adminmenu ul.wp-submenu li.current a.current span.wpfront-go-pro {
28
+ color: inherit;
29
+ }
30
+
31
  div.wrap div.footer {
32
  text-align: center;
33
  }
34
 
35
+ div.list-roles img.user-default {
36
  width: 16px;
37
  height: 16px;
38
  }
39
 
40
  div.list-roles table div.row-actions {
41
+ /*white-space: nowrap;*/
42
  }
43
 
44
  div.role-add-new form#createuser table.sub-head {
111
  display: none;
112
  }
113
 
114
+ div.wrap.assign-roles div.role-list div.role-list-item {
115
+ padding-bottom: 5px;
116
+ }
117
+
118
+ div.wrap.go-pro div.license-container {
119
+ margin-bottom: 25px;
120
+ }
121
+
122
+ div.wrap.go-pro #license_key {
123
+ padding-top: 5px;
124
+ padding-bottom: 5px;
125
+ }
126
+
127
+ div.wrap.go-pro div.license-container table.form-table td.expired {
128
+ color: red;
129
+ }
images/green_dot_64x64.png ADDED
Binary file
images/orange_dot_64x64.png ADDED
Binary file
languages/wpfront-user-role-editor.mo CHANGED
Binary file
languages/wpfront-user-role-editor.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
- "POT-Creation-Date: 2014-08-13 20:28-0700\n"
5
- "PO-Revision-Date: 2014-08-13 20:28-0700\n"
6
  "Last-Translator: \n"
7
  "Language-Team: WPFront <contact@wpfront.com>\n"
8
  "Language: en\n"
@@ -17,6 +17,7 @@ msgstr ""
17
  "X-Poedit-SearchPath-0: ..\n"
18
 
19
  #: ../classes/base/class-wpfront-base-menu.php:52
 
20
  msgid "Name"
21
  msgstr "Name"
22
 
@@ -57,6 +58,7 @@ msgid "More information about %s"
57
  msgstr "More information about %s"
58
 
59
  #: ../classes/base/class-wpfront-base-menu.php:154
 
60
  msgid "Details"
61
  msgstr "Details"
62
 
@@ -87,16 +89,21 @@ msgid "Installed"
87
  msgstr "Installed"
88
 
89
  #: ../classes/base/class-wpfront-base-menu.php:175
90
- #: ../classes/base/class-wpfront-base.php:105
 
 
 
91
  msgid "Settings"
92
  msgstr "Settings"
93
 
94
  #: ../classes/base/class-wpfront-base-menu.php:177
 
 
95
  msgid "Activate"
96
  msgstr "Activate"
97
 
98
  #: ../classes/base/class-wpfront-base-menu.php:199
99
- #: ../classes/class-wpfront-user-role-editor.php:307
100
  msgid "Feedback"
101
  msgstr "Feedback"
102
 
@@ -108,12 +115,12 @@ msgstr "WPFront"
108
  msgid "All Plugins"
109
  msgstr "All Plugins"
110
 
111
- #: ../classes/base/class-wpfront-base.php:130
112
- #: ../classes/class-wpfront-user-role-editor.php:257
113
  msgid "You do not have sufficient permissions to access this page."
114
  msgstr "You do not have sufficient permissions to access this page."
115
 
116
- #: ../classes/base/class-wpfront-base.php:150
117
  msgid ""
118
  "If you have a caching plugin, clear the cache for the new settings to take "
119
  "effect."
@@ -121,169 +128,1190 @@ msgstr ""
121
  "If you have a caching plugin, clear the cache for the new settings to take "
122
  "effect."
123
 
124
- #: ../classes/base/class-wpfront-base.php:168
125
- msgid "Settings Description"
126
- msgstr "Settings Description"
 
127
 
128
- #: ../classes/base/class-wpfront-base.php:170
129
- msgid "Plugin FAQ"
130
- msgstr "Plugin FAQ"
 
 
 
 
 
131
 
132
- #: ../classes/base/class-wpfront-base.php:172
133
- msgid "Feature Request"
134
- msgstr "Feature Request"
 
135
 
136
- #: ../classes/base/class-wpfront-base.php:174
137
- msgid "Report Bug"
138
- msgstr "Report Bug"
 
 
139
 
140
- #: ../classes/base/class-wpfront-base.php:176
141
- msgid "Write Review"
142
- msgstr "Write Review"
 
 
 
143
 
144
- #: ../classes/base/class-wpfront-base.php:178
145
- msgid "Contact Me"
146
- msgstr "Contact Me"
 
 
 
 
 
 
 
 
147
 
148
- #: ../classes/base/class-wpfront-base.php:180
149
- msgid "Buy me a Beer or Coffee"
150
- msgstr "Buy me a Beer or Coffee"
 
 
151
 
152
- #: ../classes/base/class-wpfront-base.php:197
153
- msgid "Save Changes"
154
- msgstr "Save Changes"
155
 
156
- #: ../classes/class-wpfront-user-role-editor-list.php:238
157
- #: ../templates/add-edit-role.php:111
158
- msgid "Select All"
159
- msgstr "Select All"
160
 
161
- #: ../classes/class-wpfront-user-role-editor-list.php:242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  #: ../templates/add-edit-role.php:71
163
  msgid "Display Name"
164
  msgstr "Display Name"
165
 
166
- #: ../classes/class-wpfront-user-role-editor-list.php:245
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  #: ../templates/add-edit-role.php:81
168
  msgid "Role Name"
169
  msgstr "Role Name"
170
 
171
- #: ../classes/class-wpfront-user-role-editor-list.php:248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  msgid "Type"
173
  msgstr "Type"
174
 
175
- #: ../classes/class-wpfront-user-role-editor-list.php:251
 
176
  msgid "User Default"
177
  msgstr "User Default"
178
 
179
- #: ../classes/class-wpfront-user-role-editor-list.php:254
 
180
  msgid "Users"
181
  msgstr "Users"
182
 
183
- #: ../classes/class-wpfront-user-role-editor-list.php:257
184
- #: ../templates/add-edit-role.php:95
185
- msgid "Capabilities"
186
- msgstr "Capabilities"
187
-
188
- #: ../classes/class-wpfront-user-role-editor-list.php:268
189
  msgid "Bulk Actions"
190
  msgstr "Bulk Actions"
191
 
192
- #: ../classes/class-wpfront-user-role-editor-list.php:270
193
- #: ../templates/list-roles.php:101
194
- msgid "Delete"
195
- msgstr "Delete"
196
-
197
- #: ../classes/class-wpfront-user-role-editor-list.php:273
198
  #: ../templates/add-edit-role.php:107
 
199
  msgid "Apply"
200
  msgstr "Apply"
201
 
202
- #: ../classes/class-wpfront-user-role-editor-list.php:275
203
  #, php-format
204
  msgid "%s item(s)"
205
  msgstr "%s item(s)"
206
 
207
- #: ../classes/class-wpfront-user-role-editor-list.php:298
208
  msgid "All"
209
  msgstr "All"
210
 
211
- #: ../classes/class-wpfront-user-role-editor-list.php:309
212
  msgid "Having Users"
213
  msgstr "Having Users"
214
 
215
- #: ../classes/class-wpfront-user-role-editor-list.php:315
216
  msgid "No Users"
217
  msgstr "No Users"
218
 
219
- #: ../classes/class-wpfront-user-role-editor-list.php:326
220
- #: ../templates/list-roles.php:114
221
  msgid "Built-In"
222
  msgstr "Built-In"
223
 
224
- #: ../classes/class-wpfront-user-role-editor-list.php:332
225
- #: ../templates/list-roles.php:114
226
  msgid "Custom"
227
  msgstr "Custom"
228
 
229
- #: ../classes/class-wpfront-user-role-editor-options.php:41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  msgid "Display Deprecated Capabilities"
231
  msgstr "Display Deprecated Capabilities"
232
 
233
- #: ../classes/class-wpfront-user-role-editor-options.php:42
234
- msgid "Add Role Capabilities"
235
- msgstr "Add Role Capabilities"
 
 
 
 
 
236
 
237
- #: ../classes/class-wpfront-user-role-editor-options.php:43
 
 
238
  msgid "Remove Non-Standard Capabilities on Restore"
239
  msgstr "Remove Non-Standard Capabilities on Restore"
240
 
241
- #: ../classes/class-wpfront-user-role-editor-restore.php:134
242
- #: ../templates/add-edit-role.php:45 ../templates/add-edit-role.php:53
243
- msgid "ERROR"
244
- msgstr "ERROR"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
 
246
- #: ../classes/class-wpfront-user-role-editor.php:151
247
- msgid "WPFront User Role Editor"
248
- msgstr "WPFront User Role Editor"
249
 
250
- #: ../classes/class-wpfront-user-role-editor.php:151
251
- msgid "User Role Editor"
252
- msgstr "User Role Editor"
253
 
254
- #: ../classes/class-wpfront-user-role-editor.php:179
255
- #: ../classes/class-wpfront-user-role-editor.php:181
256
- #: ../templates/list-roles.php:37
257
- msgid "Roles"
258
- msgstr "Roles"
259
 
260
- #: ../classes/class-wpfront-user-role-editor.php:181
261
- msgid "All Roles"
262
- msgstr "All Roles"
263
 
264
- #: ../classes/class-wpfront-user-role-editor.php:185
265
- #: ../templates/add-edit-role.php:35 ../templates/add-edit-role.php:154
266
- msgid "Add New Role"
267
- msgstr "Add New Role"
268
 
269
- #: ../classes/class-wpfront-user-role-editor.php:185
270
- #: ../templates/add-edit-role.php:37 ../templates/list-roles.php:40
271
- msgid "Add New"
272
- msgstr "Add New"
273
 
274
- #: ../classes/class-wpfront-user-role-editor.php:189
275
- #: ../templates/restore-role.php:34
276
- msgid "Restore Role"
277
- msgstr "Restore Role"
 
 
 
278
 
279
- #: ../classes/class-wpfront-user-role-editor.php:189
280
- #: ../templates/restore-role.php:46
281
- msgid "Restore"
282
- msgstr "Restore"
283
 
284
- #: ../classes/class-wpfront-user-role-editor.php:309
285
- msgid "Buy me a Beer"
286
- msgstr "Buy me a Beer"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
 
288
  #: ../templates/add-edit-role.php:35
289
  msgid "Edit Role"
@@ -306,6 +1334,7 @@ msgid "required"
306
  msgstr "required"
307
 
308
  #: ../templates/add-edit-role.php:100
 
309
  msgid "Copy from"
310
  msgstr "Copy from"
311
 
@@ -317,6 +1346,109 @@ msgstr "Select None"
317
  msgid "Update Role"
318
  msgstr "Update Role"
319
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
320
  #: ../templates/delete-role.php:37
321
  msgid "Delete Roles"
322
  msgstr "Delete Roles"
@@ -333,26 +1465,127 @@ msgstr "Role"
333
  msgid "Confirm Deletion"
334
  msgstr "Confirm Deletion"
335
 
336
- #: ../templates/list-roles.php:62 ../templates/list-roles.php:64
337
- msgid "Search Roles"
338
- msgstr "Search Roles"
339
 
340
- #: ../templates/list-roles.php:98
341
- msgid "Edit"
342
- msgstr "Edit"
343
 
344
- #: ../templates/list-roles.php:98
345
- msgid "View"
346
- msgstr "View"
347
 
348
- #: ../templates/list-roles.php:104
349
- msgid "Default"
350
- msgstr "Default"
351
 
352
  #: ../templates/options-template.php:32
353
  msgid "WPFront User Role Editor Settings"
354
  msgstr "WPFront User Role Editor Settings"
355
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  #: ../templates/restore-role.php:48
357
  msgid "Cancel"
358
  msgstr "Cancel"
@@ -365,8 +1598,30 @@ msgstr "Confirm"
365
  msgid "Restored"
366
  msgstr "Restored"
367
 
368
- #~ msgid "Contact Me (syam@wpfront.com)"
369
- #~ msgstr "Contact Me (syam@wpfront.com)"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
 
371
  #~ msgid "Enabled"
372
  #~ msgstr "Enabled"
@@ -532,9 +1787,6 @@ msgstr "Restored"
532
  #~ msgid "Only in landing page."
533
  #~ msgstr "Only in landing page."
534
 
535
- #~ msgid "[The first page they visit on your website.]"
536
- #~ msgstr "[The first page they visit on your website.]"
537
-
538
  #~ msgid "Include in following pages"
539
  #~ msgstr "Include in following pages"
540
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
+ "POT-Creation-Date: 2014-10-17 22:13-0700\n"
5
+ "PO-Revision-Date: 2014-10-17 22:16-0700\n"
6
  "Last-Translator: \n"
7
  "Language-Team: WPFront <contact@wpfront.com>\n"
8
  "Language: en\n"
17
  "X-Poedit-SearchPath-0: ..\n"
18
 
19
  #: ../classes/base/class-wpfront-base-menu.php:52
20
+ #: ../templates/personal-pro/menu-editor.php:132
21
  msgid "Name"
22
  msgstr "Name"
23
 
58
  msgstr "More information about %s"
59
 
60
  #: ../classes/base/class-wpfront-base-menu.php:154
61
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:217
62
  msgid "Details"
63
  msgstr "Details"
64
 
89
  msgstr "Installed"
90
 
91
  #: ../classes/base/class-wpfront-base-menu.php:175
92
+ #: ../classes/base/class-wpfront-base.php:109
93
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:104
94
+ #: ../classes/class-wpfront-user-role-editor-options.php:198
95
+ #: ../classes/class-wpfront-user-role-editor.php:205
96
  msgid "Settings"
97
  msgstr "Settings"
98
 
99
  #: ../classes/base/class-wpfront-base-menu.php:177
100
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:88
101
+ #: ../templates/go-pro.php:65 ../templates/go-pro.php:66
102
  msgid "Activate"
103
  msgstr "Activate"
104
 
105
  #: ../classes/base/class-wpfront-base-menu.php:199
106
+ #: ../classes/class-wpfront-user-role-editor.php:314
107
  msgid "Feedback"
108
  msgstr "Feedback"
109
 
115
  msgid "All Plugins"
116
  msgstr "All Plugins"
117
 
118
+ #: ../classes/base/class-wpfront-base.php:138
119
+ #: ../classes/class-wpfront-user-role-editor.php:263
120
  msgid "You do not have sufficient permissions to access this page."
121
  msgstr "You do not have sufficient permissions to access this page."
122
 
123
+ #: ../classes/base/class-wpfront-base.php:158
124
  msgid ""
125
  "If you have a caching plugin, clear the cache for the new settings to take "
126
  "effect."
128
  "If you have a caching plugin, clear the cache for the new settings to take "
129
  "effect."
130
 
131
+ #: ../classes/base/class-wpfront-base.php:205
132
+ #: ../templates/personal-pro/menu-editor.php:226
133
+ msgid "Save Changes"
134
+ msgstr "Save Changes"
135
 
136
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:81
137
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:84
138
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:74
139
+ #: ../classes/class-wpfront-user-role-editor.php:202
140
+ #: ../classes/class-wpfront-user-role-editor.php:209
141
+ #: ../templates/list-roles.php:37
142
+ msgid "Roles"
143
+ msgstr "Roles"
144
 
145
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:84
146
+ #: ../classes/class-wpfront-user-role-editor.php:202
147
+ msgid "All Roles"
148
+ msgstr "All Roles"
149
 
150
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:89
151
+ #: ../classes/class-wpfront-user-role-editor.php:203
152
+ #: ../templates/add-edit-role.php:35 ../templates/add-edit-role.php:154
153
+ msgid "Add New Role"
154
+ msgstr "Add New Role"
155
 
156
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:89
157
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:77
158
+ #: ../classes/class-wpfront-user-role-editor.php:203
159
+ #: ../templates/add-edit-role.php:37 ../templates/list-roles.php:40
160
+ msgid "Add New"
161
+ msgstr "Add New"
162
 
163
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:94
164
+ #: ../classes/class-wpfront-user-role-editor.php:204
165
+ #: ../templates/restore-role.php:34
166
+ msgid "Restore Role"
167
+ msgstr "Restore Role"
168
+
169
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:94
170
+ #: ../classes/class-wpfront-user-role-editor.php:204
171
+ #: ../templates/restore-role.php:46
172
+ msgid "Restore"
173
+ msgstr "Restore"
174
 
175
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:99
176
+ #: ../templates/business-pro/sync-roles.php:11
177
+ #: ../templates/business-pro/sync-roles.php:297
178
+ msgid "Sync Roles"
179
+ msgstr "Sync Roles"
180
 
181
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:99
182
+ msgid "Sync"
183
+ msgstr "Sync"
184
 
185
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:110
186
+ #: ../classes/class-wpfront-user-role-editor.php:188
187
+ msgid "Go Pro"
188
+ msgstr "Go Pro"
189
 
190
+ #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:121
191
+ msgid ""
192
+ "You have a large network of sites (usually 10,000 or more sites). Roles "
193
+ "functionalities will be CPU and memory intensive on large networks. Use the "
194
+ "settings screen to turn on these CPU and memory intensive functionalities."
195
+ msgstr ""
196
+ "You have a large network of sites (usually 10,000 or more sites). Roles "
197
+ "functionalities will be CPU and memory intensive on large networks. Use the "
198
+ "settings screen to turn on these CPU and memory intensive functionalities."
199
+
200
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-add-edit.php:213
201
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:114
202
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:148
203
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:162
204
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:84
205
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:223
206
+ #: ../classes/class-wpfront-user-role-editor-add-edit.php:303
207
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:296
208
+ #: ../classes/class-wpfront-user-role-editor-list.php:351
209
+ #: ../classes/class-wpfront-user-role-editor-list.php:385
210
+ #: ../classes/class-wpfront-user-role-editor-list.php:402
211
+ #: ../classes/class-wpfront-user-role-editor-options.php:191
212
+ #: ../classes/class-wpfront-user-role-editor-options.php:233
213
+ #: ../classes/class-wpfront-user-role-editor-restore.php:165
214
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-export.php:126
215
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:225
216
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:563
217
+ msgid "Overview"
218
+ msgstr "Overview"
219
+
220
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-add-edit.php:215
221
+ msgid "This screen allows you to add a new role within your network."
222
+ msgstr "This screen allows you to add a new role within your network."
223
+
224
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-add-edit.php:218
225
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:119
226
+ #: ../classes/class-wpfront-user-role-editor-add-edit.php:308
227
+ #: ../classes/class-wpfront-user-role-editor-list.php:356
228
+ msgid ""
229
+ "You can copy capabilities from existing roles using the Copy from drop down "
230
+ "list. Select the role you want to copy from, then click Apply to copy the "
231
+ "capabilities. You can select or deselect capabilities even after you copy."
232
+ msgstr ""
233
+ "You can copy capabilities from existing roles using the Copy from drop down "
234
+ "list. Select the role you want to copy from, then click Apply to copy the "
235
+ "capabilities. You can select or deselect capabilities even after you copy."
236
+
237
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-add-edit.php:223
238
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:124
239
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:179
240
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:161
241
+ #: ../classes/class-wpfront-user-role-editor-add-edit.php:313
242
+ #: ../classes/class-wpfront-user-role-editor-list.php:218
243
+ #: ../classes/class-wpfront-user-role-editor-list.php:361
244
+ #: ../classes/class-wpfront-user-role-editor-list.php:414
245
  #: ../templates/add-edit-role.php:71
246
  msgid "Display Name"
247
  msgstr "Display Name"
248
 
249
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-add-edit.php:225
250
+ #: ../classes/class-wpfront-user-role-editor-add-edit.php:315
251
+ msgid ""
252
+ "Use the Display Name field to set the display name for the new role. "
253
+ "WordPress uses display name to display this role within your site. This "
254
+ "field is required."
255
+ msgstr ""
256
+ "Use the Display Name field to set the display name for the new role. "
257
+ "WordPress uses display name to display this role within your site. This "
258
+ "field is required."
259
+
260
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-add-edit.php:230
261
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:131
262
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:174
263
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:160
264
+ #: ../classes/class-wpfront-user-role-editor-add-edit.php:320
265
+ #: ../classes/class-wpfront-user-role-editor-list.php:221
266
+ #: ../classes/class-wpfront-user-role-editor-list.php:368
267
+ #: ../classes/class-wpfront-user-role-editor-list.php:419
268
  #: ../templates/add-edit-role.php:81
269
  msgid "Role Name"
270
  msgstr "Role Name"
271
 
272
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-add-edit.php:232
273
+ #: ../classes/class-wpfront-user-role-editor-add-edit.php:322
274
+ msgid ""
275
+ "Use the Role Name field to set the role name for the new role. WordPress "
276
+ "uses role name to identify this role within your site. Once set role name "
277
+ "cannot be changed. This field is required. This plugin will auto populate "
278
+ "role name from the display name you have given, but you can change it."
279
+ msgstr ""
280
+ "Use the Role Name field to set the role name for the new role. WordPress "
281
+ "uses role name to identify this role within your site. Once set role name "
282
+ "cannot be changed. This field is required. This plugin will auto populate "
283
+ "role name from the display name you have given, but you can change it."
284
+
285
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-add-edit.php:237
286
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:138
287
+ #: ../classes/class-wpfront-user-role-editor-add-edit.php:327
288
+ #: ../classes/class-wpfront-user-role-editor-list.php:233
289
+ #: ../classes/class-wpfront-user-role-editor-list.php:375
290
+ #: ../classes/class-wpfront-user-role-editor-list.php:439
291
+ #: ../templates/add-edit-role.php:95
292
+ msgid "Capabilities"
293
+ msgstr "Capabilities"
294
+
295
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-add-edit.php:239
296
+ #: ../classes/class-wpfront-user-role-editor-add-edit.php:329
297
+ msgid ""
298
+ "Capabilities are displayed as different groups for easy access. The Roles "
299
+ "section displays capabilities created by this plugin. The Other Capabilities "
300
+ "section displays non-standard capabilities within your site. These are "
301
+ "usually created by plugins and themes. Use the check boxes to select the "
302
+ "capabilities required for this new role."
303
+ msgstr ""
304
+ "Capabilities are displayed as different groups for easy access. The Roles "
305
+ "section displays capabilities created by this plugin. The Other Capabilities "
306
+ "section displays non-standard capabilities within your site. These are "
307
+ "usually created by plugins and themes. Use the check boxes to select the "
308
+ "capabilities required for this new role."
309
+
310
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-add-edit.php:248
311
+ msgid "Documentation on Multisite Add New Role"
312
+ msgstr "Documentation on Multisite Add New Role"
313
+
314
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:86
315
+ #: ../templates/list-roles.php:62 ../templates/list-roles.php:64
316
+ msgid "Search Roles"
317
+ msgstr "Search Roles"
318
+
319
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:116
320
+ msgid "This screen allows you to edit a role within your network."
321
+ msgstr "This screen allows you to edit a role within your network."
322
+
323
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:126
324
+ #: ../classes/class-wpfront-user-role-editor-list.php:363
325
+ msgid ""
326
+ "Use the Display Name field to edit display name of the role. WordPress uses "
327
+ "display name to display this role within your site. This field is required."
328
+ msgstr ""
329
+ "Use the Display Name field to edit display name of the role. WordPress uses "
330
+ "display name to display this role within your site. This field is required."
331
+
332
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:133
333
+ #: ../classes/class-wpfront-user-role-editor-list.php:370
334
+ msgid ""
335
+ "Role Name is read only. WordPress uses role name to identify this role "
336
+ "within your site."
337
+ msgstr ""
338
+ "Role Name is read only. WordPress uses role name to identify this role "
339
+ "within your site."
340
+
341
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:140
342
+ #: ../classes/class-wpfront-user-role-editor-list.php:377
343
+ msgid ""
344
+ "Capabilities are displayed as different groups for easy access. The Roles "
345
+ "section displays capabilities created by this plugin. The Other Capabilities "
346
+ "section displays non-standard capabilities within your site. These are "
347
+ "usually created by plugins and themes. Use the check boxes to select the "
348
+ "capabilities required."
349
+ msgstr ""
350
+ "Capabilities are displayed as different groups for easy access. The Roles "
351
+ "section displays capabilities created by this plugin. The Other Capabilities "
352
+ "section displays non-standard capabilities within your site. These are "
353
+ "usually created by plugins and themes. Use the check boxes to select the "
354
+ "capabilities required."
355
+
356
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:150
357
+ msgid "This screen allows you to delete roles from your network sites."
358
+ msgstr "This screen allows you to delete roles from your network sites."
359
+
360
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:153
361
+ #: ../classes/class-wpfront-user-role-editor-list.php:390
362
+ msgid ""
363
+ "Use the Roles List screen to select the roles you want to delete. You can "
364
+ "delete individual roles using the Delete row action link or delete multiple "
365
+ "roles at the same time using the bulk action."
366
+ msgstr ""
367
+ "Use the Roles List screen to select the roles you want to delete. You can "
368
+ "delete individual roles using the Delete row action link or delete multiple "
369
+ "roles at the same time using the bulk action."
370
+
371
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:164
372
+ msgid ""
373
+ "This screen displays all the roles existing within your multisite network."
374
+ msgstr ""
375
+ "This screen displays all the roles existing within your multisite network."
376
+
377
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:167
378
+ #: ../classes/class-wpfront-user-role-editor-list.php:407
379
+ msgid ""
380
+ "To add a new role, click the Add New button at the top of the screen or Add "
381
+ "New in the Roles menu section."
382
+ msgstr ""
383
+ "To add a new role, click the Add New button at the top of the screen or Add "
384
+ "New in the Roles menu section."
385
+
386
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:172
387
+ #: ../classes/class-wpfront-user-role-editor-list.php:412
388
+ msgid "Columns"
389
+ msgstr "Columns"
390
+
391
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:176
392
+ #: ../classes/class-wpfront-user-role-editor-list.php:421
393
+ msgid "Is used by WordPress to identify this role."
394
+ msgstr "Is used by WordPress to identify this role."
395
+
396
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:181
397
+ msgid ""
398
+ "WordPress uses display name to display this role within the site. You can "
399
+ "have different display names for the same role within the network."
400
+ msgstr ""
401
+ "WordPress uses display name to display this role within the site. You can "
402
+ "have different display names for the same role within the network."
403
+
404
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:184
405
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:162
406
+ msgid "Role Type"
407
+ msgstr "Role Type"
408
+
409
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:186
410
+ msgid "Displays whether that role is a built-in role or a custom role."
411
+ msgstr "Displays whether that role is a built-in role or a custom role."
412
+
413
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:189
414
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:163
415
+ msgid "Sites"
416
+ msgstr "Sites"
417
+
418
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:191
419
+ msgid ""
420
+ "Display the sites that role belongs to. [All Sites] mean, that role is part "
421
+ "of every site within the network. Else it will display the number of sites "
422
+ "as a link. Clicking on the link will display the site list."
423
+ msgstr ""
424
+ "Display the sites that role belongs to. [All Sites] mean, that role is part "
425
+ "of every site within the network. Else it will display the number of sites "
426
+ "as a link. Clicking on the link will display the site list."
427
+
428
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:196
429
+ #: ../classes/class-wpfront-user-role-editor-list.php:451
430
+ msgid "Actions"
431
+ msgstr "Actions"
432
+
433
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:198
434
+ #: ../classes/class-wpfront-user-role-editor-list.php:453
435
+ msgid ""
436
+ "Hovering over a row in the roles list will display action links that allow "
437
+ "you to manage roles. You can perform the following actions:"
438
+ msgstr ""
439
+ "Hovering over a row in the roles list will display action links that allow "
440
+ "you to manage roles. You can perform the following actions:"
441
+
442
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:201
443
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:222
444
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:272
445
+ #: ../classes/class-wpfront-user-role-editor-list.php:456
446
+ #: ../templates/list-roles.php:98
447
+ msgid "View"
448
+ msgstr "View"
449
+
450
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:203
451
+ #: ../classes/class-wpfront-user-role-editor-list.php:458
452
+ msgid ""
453
+ "Display details about the role. You can see the capabilities assigned for "
454
+ "that role. View link will only appear when you do not have permission to "
455
+ "edit that role."
456
+ msgstr ""
457
+ "Display details about the role. You can see the capabilities assigned for "
458
+ "that role. View link will only appear when you do not have permission to "
459
+ "edit that role."
460
+
461
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:206
462
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:219
463
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:260
464
+ #: ../classes/class-wpfront-user-role-editor-list.php:461
465
+ #: ../templates/list-roles.php:98
466
+ #: ../templates/personal-pro/post-type-permissions.php:28
467
+ msgid "Edit"
468
+ msgstr "Edit"
469
+
470
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:208
471
+ #: ../classes/class-wpfront-user-role-editor-list.php:463
472
+ msgid ""
473
+ "Allows you to edit that role. You can see the capabilities assigned for that "
474
+ "role and also edit them. Edit link will only appear when you have permission "
475
+ "to edit that role."
476
+ msgstr ""
477
+ "Allows you to edit that role. You can see the capabilities assigned for that "
478
+ "role and also edit them. Edit link will only appear when you have permission "
479
+ "to edit that role."
480
+
481
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:211
482
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:110
483
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:220
484
+ #: ../classes/class-wpfront-user-role-editor-list.php:253
485
+ #: ../classes/class-wpfront-user-role-editor-list.php:466
486
+ #: ../templates/list-roles.php:101
487
+ #: ../templates/personal-pro/post-type-permissions.php:29
488
+ msgid "Delete"
489
+ msgstr "Delete"
490
+
491
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:213
492
+ msgid "Allows you to delete that role."
493
+ msgstr "Allows you to delete that role."
494
+
495
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:225
496
+ msgid "Documentation on Multisite Edit Role"
497
+ msgstr "Documentation on Multisite Edit Role"
498
+
499
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:232
500
+ msgid "Documentation on Multisite Delete Roles"
501
+ msgstr "Documentation on Multisite Delete Roles"
502
+
503
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:240
504
+ msgid "Documentation on Multisite Roles"
505
+ msgstr "Documentation on Multisite Roles"
506
+
507
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:44
508
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:73
509
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:174
510
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:176
511
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:196
512
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:215
513
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:224
514
+ #: ../classes/class-wpfront-user-role-editor-restore.php:84
515
+ #: ../templates/add-edit-role.php:45 ../templates/add-edit-role.php:53
516
+ #: ../templates/business-pro/sync-roles.php:17
517
+ msgid "ERROR"
518
+ msgstr "ERROR"
519
+
520
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:44
521
+ msgid "Permission denied."
522
+ msgstr "Permission denied."
523
+
524
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:71
525
+ msgid "Partial Failure"
526
+ msgstr "Partial Failure"
527
+
528
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:86
529
+ #: ../classes/class-wpfront-user-role-editor-restore.php:167
530
+ msgid ""
531
+ "This screen allow you to restore WordPress built-in roles to its standard "
532
+ "capability settings."
533
+ msgstr ""
534
+ "This screen allow you to restore WordPress built-in roles to its standard "
535
+ "capability settings."
536
+
537
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:89
538
+ #: ../classes/class-wpfront-user-role-editor-restore.php:170
539
+ msgid "To restore a role, click the Restore button then Confirm."
540
+ msgstr "To restore a role, click the Restore button then Confirm."
541
+
542
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:98
543
+ msgid "Documentation on Multisite Restore"
544
+ msgstr "Documentation on Multisite Restore"
545
+
546
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:116
547
+ msgid "No roles found."
548
+ msgstr "No roles found."
549
+
550
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:142
551
+ #, php-format
552
+ msgid "All <span class=\"count\">(%s)</span>"
553
+ msgstr "All <span class=\"count\">(%s)</span>"
554
+
555
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:145
556
+ #, php-format
557
+ msgid "Built-In <span class=\"count\">(%s)</span>"
558
+ msgstr "Built-In <span class=\"count\">(%s)</span>"
559
+
560
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:148
561
+ #, php-format
562
+ msgid "Custom <span class=\"count\">(%s)</span>"
563
+ msgstr "Custom <span class=\"count\">(%s)</span>"
564
+
565
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:198
566
+ #: ../templates/personal-pro/menu-editor.php:155
567
+ #: ../templates/personal-pro/menu-editor.php:191
568
+ #, php-format
569
+ msgid "Select %s"
570
+ msgstr "Select %s"
571
+
572
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:244
573
+ msgid "[All Sites]"
574
+ msgstr "[All Sites]"
575
+
576
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-roles-list-table.php:246
577
+ #, php-format
578
+ msgid "%d Site(s)"
579
+ msgstr "%d Site(s)"
580
+
581
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:56
582
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:64
583
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:83
584
+ msgid "Source site not selected."
585
+ msgstr "Source site not selected."
586
+
587
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:67
588
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:86
589
+ msgid "Destination type not selected."
590
+ msgstr "Destination type not selected."
591
+
592
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:74
593
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:93
594
+ msgid "Destination sites not selected."
595
+ msgstr "Destination sites not selected."
596
+
597
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:225
598
+ msgid "This screen allows you to sync the roles between the network."
599
+ msgstr "This screen allows you to sync the roles between the network."
600
+
601
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:228
602
+ msgid ""
603
+ "You will select a site as source, then sync the roles to selected sites or "
604
+ "entire sites within the network."
605
+ msgstr ""
606
+ "You will select a site as source, then sync the roles to selected sites or "
607
+ "entire sites within the network."
608
+
609
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:233
610
+ msgid "Step 1"
611
+ msgstr "Step 1"
612
+
613
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:235
614
+ msgid "Select source site."
615
+ msgstr "Select source site."
616
+
617
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:238
618
+ msgid "You will select the source site in this step."
619
+ msgstr "You will select the source site in this step."
620
+
621
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:243
622
+ msgid "Step 2"
623
+ msgstr "Step 2"
624
+
625
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:245
626
+ msgid "Select destination sites."
627
+ msgstr "Select destination sites."
628
+
629
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:248
630
+ msgid "You will select the destination sites in this step."
631
+ msgstr "You will select the destination sites in this step."
632
+
633
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:251
634
+ msgid ""
635
+ "Use \"All Sites\" to select all the sites within the network or you can "
636
+ "select individual sites using \"Selected Sites\"."
637
+ msgstr ""
638
+ "Use \"All Sites\" to select all the sites within the network or you can "
639
+ "select individual sites using \"Selected Sites\"."
640
+
641
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:256
642
+ msgid "Step 3"
643
+ msgstr "Step 3"
644
+
645
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:258
646
+ msgid "Choose settings."
647
+ msgstr "Choose settings."
648
+
649
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:261
650
+ #: ../templates/business-pro/sync-roles.php:222
651
+ msgid "Add roles existing only in source"
652
+ msgstr "Add roles existing only in source"
653
+
654
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:263
655
+ msgid ""
656
+ "Roles existing in source and do not existing in destination will be created."
657
+ msgstr ""
658
+ "Roles existing in source and do not existing in destination will be created."
659
+
660
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:266
661
+ #: ../templates/business-pro/sync-roles.php:227
662
+ msgid "Overwrite existing roles"
663
+ msgstr "Overwrite existing roles"
664
+
665
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:268
666
+ msgid ""
667
+ "If the role from source already exists in destination, it will be "
668
+ "overwritten."
669
+ msgstr ""
670
+ "If the role from source already exists in destination, it will be "
671
+ "overwritten."
672
+
673
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:271
674
+ #: ../templates/business-pro/sync-roles.php:232
675
+ msgid "Remove roles existing only in destination"
676
+ msgstr "Remove roles existing only in destination"
677
+
678
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:273
679
+ msgid ""
680
+ "If a role do not exist in source, but exists in destination it will be "
681
+ "removed."
682
+ msgstr ""
683
+ "If a role do not exist in source, but exists in destination it will be "
684
+ "removed."
685
+
686
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:276
687
+ #: ../templates/business-pro/sync-roles.php:237
688
+ msgid "Update new user default role"
689
+ msgstr "Update new user default role"
690
+
691
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:278
692
+ msgid ""
693
+ "The destination new user default role will be updated as same as source."
694
+ msgstr ""
695
+ "The destination new user default role will be updated as same as source."
696
+
697
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:283
698
+ msgid "Step 4"
699
+ msgstr "Step 4"
700
+
701
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:285
702
+ msgid "Confirm and Sync"
703
+ msgstr "Confirm and Sync"
704
+
705
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:288
706
+ msgid "You can verify your settings and start syncing."
707
+ msgstr "You can verify your settings and start syncing."
708
+
709
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:291
710
+ msgid "Click Sync Roles to start syncing."
711
+ msgstr "Click Sync Roles to start syncing."
712
+
713
+ #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:300
714
+ msgid "Documentation on Multisite Sync"
715
+ msgstr "Documentation on Multisite Sync"
716
+
717
+ #: ../classes/class-wpfront-user-role-editor-add-edit.php:305
718
+ msgid "This screen allows you to add a new role within your site."
719
+ msgstr "This screen allows you to add a new role within your site."
720
+
721
+ #: ../classes/class-wpfront-user-role-editor-add-edit.php:338
722
+ msgid "Documentation on Add New Role"
723
+ msgstr "Documentation on Add New Role"
724
+
725
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:59
726
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:270
727
+ msgid "Secondary Roles"
728
+ msgstr "Secondary Roles"
729
+
730
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:74
731
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:303
732
+ #: ../templates/assign-roles.php:36 ../templates/assign-roles.php:88
733
+ msgid "Assign Roles"
734
+ msgstr "Assign Roles"
735
+
736
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:111
737
+ msgid "No role for this site"
738
+ msgstr "No role for this site"
739
+
740
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:127
741
+ msgid "Invalid user."
742
+ msgstr "Invalid user."
743
+
744
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:155
745
+ msgid "Roles updated successfully."
746
+ msgstr "Roles updated successfully."
747
+
748
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:157
749
+ msgid "Invalid primary role specified."
750
+ msgstr "Invalid primary role specified."
751
+
752
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:175
753
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:185
754
+ msgid "Invalid primary role."
755
+ msgstr "Invalid primary role."
756
+
757
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:207
758
+ #, php-format
759
+ msgid "%d user(s) migrated."
760
+ msgstr "%d user(s) migrated."
761
+
762
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:252
763
+ msgid "Primary Role"
764
+ msgstr "Primary Role"
765
+
766
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:298
767
+ msgid ""
768
+ "This screen allows you to assign multiple roles to a user and also allows "
769
+ "you to migrate users from a role to another role."
770
+ msgstr ""
771
+ "This screen allows you to assign multiple roles to a user and also allows "
772
+ "you to migrate users from a role to another role."
773
+
774
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:305
775
+ msgid ""
776
+ "To assign multiple roles to a user, select that user within the User drop "
777
+ "down list and select the primary role you want for that user using the "
778
+ "Primary Role drop down list. Select the secondary roles using the check "
779
+ "boxes below, then click Assign Roles."
780
+ msgstr ""
781
+ "To assign multiple roles to a user, select that user within the User drop "
782
+ "down list and select the primary role you want for that user using the "
783
+ "Primary Role drop down list. Select the secondary roles using the check "
784
+ "boxes below, then click Assign Roles."
785
+
786
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:310
787
+ #: ../templates/assign-roles.php:93 ../templates/assign-roles.php:126
788
+ msgid "Migrate Users"
789
+ msgstr "Migrate Users"
790
+
791
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:312
792
+ msgid ""
793
+ "To migrate users from one role to another role or to add secondary roles to "
794
+ "users belonging to a particular primary role, use the migrate users "
795
+ "functionality."
796
+ msgstr ""
797
+ "To migrate users from one role to another role or to add secondary roles to "
798
+ "users belonging to a particular primary role, use the migrate users "
799
+ "functionality."
800
+
801
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:315
802
+ msgid ""
803
+ "Select the users using the From Primary Role drop down, to primary role "
804
+ "using the Primary Role drop down and secondary roles using the check boxes "
805
+ "then click Migrate Users."
806
+ msgstr ""
807
+ "Select the users using the From Primary Role drop down, to primary role "
808
+ "using the Primary Role drop down and secondary roles using the check boxes "
809
+ "then click Migrate Users."
810
+
811
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:324
812
+ msgid "Documentation on Assign / Migrate Users"
813
+ msgstr "Documentation on Assign / Migrate Users"
814
+
815
+ #: ../classes/class-wpfront-user-role-editor-controller-base.php:81
816
+ msgid "Links:"
817
+ msgstr "Links:"
818
+
819
+ #: ../classes/class-wpfront-user-role-editor-controller-base.php:87
820
+ msgid "FAQ"
821
+ msgstr "FAQ"
822
+
823
+ #: ../classes/class-wpfront-user-role-editor-controller-base.php:88
824
+ msgid "Support"
825
+ msgstr "Support"
826
+
827
+ #: ../classes/class-wpfront-user-role-editor-controller-base.php:89
828
+ msgid "Review"
829
+ msgstr "Review"
830
+
831
+ #: ../classes/class-wpfront-user-role-editor-controller-base.php:90
832
+ msgid "Contact"
833
+ msgstr "Contact"
834
+
835
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:174
836
+ msgid "License key activation limit reached"
837
+ msgstr "License key activation limit reached"
838
+
839
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:176
840
+ msgid "Invalid license key"
841
+ msgstr "Invalid license key"
842
+
843
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:196
844
+ msgid "Unable to deactivate, expired license?"
845
+ msgstr "Unable to deactivate, expired license?"
846
+
847
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:215
848
+ msgid "Unable to contact wpfront.com"
849
+ msgstr "Unable to contact wpfront.com"
850
+
851
+ #: ../classes/class-wpfront-user-role-editor-go-pro.php:224
852
+ msgid "Unable to parse response"
853
+ msgstr "Unable to parse response"
854
+
855
+ #: ../classes/class-wpfront-user-role-editor-list.php:214
856
+ #: ../templates/add-edit-role.php:111
857
+ #: ../templates/personal-pro/menu-editor.php:126
858
+ msgid "Select All"
859
+ msgstr "Select All"
860
+
861
+ #: ../classes/class-wpfront-user-role-editor-list.php:224
862
+ #: ../classes/class-wpfront-user-role-editor-list.php:424
863
  msgid "Type"
864
  msgstr "Type"
865
 
866
+ #: ../classes/class-wpfront-user-role-editor-list.php:227
867
+ #: ../classes/class-wpfront-user-role-editor-list.php:429
868
  msgid "User Default"
869
  msgstr "User Default"
870
 
871
+ #: ../classes/class-wpfront-user-role-editor-list.php:230
872
+ #: ../classes/class-wpfront-user-role-editor-list.php:434
873
  msgid "Users"
874
  msgstr "Users"
875
 
876
+ #: ../classes/class-wpfront-user-role-editor-list.php:251
 
 
 
 
 
877
  msgid "Bulk Actions"
878
  msgstr "Bulk Actions"
879
 
880
+ #: ../classes/class-wpfront-user-role-editor-list.php:256
 
 
 
 
 
881
  #: ../templates/add-edit-role.php:107
882
+ #: ../templates/personal-pro/menu-editor.php:94
883
  msgid "Apply"
884
  msgstr "Apply"
885
 
886
+ #: ../classes/class-wpfront-user-role-editor-list.php:258
887
  #, php-format
888
  msgid "%s item(s)"
889
  msgstr "%s item(s)"
890
 
891
+ #: ../classes/class-wpfront-user-role-editor-list.php:281
892
  msgid "All"
893
  msgstr "All"
894
 
895
+ #: ../classes/class-wpfront-user-role-editor-list.php:292
896
  msgid "Having Users"
897
  msgstr "Having Users"
898
 
899
+ #: ../classes/class-wpfront-user-role-editor-list.php:298
900
  msgid "No Users"
901
  msgstr "No Users"
902
 
903
+ #: ../classes/class-wpfront-user-role-editor-list.php:309
904
+ #: ../templates/list-roles.php:118
905
  msgid "Built-In"
906
  msgstr "Built-In"
907
 
908
+ #: ../classes/class-wpfront-user-role-editor-list.php:315
909
+ #: ../templates/list-roles.php:118
910
  msgid "Custom"
911
  msgstr "Custom"
912
 
913
+ #: ../classes/class-wpfront-user-role-editor-list.php:353
914
+ msgid "This screen allows you to edit a role within your site."
915
+ msgstr "This screen allows you to edit a role within your site."
916
+
917
+ #: ../classes/class-wpfront-user-role-editor-list.php:387
918
+ msgid "This screen allows you to delete roles from your WordPress site."
919
+ msgstr "This screen allows you to delete roles from your WordPress site."
920
+
921
+ #: ../classes/class-wpfront-user-role-editor-list.php:393
922
+ msgid ""
923
+ "You cannot delete administrator role, current user’s role and roles you do "
924
+ "not have permission to."
925
+ msgstr ""
926
+ "You cannot delete administrator role, current user’s role and roles you do "
927
+ "not have permission to."
928
+
929
+ #: ../classes/class-wpfront-user-role-editor-list.php:404
930
+ msgid "This screen lists all the existing roles within your site."
931
+ msgstr "This screen lists all the existing roles within your site."
932
+
933
+ #: ../classes/class-wpfront-user-role-editor-list.php:416
934
+ msgid "Used to display this role within this site."
935
+ msgstr "Used to display this role within this site."
936
+
937
+ #: ../classes/class-wpfront-user-role-editor-list.php:426
938
+ msgid ""
939
+ "Says whether the role is a WordPress built-in role or not. There are five "
940
+ "built-in roles."
941
+ msgstr ""
942
+ "Says whether the role is a WordPress built-in role or not. There are five "
943
+ "built-in roles."
944
+
945
+ #: ../classes/class-wpfront-user-role-editor-list.php:431
946
+ msgid "Displays whether a role is the default role of a new user."
947
+ msgstr "Displays whether a role is the default role of a new user."
948
+
949
+ #: ../classes/class-wpfront-user-role-editor-list.php:436
950
+ msgid "Number of users in that role."
951
+ msgstr "Number of users in that role."
952
+
953
+ #: ../classes/class-wpfront-user-role-editor-list.php:441
954
+ msgid "Number of capabilities that role have."
955
+ msgstr "Number of capabilities that role have."
956
+
957
+ #: ../classes/class-wpfront-user-role-editor-list.php:444
958
+ msgid "Menu Edited"
959
+ msgstr "Menu Edited"
960
+
961
+ #: ../classes/class-wpfront-user-role-editor-list.php:446
962
+ msgid ""
963
+ "Displays whether the menu has been edited for this role. This is a pro "
964
+ "feature."
965
+ msgstr ""
966
+ "Displays whether the menu has been edited for this role. This is a pro "
967
+ "feature."
968
+
969
+ #: ../classes/class-wpfront-user-role-editor-list.php:468
970
+ msgid ""
971
+ "Allows you to delete that role. Delete action will not appear if you do not "
972
+ "have permission to delete that role."
973
+ msgstr ""
974
+ "Allows you to delete that role. Delete action will not appear if you do not "
975
+ "have permission to delete that role."
976
+
977
+ #: ../classes/class-wpfront-user-role-editor-list.php:471
978
+ #: ../templates/list-roles.php:104
979
+ msgid "Default"
980
+ msgstr "Default"
981
+
982
+ #: ../classes/class-wpfront-user-role-editor-list.php:473
983
+ msgid ""
984
+ "Allows you to set that role as the default role for new user registration."
985
+ msgstr ""
986
+ "Allows you to set that role as the default role for new user registration."
987
+
988
+ #: ../classes/class-wpfront-user-role-editor-list.php:476
989
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:555
990
+ msgid "Edit Menu"
991
+ msgstr "Edit Menu"
992
+
993
+ #: ../classes/class-wpfront-user-role-editor-list.php:478
994
+ msgid ""
995
+ "Takes you to the menu editor screen for that role. You need \"edit_role_menus"
996
+ "\" capability for this link to appear. This is a pro feature."
997
+ msgstr ""
998
+ "Takes you to the menu editor screen for that role. You need \"edit_role_menus"
999
+ "\" capability for this link to appear. This is a pro feature."
1000
+
1001
+ #: ../classes/class-wpfront-user-role-editor-list.php:490
1002
+ msgid "Documentation on Edit Role"
1003
+ msgstr "Documentation on Edit Role"
1004
+
1005
+ #: ../classes/class-wpfront-user-role-editor-list.php:497
1006
+ msgid "Documentation on Delete Roles"
1007
+ msgstr "Documentation on Delete Roles"
1008
+
1009
+ #: ../classes/class-wpfront-user-role-editor-list.php:505
1010
+ msgid "Documentation on Roles"
1011
+ msgstr "Documentation on Roles"
1012
+
1013
+ #: ../classes/class-wpfront-user-role-editor-options.php:193
1014
+ msgid ""
1015
+ "These settings are applicable for the network admin dashboard. Also these "
1016
+ "settings will propagate to the individual sites unless its overridden within "
1017
+ "that site’s settings."
1018
+ msgstr ""
1019
+ "These settings are applicable for the network admin dashboard. Also these "
1020
+ "settings will propagate to the individual sites unless its overridden within "
1021
+ "that site’s settings."
1022
+
1023
+ #: ../classes/class-wpfront-user-role-editor-options.php:200
1024
+ #: ../templates/options-template.php:40
1025
+ msgid "Enable Large Network Functionalities"
1026
+ msgstr "Enable Large Network Functionalities"
1027
+
1028
+ #: ../classes/class-wpfront-user-role-editor-options.php:202
1029
+ msgid "This setting is only visible when you have a large network."
1030
+ msgstr "This setting is only visible when you have a large network."
1031
+
1032
+ #: ../classes/class-wpfront-user-role-editor-options.php:204
1033
+ msgid "More details"
1034
+ msgstr "More details"
1035
+
1036
+ #: ../classes/class-wpfront-user-role-editor-options.php:208
1037
+ #: ../classes/class-wpfront-user-role-editor-options.php:235
1038
+ #: ../templates/options-template.php:49
1039
  msgid "Display Deprecated Capabilities"
1040
  msgstr "Display Deprecated Capabilities"
1041
 
1042
+ #: ../classes/class-wpfront-user-role-editor-options.php:210
1043
+ #: ../classes/class-wpfront-user-role-editor-options.php:237
1044
+ msgid ""
1045
+ "If enabled, deprecated capabilities will be displayed within the add/edit "
1046
+ "screens."
1047
+ msgstr ""
1048
+ "If enabled, deprecated capabilities will be displayed within the add/edit "
1049
+ "screens."
1050
 
1051
+ #: ../classes/class-wpfront-user-role-editor-options.php:213
1052
+ #: ../classes/class-wpfront-user-role-editor-options.php:240
1053
+ #: ../templates/options-template.php:57
1054
  msgid "Remove Non-Standard Capabilities on Restore"
1055
  msgstr "Remove Non-Standard Capabilities on Restore"
1056
 
1057
+ #: ../classes/class-wpfront-user-role-editor-options.php:215
1058
+ #: ../classes/class-wpfront-user-role-editor-options.php:242
1059
+ msgid ""
1060
+ "If enabled, while restoring WordPress built-in capabilities non-standard "
1061
+ "capabilities will be removed."
1062
+ msgstr ""
1063
+ "If enabled, while restoring WordPress built-in capabilities non-standard "
1064
+ "capabilities will be removed."
1065
+
1066
+ #: ../classes/class-wpfront-user-role-editor-options.php:218
1067
+ #: ../classes/class-wpfront-user-role-editor-options.php:245
1068
+ #: ../templates/options-template.php:65
1069
+ msgid "Override Edit Permissions"
1070
+ msgstr "Override Edit Permissions"
1071
+
1072
+ #: ../classes/class-wpfront-user-role-editor-options.php:220
1073
+ #: ../classes/class-wpfront-user-role-editor-options.php:247
1074
+ msgid "If enabled, ignores the check to the function get_editable_roles."
1075
+ msgstr "If enabled, ignores the check to the function get_editable_roles."
1076
+
1077
+ #: ../classes/class-wpfront-user-role-editor-options.php:223
1078
+ #: ../classes/class-wpfront-user-role-editor-options.php:250
1079
+ #: ../templates/options-template.php:74
1080
+ msgid "Remove Data on Uninstall"
1081
+ msgstr "Remove Data on Uninstall"
1082
+
1083
+ #: ../classes/class-wpfront-user-role-editor-options.php:225
1084
+ #: ../classes/class-wpfront-user-role-editor-options.php:252
1085
+ msgid ""
1086
+ "If enabled, removes all data related to this plugin from database (except "
1087
+ "roles data) including license information if any. This will not deactivate "
1088
+ "the license automatically."
1089
+ msgstr ""
1090
+ "If enabled, removes all data related to this plugin from database (except "
1091
+ "roles data) including license information if any. This will not deactivate "
1092
+ "the license automatically."
1093
 
1094
+ #: ../classes/class-wpfront-user-role-editor-options.php:263
1095
+ msgid "Documentation on Multisite Settings"
1096
+ msgstr "Documentation on Multisite Settings"
1097
 
1098
+ #: ../classes/class-wpfront-user-role-editor-options.php:270
1099
+ msgid "Documentation on Settings"
1100
+ msgstr "Documentation on Settings"
1101
 
1102
+ #: ../classes/class-wpfront-user-role-editor-restore.php:179
1103
+ msgid "Documentation on Restore"
1104
+ msgstr "Documentation on Restore"
 
 
1105
 
1106
+ #: ../classes/class-wpfront-user-role-editor.php:221
1107
+ msgid "Assign Roles | Migrate Users"
1108
+ msgstr "Assign Roles | Migrate Users"
1109
 
1110
+ #: ../classes/class-wpfront-user-role-editor.php:221
1111
+ msgid "Assign / Migrate"
1112
+ msgstr "Assign / Migrate"
 
1113
 
1114
+ #: ../classes/class-wpfront-user-role-editor.php:316
1115
+ msgid "Buy me a Beer"
1116
+ msgstr "Buy me a Beer"
 
1117
 
1118
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-export.php:128
1119
+ msgid ""
1120
+ "This screen allows you to export the roles existing within your site and "
1121
+ "import into the same site or a different site."
1122
+ msgstr ""
1123
+ "This screen allows you to export the roles existing within your site and "
1124
+ "import into the same site or a different site."
1125
 
1126
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-export.php:131
1127
+ msgid "Select the roles to export, then click Download Export File."
1128
+ msgstr "Select the roles to export, then click Download Export File."
 
1129
 
1130
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-export.php:140
1131
+ msgid "Documentation on Export"
1132
+ msgstr "Documentation on Export"
1133
+
1134
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:33
1135
+ msgid "This functionality requires SimpleXML extension, which is not loaded."
1136
+ msgstr "This functionality requires SimpleXML extension, which is not loaded."
1137
+
1138
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:81
1139
+ #, php-format
1140
+ msgid "%d role(s) imported."
1141
+ msgstr "%d role(s) imported."
1142
+
1143
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:102
1144
+ #, php-format
1145
+ msgid ""
1146
+ "The export file could not be found at <code>%s</code>. It is likely that "
1147
+ "this was caused by a permissions problem."
1148
+ msgstr ""
1149
+ "The export file could not be found at <code>%s</code>. It is likely that "
1150
+ "this was caused by a permissions problem."
1151
+
1152
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:133
1153
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:141
1154
+ msgid "There was an error when reading this export file"
1155
+ msgstr "There was an error when reading this export file"
1156
+
1157
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:158
1158
+ #, php-format
1159
+ msgid ""
1160
+ "Please update the plugin to latest version. This export file requires plugin "
1161
+ "version %s or higher."
1162
+ msgstr ""
1163
+ "Please update the plugin to latest version. This export file requires plugin "
1164
+ "version %s or higher."
1165
+
1166
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:214
1167
+ msgid "This file does not appears to be a valid export file."
1168
+ msgstr "This file does not appears to be a valid export file."
1169
+
1170
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:227
1171
+ msgid ""
1172
+ "Step 1: Select export file using the Browse button. Then click Upload file "
1173
+ "and Import."
1174
+ msgstr ""
1175
+ "Step 1: Select export file using the Browse button. Then click Upload file "
1176
+ "and Import."
1177
+
1178
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:230
1179
+ msgid ""
1180
+ "Step 2: Select the roles you want to import using the check boxes and click "
1181
+ "Import Roles."
1182
+ msgstr ""
1183
+ "Step 2: Select the roles you want to import using the check boxes and click "
1184
+ "Import Roles."
1185
+
1186
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:239
1187
+ msgid "Documentation on Import"
1188
+ msgstr "Documentation on Import"
1189
+
1190
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:157
1191
+ msgid "Menu changes saved."
1192
+ msgstr "Menu changes saved."
1193
+
1194
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:170
1195
+ msgid "Menu defaults restored."
1196
+ msgstr "Menu defaults restored."
1197
+
1198
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:185
1199
+ msgid "No editable roles found on this site."
1200
+ msgstr "No editable roles found on this site."
1201
+
1202
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:565
1203
+ msgid ""
1204
+ "This screen allows you to enable and disable admin menus for a particular "
1205
+ "role."
1206
+ msgstr ""
1207
+ "This screen allows you to enable and disable admin menus for a particular "
1208
+ "role."
1209
+
1210
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:568
1211
+ msgid "Deselect a menu from the grid to remove that menu."
1212
+ msgstr "Deselect a menu from the grid to remove that menu."
1213
+
1214
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:571
1215
+ msgid ""
1216
+ "Disabled menu items are already hidden, because the selected role doesn't "
1217
+ "have the capability to display that menu. Grid displays menus which the "
1218
+ "current user has access to."
1219
+ msgstr ""
1220
+ "Disabled menu items are already hidden, because the selected role doesn't "
1221
+ "have the capability to display that menu. Grid displays menus which the "
1222
+ "current user has access to."
1223
+
1224
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:576
1225
+ msgid "Fields"
1226
+ msgstr "Fields"
1227
+
1228
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:578
1229
+ #: ../templates/personal-pro/menu-editor.php:33
1230
+ msgid "Override Role"
1231
+ msgstr "Override Role"
1232
+
1233
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:580
1234
+ msgid "The role you want to override."
1235
+ msgstr "The role you want to override."
1236
+
1237
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:583
1238
+ #: ../templates/personal-pro/menu-editor.php:50
1239
+ msgid "Override Type"
1240
+ msgstr "Override Type"
1241
+
1242
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:585
1243
+ msgid ""
1244
+ "Soft - Pages may be available through directly typing the URL. Hard - Even "
1245
+ "URLs will be blocked."
1246
+ msgstr ""
1247
+ "Soft - Pages may be available through directly typing the URL. Hard - Even "
1248
+ "URLs will be blocked."
1249
+
1250
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:588
1251
+ #: ../templates/personal-pro/menu-editor.php:61
1252
+ msgid "Hide New Menus"
1253
+ msgstr "Hide New Menus"
1254
+
1255
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:590
1256
+ msgid "Allow you to hide future menus."
1257
+ msgstr "Allow you to hide future menus."
1258
+
1259
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:593
1260
+ #: ../templates/personal-pro/menu-editor.php:69
1261
+ msgid "Disable For Secondary Role"
1262
+ msgstr "Disable For Secondary Role"
1263
+
1264
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:595
1265
+ msgid "Disables menu settings while the selected role is a secondary role."
1266
+ msgstr "Disables menu settings while the selected role is a secondary role."
1267
+
1268
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:600
1269
+ msgid "Restore Default"
1270
+ msgstr "Restore Default"
1271
+
1272
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:602
1273
+ msgid ""
1274
+ "Select \"Restore default\" from the \"Copy from\" drop down and click apply."
1275
+ msgstr ""
1276
+ "Select \"Restore default\" from the \"Copy from\" drop down and click apply."
1277
+
1278
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:611
1279
+ msgid "Documentation on Menu Editor"
1280
+ msgstr "Documentation on Menu Editor"
1281
+
1282
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:65
1283
+ #: ../templates/personal-pro/menu-editor.php:3
1284
+ msgid "Menu Editor"
1285
+ msgstr "Menu Editor"
1286
+
1287
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:66
1288
+ #: ../templates/personal-pro/export-roles.php:3
1289
+ msgid "Export Roles"
1290
+ msgstr "Export Roles"
1291
+
1292
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:66
1293
+ msgid "Export"
1294
+ msgstr "Export"
1295
+
1296
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:67
1297
+ #: ../templates/personal-pro/import-roles.php:3
1298
+ #: ../templates/personal-pro/import-roles.php:82
1299
+ msgid "Import Roles"
1300
+ msgstr "Import Roles"
1301
+
1302
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:67
1303
+ msgid "Import"
1304
+ msgstr "Import"
1305
+
1306
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:87
1307
+ #, php-format
1308
+ msgid "%s license not activated."
1309
+ msgstr "%s license not activated."
1310
+
1311
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-post-type-permissions.php:44
1312
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-post-type-permissions.php:269
1313
+ msgid "Role Permissions"
1314
+ msgstr "Role Permissions"
1315
 
1316
  #: ../templates/add-edit-role.php:35
1317
  msgid "Edit Role"
1334
  msgstr "required"
1335
 
1336
  #: ../templates/add-edit-role.php:100
1337
+ #: ../templates/personal-pro/menu-editor.php:83
1338
  msgid "Copy from"
1339
  msgstr "Copy from"
1340
 
1346
  msgid "Update Role"
1347
  msgstr "Update Role"
1348
 
1349
+ #: ../templates/assign-roles.php:62
1350
+ msgid "User"
1351
+ msgstr "User"
1352
+
1353
+ #: ../templates/assign-roles.php:103
1354
+ msgid "From Primary Role"
1355
+ msgstr "From Primary Role"
1356
+
1357
+ #: ../templates/business-pro/sync-roles.php:25
1358
+ msgid "Step 1: Select the source site"
1359
+ msgstr "Step 1: Select the source site"
1360
+
1361
+ #: ../templates/business-pro/sync-roles.php:34
1362
+ #: ../templates/business-pro/sync-roles.php:84
1363
+ msgid "Search Sites"
1364
+ msgstr "Search Sites"
1365
+
1366
+ #: ../templates/business-pro/sync-roles.php:40
1367
+ #: ../templates/business-pro/sync-roles.php:95
1368
+ #: ../templates/business-pro/sync-roles.php:245
1369
+ msgid "Next Step"
1370
+ msgstr "Next Step"
1371
+
1372
+ #: ../templates/business-pro/sync-roles.php:70
1373
+ msgid "Step 2: Select destination sites"
1374
+ msgstr "Step 2: Select destination sites"
1375
+
1376
+ #: ../templates/business-pro/sync-roles.php:74
1377
+ #: ../templates/business-pro/sync-roles.php:269
1378
+ msgid "All Sites"
1379
+ msgstr "All Sites"
1380
+
1381
+ #: ../templates/business-pro/sync-roles.php:77
1382
+ msgid "Selected Sites"
1383
+ msgstr "Selected Sites"
1384
+
1385
+ #: ../templates/business-pro/sync-roles.php:216
1386
+ msgid "Step 3: Choose settings"
1387
+ msgstr "Step 3: Choose settings"
1388
+
1389
+ #: ../templates/business-pro/sync-roles.php:255
1390
+ msgid "Step 4: Confirm and Sync"
1391
+ msgstr "Step 4: Confirm and Sync"
1392
+
1393
+ #: ../templates/business-pro/sync-roles.php:260
1394
+ msgid "Source: "
1395
+ msgstr "Source: "
1396
+
1397
+ #: ../templates/business-pro/sync-roles.php:268
1398
+ msgid "Destination: "
1399
+ msgstr "Destination: "
1400
+
1401
+ #: ../templates/business-pro/sync-roles.php:269
1402
+ msgid "Selected sites"
1403
+ msgstr "Selected sites"
1404
+
1405
+ #: ../templates/business-pro/sync-roles.php:269
1406
+ #, php-format
1407
+ msgid "%s site(s) selected"
1408
+ msgstr "%s site(s) selected"
1409
+
1410
+ #: ../templates/business-pro/sync-roles.php:274
1411
+ msgid "Add roles existing only in source: "
1412
+ msgstr "Add roles existing only in source: "
1413
+
1414
+ #: ../templates/business-pro/sync-roles.php:275
1415
+ #: ../templates/business-pro/sync-roles.php:281
1416
+ #: ../templates/business-pro/sync-roles.php:287
1417
+ #: ../templates/business-pro/sync-roles.php:293
1418
+ msgid "Yes"
1419
+ msgstr "Yes"
1420
+
1421
+ #: ../templates/business-pro/sync-roles.php:275
1422
+ #: ../templates/business-pro/sync-roles.php:281
1423
+ #: ../templates/business-pro/sync-roles.php:287
1424
+ #: ../templates/business-pro/sync-roles.php:293
1425
+ msgid "No"
1426
+ msgstr "No"
1427
+
1428
+ #: ../templates/business-pro/sync-roles.php:280
1429
+ msgid "Overwrite existing roles: "
1430
+ msgstr "Overwrite existing roles: "
1431
+
1432
+ #: ../templates/business-pro/sync-roles.php:286
1433
+ msgid "Remove roles existing only in destination: "
1434
+ msgstr "Remove roles existing only in destination: "
1435
+
1436
+ #: ../templates/business-pro/sync-roles.php:292
1437
+ msgid "Update new user default role: "
1438
+ msgstr "Update new user default role: "
1439
+
1440
+ #: ../templates/business-pro/sync-roles.php:344
1441
+ msgid "SUCCESS"
1442
+ msgstr "SUCCESS"
1443
+
1444
+ #: ../templates/business-pro/sync-roles.php:347
1445
+ msgid "FAIL"
1446
+ msgstr "FAIL"
1447
+
1448
+ #: ../templates/business-pro/sync-roles.php:370
1449
+ msgid "Synching site"
1450
+ msgstr "Synching site"
1451
+
1452
  #: ../templates/delete-role.php:37
1453
  msgid "Delete Roles"
1454
  msgstr "Delete Roles"
1465
  msgid "Confirm Deletion"
1466
  msgstr "Confirm Deletion"
1467
 
1468
+ #: ../templates/go-pro.php:36
1469
+ msgid "WPFront User Role Editor Pro"
1470
+ msgstr "WPFront User Role Editor Pro"
1471
 
1472
+ #: ../templates/go-pro.php:59
1473
+ msgid "License Key"
1474
+ msgstr "License Key"
1475
 
1476
+ #: ../templates/go-pro.php:68 ../templates/go-pro.php:69
1477
+ msgid "Deactivate"
1478
+ msgstr "Deactivate"
1479
 
1480
+ #: ../templates/go-pro.php:76
1481
+ msgid "License Expires"
1482
+ msgstr "License Expires"
1483
 
1484
  #: ../templates/options-template.php:32
1485
  msgid "WPFront User Role Editor Settings"
1486
  msgstr "WPFront User Role Editor Settings"
1487
 
1488
+ #: ../templates/personal-pro/export-roles.php:7
1489
+ msgid "Select the roles to be uploaded"
1490
+ msgstr "Select the roles to be uploaded"
1491
+
1492
+ #: ../templates/personal-pro/export-roles.php:34
1493
+ msgid "Download Export File"
1494
+ msgstr "Download Export File"
1495
+
1496
+ #: ../templates/personal-pro/import-roles.php:15
1497
+ msgid "ERROR:"
1498
+ msgstr "ERROR:"
1499
+
1500
+ #: ../templates/personal-pro/import-roles.php:24
1501
+ msgid ""
1502
+ "Choose a WPFront User Role Editor export file (.xml) to upload, then click "
1503
+ "Upload file and import."
1504
+ msgstr ""
1505
+ "Choose a WPFront User Role Editor export file (.xml) to upload, then click "
1506
+ "Upload file and import."
1507
+
1508
+ #: ../templates/personal-pro/import-roles.php:33
1509
+ #, php-format
1510
+ msgid "Roles exported from %s on %s by user %s."
1511
+ msgstr "Roles exported from %s on %s by user %s."
1512
+
1513
+ #: ../templates/personal-pro/import-roles.php:33
1514
+ msgid "UTC"
1515
+ msgstr "UTC"
1516
+
1517
+ #: ../templates/personal-pro/import-roles.php:40
1518
+ msgid "Zero roles found in this export file to import."
1519
+ msgstr "Zero roles found in this export file to import."
1520
+
1521
+ #: ../templates/personal-pro/import-roles.php:46
1522
+ msgid "Select roles to import"
1523
+ msgstr "Select roles to import"
1524
+
1525
+ #: ../templates/personal-pro/import-roles.php:75
1526
+ msgid ""
1527
+ "* These roles already exist in this site. Importing them will overwrite "
1528
+ "existing roles."
1529
+ msgstr ""
1530
+ "* These roles already exist in this site. Importing them will overwrite "
1531
+ "existing roles."
1532
+
1533
+ #: ../templates/personal-pro/menu-editor.php:20
1534
+ msgid ""
1535
+ "Select a role below to edit menu for that role. Deselect a menu from the "
1536
+ "grid to remove that menu. Disabled menu items are already hidden, because "
1537
+ "the selected role doesn't have the capability to display that menu. Grid "
1538
+ "displays menus which the current user has access to. "
1539
+ msgstr ""
1540
+ "Select a role below to edit menu for that role. Deselect a menu from the "
1541
+ "grid to remove that menu. Disabled menu items are already hidden, because "
1542
+ "the selected role doesn't have the capability to display that menu. Grid "
1543
+ "displays menus which the current user has access to. "
1544
+
1545
+ #: ../templates/personal-pro/menu-editor.php:54
1546
+ msgid "Soft"
1547
+ msgstr "Soft"
1548
+
1549
+ #: ../templates/personal-pro/menu-editor.php:55
1550
+ msgid "Hard"
1551
+ msgstr "Hard"
1552
+
1553
+ #: ../templates/personal-pro/menu-editor.php:86
1554
+ msgid "Restore default"
1555
+ msgstr "Restore default"
1556
+
1557
+ #: ../templates/personal-pro/menu-editor.php:99
1558
+ msgid "Hide deselected item(s)"
1559
+ msgstr "Hide deselected item(s)"
1560
+
1561
+ #: ../templates/personal-pro/menu-editor.php:104
1562
+ msgid "Hide disabled item(s)"
1563
+ msgstr "Hide disabled item(s)"
1564
+
1565
+ #: ../templates/personal-pro/menu-editor.php:110
1566
+ msgid "Has Capability"
1567
+ msgstr "Has Capability"
1568
+
1569
+ #: ../templates/personal-pro/menu-editor.php:115
1570
+ msgid "No Capability"
1571
+ msgstr "No Capability"
1572
+
1573
+ #: ../templates/personal-pro/menu-editor.php:135
1574
+ msgid "Capability"
1575
+ msgstr "Capability"
1576
+
1577
+ #: ../templates/personal-pro/menu-editor.php:138
1578
+ msgid "Menu Slug"
1579
+ msgstr "Menu Slug"
1580
+
1581
+ #: ../templates/personal-pro/post-type-permissions.php:19
1582
+ msgid "Enable Role Permissions"
1583
+ msgstr "Enable Role Permissions"
1584
+
1585
+ #: ../templates/personal-pro/post-type-permissions.php:27
1586
+ msgid "Read"
1587
+ msgstr "Read"
1588
+
1589
  #: ../templates/restore-role.php:48
1590
  msgid "Cancel"
1591
  msgstr "Cancel"
1598
  msgid "Restored"
1599
  msgstr "Restored"
1600
 
1601
+ #: ../templates/restore-role.php:101
1602
+ msgid "Unexpected error / Timed out"
1603
+ msgstr "Unexpected error / Timed out"
1604
+
1605
+ #~ msgid "Settings Description"
1606
+ #~ msgstr "Settings Description"
1607
+
1608
+ #~ msgid "Plugin FAQ"
1609
+ #~ msgstr "Plugin FAQ"
1610
+
1611
+ #~ msgid "Feature Request"
1612
+ #~ msgstr "Feature Request"
1613
+
1614
+ #~ msgid "Report Bug"
1615
+ #~ msgstr "Report Bug"
1616
+
1617
+ #~ msgid "Buy me a Beer or Coffee"
1618
+ #~ msgstr "Buy me a Beer or Coffee"
1619
+
1620
+ #~ msgid "Add Role Capabilities"
1621
+ #~ msgstr "Add Role Capabilities"
1622
+
1623
+ #~ msgid "User Role Editor"
1624
+ #~ msgstr "User Role Editor"
1625
 
1626
  #~ msgid "Enabled"
1627
  #~ msgstr "Enabled"
1787
  #~ msgid "Only in landing page."
1788
  #~ msgstr "Only in landing page."
1789
 
 
 
 
1790
  #~ msgid "Include in following pages"
1791
  #~ msgstr "Include in following pages"
1792
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WPFront User Role Editor ===
2
  Contributors: syammohanm
3
- Donate link: http://wpfront.com/donate/
4
- Tags: user role editor, role editor, user role, role, user roles, roles, user roles editor, roles editor, role manager, roles manager, manage roles, manage role, access, capability, editor, permission, role, security, user, capability editor, capability manager
5
  Requires at least: 3.5
6
  Tested up to: 4.0
7
- Stable tag: 1.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -22,10 +22,15 @@ You can create, edit or delete user roles and manage role capabilities.
22
  * Allows you to add role capabilities.
23
  * Change default user role.
24
  * Restore role.
 
 
 
 
 
 
 
25
 
26
- Visit [WPFront User Role Editor](http://wpfront.com/user-role-editor-plugin/) page for screens and functionalities.
27
-
28
- Visit [WPFront User Role Editor Settings](http://wpfront.com/user-role-editor-plugin-settings/) page for setting descriptions.
29
 
30
  == Installation ==
31
 
@@ -41,50 +46,67 @@ Visit [WPFront User Role Editor Settings](http://wpfront.com/user-role-editor-pl
41
 
42
  == Frequently Asked Questions ==
43
 
44
- Please visit [WPFront User Role Editor FAQ](http://wpfront.com/wordpress-plugins/user-role-editor-plugin/user-role-editor-plugin-faq/).
45
 
46
  == Screenshots ==
47
 
48
- 1. Roles list
49
- 2. Add new role
50
- 3. Edit role
51
- 4. Restore role
52
- 5. Global settings
 
 
 
 
 
 
 
53
 
54
  == Changelog ==
55
 
 
 
 
 
 
 
56
  = 1.2 =
57
- * Restore role
58
- * Bug fixes
59
 
60
  = 1.1 =
61
- * Edit deprecated capabilities
62
 
63
  = 1.0 =
64
- * Set new user default role
65
- * Stability improvements
66
 
67
  = 0.3.1 =
68
- * Bug fixes
69
 
70
  = 0.3 =
71
- * Initial release
72
 
73
  == Upgrade Notice ==
74
 
 
 
 
 
75
  = 1.2 =
76
- * Now you can restore roles
77
 
78
  = 1.1 =
79
- * Can edit deprecated capabilities now
80
 
81
  = 1.0 =
82
- * Easily set new user default role
83
 
84
  = 0.3.1 =
85
- * Fixed an issue with deleting roles
86
 
87
  = 0.3 =
88
- * Initial release
89
 
90
 
1
  === WPFront User Role Editor ===
2
  Contributors: syammohanm
3
+ Donate link: https://wpfront.com/donate/
4
+ Tags: user role editor, role editor, user role, role, user roles, roles, user roles editor, roles editor, role manager, roles manager, manage roles, manage role, access, capability, editor, permission, role, security, user, capability editor, capability manager, custom post types, custom post type permissions, custom post type capabilities, post type permissions, post type capabilities, menu editor, role menu, role menu editor, multisite roles, multisite role editor, multisite user roles, import roles, export roles
5
  Requires at least: 3.5
6
  Tested up to: 4.0
7
+ Stable tag: 2.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
22
  * Allows you to add role capabilities.
23
  * Change default user role.
24
  * Restore role.
25
+ * Assign multiple roles.
26
+ * Migrate users.
27
+ * Menu editor. [PRO]
28
+ * Post/Page extended permissions. [PRO]
29
+ * Custom post type permissions. [PRO]
30
+ * Import/Export. [PRO]
31
+ * Multisite. [PRO]
32
 
33
+ Compare [User Role Editor Pro](https://wpfront.com/ppro)
 
 
34
 
35
  == Installation ==
36
 
46
 
47
  == Frequently Asked Questions ==
48
 
49
+ Please visit [WPFront User Role Editor FAQ](https://wpfront.com/user-role-editor-pro/faq/).
50
 
51
  == Screenshots ==
52
 
53
+ 01. Roles list
54
+ 02. Settings
55
+ 03. Assign / Migrate users
56
+ 04. Custom post type permissions
57
+ 05. Extended permissions
58
+ 06. Menu editor
59
+ 07. Export roles
60
+ 08. Import roles
61
+ 09. Multisite sync roles
62
+ 10. Add new role
63
+ 11. Edit role
64
+ 12. Restore role
65
 
66
  == Changelog ==
67
 
68
+ = 2.0 =
69
+ * Removed 'wpfront_' from role capabilities.
70
+ * Removed 'Add role capabilities'. It is enabled by default.
71
+ * Assign/Migrate users.
72
+ * Bug fixes.
73
+
74
  = 1.2 =
75
+ * Restore role.
76
+ * Bug fixes.
77
 
78
  = 1.1 =
79
+ * Edit deprecated capabilities.
80
 
81
  = 1.0 =
82
+ * Set new user default role.
83
+ * Stability improvements.
84
 
85
  = 0.3.1 =
86
+ * Bug fixes.
87
 
88
  = 0.3 =
89
+ * Initial release.
90
 
91
  == Upgrade Notice ==
92
 
93
+ = 2.0 =
94
+ * Now you can assign multiple roles to a user.
95
+ * Migrate users from role to role.
96
+
97
  = 1.2 =
98
+ * Now you can restore roles.
99
 
100
  = 1.1 =
101
+ * Can edit deprecated capabilities now.
102
 
103
  = 1.0 =
104
+ * Easily set new user default role.
105
 
106
  = 0.3.1 =
107
+ * Fixed an issue with deleting roles.
108
 
109
  = 0.3 =
110
+ * Initial release.
111
 
112
 
templates/add-edit-role.php CHANGED
@@ -246,8 +246,17 @@ if ($this->role == NULL) {
246
  var button = $(this).prop("disabled", true);
247
  var data = {
248
  "action": "wpfront_user_role_editor_copy_capabilities",
249
- "role": $(this).prev().val()
 
 
250
  };
 
 
 
 
 
 
 
251
  $.post(ajaxurl, data, function(response) {
252
  $("div.role-add-new div.postbox input").prop("checked", false);
253
  for (m in response) {
246
  var button = $(this).prop("disabled", true);
247
  var data = {
248
  "action": "wpfront_user_role_editor_copy_capabilities",
249
+ "role": $(this).prev().val(),
250
+ "referer": <?php echo json_encode($_SERVER['REQUEST_URI']); ?>,
251
+ "nonce": <?php echo json_encode(wp_create_nonce($_SERVER['REQUEST_URI'])); ?>
252
  };
253
+ <?php
254
+ if ($this->multisite) {
255
+ ?>
256
+ data["multisite"] = true;
257
+ <?php
258
+ }
259
+ ?>
260
  $.post(ajaxurl, data, function(response) {
261
  $("div.role-add-new div.postbox input").prop("checked", false);
262
  for (m in response) {
templates/assign-roles.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ WPFront User Role Editor Plugin
4
+ Copyright (C) 2014, WPFront.com
5
+ Website: wpfront.com
6
+ Contact: syam@wpfront.com
7
+
8
+ WPFront User Role Editor Plugin is distributed under the GNU General Public License, Version 3,
9
+ June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
10
+ St, Fifth Floor, Boston, MA 02110, USA
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
16
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
+ */
23
+
24
+ /**
25
+ * Template for WPFront User Role Editor List Roles
26
+ *
27
+ * @author Syam Mohan <syam@wpfront.com>
28
+ * @copyright 2014 WPFront.com
29
+ */
30
+ ?>
31
+
32
+ <?php $this->main->verify_nonce(); ?>
33
+
34
+ <div class="wrap assign-roles">
35
+ <h2 id="assign-roles">
36
+ <?php echo $this->__('Assign Roles'); ?>
37
+ </h2>
38
+
39
+ <?php
40
+ if ($this->result != NULL) {
41
+ if ($this->result->success) {
42
+ ?>
43
+ <div class="updated">
44
+ <p><?php echo $this->result->message; ?></p>
45
+ </div>
46
+ <?php } else { ?>
47
+
48
+ <div class="error">
49
+ <p><?php echo $this->result->message; ?></p>
50
+ </div>
51
+ <?php
52
+ }
53
+ }
54
+ ?>
55
+
56
+ <form method="POST">
57
+ <?php $this->main->create_nonce(); ?>
58
+ <table class="form-table">
59
+ <tbody>
60
+ <tr>
61
+ <th scope="row">
62
+ <?php echo $this->__('User'); ?>
63
+ </th>
64
+ <td>
65
+ <select id="assign_users_list" name="assign-user">
66
+ <?php
67
+ foreach ($this->users as $user) {
68
+ $select = FALSE;
69
+ if ($this->user != NULL && $this->user->ID == $user->ID)
70
+ $select = TRUE;
71
+ ?>
72
+ <option <?php echo $select ? 'selected' : ''; ?> value="<?php echo $user->ID; ?>">
73
+ <?php echo $user->display_name . ' [' . $user->user_login . ']' ; ?>
74
+ </option>
75
+ <?php
76
+ }
77
+ ?>
78
+ </select>
79
+ </td>
80
+ </tr>
81
+
82
+ <?php $this->primary_secondary_section('assign', $this->userPrimaryRole, $this->userSecondaryRoles); ?>
83
+
84
+ </tbody>
85
+ </table>
86
+
87
+ <p class="submit">
88
+ <input type="submit" name="assignroles" id="assignroles" class="button button-primary" value="<?php echo $this->__('Assign Roles'); ?>" />
89
+ </p>
90
+ </form>
91
+
92
+ <h2 id="migrate-users">
93
+ <?php echo $this->__('Migrate Users'); ?>
94
+ </h2>
95
+
96
+ <form method="POST">
97
+ <?php $this->main->create_nonce(); ?>
98
+
99
+ <table class="form-table">
100
+ <tbody>
101
+ <tr>
102
+ <th scope="row">
103
+ <?php echo $this->__('From Primary Role'); ?>
104
+ </th>
105
+ <td>
106
+ <select id="migrate_from_role" name="migrate-from-primary-role">
107
+ <?php
108
+ foreach ($this->primary_roles as $key => $role) {
109
+ ?>
110
+ <option value="<?php echo $key; ?>" <?php echo $this->migrateFromPrimaryRole === $key ? 'selected' : ''; ?>>
111
+ <?php echo $role; ?>
112
+ </option>
113
+ <?php
114
+ }
115
+ ?>
116
+ </select>
117
+ </td>
118
+ </tr>
119
+
120
+ <?php $this->primary_secondary_section('migrate', $this->migrateToPrimaryRole, $this->migrateToSecondaryRoles); ?>
121
+
122
+ </tbody>
123
+ </table>
124
+
125
+ <p class="submit">
126
+ <input type="submit" name="migrateroles" id="migrateroles" class="button button-primary" value="<?php echo $this->__('Migrate Users'); ?>" />
127
+ </p>
128
+ </form>
129
+
130
+ </div>
131
+
132
+ <script type="text/javascript">
133
+
134
+ (function($) {
135
+
136
+ var page_url = '<?php echo $this->get_assign_role_url(); ?>';
137
+
138
+ $('#assign_users_list').change(function() {
139
+ window.location.replace(page_url + $(this).val());
140
+ });
141
+
142
+ $('#assign_roles_list, #migrate_roles_list').change(function() {
143
+ var $this = $(this);
144
+ if ($this.val() == '') {
145
+ $this.closest('table').find('div.role-list-item input').prop('disabled', true);
146
+ }
147
+ else {
148
+ $this.closest('table').find('div.role-list-item input').prop('disabled', false);
149
+ }
150
+ }).change();
151
+
152
+ })(jQuery);
153
+
154
+ </script>
templates/go-pro-table ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style type="text/css">
2
+
3
+ div.wrap.go-pro div.container:before,
4
+ div.wrap.go-pro div.container:after {
5
+ content:"";
6
+ display:table;
7
+ }
8
+ div.wrap.go-pro div.container:after {
9
+ clear:both;
10
+ }
11
+ div.wrap.go-pro div.container {
12
+ zoom:1; /* For IE 6/7 (trigger hasLayout) */
13
+ }
14
+
15
+ div.wrap.go-pro {
16
+ /* text-align: center;*/
17
+ /* background: #FFF;*/
18
+ /* padding-top: 1%;
19
+ padding-bottom: 1%;*/
20
+ }
21
+
22
+ div.wrap.go-pro div.container {
23
+ text-align: center;
24
+ display: inline-block;
25
+ }
26
+
27
+ div.wrap.go-pro div.container div.col {
28
+ float: left;
29
+ width: 200px;
30
+ background-color: #FFF;
31
+ /* box-shadow: 1px 1px 15px 0px rgba(50, 50, 50, 0.75);*/
32
+ margin-right: 1px;
33
+ }
34
+
35
+ div.wrap.go-pro div.container div.cell {
36
+ height: 40px;
37
+ padding: 10px 10px 0px 10px;
38
+ text-align: center;
39
+ border: 1px solid #fafafa;
40
+ }
41
+
42
+ div.wrap.go-pro div.container div.header.cell {
43
+ background-color: #2ea2cc;
44
+ height: auto;
45
+ padding-top: 5px;
46
+ padding-bottom: 5px;
47
+ border-radius: 3px 3px 0px 0px;
48
+ border: 0px;
49
+ }
50
+
51
+ div.wrap.go-pro div.container div.header.cell h3 {
52
+ color: #FFF;
53
+ }
54
+
55
+ </style>
56
+
57
+ <div class="container">
58
+ <div class="col col1">
59
+ <div class="cell header">
60
+ <h3>Free Version</h3>
61
+ </div>
62
+ <div class="cell">
63
+ Add/Edit/Delete
64
+ </div>
65
+ <div class="cell">
66
+ Restore Roles
67
+ </div>
68
+ <div class="cell">
69
+ Assign/Migrate Users
70
+ </div>
71
+ <div class="cell">
72
+ <i class="fa fa-times"></i>
73
+ </div>
74
+ <div class="cell">
75
+ <i class="fa fa-times"></i>
76
+ </div>
77
+ <div class="cell">
78
+ <i class="fa fa-times"></i>
79
+ </div>
80
+ <div class="cell">
81
+ <i class="fa fa-times"></i>
82
+ </div>
83
+ <div class="cell">
84
+ <i class="fa fa-times"></i>
85
+ </div>
86
+ <div class="cell">
87
+ &nbsp;
88
+ </div>
89
+ </div>
90
+ <div class="col col2">
91
+ <div class="cell header">
92
+ <h3>Personal Pro</h3>
93
+ </div>
94
+ <div class="cell">
95
+ Add/Edit/Delete
96
+ </div>
97
+ <div class="cell">
98
+ Restore Roles
99
+ </div>
100
+ <div class="cell">
101
+ Assign/Migrate Users
102
+ </div>
103
+ <div class="cell">
104
+ Import/Export
105
+ </div>
106
+ <div class="cell">
107
+ Menu Editor
108
+ </div>
109
+ <div class="cell">
110
+ Posts/Pages Extended Permissions
111
+ </div>
112
+ <div class="cell">
113
+ <i class="fa fa-times"></i>
114
+ </div>
115
+ <div class="cell">
116
+ Private Forums & Updates for One Year
117
+ </div>
118
+ <div class="cell footer">
119
+ <a class="button-primary" href="https://wpfront.com/ppro" target="_blank">
120
+ <i class="fa fa-shopping-cart"></i>
121
+ Buy Now
122
+ </a>
123
+ </div>
124
+ </div>
125
+ <div class="col col3">
126
+ <div class="cell header">
127
+ <h3>Business Pro</h3>
128
+ </div>
129
+ <div class="cell">
130
+ Add/Edit/Delete
131
+ </div>
132
+ <div class="cell">
133
+ Restore Roles
134
+ </div>
135
+ <div class="cell">
136
+ Assign/Migrate Users
137
+ </div>
138
+ <div class="cell">
139
+ Import/Export
140
+ </div>
141
+ <div class="cell">
142
+ Menu Editor
143
+ </div>
144
+ <div class="cell">
145
+ Posts/Pages Extended Permissions
146
+ </div>
147
+ <div class="cell">
148
+ Multisite Support
149
+ </div>
150
+ <div class="cell">
151
+ Private Forums & Updates for One Year
152
+ </div>
153
+ <div class="cell footer">
154
+ <a class="button-primary" href="https://wpfront.com/bpro" target="_blank">
155
+ <i class="fa fa-shopping-cart"></i>
156
+ Buy Now
157
+ </a>
158
+ </div>
159
+ </div>
160
+ <img src="https://wpfront.com/uret" style="width:1px;height:1px;" />
161
+ </div>
templates/go-pro.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ WPFront User Role Editor Plugin
4
+ Copyright (C) 2014, WPFront.com
5
+ Website: wpfront.com
6
+ Contact: syam@wpfront.com
7
+
8
+ WPFront User Role Editor Plugin is distributed under the GNU General Public License, Version 3,
9
+ June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
10
+ St, Fifth Floor, Boston, MA 02110, USA
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
16
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
17
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
18
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
+ */
23
+
24
+ /**
25
+ * Template for WPFront User Role Editor Go Pro
26
+ *
27
+ * @author Syam Mohan <syam@wpfront.com>
28
+ * @copyright 2014 WPFront.com
29
+ */
30
+ ?>
31
+
32
+ <div class="wrap go-pro">
33
+ <h2>
34
+ <?php
35
+ if ($this->product === NULL)
36
+ echo $this->__('WPFront User Role Editor Pro');
37
+ else
38
+ echo $this->__($this->product);
39
+ ?>
40
+ </h2>
41
+
42
+ <?php if ($this->error !== NULL) { ?>
43
+ <div class="error below-h2">
44
+ <p>
45
+ <?php echo $this->error; ?>
46
+ </p>
47
+ </div>
48
+ <?php } ?>
49
+
50
+ <?php if ($this->need_license) { ?>
51
+ <div class="license-container">
52
+ <form id="license-form" method="POST">
53
+ <?php $this->main->create_nonce(); ?>
54
+ <table class="form-table">
55
+ <tbody>
56
+ <tr class="form-required">
57
+ <th scope="row">
58
+ <label for="license_key">
59
+ <?php echo $this->__('License Key'); ?>
60
+ </label>
61
+ </th>
62
+ <td>
63
+ <input name="license_key" type="text" id="license_key" class="regular-text" value="<?php echo $this->license_key; ?>" aria-required="true" <?php echo $this->has_license ? 'disabled' : ''; ?> />
64
+ <?php if (!$this->has_license) { ?>
65
+ <input type="hidden" name="activate" value="<?php echo $this->__('Activate'); ?>" />
66
+ <input type="submit" class="button-secondary" value="<?php echo $this->__('Activate'); ?>" />
67
+ <?php } else { ?>
68
+ <input type="hidden" name="deactivate" value="<?php echo $this->__('Deactivate'); ?>" />
69
+ <input type="submit" class="button-secondary" value="<?php echo $this->__('Deactivate'); ?>" />
70
+ <?php } ?>
71
+ </td>
72
+ </tr>
73
+ <?php if ($this->has_license) { ?>
74
+ <tr>
75
+ <th scope="row">
76
+ <?php echo $this->__('License Expires'); ?>
77
+ </th>
78
+ <td class="<?php echo $this->license_expired ? 'expired' : ''; ?>">
79
+ <?php echo $this->license_expires; ?>
80
+ </td>
81
+ </tr>
82
+ <?php } ?>
83
+ </tbody>
84
+ </table>
85
+ </form>
86
+ </div>
87
+
88
+ <script type="text/javascript">
89
+ (function($) {
90
+ var noblock = false;
91
+ var $form = $('#license-form').submit(function() {
92
+ if (noblock)
93
+ return;
94
+
95
+ var data = {
96
+ "action": "wpfront_user_role_editor_license_functions"
97
+ };
98
+
99
+ $(this).find("input").prop('disabled', true).each(function() {
100
+ var $input = $(this);
101
+ data[$input.attr('name')] = $input.val();
102
+ });
103
+
104
+ $.post(ajaxurl, data, function(response) {
105
+ if (response)
106
+ window.location.replace(window.location.href);
107
+ else {
108
+ noblock = true;
109
+ $form.find("input").prop('disabled', false);
110
+ $form.submit();
111
+ }
112
+ }, 'json');
113
+
114
+ return false;
115
+ });
116
+ })(jQuery);
117
+ </script>
118
+ <?php } ?>
119
+
120
+ <div>
121
+ <p></p>
122
+ <?php echo $this->pro_html; ?>
123
+ </div>
124
+
125
+ </div>
templates/list-roles.php CHANGED
@@ -60,7 +60,7 @@
60
  <?php $this->main->create_nonce(); ?>
61
  <p class = "search-box">
62
  <label class = "screen-reader-text" for = "role-search-input"><?php echo $this->__('Search Roles') . ':'; ?></label>
63
- <input type="search" id="role-search-input" name="search" value="<?php echo $this->get_search_term(); ?>">
64
  <input type="submit" name="search-submit" id="search-submit" class="button" value="<?php echo $this->__('Search Roles'); ?>">
65
  </p>
66
  <?php $this->bulk_actions('top'); ?>
@@ -100,9 +100,13 @@
100
  if ($this->can_delete() && $value['is_deletable']) {
101
  $links[] = sprintf('<span class="delete"><a href="%s">%s</a></span>', $value['delete_url'], $this->__('Delete'));
102
  }
103
- if(!empty($value['set_default_url'])) {
104
  $links[] = sprintf('<span class="set-default"><a href="%s">%s</a></span>', $value['set_default_url'], $this->__('Default'));
105
  }
 
 
 
 
106
  echo implode('|', $links);
107
  ?>
108
  </div>
@@ -126,6 +130,13 @@
126
  <td class="capscount column-capscount num">
127
  <?php echo $value['caps_count']; ?>
128
  </td>
 
 
 
 
 
 
 
129
  </tr>
130
  <?php
131
  $index++;
60
  <?php $this->main->create_nonce(); ?>
61
  <p class = "search-box">
62
  <label class = "screen-reader-text" for = "role-search-input"><?php echo $this->__('Search Roles') . ':'; ?></label>
63
+ <input type="search" id="role-search-input" name="s" value="<?php echo $this->get_search_term(); ?>">
64
  <input type="submit" name="search-submit" id="search-submit" class="button" value="<?php echo $this->__('Search Roles'); ?>">
65
  </p>
66
  <?php $this->bulk_actions('top'); ?>
100
  if ($this->can_delete() && $value['is_deletable']) {
101
  $links[] = sprintf('<span class="delete"><a href="%s">%s</a></span>', $value['delete_url'], $this->__('Delete'));
102
  }
103
+ if (!empty($value['set_default_url'])) {
104
  $links[] = sprintf('<span class="set-default"><a href="%s">%s</a></span>', $value['set_default_url'], $this->__('Default'));
105
  }
106
+ $custom_links = apply_filters('role_row_actions', array(), get_role($key));
107
+ foreach ($custom_links as $link_key => $link_value) {
108
+ $links[] = "<span class='$link_key'>$link_value</span>";
109
+ }
110
  echo implode('|', $links);
111
  ?>
112
  </div>
130
  <td class="capscount column-capscount num">
131
  <?php echo $value['caps_count']; ?>
132
  </td>
133
+ <?php
134
+ foreach ($this->custom_columns as $column_key => $column_value) {
135
+ echo "<td class='$column_key column-$column_key num'>"
136
+ . apply_filters('manage_roles_custom_column', $column_value, $column_key, $key)
137
+ . "</td>";
138
+ }
139
+ ?>
140
  </tr>
141
  <?php
142
  $index++;
templates/options-template.php CHANGED
@@ -29,39 +29,67 @@
29
  */
30
  ?>
31
 
32
- <?php @$this->options_page_header($this->__('WPFront User Role Editor Settings'), WPFront_User_Role_Editor::OPTIONS_GROUP_NAME); ?>
33
 
34
  <table class="form-table">
 
 
 
 
 
 
 
 
 
 
 
 
35
  <tr>
36
  <th scope="row">
37
- <?php echo $this->options->display_deprecated_label(); ?>
38
  </th>
39
  <td>
40
- <input type="checkbox" name="<?php echo $this->options->display_deprecated_name(); ?>" <?php echo $this->options->display_deprecated() ? 'checked' : ''; ?> />
41
  </td>
42
  </tr>
43
  <tr>
44
  <th scope="row">
45
- <?php echo $this->options->enable_role_capabilities_label(); ?>
46
  </th>
47
  <td>
48
- <input type="checkbox" name="<?php echo $this->options->enable_role_capabilities_name(); ?>" <?php echo $this->options->enable_role_capabilities() ? 'checked' : ''; ?> />
49
  </td>
50
  </tr>
51
  <tr>
52
  <th scope="row">
53
- <?php echo $this->options->remove_nonstandard_capabilities_restore_label(); ?>
54
  </th>
55
  <td>
56
- <input type="checkbox" name="<?php echo $this->options->remove_nonstandard_capabilities_restore_name(); ?>" <?php echo $this->options->remove_nonstandard_capabilities_restore() ? 'checked' : ''; ?> />
57
  </td>
58
  </tr>
 
 
 
 
 
 
 
 
 
 
59
  </table>
60
 
61
  <input type="hidden" name="nonce" value="<?php echo wp_create_nonce($_SERVER['REQUEST_URI']); ?>" />
62
  <input type="hidden" name="referer" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
63
 
64
- <?php @$this->options_page_footer('user-role-editor-plugin-settings/', 'user-role-editor-plugin-faq/'); ?>
 
 
 
 
 
 
65
 
66
  <script type="text/javascript">
67
  (function($) {
@@ -73,9 +101,7 @@
73
  fields.each(function(i, e) {
74
  var ele = $(e);
75
  if (ele.attr("type") == "checkbox") {
76
- if (ele.prop("checked")) {
77
- data[ele.attr("name")] = "on";
78
- }
79
  }
80
  else
81
  data[ele.attr("name")] = ele.val();
29
  */
30
  ?>
31
 
32
+ <?php @$this->main->options_page_header($this->__('WPFront User Role Editor Settings')); ?>
33
 
34
  <table class="form-table">
35
+ <?php
36
+ if ($this->multisite && wp_is_large_network()) {
37
+ ?>
38
+ <tr>
39
+ <th scope="row">
40
+ <?php echo $this->__('Enable Large Network Functionalities'); ?>
41
+ </th>
42
+ <td>
43
+ <input type="checkbox" name="enable_large_network_functionalities" <?php echo $this->ms_enable_large_network_functionalities() ? 'checked' : ''; ?> />
44
+ </td>
45
+ </tr>
46
+ <?php } ?>
47
  <tr>
48
  <th scope="row">
49
+ <?php echo $this->__('Display Deprecated Capabilities'); ?>
50
  </th>
51
  <td>
52
+ <input type="checkbox" name="display_deprecated" <?php echo $this->display_deprecated() ? 'checked' : ''; ?> />
53
  </td>
54
  </tr>
55
  <tr>
56
  <th scope="row">
57
+ <?php echo $this->__('Remove Non-Standard Capabilities on Restore'); ?>
58
  </th>
59
  <td>
60
+ <input type="checkbox" name="remove_nonstandard_capabilities_restore" <?php echo $this->remove_nonstandard_capabilities_restore() ? 'checked' : ''; ?> />
61
  </td>
62
  </tr>
63
  <tr>
64
  <th scope="row">
65
+ <?php echo $this->__('Override Edit Permissions'); ?>
66
  </th>
67
  <td>
68
+ <input type="checkbox" name="override_edit_permissions" <?php echo $this->override_edit_permissions() ? 'checked' : ''; ?> />
69
  </td>
70
  </tr>
71
+ <?php if ($this->main->enable_multisite_only_options($this->multisite)) { ?>
72
+ <tr>
73
+ <th scope="row">
74
+ <?php echo $this->__('Remove Data on Uninstall'); ?>
75
+ </th>
76
+ <td>
77
+ <input type="checkbox" name="remove_data_on_uninstall" <?php echo $this->remove_data_on_uninstall() ? 'checked' : ''; ?> />
78
+ </td>
79
+ </tr>
80
+ <?php } ?>
81
  </table>
82
 
83
  <input type="hidden" name="nonce" value="<?php echo wp_create_nonce($_SERVER['REQUEST_URI']); ?>" />
84
  <input type="hidden" name="referer" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
85
 
86
+ <?php if ($this->multisite) {
87
+ ?>
88
+ <input type="hidden" name="multisite" value="true" />
89
+ <?php }
90
+ ?>
91
+
92
+ <?php @$this->main->options_page_footer('user-role-editor-plugin-settings/', 'user-role-editor-plugin-faq/'); ?>
93
 
94
  <script type="text/javascript">
95
  (function($) {
101
  fields.each(function(i, e) {
102
  var ele = $(e);
103
  if (ele.attr("type") == "checkbox") {
104
+ data[ele.attr("name")] = ele.prop("checked");
 
 
105
  }
106
  else
107
  data[ele.attr("name")] = ele.val();
templates/restore-role.php CHANGED
@@ -77,20 +77,41 @@
77
  });
78
 
79
  $('button.restore-role-confirm').click(function() {
 
 
80
  var _this = $(this).parent().hide().next().show();
81
 
82
  var data = {
83
  "action": "wpfront_user_role_editor_restore_role",
84
- "role": $(this).val()
 
 
85
  };
86
 
87
- $.post(ajaxurl, data, function(response) {
 
 
 
 
 
 
 
 
 
 
 
88
  _this.hide();
89
  if (response.result)
90
  _this.next().show();
91
  else
92
  _this.next().text(response.message).css('color', 'Red').show();
93
- }, 'json');
 
 
 
 
 
 
94
  });
95
  })(jQuery);
96
  </script>
77
  });
78
 
79
  $('button.restore-role-confirm').click(function() {
80
+ $('button.restore-role-confirm').prop('disabled', true);
81
+
82
  var _this = $(this).parent().hide().next().show();
83
 
84
  var data = {
85
  "action": "wpfront_user_role_editor_restore_role",
86
+ "role": $(this).val(),
87
+ "referer": <?php echo json_encode($_SERVER['REQUEST_URI']); ?>,
88
+ "nonce": <?php echo json_encode(wp_create_nonce($_SERVER['REQUEST_URI'])); ?>
89
  };
90
 
91
+ <?php
92
+ if ($this->multisite) {
93
+ ?>
94
+ data["multisite"] = true;
95
+ <?php
96
+ }
97
+ ?>
98
+
99
+ var response_process = function(response) {
100
+ if (typeof response === 'undefined' || response == null) {
101
+ response = {'result': false, 'message': <?php echo json_encode($this->__('Unexpected error / Timed out')); ?>};
102
+ }
103
  _this.hide();
104
  if (response.result)
105
  _this.next().show();
106
  else
107
  _this.next().text(response.message).css('color', 'Red').show();
108
+
109
+ $('button.restore-role-confirm').prop('disabled', false);
110
+ };
111
+
112
+ $.post(ajaxurl, data, response_process, 'json').fail(function() {
113
+ response_process();
114
+ });
115
  });
116
  })(jQuery);
117
  </script>
uninstall.php CHANGED
@@ -4,11 +4,37 @@ if (!defined('WP_UNINSTALL_PLUGIN')) {
4
  exit();
5
  }
6
 
7
- $option_name = 'wpfront-user-role-editor-options';
8
 
9
- delete_option($option_name);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
- //TODO: Multisite delete
12
- //http://codex.wordpress.org/Function_Reference/register_uninstall_hook
13
- //http://wordpress.org/support/topic/how-can-i-remove-an-option-from-all-option-tables-in-multisite
14
 
4
  exit();
5
  }
6
 
7
+ require_once dirname(__FILE__) . '/classes/class-wpfront-user-role-editor.php';
8
 
9
+ if (is_multisite() && class_exists('WPFront_User_Role_Editor_Business_Pro_Controller_Base')) {
10
+ $entity = new WPFront_User_Role_Editor_Business_Pro_Controller_Base(NULL);
11
+ $blogids = $entity->get_ms_blog_ids();
12
+
13
+ switch_to_blog(WPFront_User_Role_Editor_Options::get_ms_options_blog_id());
14
+ $entity = new WPFront_User_Role_Editor_Options(NULL);
15
+ if ($entity->remove_data_on_uninstall()) {
16
+ foreach ($blogids as $blogid) {
17
+ switch_to_blog($blogid);
18
+
19
+ WPFront_User_Role_Editor_Entity_Options::uninstall();
20
+ WPFront_User_Role_Editor_Entity_Menu_Editor::uninstall();
21
+ WPFront_User_Role_Editor_Entity_Post_Type_Permissions::uninstall();
22
+ }
23
+ }
24
+
25
+ restore_current_blog();
26
+ } else {
27
+ $entity = new WPFront_User_Role_Editor_Options(NULL);
28
+ if ($entity->remove_data_on_uninstall()) {
29
+ if (class_exists('WPFront_User_Role_Editor_Entity_Options'))
30
+ WPFront_User_Role_Editor_Entity_Options::uninstall();
31
+
32
+ if (class_exists('WPFront_User_Role_Editor_Entity_Menu_Editor'))
33
+ WPFront_User_Role_Editor_Entity_Menu_Editor::uninstall();
34
+
35
+ if (class_exists('WPFront_User_Role_Editor_Entity_Post_Type_Permissions'))
36
+ WPFront_User_Role_Editor_Entity_Post_Type_Permissions::uninstall();
37
+ }
38
+ }
39
 
 
 
 
40
 
wpfront-user-role-editor.php CHANGED
@@ -1,25 +1,26 @@
1
  <?php
 
2
  /*
3
  * Plugin Name: WPFront User Role Editor
4
- * Plugin URI: http://wpfront.com/user-role-editor-plugin/
5
  * Description: Allows you to manage user roles.
6
- * Version: 1.2
7
  * Author: Syam Mohan
8
  * Author URI: http://wpfront.com
9
  * License: GPL v3
10
  * Text Domain: wpfront-user-role-editor
11
- */
12
 
13
  /*
14
  WPFront User Role Editor Plugin
15
  Copyright (C) 2014, WPFront.com
16
- Website: wpfront.com
17
  Contact: syam@wpfront.com
18
 
19
  WPFront User Role Editor Plugin is distributed under the GNU General Public License, Version 3,
20
  June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
21
  St, Fifth Floor, Boston, MA 02110, USA
22
-
23
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -30,9 +31,10 @@
30
  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
- */
 
34
 
 
35
 
36
- require_once("classes/class-wpfront-user-role-editor.php");
37
 
38
- new WPFront_User_Role_Editor();
1
  <?php
2
+
3
  /*
4
  * Plugin Name: WPFront User Role Editor
5
+ * Plugin URI: http://wpfront.com/user-role-editor-pro/
6
  * Description: Allows you to manage user roles.
7
+ * Version: 2.0
8
  * Author: Syam Mohan
9
  * Author URI: http://wpfront.com
10
  * License: GPL v3
11
  * Text Domain: wpfront-user-role-editor
12
+ */
13
 
14
  /*
15
  WPFront User Role Editor Plugin
16
  Copyright (C) 2014, WPFront.com
17
+ Website: wpfront.com
18
  Contact: syam@wpfront.com
19
 
20
  WPFront User Role Editor Plugin is distributed under the GNU General Public License, Version 3,
21
  June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
22
  St, Fifth Floor, Boston, MA 02110, USA
23
+
24
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31
  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ */
35
+
36
 
37
+ require_once(plugin_dir_path(__FILE__) . "classes/class-wpfront-user-role-editor.php");
38
 
39
+ WPFront_User_Role_Editor::Instanciate(__FILE__);
40