Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
operate-php
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
examples
operate-php
Commits
87b36213
Commit
87b36213
authored
Jun 12, 2018
by
Tariq Khan
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Occupie variable
parent
a7d4e5f5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
oauth2.php
oauth2.php
+5
-5
No files found.
oauth2.php
View file @
87b36213
<?php
<?php
class
Oauth2
{
class
Oauth2
{
private
$o
ccupi
eUrl
=
false
;
private
$o
perat
eUrl
=
false
;
private
$client
=
false
;
private
$client
=
false
;
private
$clientSecret
=
false
;
private
$clientSecret
=
false
;
private
$scope
=
false
;
private
$scope
=
false
;
...
@@ -107,7 +107,7 @@ class Oauth2 {
...
@@ -107,7 +107,7 @@ class Oauth2 {
'Accept: application/json'
'Accept: application/json'
)
)
);
);
$response
=
$this
->
httpRequest
(
$this
->
o
ccupi
eUrl
.
'/api/1.0/'
.
$endpoint
,
$options
,
$responseHeaders
);
$response
=
$this
->
httpRequest
(
$this
->
o
perat
eUrl
.
'/api/1.0/'
.
$endpoint
,
$options
,
$responseHeaders
);
highlight_string
(
"<?php
\n
"
.
var_export
(
$response
?
$response
->
response
:
$responseHeaders
,
true
)
.
";
\n
?>"
);
highlight_string
(
"<?php
\n
"
.
var_export
(
$response
?
$response
->
response
:
$responseHeaders
,
true
)
.
";
\n
?>"
);
}
}
private
function
fetchAllDevices
()
{
private
function
fetchAllDevices
()
{
...
@@ -198,13 +198,13 @@ class Oauth2 {
...
@@ -198,13 +198,13 @@ class Oauth2 {
return
$raw
?
$content
:
json_decode
(
$content
);
return
$raw
?
$content
:
json_decode
(
$content
);
}
}
private
function
getTokenEndpoint
()
{
private
function
getTokenEndpoint
()
{
return
$this
->
o
ccupi
eUrl
.
'/oauth2/token'
;
return
$this
->
o
perat
eUrl
.
'/oauth2/token'
;
}
}
private
function
getTrackingDeviceApiUri
()
{
private
function
getTrackingDeviceApiUri
()
{
return
$this
->
o
ccupi
eUrl
.
'/api/1.0/trackingdevice'
;
return
$this
->
o
perat
eUrl
.
'/api/1.0/trackingdevice'
;
}
}
private
function
getTrackingEntryApiUri
()
{
private
function
getTrackingEntryApiUri
()
{
return
$this
->
o
ccupi
eUrl
.
'/api/1.0/trackingentries'
;
return
$this
->
o
perat
eUrl
.
'/api/1.0/trackingentries'
;
}
}
public
function
isUserAuthenticated
()
{
public
function
isUserAuthenticated
()
{
return
$this
->
accessToken
!==
false
;
return
$this
->
accessToken
!==
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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