From fc7d29edd360da4b9de78ba15de458367a6b8121 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 12 Oct 2016 15:31:14 -0700 Subject: some more api work --- Zotlabs/Module/Api.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Zotlabs/Module/Api.php') diff --git a/Zotlabs/Module/Api.php b/Zotlabs/Module/Api.php index 4fd59acc4..0f2ca1e47 100644 --- a/Zotlabs/Module/Api.php +++ b/Zotlabs/Module/Api.php @@ -17,13 +17,13 @@ class Api extends \Zotlabs\Web\Controller { function get() { - if(\App::$cmd=='api/oauth/authorize'){ + if(\App::$cmd === 'api/oauth/authorize'){ /* * api/oauth/authorize interact with the user. return a standard page */ - \App::$page['template'] = "minimal"; + \App::$page['template'] = 'minimal'; // get consumer/client from request token try { @@ -42,8 +42,8 @@ class Api extends \Zotlabs\Web\Controller { $consumer = new OAuth1Consumer($app['client_id'], $app['pw'], $app['redirect_uri']); - $verifier = md5($app['secret'].local_channel()); - set_config("oauth", $verifier, local_channel()); + $verifier = md5($app['secret'] . local_channel()); + set_config('oauth', $verifier, local_channel()); if($consumer->callback_url != null) { @@ -78,11 +78,11 @@ class Api extends \Zotlabs\Web\Controller { $tpl = get_markup_template('oauth_authorize.tpl'); $o = replace_macros($tpl, array( - '$title' => t('Authorize application connection'), - '$app' => $app, + '$title' => t('Authorize application connection'), + '$app' => $app, '$authorize' => t('Do you want to authorize this application to access your posts and contacts, and/or create new posts for you?'), - '$yes' => t('Yes'), - '$no' => t('No'), + '$yes' => t('Yes'), + '$no' => t('No'), )); //echo "
"; var_dump($app); killme();
-- 
cgit v1.2.3


From b80674bf2e72fba633cb85ac48062435d68032c5 Mon Sep 17 00:00:00 2001
From: zotlabs 
Date: Tue, 8 Nov 2016 14:54:55 -0800
Subject: move twitter api to addon; there's still a bit of cleanup remaining,
 mostly dealing with abstracting the authentication calls and separating out
 the twitter authentication structure from the zot api.

---
 Zotlabs/Module/Api.php | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'Zotlabs/Module/Api.php')

diff --git a/Zotlabs/Module/Api.php b/Zotlabs/Module/Api.php
index 0f2ca1e47..a24748b59 100644
--- a/Zotlabs/Module/Api.php
+++ b/Zotlabs/Module/Api.php
@@ -3,9 +3,19 @@ namespace Zotlabs\Module;
 
 require_once('include/api.php');
 
+class Api extends \Zotlabs\Web\Controller {
 
 
-class Api extends \Zotlabs\Web\Controller {
+	function init() {
+		$args = [];
+		call_hooks('api_register',$args);
+
+		api_register_func('api/client/register', 'api_client_register', false);
+		api_register_func('api/oauth/request_token', 'api_oauth_request_token', false);
+		api_register_func('api/oauth/access_token', 'api_oauth_access_token', false);
+
+		return;
+	}
 
 	function post() {
 		if(! local_channel()) {
-- 
cgit v1.2.3


From fabf278633b40999640f9bfbb2523c14f42cb1fb Mon Sep 17 00:00:00 2001
From: zotlabs 
Date: Tue, 8 Nov 2016 16:55:29 -0800
Subject: more api re-org

---
 Zotlabs/Module/Api.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'Zotlabs/Module/Api.php')

diff --git a/Zotlabs/Module/Api.php b/Zotlabs/Module/Api.php
index a24748b59..a2a1aac1d 100644
--- a/Zotlabs/Module/Api.php
+++ b/Zotlabs/Module/Api.php
@@ -7,13 +7,15 @@ class Api extends \Zotlabs\Web\Controller {
 
 
 	function init() {
-		$args = [];
-		call_hooks('api_register',$args);
+		zot_api_init();
 
 		api_register_func('api/client/register', 'api_client_register', false);
 		api_register_func('api/oauth/request_token', 'api_oauth_request_token', false);
 		api_register_func('api/oauth/access_token', 'api_oauth_access_token', false);
 
+		$args = [];
+		call_hooks('api_register',$args);
+
 		return;
 	}
 
-- 
cgit v1.2.3