X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Foauthstore.php;h=6db07b20f781c9e2cf901a6e631760b681e80f41;hb=3bc55e7b8bff2fe331371333de9ff4f96c8584d2;hp=7ad3be20e2ac318517b5b150e974de7a32633546;hpb=02877224b20f87af304553f739b69544d7ac4cfa;p=quix0rs-gnu-social.git diff --git a/lib/oauthstore.php b/lib/oauthstore.php index 7ad3be20e2..6db07b20f7 100644 --- a/lib/oauthstore.php +++ b/lib/oauthstore.php @@ -1,7 +1,7 @@ . */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/omb.php'); -class LaconicaOAuthDataStore extends OAuthDataStore +class StatusNetOAuthDataStore extends OAuthDataStore { // We keep a record of who's contacted us @@ -54,16 +54,21 @@ class LaconicaOAuthDataStore extends OAuthDataStore } } + // http://oauth.net/core/1.0/#nonce + // "The Consumer SHALL then generate a Nonce value that is unique for + // all requests with that timestamp." + + // XXX: It's not clear why the token is here + function lookup_nonce($consumer, $token, $nonce, $timestamp) { $n = new Nonce(); $n->consumer_key = $consumer->key; - $n->tok = $token->key; + $n->ts = $timestamp; $n->nonce = $nonce; if ($n->find(true)) { return true; } else { - $n->timestamp = $timestamp; $n->created = DB_DataObject_Cast::dateTime(); $n->insert(); return false;