Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
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
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
43c60ec2
Commit
43c60ec2
authored
7 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix error management at wrong place
parent
cf274a7e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/core/modules/oauth/github_oauthcallback.php
+20
-16
20 additions, 16 deletions
htdocs/core/modules/oauth/github_oauthcallback.php
htdocs/core/modules/oauth/google_oauthcallback.php
+16
-15
16 additions, 15 deletions
htdocs/core/modules/oauth/google_oauthcallback.php
with
36 additions
and
31 deletions
htdocs/core/modules/oauth/github_oauthcallback.php
+
20
−
16
View file @
43c60ec2
...
...
@@ -106,6 +106,10 @@ if ($action == 'delete')
if
(
!
empty
(
$_GET
[
'code'
]))
// We are coming from oauth provider page
{
// We should have
//$_GET=array('code' => string 'aaaaaaaaaaaaaa' (length=20), 'state' => string 'user,public_repo' (length=16))
dol_syslog
(
"We are coming fr mthe oauth provider page"
);
//llxHeader('',$langs->trans("OAuthSetup"));
//$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
...
...
@@ -124,21 +128,21 @@ if (! empty($_GET['code'])) // We are coming from oauth provider page
//$token = $apiService->requestAccessToken($_GET['code'], $state);
$token
=
$apiService
->
requestAccessToken
(
$_GET
[
'code'
]);
// Github is a service that does not need state
y
o be stored.
// Github is a service that does not need state
t
o be stored.
// Into constructor of GitHub, the call
// parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri)
// has not the ending parameter to true like the Google class constructor.
setEventMessages
(
$langs
->
trans
(
'NewTokenStored'
),
null
,
'mesgs'
);
// Stored into object managed by class DoliStorage so into table oauth_token
}
catch
(
Exception
$e
)
{
print
$e
->
getMessage
();
}
$backtourl
=
$_SESSION
[
"backtourlsavedbeforeoauthjump"
];
unset
(
$_SESSION
[
"backtourlsavedbeforeoauthjump"
]);
header
(
'Location: '
.
$backtourl
);
exit
();
}
catch
(
Exception
$e
)
{
print
$e
->
getMessage
();
}
}
else
// If entry on page with no parameter, we arrive here
{
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/modules/oauth/google_oauthcallback.php
+
16
−
15
View file @
43c60ec2
...
...
@@ -109,6 +109,7 @@ if ($action == 'delete')
if
(
!
empty
(
$_GET
[
'code'
]))
// We are coming from oauth provider page
{
dol_syslog
(
"We are coming fr mthe oauth provider page"
);
//llxHeader('',$langs->trans("OAuthSetup"));
//$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
...
...
@@ -128,15 +129,15 @@ if (! empty($_GET['code'])) // We are coming from oauth provider page
$token
=
$apiService
->
requestAccessToken
(
$_GET
[
'code'
],
$state
);
setEventMessages
(
$langs
->
trans
(
'NewTokenStored'
),
null
,
'mesgs'
);
// Stored into object managed by class DoliStorage so into table oauth_token
}
catch
(
Exception
$e
)
{
print
$e
->
getMessage
();
}
$backtourl
=
$_SESSION
[
"backtourlsavedbeforeoauthjump"
];
unset
(
$_SESSION
[
"backtourlsavedbeforeoauthjump"
]);
header
(
'Location: '
.
$backtourl
);
exit
();
}
catch
(
Exception
$e
)
{
print
$e
->
getMessage
();
}
}
else
// If entry on page with no parameter, we arrive here
{
...
...
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