diff options
author | zotlabs <mike@macgirvin.com> | 2017-07-05 15:35:05 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-07-05 15:35:05 -0700 |
commit | fca8e0aa6ac9d4f2084371486e906d7e3726a5a5 (patch) | |
tree | 81d27ea002828a42c53541f741bad44684a2c601 /include/api.php | |
parent | 41111bcdadcd16ebc4f078fc812eb5a290f185e5 (diff) | |
parent | 8dd9ab05a97f92f9eca5d527e48272f3a44010a8 (diff) | |
download | volse-hubzilla-fca8e0aa6ac9d4f2084371486e906d7e3726a5a5.tar.gz volse-hubzilla-fca8e0aa6ac9d4f2084371486e906d7e3726a5a5.tar.bz2 volse-hubzilla-fca8e0aa6ac9d4f2084371486e906d7e3726a5a5.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'include/api.php')
-rw-r--r-- | include/api.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/include/api.php b/include/api.php index 693967696..c91590070 100644 --- a/include/api.php +++ b/include/api.php @@ -194,15 +194,25 @@ require_once('include/api_zot.php'); else $redirect = trim($_REQUEST['redirect_uris']); $icon = trim($_REQUEST['logo_uri']); - $r = q("INSERT INTO clients (client_id, pw, clname, redirect_uri, icon, uid) - VALUES ('%s','%s','%s','%s','%s',%d)", - dbesc($key), - dbesc($secret), - dbesc($name), - dbesc($redirect), - dbesc($icon), - intval(0) - ); + if($oauth2) { + $r = q("INSERT INTO oauth_clients (client_id, client_secret, redirect_uri, grant_types, scope, user_id) + VALUES ( '%s', '%s', '%s', null, null, null ) ", + dbesc($key), + dbesc($secret), + dbesc($redirect) + ); + } + else { + $r = q("INSERT INTO clients (client_id, pw, clname, redirect_uri, icon, uid) + VALUES ('%s','%s','%s','%s','%s',%d)", + dbesc($key), + dbesc($secret), + dbesc($name), + dbesc($redirect), + dbesc($icon), + intval(0) + ); + } $ret['client_id'] = $key; $ret['client_secret'] = $secret; |