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
7ef3a079
authored
2016-07-20 09:57:07 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
g
1 parent
d1fedc50
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
app/Http/Controllers/GoogledriveuploadpdfController.php
app/Http/Controllers/GoogledriveuploadpdfController.php
View file @
7ef3a07
...
...
@@ -38,18 +38,20 @@ class GoogledriveuploadpdfController extends Controller
$client
->
setClientId
(
'206523860143-kgs80emhfm1sof79nggd48gnhbl1j6ei.apps.googleusercontent.com'
);
$client
->
setClientSecret
(
'qmUMAi09SU4wU4R3uOkvsiwK'
);
$client
->
setRedirectUri
(
'http://pdf-customizer.synapsus.co/auth/google/callback'
);
$client
->
setAccessType
(
'offline'
);
// 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'
]
);
$client
->
authenticate
(
);
$_SESSION
[
'access_token'
]
=
$client
->
getAccessToken
();
}
else
$client
->
setAccessToken
(
$_SESSION
[
'access_token'
]);
}
$google_token
=
json_decode
(
$_SESSION
[
'access_token'
]);
$client
->
refreshToken
(
$google_token
->
refresh_token
);
$_SESSION
[
'access_token'
]
=
$client
->
getAccessToken
()
$dr_service
=
new
\Google_Service_Drive
(
$client
);
//error_log(print_r($dr_service ,true));
...
...
@@ -77,11 +79,8 @@ class GoogledriveuploadpdfController extends Controller
'mimeType'
=>
$mimetype
,
//text/plain',
'uploadType'
=>
$uploadType
));
}
else
{
$authUrl
=
$client
->
createAuthUrl
();
header
(
'Location: '
.
$authUrl
);
exit
();
}
}
...
...
@@ -89,6 +88,7 @@ class GoogledriveuploadpdfController extends Controller
{
return
Redirect
::
to
(
'home'
);
}
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment