PluginProbe
WebTotem Security / 2.2.4
WebTotem Security v2.2.4
3.0.1 3.0.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.1 2.2.2 2.2.3 2.2.4 All 109 releases
wt-security / library / App.php

App.php in WebTotem Security 2.2.4, at library/App.php

69 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php defined('ABSPATH') or die("Protected By WT!");
2
3
4 class WTSEC_LIBRARY_App
5 {
6
7 public function __construct()
8 {
9 $this->auth();
10 }
11
12 public function auth(){
13 if(self::getOption('authorized') === false){
14 wp_safe_redirect(wtsec_getUrl('login'));
15 exit;
16 }
17 }
18
19 public static function authorized(){
20 return (boolean) self::getOption('authorized');
21 }
22
23 public static function login($token){
24 self::_set('authorized', true);
25 self::_set('authToken', $token);
26 }
27
28 public static function logout(){
29 self::_set('authorized', false);
30 self::_set('authToken', "");
31 self::_set('am_installed', false);
32 }
33
34 public function getLocalDomains(){
35 return [];
36 }
37
38 public static function _set($name,$value){
39 return update_option(WTSEC_PLUGIN_PREFIX.$name,$value);
40 }
41
42 public static function _get($name){
43 return get_option(WTSEC_PLUGIN_PREFIX.$name);
44 }
45
46 public function set($name,$value){
47 return update_option(WTSEC_PLUGIN_PREFIX.$name,$value);
48 }
49
50 public function get($name){
51 return get_option(WTSEC_PLUGIN_PREFIX.$name);
52 }
53
54 public static function getOption($name){
55 return get_option(WTSEC_PLUGIN_PREFIX.$name);
56 }
57
58 public static function deleteOption($name){
59 return delete_option(WTSEC_PLUGIN_PREFIX.$name);
60 }
61
62 public static function getToken(){
63 return self::getOption('authToken');
64 }
65
66 public static function getName(){
67 return self::getOption('username');
68 }
69 }