This repository has been archived by the owner on Aug 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
73 lines (58 loc) · 1.58 KB
/
settings.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
namespace AD_B2C_Auth;
class Settings
{
private const RESPONSE_TYPE = 'id_token';
private const RESPONSE_MODE = 'form_post';
private const SCOPE = 'openid';
private $options;
public static function getInstance()
{
static $inst = null;
if ($inst === null) {
$inst = new self();
}
return $inst;
}
function __construct()
{
$this->options = get_option( SettingsPage::OPTION_NAME );
}
public function getResponseType() : string
{
return self::RESPONSE_TYPE;
}
public function getResponseMode() : string
{
return self::RESPONSE_MODE;
}
public function getScope() : string
{
return self::SCOPE;
}
public function getTenantName() : string
{
return $this->getOption('tenant_name', 'exampletenantname.com');
}
public function getSignInSignUpPolicyName() : string
{
return $this->getOption('signin_signup_policy_name', 'example_policy_name');
}
public function getPasswordResetPolicyName() : string
{
return $this->getOption('password_reset_policy_name', 'example_policy_name');
}
public function getClientId() : string
{
return $this->getOption('client_id', 'example_client_id');
}
public function getNonceSecret() : string
{
return $this->getOption('nonce_secret', 'xxxxxxxxxxx');
}
private function getOption($field_id, $default_value)
{
return isset($this->options[$field_id]) ? $this->options[$field_id] : $default_value;
}
}
?>