diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/oauthstore.php | 2 | ||||
-rw-r--r-- | lib/omb.php | 9 | ||||
-rw-r--r-- | lib/util.php | 10 |
3 files changed, 20 insertions, 1 deletions
diff --git a/lib/oauthstore.php b/lib/oauthstore.php index a622647b7..4d2ce9a58 100644 --- a/lib/oauthstore.php +++ b/lib/oauthstore.php @@ -23,7 +23,7 @@ require_once(INSTALLDIR.'/lib/omb.php'); class LaconicaOAuthDataStore extends OAuthDataStore { - # We just keep a record of who's contacted us + # We keep a record of who's contacted us function lookup_consumer($consumer_key) { $con = new Consumer('key', $consumer_key); diff --git a/lib/omb.php b/lib/omb.php index b68d08abf..df4ffb4b2 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -20,6 +20,7 @@ if (!defined('LACONICA')) { exit(1); } require_once('OAuth.php'); +require_once(INSTALLDIR.'lib/oauthstore.php'); define('OAUTH_NAMESPACE', 'http://oauth.net/core/1.0/'); define('OMB_NAMESPACE', 'http://openmicroblogging.org/protocol/0.1'); @@ -44,6 +45,14 @@ function omb_oauth_consumer() { return $con; } +function omb_oauth_server() { + static $server = null; + if ($server) { + $server = new OAuthServer(new LaconicaOAuthStore()); + } + return $server; +} + function omb_hmac_sha1() { static $hmac_method = NULL; if (!$hmac_method) { diff --git a/lib/util.php b/lib/util.php index 30bd4d3ae..2d4fc2766 100644 --- a/lib/util.php +++ b/lib/util.php @@ -525,6 +525,16 @@ function common_mtrand($bytes) { return $enc; } +function common_set_returnto($url) { + common_ensure_session(); + $_SESSION['returnto'] = $url; +} + +function common_get_returnto() { + common_ensure_session(); + return $_SESSION['returnto']; +} + function common_timestamp() { return date('YmdHis'); } |