aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2018-04-05 10:52:39 +0200
committerGitHub <noreply@github.com>2018-04-05 10:52:39 +0200
commita7ff2cc5ea11afd7b832bef24866abfb0220d022 (patch)
treee7dcd63bbfdaa6ae564c60d59ef60edf0e6ba7a7 /include/api.php
parent20ac91703d54679d2e5080ba2d4985e93986a515 (diff)
parentdcacdd23c87061dc15bd12ed2e959bcbe020c5df (diff)
downloadvolse-hubzilla-a7ff2cc5ea11afd7b832bef24866abfb0220d022.tar.gz
volse-hubzilla-a7ff2cc5ea11afd7b832bef24866abfb0220d022.tar.bz2
volse-hubzilla-a7ff2cc5ea11afd7b832bef24866abfb0220d022.zip
Merge pull request #3 from redmatrix/dev
Dev
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;