Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
pdf-customizer
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c077dac5
authored
2016-07-20 09:26:50 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
7ae1647d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
app/Http/Controllers/GoogledriveuploadpdfController.php
app/Http/Controllers/GoogledriveuploadpdfController.php
View file @
c077dac
...
...
@@ -42,6 +42,15 @@ class GoogledriveuploadpdfController extends Controller
// error_log(print_r($client,true));
session_start
();
if
(
isset
(
$_GET
[
'code'
])
||
(
isset
(
$_SESSION
[
'access_token'
])
&&
$_SESSION
[
'access_token'
]))
{
if
(
isset
(
$_GET
[
'code'
]))
{
$client
->
authenticate
(
$_GET
[
'code'
]);
$_SESSION
[
'access_token'
]
=
$client
->
getAccessToken
();
}
else
$client
->
setAccessToken
(
$_SESSION
[
'access_token'
]);
$dr_service
=
new
\Google_Service_Drive
(
$client
);
//error_log(print_r($dr_service ,true));
...
...
@@ -68,7 +77,11 @@ class GoogledriveuploadpdfController extends Controller
'mimeType'
=>
$mimetype
,
//text/plain',
'uploadType'
=>
$uploadType
));
}
else
{
$authUrl
=
$client
->
createAuthUrl
();
header
(
'Location: '
.
$authUrl
);
exit
();
}
}
...
...
Please
register
or
sign in
to post a comment