aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2018-04-07 17:48:48 -0400
committerAndrew Manning <tamanning@zoho.com>2018-04-07 17:48:48 -0400
commitbe6dcb5d0a96d3618c4d4d824bf94b0a6753fefc (patch)
tree986d8b726fc2ec7e9eb1aa696c563683a9569d33 /include/api.php
parenta5aff7d0c969adb78338e35a1d736ad80462b34b (diff)
parentbddf8cfde4811dbdc821c1c65a2042e13f05e109 (diff)
downloadvolse-hubzilla-be6dcb5d0a96d3618c4d4d824bf94b0a6753fefc.tar.gz
volse-hubzilla-be6dcb5d0a96d3618c4d4d824bf94b0a6753fefc.tar.bz2
volse-hubzilla-be6dcb5d0a96d3618c4d4d824bf94b0a6753fefc.zip
Merge branch 'dev' into auto-save
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php30
1 files changed, 11 insertions, 19 deletions
diff --git a/include/api.php b/include/api.php
index c91590070..6a05a40a5 100644
--- a/include/api.php
+++ b/include/api.php
@@ -193,26 +193,18 @@ require_once('include/api_zot.php');
$redirect = trim($_REQUEST['redirect_uris'][0]);
else
$redirect = trim($_REQUEST['redirect_uris']);
+ $grant_types = trim($_REQUEST['grant_types']);
+ $scope = trim($_REQUEST['scope']);
$icon = trim($_REQUEST['logo_uri']);
- 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)
- );
- }
+ $r = q("INSERT INTO oauth_clients (client_id, client_secret, redirect_uri, grant_types, scope, user_id)
+ VALUES ( '%s', '%s', '%s', '%s', '%s', '%s' ) ",
+ dbesc($key),
+ dbesc($secret),
+ dbesc($redirect),
+ dbesc($grant_types),
+ dbesc($scope),
+ dbesc((string) api_user())
+ );
$ret['client_id'] = $key;
$ret['client_secret'] = $secret;