kishanjasani /
SociaManager
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Copyright 2018 Social Manager. |
||
| 4 | * PHP version 7.2.8 |
||
| 5 | * |
||
| 6 | * It will check your credentials |
||
| 7 | * |
||
| 8 | * @category Album_Manager |
||
| 9 | * @package Zipper |
||
| 10 | * @author Kishan Jasani <[email protected]> |
||
| 11 | * @license https://rtfbchallenge.tk/privacy_policy/privacy_policy.php |
||
| 12 | * @link "" |
||
| 13 | * |
||
| 14 | * You are hereby granted a non-exclusive, worldwide, royalty-free license to |
||
| 15 | * use, copy, modify, and distribute this software in source code or binary |
||
| 16 | * form for use in connection with the web services and APIs provided by |
||
| 17 | * Kishan Jasani. |
||
| 18 | * |
||
| 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND |
||
| 20 | */ |
||
| 21 | require_once 'gClient.php'; |
||
| 22 | $gClient =new CreateGoogleClient(); |
||
| 23 | $client = $gClient->createClient(); |
||
| 24 | |||
| 25 | if (!isset($_GET['code'])) {
|
||
| 26 | $auth_url = $client->createAuthUrl(); |
||
| 27 | header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
|
||
| 28 | } else {
|
||
| 29 | $client->authenticate($_GET['code']); |
||
|
0 ignored issues
–
show
Deprecated Code
introduced
by
Loading history...
|
|||
| 30 | $_SESSION['google_access_token'] = $client->getAccessToken(); |
||
| 31 | $redirect_uri = 'https://' . $_SERVER['HTTP_HOST'] . '/SociaManager/index.php'; |
||
| 32 | header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));
|
||
| 33 | }; |
||
| 34 | ?> |
||
|
0 ignored issues
–
show
It is not recommended to use PHP's closing tag
?> in files other than templates.
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore. A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever. Loading history...
|
|||
| 35 |