aboutsummaryrefslogtreecommitdiffstats
path: root/include/oauth.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-05-17 19:48:57 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-05-17 19:48:57 -0700
commit76558df9667b4900b4036faca0075985596b93cd (patch)
tree08b57c1159399db70af105ac93726000bf5fe36b /include/oauth.php
parentdd72f580dd14e8745dd81bc056e1a73df1e8e563 (diff)
parentac3b886cc46bd9c634cce7b409f5bea7211382da (diff)
downloadvolse-hubzilla-76558df9667b4900b4036faca0075985596b93cd.tar.gz
volse-hubzilla-76558df9667b4900b4036faca0075985596b93cd.tar.bz2
volse-hubzilla-76558df9667b4900b4036faca0075985596b93cd.zip
Merge branch 'master' of https://github.com/redmatrix/redmatrix
Conflicts: include/bb2diaspora.php include/diaspora.php include/enotify.php mod/admin.php mod/cloud.php mod/dav.php mod/home.php mod/invite.php mod/like.php mod/mitem.php mod/p.php mod/pubsites.php mod/setup.php mod/siteinfo.php util/messages.po
Diffstat (limited to 'include/oauth.php')
-rw-r--r--include/oauth.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/oauth.php b/include/oauth.php
index 8eb8a83d8..ec754db95 100644
--- a/include/oauth.php
+++ b/include/oauth.php
@@ -20,19 +20,21 @@ class FKOAuthDataStore extends OAuthDataStore {
logger(__function__.":".$consumer_key);
// echo "<pre>"; var_dump($consumer_key); killme();
- $r = q("SELECT client_id, pw, redirect_uri FROM clients WHERE client_id='%s'",
+ $r = q("SELECT client_id, pw, redirect_uri FROM clients WHERE client_id = '%s'",
dbesc($consumer_key)
);
- if (count($r))
+ if($r) {
+ get_app()->set_oauth_key($consumer_key);
return new OAuthConsumer($r[0]['client_id'],$r[0]['pw'],$r[0]['redirect_uri']);
+ }
return null;
}
function lookup_token($consumer, $token_type, $token) {
logger(__function__.":".$consumer.", ". $token_type.", ".$token);
- $r = q("SELECT id, secret,scope, expires, uid FROM tokens WHERE client_id='%s' AND scope='%s' AND id='%s'",
+ $r = q("SELECT id, secret, scope, expires, uid FROM tokens WHERE client_id = '%s' AND scope = '%s' AND id = '%s'",
dbesc($consumer->key),
dbesc($token_type),
dbesc($token)
@@ -51,7 +53,7 @@ class FKOAuthDataStore extends OAuthDataStore {
function lookup_nonce($consumer, $token, $nonce, $timestamp) {
// echo __file__.":".__line__."<pre>"; var_dump($consumer,$key); killme();
- $r = q("SELECT id, secret FROM tokens WHERE client_id='%s' AND id='%s' AND expires=%d",
+ $r = q("SELECT id, secret FROM tokens WHERE client_id = '%s' AND id = '%s' AND expires = %d",
dbesc($consumer->key),
dbesc($nonce),
intval($timestamp)
@@ -132,6 +134,7 @@ class FKOAuthDataStore extends OAuthDataStore {
}
class FKOAuth1 extends OAuthServer {
+
function __construct() {
parent::__construct(new FKOAuthDataStore());
$this->add_signature_method(new OAuthSignatureMethod_PLAINTEXT());