2014-07-02 10:35:50 +02:00
|
|
|
<?php
|
|
|
|
/* Last updated with phpFlickr 2.3.2
|
2011-12-13 12:29:05 +01:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
$api_key = "[your api key]";
|
|
|
|
$api_secret = "[your api secret]";
|
|
|
|
$default_redirect = "/";
|
|
|
|
$permissions = "read";
|
|
|
|
$path_to_phpFlickr_class = "./";
|
|
|
|
|
|
|
|
ob_start();
|
2014-11-26 10:40:03 +01:00
|
|
|
require_once $path_to_phpFlickr_class . "phpFlickr.php";
|
|
|
|
unset($_SESSION['phpFlickr_auth_token']);
|
2011-12-13 12:29:05 +01:00
|
|
|
|
2014-07-02 10:35:50 +02:00
|
|
|
if ( isset($_SESSION['phpFlickr_auth_redirect']) && !empty($_SESSION['phpFlickr_auth_redirect']) ) {
|
|
|
|
$redirect = $_SESSION['phpFlickr_auth_redirect'];
|
|
|
|
unset($_SESSION['phpFlickr_auth_redirect']);
|
2011-12-13 12:29:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$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);
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|