Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AuthSCH - Client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Szabó Gergely
AuthSCH - Client
Commits
a687d8ef
Commit
a687d8ef
authored
11 years ago
by
Janega Zoltán
Browse files
Options
Downloads
Patches
Plain Diff
fixing variable names
parent
f18c3b13
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
php/AuthSCHClient.class.php
+3
-2
3 additions, 2 deletions
php/AuthSCHClient.class.php
with
3 additions
and
2 deletions
php/AuthSCHClient.class.php
+
3
−
2
View file @
a687d8ef
...
...
@@ -37,7 +37,7 @@ class AuthSCHClient {
curl_setopt
(
$ch
,
CURLOPT_URL
,
self
::
$host
.
$urlPart
);
curl_setopt
(
$ch
,
CURLOPT_HEADER
,
0
);
if
(
$urlPart
!=
"oauth2/resource"
)
curl_setopt
(
$c
url
,
CURLOPT_USERPWD
,
self
::
$username
.
":"
.
self
::
$password
);
curl_setopt
(
$c
h
,
CURLOPT_USERPWD
,
self
::
$username
.
":"
.
self
::
$password
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
30
);
curl_setopt
(
$ch
,
CURLOPT_POST
,
1
);
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
http_build_query
(
$data
));
...
...
@@ -62,10 +62,11 @@ class AuthSCHClient {
);
$ch
=
$this
->
curlExec
(
"oauth2/resource"
,
$data
);
$res
=
json_decode
(
$ch
);
// check api access & redirect to auth.sch.bme.hu for authorization
if
(
$res
!=
null
&&
isset
(
$res
->
success
)
&&
$res
->
success
==
true
)
header
(
"Location: "
.
self
::
$host
.
"site/login?response_type=code&client_id
&
"
.
self
::
$username
.
"&state="
.
sha1
(
$_SERVER
[
'REMOTE_ADDR'
]
.
$_SERVER
[
'HTTP_USER_AGENT'
])
.
"&scope="
.
self
::
$scope
);
header
(
"Location: "
.
self
::
$host
.
"site/login?response_type=code&client_id
=
"
.
self
::
$username
.
"&state="
.
sha1
(
$_SERVER
[
'REMOTE_ADDR'
]
.
$_SERVER
[
'HTTP_USER_AGENT'
])
.
"&scope="
.
self
::
$scope
);
else
throw
new
Exception
(
"error during api check"
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment