-
Notifications
You must be signed in to change notification settings - Fork 0
/
grantedbyme.options.php
41 lines (39 loc) · 1014 Bytes
/
grantedbyme.options.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* GrantedByMe WordPress Options helper
*
* PHP version 5
*
* @category PlugIn
* @package GBM
* @author GrantedByMe <info@grantedby.me>
* @access private
* @license https://grantedby.me/licenses/php/license.md MIT
* @version Release: <release_id>
* @link https://grantedby.me
*/
class GrantedByMeOptions
{
/**
* Constructor
*/
function __construct()
{
}
/**
* @return bool
*/
public static function gbm_is_current_account_linked()
{
$options = get_option('grantedbyme_option_name');
$current_user_id = get_current_user_id();
if ($current_user_id == 0) {
return false;
}
if(!isset($options['users']) || !isset($options['users'][$current_user_id])) {
return false;
}
$authenticator_secret = $options['users'][$current_user_id];
return isset($authenticator_secret) && !empty($authenticator_secret) && strlen($authenticator_secret) >= 128;
}
}