-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth.php
executable file
·44 lines (37 loc) · 1.38 KB
/
auth.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/* Last updated with phpFlickr 2.3.2
*
* Edit these variables to reflect the values you need. $default_redirect
* and $permissions are only important if you are linking here instead of
* using phpFlickr::auth() from another page or if you set the remember_uri
* argument to false.
VCUL customization
------------------
Developer: shettynr, 2011-06
- Included config.php and changed the API Key/Secret to the value from that.
*/
include 'config.php';
$api_key = FLICKR_API_KEY;
$api_secret = FLICKR_SECRET;
$default_redirect = "/";
$permissions = "read";
$path_to_phpFlickr_class = "./lib/";
ob_start();
require_once($path_to_phpFlickr_class . "phpFlickr.php");
unset($_SESSION['phpFlickr_auth_token']);
if ( isset($_SESSION['phpFlickr_auth_redirect']) && !empty($_SESSION['phpFlickr_auth_redirect']) ) {
$redirect = $_SESSION['phpFlickr_auth_redirect'];
unset($_SESSION['phpFlickr_auth_redirect']);
}
$f = new phpFlickr($api_key, $api_secret);
if (empty($_GET['frob'])) {
$f->auth($permissions, false);
} else {
$f->auth_getToken($_GET['frob']);
}
if (empty($redirect)) {
header("Location: " . $default_redirect);
} else {
header("Location: " . $redirect);
}
?>