From d251e624a9885fdd5ca9a3de446071606c1ac54d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 4 Jun 2008 14:51:31 -0400 Subject: full interface for userauthorization darcs-hash:20080604185131-84dde-2ff45e07ebba18c97803ed4a99121a6244ef1158.gz --- lib/omb.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/omb.php') diff --git a/lib/omb.php b/lib/omb.php index 19ac66ee2..7c7a21cc8 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -42,7 +42,7 @@ define('OAUTH_POST_BODY', OAUTH_NAMESPACE.'parameters/post-body'); define('OAUTH_HMAC_SHA1', OAUTH_NAMESPACE.'signature/HMAC-SHA1'); function omb_oauth_consumer() { - static $con = null; + static $con = NULL; if (!$con) { $con = new OAuthConsumer(common_root_url(), ''); } @@ -52,12 +52,20 @@ function omb_oauth_consumer() { function omb_oauth_server() { static $server = null; if (!$server) { - $server = new OAuthServer(new LaconicaOAuthDataStore()); + $server = new OAuthServer(omb_oauth_datastore()); $server->add_signature_method(omb_hmac_sha1()); } return $server; } +function omb_oauth_datastore() { + static $store = NULL; + if (!$store) { + $store = new LaconicaOAuthDataStore(); + } + return $store; +} + function omb_hmac_sha1() { static $hmac_method = NULL; if (!$hmac_method) { -- cgit v1.2.3-54-g00ecf