Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
WP Plugins
Authy for WP
Commits
6ee12fa0
Commit
6ee12fa0
authored
Dec 01, 2012
by
Erick Hitter
Browse files
Track environment so keys can be stored separately.
parent
736360fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
authy-wp.php
View file @
6ee12fa0
...
...
@@ -36,6 +36,7 @@ class Authy_WP {
protected
$api
=
null
;
protected
$api_key
=
null
;
protected
$api_endpoint
=
null
;
protected
$environment
=
'production'
;
// Commong plugin elements
protected
$settings_page
=
'authy-for-wp'
;
...
...
@@ -134,13 +135,13 @@ class Authy_WP {
'development'
=>
'http://sandbox-api.authy.com'
);
$environment
=
$this
->
get_setting
(
'environment'
);
$
this
->
environment
=
$this
->
get_setting
(
'environment'
);
$api_key
=
$this
->
get_setting
(
'api_key_'
.
$environment
);
$api_key
=
$this
->
get_setting
(
'api_key_'
.
$
this
->
environment
);
if
(
$api_key
&&
isset
(
$endpoints
[
$environment
]
)
)
{
if
(
$api_key
&&
isset
(
$endpoints
[
$
this
->
environment
]
)
)
{
$this
->
api_key
=
$api_key
;
$this
->
api_endpoint
=
$endpoints
[
$environment
];
$this
->
api_endpoint
=
$endpoints
[
$
this
->
environment
];
}
$this
->
api
=
Authy_WP_API
::
instance
(
$this
->
api_key
,
$this
->
api_endpoint
);
...
...
@@ -176,7 +177,7 @@ class Authy_WP {
$this
->
settings
=
wp_parse_args
(
$this
->
settings
,
array
(
'api_key_production'
=>
''
,
'api_key_development'
=>
''
,
'environment'
=>
'development'
'environment'
=>
apply_filters
(
'authy_wp_environment'
,
'production'
)
)
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment