PluginProbe
RSFirewall! / trunk
RSFirewall! vtrunk
rsfirewall / models / ignored.php

ignored.php in RSFirewall! trunk, at models/ignored.php

46 lines 995 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package RSFirewall!
4 * @copyright (c) 2018 RSJoomla!
5 * @link https://www.rsjoomla.com
6 * @license GNU General Public License http://www.gnu.org/licenses/gpl-3.0.en.html
7 */
8
9 if ( ! defined( 'WPINC' ) ) {
10 die;
11 }
12
13 class RSFirewall_Model_Ignored extends RSFirewall_Model
14 {
15 public function get_files()
16 {
17 global $wpdb;
18 $wpdb->show_errors();
19 $table = $wpdb->prefix . 'rsfirewall_hashes';
20
21 $results = $wpdb->get_results(
22 "SELECT *
23 FROM $table
24 WHERE `type` = 'ignore'
25 ",
26 OBJECT
27 );
28
29 return $results;
30 }
31
32 public function remove($id)
33 {
34 global $wpdb;
35 $table = $wpdb->prefix . 'rsfirewall_hashes';
36
37 $result = $wpdb->delete($table, array('id' => $id));
38
39 if (is_bool($result) && !$result) {
40 throw new Exception ( esc_html__( 'The file could not be removed!', 'rsfirewall' ) );
41 }
42
43 return $result;
44
45 }
46 }