PluginProbe
WP Directory Kit / 1.5.9
WP Directory Kit v1.5.9
1.5.9 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 All 37 releases
← All changes | application/controllers/Wdk_fields.php +9 -2 1.5.5 → 1.5.9 View file →
@@ -3,13 +3,20 @@
3 3
4 4 class Wdk_fields extends Winter_MVC_Controller {
5 5
6 6 public function __construct(){
7 +
8 + if ( ! current_user_can('administrator') ) {
9 + wp_die( esc_html__('You do not have sufficient permissions to access this page.','wpdirectorykit') );
10 + }
11 +
7 12 parent::__construct();
8 13 }
9 14
10 15 public function index()
11 16 {
17 +
18 +
12 19 $this->load->model('field_m');
13 20
14 21 $this->data['fields'] = $this->field_m->get();
15 22
@@ -207,14 +214,14 @@
207 214 foreach( $this->data['fields_tree'] as $key_section => $section)
208 215 {
209 216 if(empty($key_section)) continue;
210 217
211 - $values[] = array('order_index' => $order_index, 'idfield' => $key_section);
218 + $values[] = array('order_index' => $order_index, 'idfield' => (int) $key_section);
212 219 $order_index++;
213 220 if(is_array($section))
214 221 foreach($section as $key_field => $field)
215 222 {
216 - $values[] = array('order_index' => $order_index, 'idfield' => $key_field);
223 + $values[] = array('order_index' => $order_index, 'idfield' => (int) $key_field);
217 224 $order_index++;
218 225 }
219 226 }
220 227 $this->db->updateBatch( $this->field_m->_table_name, $values, 'idfield');