From d95f08096b63acce524fc5c0ce22fae79ab6941e Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Fri, 16 May 2014 04:07:30 +0200 Subject: [PATCH] change login method to native gnu social this required an edit of lib/apiauthaction.php to accept the normal login session as authentication. i'm not sure if this might cause any problems or security risks, but i don't think so.. --- README.md | 10 +- actions/qvitter.php | 30 +- actions/qvitterapi.php | 103 ----- edited-gnu-social-files/lib/apiauthaction.php | 385 +++++++++++++++++ js/ajax-functions.js | 149 ++----- js/dom-functions.js | 66 +-- js/lan.js | 19 +- js/misc-functions.js | 52 +-- js/qvitter.js | 392 ++++++++---------- 9 files changed, 688 insertions(+), 518 deletions(-) delete mode 100644 actions/qvitterapi.php create mode 100644 edited-gnu-social-files/lib/apiauthaction.php diff --git a/README.md b/README.md index 70d24e0..10fc586 100644 --- a/README.md +++ b/README.md @@ -26,16 +26,16 @@ Setup 2. Put all files in /plugins/Qvitter -3. Add `addPlugin('Qvitter');` to your /config.php file. +3. Replace your lib/apiauthaction.php file with the one supplied in edited-gnu-social-files/lib/apiauthaction.php -4. There are a few settings in /plugins/Qvitter/QvitterPlugin.php. By default Qvitter is +4. Add `addPlugin('Qvitter');` to your /config.php file. + +5. There are a few settings in /plugins/Qvitter/QvitterPlugin.php. By default Qvitter is opt-out for users. If you set `$settings['enabledbydefault'] = false;` Qvitter will be opt-in instead. -5. Users can go to ://{instance}/settings/qvitter and enable or disable Qvitter. +6. Users can go to ://{instance}/settings/qvitter and enable or disable Qvitter. -NOTE: Qvitter is now a plugin for GNU Social. There will probably be bugs because of -this change. TODO diff --git a/actions/qvitter.php b/actions/qvitter.php index ce57845..67add33 100644 --- a/actions/qvitter.php +++ b/actions/qvitter.php @@ -33,7 +33,7 @@ · Contact h@nnesmannerhe.im if you have any questions. · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */ -class QvitterAction extends Action +class QvitterAction extends ApiAction { function isReadOnly($args) @@ -63,11 +63,18 @@ class QvitterAction extends Action $logged_in_user_nickname = ''; + $logged_in_user_obj = false; $logged_in_user = common_current_user(); if($logged_in_user) { $logged_in_user_nickname = $logged_in_user->nickname; + $logged_in_user_obj = ApiAction::twitterUserArray($logged_in_user->getProfile()); } - + + $registrationsclosed = false; + if(common_config('site','closed') == 1 || common_config('site','inviteonly') == 1) { + $registrationsclosed = true; + } + $sitetitle = common_config('site','name'); $siterootdomain = common_config('site','server'); $qvitterpath = Plugin::staticPath('Qvitter', ''); @@ -139,13 +146,17 @@ class QvitterAction extends Action print ' '."\n"; } } - + + + ?>