0) { $BBC = new BasicBlobCrypter(); $crypter = new BasicBlobCrypter(srand($BBC->MASTER_KEY_MIN_LEN)); $clientState = new OAuthCallbackState($crypter, $state); $url = $clientState->getRealCallbackUrl(); $callbackUrl = "http://" . $_SERVER['HTTP_HOST'] . "/gadgets/oauthcallback"; if ($url = $callbackUrl) { unset($_GET['state']); header('Location: '.$callbackUrl.'?'.http_build_query($_GET)); exit; } } else if ((strlen($token) > 0 || strlen($code) > 0) && strlen($state) == 0 ) { $this->setCacheTime(3600); echo "" . "" . "" . "Close this window" . "" . "" . "" . "Close this window." . "" . ""; exit; } header("HTTP/1.0 400 Bad Request", true); echo "

" . "400 - Bad Request Error" . "

"; die(); } }