diff options
-rw-r--r-- | README | 49 | ||||
-rw-r--r-- | lib/router.php | 8 | ||||
-rw-r--r-- | lib/unqueuemanager.php | 6 | ||||
-rw-r--r-- | plugins/FBConnect/README | 76 | ||||
-rw-r--r-- | plugins/Facebook/FBCLoginGroupNav.php (renamed from plugins/FBConnect/FBCLoginGroupNav.php) | 0 | ||||
-rw-r--r-- | plugins/Facebook/FBCSettingsNav.php (renamed from plugins/FBConnect/FBCSettingsNav.php) | 0 | ||||
-rw-r--r-- | plugins/Facebook/FBC_XDReceiver.php (renamed from plugins/FBConnect/FBC_XDReceiver.php) | 0 | ||||
-rw-r--r-- | plugins/Facebook/FBConnect.css (renamed from plugins/FBConnect/FBConnectPlugin.css) | 0 | ||||
-rw-r--r-- | plugins/Facebook/FBConnectAuth.php (renamed from plugins/FBConnect/FBConnectAuth.php) | 2 | ||||
-rw-r--r-- | plugins/Facebook/FBConnectLogin.php (renamed from plugins/FBConnect/FBConnectLogin.php) | 3 | ||||
-rw-r--r-- | plugins/Facebook/FBConnectSettings.php (renamed from plugins/FBConnect/FBConnectSettings.php) | 0 | ||||
-rw-r--r-- | plugins/Facebook/FacebookPlugin.php (renamed from plugins/FBConnect/FBConnectPlugin.php) | 149 | ||||
-rw-r--r-- | plugins/Facebook/README | 129 | ||||
-rw-r--r-- | plugins/Facebook/facebook/facebook.php (renamed from extlib/facebook/facebook.php) | 0 | ||||
-rw-r--r-- | plugins/Facebook/facebook/facebook_desktop.php (renamed from extlib/facebook/facebook_desktop.php) | 0 | ||||
-rwxr-xr-x | plugins/Facebook/facebook/facebookapi_php5_restlib.php (renamed from extlib/facebook/facebookapi_php5_restlib.php) | 0 | ||||
-rw-r--r-- | plugins/Facebook/facebook/jsonwrapper/JSON/JSON.php (renamed from extlib/facebook/jsonwrapper/JSON/JSON.php) | 0 | ||||
-rw-r--r-- | plugins/Facebook/facebook/jsonwrapper/JSON/LICENSE (renamed from extlib/facebook/jsonwrapper/JSON/LICENSE) | 0 | ||||
-rw-r--r-- | plugins/Facebook/facebook/jsonwrapper/jsonwrapper.php (renamed from extlib/facebook/jsonwrapper/jsonwrapper.php) | 0 | ||||
-rw-r--r-- | plugins/Facebook/facebook/jsonwrapper/jsonwrapper_inner.php (renamed from extlib/facebook/jsonwrapper/jsonwrapper_inner.php) | 0 | ||||
-rw-r--r-- | plugins/Facebook/facebookaction.php (renamed from lib/facebookaction.php) | 44 | ||||
-rw-r--r-- | plugins/Facebook/facebookhome.php (renamed from actions/facebookhome.php) | 6 | ||||
-rw-r--r-- | plugins/Facebook/facebookinvite.php (renamed from actions/facebookinvite.php) | 2 | ||||
-rw-r--r-- | plugins/Facebook/facebooklogin.php (renamed from actions/facebooklogin.php) | 34 | ||||
-rwxr-xr-x | plugins/Facebook/facebookqueuehandler.php (renamed from scripts/facebookqueuehandler.php) | 7 | ||||
-rw-r--r-- | plugins/Facebook/facebookremove.php (renamed from actions/facebookremove.php) | 6 | ||||
-rw-r--r-- | plugins/Facebook/facebooksettings.php (renamed from actions/facebooksettings.php) | 24 | ||||
-rw-r--r-- | plugins/Facebook/facebookutil.php (renamed from lib/facebookutil.php) | 6 | ||||
-rw-r--r-- | plugins/Facebook/fbfavicon.ico (renamed from plugins/FBConnect/fbfavicon.ico) | bin | 1150 -> 1150 bytes | |||
-rwxr-xr-x | scripts/getvaliddaemons.php | 1 |
30 files changed, 316 insertions, 236 deletions
@@ -526,8 +526,6 @@ This will run eight (for now) queue handlers: of registered users. * xmppconfirmhandler.php - sends confirmation messages to registered users. -* facebookqueuehandler.php - sends queued notices to Facebook for users - of the built-in Facebook application. Note that these queue daemons are pretty raw, and need your care. In particular, they leak memory, and you may want to restart them on a @@ -545,53 +543,6 @@ our kind of hacky home-grown DB-based queue solution. See the "queues" config section below for how to configure to use STOMP. As of this writing, the software has been tested with ActiveMQ ( -Built-in Facebook Application ------------------------------ - -StatusNet's Facebook application allows your users to automatically -update their Facebook statuses with their latest notices, invite -their friends to use the app (and thus your site), view their notice -timelines, and post notices -- all from within Facebook. The application -is built into StatusNet and runs on your host. For automatic Facebook -status updating to work you will need to enable queuing and run the -facebookqueuehandler.php daemon (see the "Queues and daemons" section -above). - -Quick setup instructions*: - -Install the Facebook Developer application on Facebook: - - http://www.facebook.com/developers/ - -Use it to create a new application and generate an API key and secret. -Uncomment the Facebook app section of your config.php and copy in the -key and secret, e.g.: - - # Config section for the built-in Facebook application - $config['facebook']['apikey'] = 'APIKEY'; - $config['facebook']['secret'] = 'SECRET'; - -In Facebook's application editor, specify the following URLs for your app: - -- Canvas Callback URL: http://example.net/mublog/facebook/ -- Post-Remove Callback URL: http://example.net/mublog/facebook/remove -- Post-Add Redirect URL: http://apps.facebook.com/yourapp/ -- Canvas Page URL: http://apps.facebook.com/yourapp/ - -(Replace 'example.net' with your host's URL, 'mublog' with the path -to your StatusNet installation, and 'yourapp' with the name of the -Facebook application you created.) - -Additionally, Choose "Web" for Application type in the Advanced tab. -In the "Canvas setting" section, choose the "FBML" for Render Method, -"Smart Size" for IFrame size, and "Full width (760px)" for Canvas Width. -Everything else can be left with default values. - -*For more detailed instructions please see the installation guide on the -StatusNet wiki: - - http://status.net/trac/wiki/FacebookApplication - Sitemaps -------- diff --git a/lib/router.php b/lib/router.php index a5b6a9a30..4fb0834fd 100644 --- a/lib/router.php +++ b/lib/router.php @@ -86,14 +86,6 @@ class Router $m->connect('doc/:title', array('action' => 'doc')); - // facebook - - $m->connect('facebook', array('action' => 'facebookhome')); - $m->connect('facebook/index.php', array('action' => 'facebookhome')); - $m->connect('facebook/settings.php', array('action' => 'facebooksettings')); - $m->connect('facebook/invite.php', array('action' => 'facebookinvite')); - $m->connect('facebook/remove', array('action' => 'facebookremove')); - // main stuff is repetitive $main = array('login', 'logout', 'register', 'subscribe', diff --git a/lib/unqueuemanager.php b/lib/unqueuemanager.php index 51261bcd7..cef9a6588 100644 --- a/lib/unqueuemanager.php +++ b/lib/unqueuemanager.php @@ -48,12 +48,6 @@ class UnQueueManager jabber_public_notice($notice); } break; - case 'facebook': - if ($this->_isLocal($notice)) { - require_once INSTALLDIR . '/lib/facebookutil.php'; - return facebookBroadcastNotice($notice); - } - break; case 'ping': if ($this->_isLocal($notice)) { require_once INSTALLDIR . '/lib/ping.php'; diff --git a/plugins/FBConnect/README b/plugins/FBConnect/README deleted file mode 100644 index 77d57eff9..000000000 --- a/plugins/FBConnect/README +++ /dev/null @@ -1,76 +0,0 @@ -This plugin allows you to utilize Facebook Connect with StatusNet. -Supported Facebook Connect features: - -- Authenticate (register/login/logout -- works similar to OpenID) -- Associate an existing StatusNet account with a Facebook account -- Disconnect a Facebook account from a StatusNet account - -Future planned functionality: - -- Invite Facebook friends to use your StatusNet installation -- Auto-subscribe Facebook friends already using StatusNet -- Share StatusNet favorite notices to your Facebook stream - -To use the plugin you will need to configure a Facebook application -to point to your StatusNet installation (see the Installation section -below). - -Installation -============ - -If you don't already have the built-in Facebook application configured, -you'll need to log into Facebook and create/configure a new application. -Please follow the instructions in the section titled, "Setting Up Your -Application and Getting an API Key," on the following page of the -Facebook developer wiki: - - http://wiki.developers.facebook.com/index.php/Connect/Setting_Up_Your_Site - -If you already are using the build-in StatusNet Facebook application, -you can modify your existing application's configuration using the -Facebook Developer Application on Facebook. Use it to edit your -application settings, and under the 'Connect' tab, change the 'Connect -URL' to be the main URL for your StatusNet site. E.g.: - - http://SITE/PATH_TO_STATUSNET/ - -After you application is created and configured, you'll need to add its -API key and secret to your StatusNet config.php file: - - $config['facebook']['apikey'] = 'APIKEY'; - $config['facebook']['secret'] = 'SECRET'; - -Finally, to enable the plugin, add the following stanza to your -config.php: - - addPlugin('FBConnect'); - -To try out the plugin, fire up your browser and connect to: - - http://SITE/PATH_TO_STATUSNET/main/facebooklogin - -or, if you do not have fancy URLs turned on: - - http://SITE/PATH_TO_STATUSNET/index.php/main/facebooklogin - -You should see a page with a blue button that says: "Connect with -Facebook". - -Connect/Disconnect existing account -=================================== - -If the Facebook Connect plugin is enabled, there will be a new Facebook -Connect Settings tab under each user's Connect menu. Users can connect -and disconnect to their Facebook accounts from it. Note: Before a user -can disconnect from Facebook, she must set a normal StatusNet password. -Otherwise, she might not be able to login in to her account in the -future. This is usually only required for users who have used Facebook -Connect to register their StatusNet account, and therefore haven't -already set a local password. - -Helpful links -============= - -Facebook Connect Homepage: -http://developers.facebook.com/connect.php - diff --git a/plugins/FBConnect/FBCLoginGroupNav.php b/plugins/Facebook/FBCLoginGroupNav.php index 81b2520a4..81b2520a4 100644 --- a/plugins/FBConnect/FBCLoginGroupNav.php +++ b/plugins/Facebook/FBCLoginGroupNav.php diff --git a/plugins/FBConnect/FBCSettingsNav.php b/plugins/Facebook/FBCSettingsNav.php index ed02371e2..ed02371e2 100644 --- a/plugins/FBConnect/FBCSettingsNav.php +++ b/plugins/Facebook/FBCSettingsNav.php diff --git a/plugins/FBConnect/FBC_XDReceiver.php b/plugins/Facebook/FBC_XDReceiver.php index 2bc790d5a..2bc790d5a 100644 --- a/plugins/FBConnect/FBC_XDReceiver.php +++ b/plugins/Facebook/FBC_XDReceiver.php diff --git a/plugins/FBConnect/FBConnectPlugin.css b/plugins/Facebook/FBConnect.css index 49217bf13..49217bf13 100644 --- a/plugins/FBConnect/FBConnectPlugin.css +++ b/plugins/Facebook/FBConnect.css diff --git a/plugins/FBConnect/FBConnectAuth.php b/plugins/Facebook/FBConnectAuth.php index 647d5def8..b909a4977 100644 --- a/plugins/FBConnect/FBConnectAuth.php +++ b/plugins/Facebook/FBConnectAuth.php @@ -27,7 +27,7 @@ * @link http://status.net/ */ -require_once INSTALLDIR . '/plugins/FBConnect/FBConnectPlugin.php'; +require_once INSTALLDIR . '/plugins/Facebook/FacebookPlugin.php'; class FBConnectauthAction extends Action { diff --git a/plugins/FBConnect/FBConnectLogin.php b/plugins/Facebook/FBConnectLogin.php index 5696d8848..f146bef7d 100644 --- a/plugins/FBConnect/FBConnectLogin.php +++ b/plugins/Facebook/FBConnectLogin.php @@ -21,7 +21,8 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR . '/plugins/FBConnect/FBConnectPlugin.php'; + +require_once INSTALLDIR . '/plugins/Facebook/FacebookPlugin.php'; class FBConnectLoginAction extends Action { diff --git a/plugins/FBConnect/FBConnectSettings.php b/plugins/Facebook/FBConnectSettings.php index 911c56787..911c56787 100644 --- a/plugins/FBConnect/FBConnectSettings.php +++ b/plugins/Facebook/FBConnectSettings.php diff --git a/plugins/FBConnect/FBConnectPlugin.php b/plugins/Facebook/FacebookPlugin.php index 0dacf9012..bcd1a7c74 100644 --- a/plugins/FBConnect/FBConnectPlugin.php +++ b/plugins/Facebook/FacebookPlugin.php @@ -2,7 +2,7 @@ /** * StatusNet, the distributed open-source microblogging tool * - * Plugin to enable Facebook Connect + * Plugin to add a StatusNet Facebook application * * PHP version 5 * @@ -27,22 +27,16 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } define("FACEBOOK_CONNECT_SERVICE", 3); -require_once INSTALLDIR . '/lib/facebookutil.php'; -require_once INSTALLDIR . '/plugins/FBConnect/FBConnectAuth.php'; -require_once INSTALLDIR . '/plugins/FBConnect/FBConnectLogin.php'; -require_once INSTALLDIR . '/plugins/FBConnect/FBConnectSettings.php'; -require_once INSTALLDIR . '/plugins/FBConnect/FBCLoginGroupNav.php'; -require_once INSTALLDIR . '/plugins/FBConnect/FBCSettingsNav.php'; -require_once INSTALLDIR . '/plugins/FBConnect/FBC_XDReceiver.php'; +require_once INSTALLDIR . '/plugins/Facebook/facebookutil.php'; /** - * Plugin to enable Facebook Connect + * Facebook plugin to add a StatusNet Facebook application * * @category Plugin * @package StatusNet @@ -51,20 +45,76 @@ require_once INSTALLDIR . '/plugins/FBConnect/FBC_XDReceiver.php'; * @link http://status.net/ */ -class FBConnectPlugin extends Plugin +class FacebookPlugin extends Plugin { - function __construct() + + /** + * Add Facebook app actions to the router table + * + * Hook for RouterInitialized event. + * + * @param Net_URL_Mapper &$m path-to-action mapper + * + * @return boolean hook return + */ + + function onRouterInitialized(&$m) { - parent::__construct(); - } - // Hook in new actions - function onRouterInitialized(&$m) { + // Facebook App stuff + + $m->connect('facebook/app', array('action' => 'facebookhome')); + $m->connect('facebook/app/index.php', array('action' => 'facebookhome')); + $m->connect('facebook/app/settings.php', array('action' => 'facebooksettings')); + $m->connect('facebook/app/invite.php', array('action' => 'facebookinvite')); + $m->connect('facebook/app/remove', array('action' => 'facebookremove')); + + // Facebook Connect stuff + $m->connect('main/facebookconnect', array('action' => 'FBConnectAuth')); $m->connect('main/facebooklogin', array('action' => 'FBConnectLogin')); $m->connect('settings/facebook', array('action' => 'FBConnectSettings')); $m->connect('xd_receiver.html', array('action' => 'FBC_XDReceiver')); - } + + return true; + } + + /** + * Automatically load the actions and libraries used by the Facebook app + * + * @param Class $cls the class + * + * @return boolean hook return + * + */ + function onAutoload($cls) + { + switch ($cls) { + case 'FacebookAction': + case 'FacebookhomeAction': + case 'FacebookinviteAction': + case 'FacebookremoveAction': + case 'FacebooksettingsAction': + include_once INSTALLDIR . '/plugins/Facebook/' . + strtolower(mb_substr($cls, 0, -6)) . '.php'; + return false; + case 'FBConnectAuthAction': + case 'FBConnectLoginAction': + case 'FBConnectSettingsAction': + case 'FBC_XDReceiverAction': + include_once INSTALLDIR . '/plugins/Facebook/' . + mb_substr($cls, 0, -6) . '.php'; + return false; + case 'FBCLoginGroupNav': + include_once INSTALLDIR . '/plugins/Facebook/FBCLoginGroupNav.php'; + return false; + case 'FBCSettingsNav': + include_once INSTALLDIR . '/plugins/Facebook/FBCSettingsNav.php'; + return false; + default: + return true; + } + } // Add in xmlns:fb function onStartShowHTML($action) @@ -107,7 +157,7 @@ class FBConnectPlugin extends Plugin if ($this->reqFbScripts($action)) { $apikey = common_config('facebook', 'apikey'); - $plugin_path = common_path('plugins/FBConnect'); + $plugin_path = common_path('plugins/Facebook'); $login_url = common_local_url('FBConnectAuth'); $logout_url = common_local_url('logout'); @@ -173,7 +223,7 @@ class FBConnectPlugin extends Plugin function onEndShowStatusNetStyles($action) { if ($this->reqFbScripts($action)) { - $action->cssLink('plugins/FBConnect/FBConnectPlugin.css'); + $action->cssLink('plugins/Facebook/FBConnect.css'); } } @@ -283,7 +333,7 @@ class FBConnectPlugin extends Plugin 'alt' => 'Facebook Connect User', 'width' => '16'), ''); - $iconurl = common_path('plugins/FBConnect/fbfavicon.ico'); + $iconurl = common_path('plugins/Facebook/fbfavicon.ico'); $action->element('img', array('id' => 'fb_favicon', 'src' => $iconurl)); @@ -364,4 +414,63 @@ class FBConnectPlugin extends Plugin } + /** + * Add a Facebook queue item for each notice + * + * @param Notice $notice the notice + * @param array &$transports the list of transports (queues) + * + * @return boolean hook return + */ + function onStartEnqueueNotice($notice, &$transports) + { + array_push($transports, 'facebook'); + return true; + } + + /** + * broadcast the message when not using queuehandler + * + * @param Notice &$notice the notice + * @param array $queue destination queue + * + * @return boolean hook return + */ + function onUnqueueHandleNotice(&$notice, $queue) + { + if (($queue == 'facebook') && ($this->_isLocal($notice))) { + facebookBroadcastNotice($notice); + return false; + } + return true; + } + + /** + * Determine whether the notice was locally created + * + * @param Notice $notice + * + * @return boolean locality + */ + function _isLocal($notice) + { + return ($notice->is_local == Notice::LOCAL_PUBLIC || + $notice->is_local == Notice::LOCAL_NONPUBLIC); + } + + /** + * Add Facebook queuehandler to the list of daemons to start + * + * @param array $daemons the list fo daemons to run + * + * @return boolean hook return + * + */ + function onGetValidDaemons($daemons) + { + array_push($daemons, INSTALLDIR . + '/plugins/Facebook/facebookqueuehandler.php'); + return true; + } + } diff --git a/plugins/Facebook/README b/plugins/Facebook/README new file mode 100644 index 000000000..bf2f4a180 --- /dev/null +++ b/plugins/Facebook/README @@ -0,0 +1,129 @@ +This plugin allows you to use Facebook Connect with StatusNet, provides a +Facebook application for your users, and allows them to update their +Facebook statuses from StatusNet. + +Facebook Connect +---------------- + +Facebook connect allows users to register and login using nothing but their +Facebook credentials. With Facebook Connect, your users can: + +- Authenticate (register/login/logout -- works similar to OpenID) +- Associate an existing StatusNet account with a Facebook account +- Disconnect a Facebook account from a StatusNet account + +Built-in Facebook Application +----------------------------- + +The plugin also installs a StatusNet Facebook application that allows your +users to automatically update their Facebook statuses with their latest +notices, invite their friends to use the app (and thus your site), view +their notice timelines, and post notices -- all from within Facebook. The +application is built into the StatusNet Facebook plugin and runs on your +host. + +Quick setup instructions* +------------------------- + +Install the Facebook Developer application on Facebook: + + http://www.facebook.com/developers/ + +Use it to create a new application and generate an API key and secret. Add a +Facebook app section of your config.php and copy in the key and secret, +e.g.: + + // Config section for the built-in Facebook application + $config['facebook']['apikey'] = 'APIKEY'; + $config['facebook']['secret'] = 'SECRET'; + +In Facebook's application editor, specify the following URLs for your app: + +- Canvas Callback URL : http://example.net/mublog/facebook/app/ +- Post-Remove Callback URL: http://example.net/mublog/facebook/app/remove +- Post-Add Redirect URL : http://apps.facebook.com/yourapp/ +- Canvas Page URL : http://apps.facebook.com/yourapp/ +- Connect URL : http://example.net/mublog/ + + *** ATTENTION *** + These URLs have changed slightly since StatusNet version 0.8.1, + so if you have been using the Facebook app previously, you will + need to update your configuration! + +Replace "example.net" with your host's URL, "mublog" with the path to your +StatusNet installation, and 'yourapp' with the name of the Facebook +application you created. (If you don't have "Fancy URLs" on, you'll need to +change http://example.net/mublog/ to http://example.net/mublog/index.php/). + +Additionally, Choose "Web" for Application type in the Advanced tab. In the +"Canvas setting" section, choose the "FBML" for Render Method, "Smart Size" +for IFrame size, and "Full width (760px)" for Canvas Width. Everything else +can be left with default values. + +* NOTE: For more under-the-hood detailed instructions about setting up a + Facebook application and getting an API key, check out the + following pages on the Facebook wiki: + + http://wiki.developers.facebook.com/index.php/Connect/Setting_Up_Your_Site + http://wiki.developers.facebook.com/index.php/Creating_your_first_application + +Finally you must activate the plugin by adding the following line to your +config.php: + + addPlugin('Facebook'); + +Testing It Out +-------------- + +If the Facebook plugin is enabled and working, there will be a new Facebook +Connect Settings tab under each user's Connect menu. Users can connect and +disconnect* to their Facebook accounts from it. + +To try out the plugin, fire up your browser and connect to: + + http://SITE/PATH_TO_STATUSNET/main/facebooklogin + +or, if you do not have fancy URLs turned on: + + http://SITE/PATH_TO_STATUSNET/index.php/main/facebooklogin + +You should see a page with a blue button that says: "Connect with Facebook" +and you should be able to login or register. + +From within Facebook, you should also be able to get to the Facebook +application, and run it by hitting the link you specified above when +configuring it: + + http://apps.facebook.com/yourapp/ + +That link should be present you with a login screen. After logging in to +the app, you are given the option to update their Facebook status via +StatusNet. + +* Note: Before a user can disconnect from Facebook, she must set a normal + StatusNet password. Otherwise, she might not be able to login in to her + account in the future. This is usually only required for users who have + used Facebook Connect to register their StatusNet account, and therefore + haven't already set a local password. + +Offline Queue Handling +---------------------- + +For larger sites needing better performance it's possible to enable queuing +and have users' notices posted to Facebook via a separate "offline" +FacebookQueueHandler (facebookqueuhandler.php in the Facebook plugin +directory), which will be started by the plugin along with their other +daemons when you run scripts/startdaemons.sh. See the StatusNet README for +more about queuing and daemons. + +TODO +---- + +- Invite Facebook friends to use your StatusNet installation via Facebook + Connect +- Auto-subscribe Facebook friends already using StatusNet +- Share StatusNet favorite notices to your Facebook stream +- Allow users to update their Facebook statuses once they have authenticated + with Facebook Connect (no need for them to use the Facebook app if they + don't want to). +- Re-design the whole thing to support multiple instances of StatusNet diff --git a/extlib/facebook/facebook.php b/plugins/Facebook/facebook/facebook.php index 016e8e8e0..016e8e8e0 100644 --- a/extlib/facebook/facebook.php +++ b/plugins/Facebook/facebook/facebook.php diff --git a/extlib/facebook/facebook_desktop.php b/plugins/Facebook/facebook/facebook_desktop.php index e79a2ca34..e79a2ca34 100644 --- a/extlib/facebook/facebook_desktop.php +++ b/plugins/Facebook/facebook/facebook_desktop.php diff --git a/extlib/facebook/facebookapi_php5_restlib.php b/plugins/Facebook/facebook/facebookapi_php5_restlib.php index 55cb7fb86..55cb7fb86 100755 --- a/extlib/facebook/facebookapi_php5_restlib.php +++ b/plugins/Facebook/facebook/facebookapi_php5_restlib.php diff --git a/extlib/facebook/jsonwrapper/JSON/JSON.php b/plugins/Facebook/facebook/jsonwrapper/JSON/JSON.php index 0cddbddb4..0cddbddb4 100644 --- a/extlib/facebook/jsonwrapper/JSON/JSON.php +++ b/plugins/Facebook/facebook/jsonwrapper/JSON/JSON.php diff --git a/extlib/facebook/jsonwrapper/JSON/LICENSE b/plugins/Facebook/facebook/jsonwrapper/JSON/LICENSE index 4ae6bef55..4ae6bef55 100644 --- a/extlib/facebook/jsonwrapper/JSON/LICENSE +++ b/plugins/Facebook/facebook/jsonwrapper/JSON/LICENSE diff --git a/extlib/facebook/jsonwrapper/jsonwrapper.php b/plugins/Facebook/facebook/jsonwrapper/jsonwrapper.php index 29509deba..29509deba 100644 --- a/extlib/facebook/jsonwrapper/jsonwrapper.php +++ b/plugins/Facebook/facebook/jsonwrapper/jsonwrapper.php diff --git a/extlib/facebook/jsonwrapper/jsonwrapper_inner.php b/plugins/Facebook/facebook/jsonwrapper/jsonwrapper_inner.php index 36a3f2863..36a3f2863 100644 --- a/extlib/facebook/jsonwrapper/jsonwrapper_inner.php +++ b/plugins/Facebook/facebook/jsonwrapper/jsonwrapper_inner.php diff --git a/lib/facebookaction.php b/plugins/Facebook/facebookaction.php index 3f3a8d3b0..f5ad3d06b 100644 --- a/lib/facebookaction.php +++ b/plugins/Facebook/facebookaction.php @@ -2,7 +2,7 @@ /** * StatusNet, the distributed open-source microblogging tool * - * Low-level generator for HTML + * Base Facebook Action * * PHP version 5 * @@ -22,18 +22,17 @@ * @category Faceboook * @package StatusNet * @author Zach Copley <zach@status.net> - * @copyright 2008 StatusNet, Inc. + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) -{ +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/lib/facebookutil.php'; -require_once INSTALLDIR.'/lib/noticeform.php'; +require_once INSTALLDIR . '/plugins/Facebook/facebookutil.php'; +require_once INSTALLDIR . '/lib/noticeform.php'; class FacebookAction extends Action { @@ -45,17 +44,6 @@ class FacebookAction extends Action var $app_uri = null; var $app_name = null; - /** - * Constructor - * - * Just wraps the HTMLOutputter constructor. - * - * @param string $output URI to output to, default = stdout - * @param boolean $indent Whether to indent output, default true - * - * @see XMLOutputter::__construct - * @see HTMLOutputter::__construct - */ function __construct($output='php://output', $indent=true, $facebook=null, $flink=null) { parent::__construct($output, $indent); @@ -107,10 +95,8 @@ class FacebookAction extends Action /** * Start an Facebook ready HTML document * - * For Facebook we don't want to actually output any headers, - * DTD info, etc. Just Stylesheet and JavaScript links. - * - * If $type isn't specified, will attempt to do content negotiation. + * For Facebook we don't want to actually output any headers, + * DTD info, etc. Just Stylesheet and JavaScript links. * * @param string $type MIME type to use; default is to do negotation. * @@ -139,8 +125,6 @@ class FacebookAction extends Action /** * Show notice form. * - * MAY overload if no notice form needed... or direct message box???? - * * @return nothing */ function showNoticeForm() @@ -157,10 +141,6 @@ class FacebookAction extends Action $this->elementEnd('div'); } - function showAside() - { - } - function showHead($error, $success) { @@ -214,8 +194,6 @@ class FacebookAction extends Action /** * Show header of the page. * - * Calls template methods - * * @return nothing */ function showHeader() @@ -257,7 +235,7 @@ class FacebookAction extends Action $this->element('a', array('href' => common_local_url('register')), _('Register')); $this->text($loginmsg_part2); - $this->elementEnd('p'); + $this->elementEnd('p'); $this->elementEnd('dd'); $this->elementEnd('dl'); @@ -295,7 +273,7 @@ class FacebookAction extends Action $this->elementEnd('ul'); $this->submit('submit', _('Login')); - $this->elementEnd('fieldset'); + $this->elementEnd('fieldset'); $this->elementEnd('form'); $this->elementStart('p'); @@ -313,8 +291,8 @@ class FacebookAction extends Action // Need to include inline CSS for styling the Profile box - $app_props = $this->facebook->api_client->Admin_getAppProperties(array('icon_url')); - $icon_url = $app_props['icon_url']; + $app_props = $this->facebook->api_client->Admin_getAppProperties(array('icon_url')); + $icon_url = $app_props['icon_url']; $style = '<style> .entry-title *, diff --git a/actions/facebookhome.php b/plugins/Facebook/facebookhome.php index 70f205205..91c0cc6b8 100644 --- a/actions/facebookhome.php +++ b/plugins/Facebook/facebookhome.php @@ -17,9 +17,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); +} -require_once INSTALLDIR.'/lib/facebookaction.php'; +require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; class FacebookhomeAction extends FacebookAction { diff --git a/actions/facebookinvite.php b/plugins/Facebook/facebookinvite.php index 6dfc9d688..ecda1717c 100644 --- a/actions/facebookinvite.php +++ b/plugins/Facebook/facebookinvite.php @@ -21,7 +21,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once(INSTALLDIR.'/lib/facebookaction.php'); +require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; class FacebookinviteAction extends FacebookAction { diff --git a/actions/facebooklogin.php b/plugins/Facebook/facebooklogin.php index 8ac2477ab..f77aecca3 100644 --- a/actions/facebooklogin.php +++ b/plugins/Facebook/facebooklogin.php @@ -17,9 +17,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); +} -require_once(INSTALLDIR.'/lib/facebookaction.php'); +require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; class FacebookinviteAction extends FacebookAction { @@ -27,25 +29,24 @@ class FacebookinviteAction extends FacebookAction function handle($args) { parent::handle($args); - + $this->error = $error; - + if ($this->flink) { if (!$this->facebook->api_client->users_hasAppPermission('publish_stream') && $this->facebook->api_client->data_getUserPreference( FACEBOOK_PROMPTED_UPDATE_PREF) == 'true') { - + echo '<h1>REDIRECT TO HOME</h1>'; } - } else { + } else { $this->showPage(); } } - function showContent() { - + // If the user has opted not to initially allow the app to have // Facebook status update permission, store that preference. Only // promt the user the first time she uses the app @@ -68,34 +69,31 @@ class FacebookinviteAction extends FacebookAction return; } } - + } else { $this->showLoginForm(); } - + } function showSuccessContent() { - - } function showFormContent() { - } - - function title() + + function title() { return sprintf(_('Login')); } - - function redirectHome() + + function redirectHome() { - + } } diff --git a/scripts/facebookqueuehandler.php b/plugins/Facebook/facebookqueuehandler.php index e13ac4e85..e4ae7d4ee 100755 --- a/scripts/facebookqueuehandler.php +++ b/plugins/Facebook/facebookqueuehandler.php @@ -18,7 +18,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); +define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..')); $shortoptions = 'i::'; $longoptions = array('id::'); @@ -30,9 +30,8 @@ Daemon script for pushing new notices to Facebook. END_OF_FACEBOOK_HELP; -require_once INSTALLDIR.'/scripts/commandline.inc'; - -require_once INSTALLDIR . '/lib/facebookutil.php'; +require_once INSTALLDIR . '/scripts/commandline.inc'; +require_once INSTALLDIR . '/plugins/Facebook/facebookutil.php'; require_once INSTALLDIR . '/lib/queuehandler.php'; class FacebookQueueHandler extends QueueHandler diff --git a/actions/facebookremove.php b/plugins/Facebook/facebookremove.php index ae231c0fb..8531a8e6e 100644 --- a/actions/facebookremove.php +++ b/plugins/Facebook/facebookremove.php @@ -17,9 +17,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); +} -require_once INSTALLDIR.'/lib/facebookaction.php'; +require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; class FacebookremoveAction extends FacebookAction { diff --git a/actions/facebooksettings.php b/plugins/Facebook/facebooksettings.php index b2b1d6807..2f182e368 100644 --- a/actions/facebooksettings.php +++ b/plugins/Facebook/facebooksettings.php @@ -17,9 +17,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); +} -require_once INSTALLDIR.'/lib/facebookaction.php'; +require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; class FacebooksettingsAction extends FacebookAction { @@ -91,16 +93,16 @@ class FacebooksettingsAction extends FacebookAction 'id' => 'facebook_settings')); $this->elementStart('ul', 'form_data'); - + $this->elementStart('li'); - + $this->checkbox('noticesync', _('Automatically update my Facebook status with my notices.'), ($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND) : true); $this->elementEnd('li'); - + $this->elementStart('li'); - + $this->checkbox('replysync', _('Send "@" replies to Facebook.'), ($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true); @@ -115,15 +117,15 @@ class FacebooksettingsAction extends FacebookAction _('A string to prefix notices with.')); $this->elementEnd('li'); - + $this->elementStart('li'); - + $this->submit('save', _('Save')); $this->elementEnd('li'); $this->elementEnd('ul'); - + $this->elementEnd('form'); } else { @@ -148,8 +150,8 @@ class FacebooksettingsAction extends FacebookAction } } - - function title() + + function title() { return _('Sync preferences'); } diff --git a/lib/facebookutil.php b/plugins/Facebook/facebookutil.php index c991c5439..da53f35e2 100644 --- a/lib/facebookutil.php +++ b/plugins/Facebook/facebookutil.php @@ -17,9 +17,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -require_once INSTALLDIR.'/extlib/facebook/facebook.php'; -require_once INSTALLDIR.'/lib/facebookaction.php'; -require_once INSTALLDIR.'/lib/noticelist.php'; +require_once INSTALLDIR . '/plugins/Facebook/facebook/facebook.php'; +require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; +require_once INSTALLDIR . '/lib/noticelist.php'; define("FACEBOOK_SERVICE", 2); // Facebook is foreign_service ID 2 define("FACEBOOK_NOTICE_PREFIX", 1); diff --git a/plugins/FBConnect/fbfavicon.ico b/plugins/Facebook/fbfavicon.ico Binary files differindex c57c0342f..c57c0342f 100644 --- a/plugins/FBConnect/fbfavicon.ico +++ b/plugins/Facebook/fbfavicon.ico diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php index 7caea1bb7..99ad41b37 100755 --- a/scripts/getvaliddaemons.php +++ b/scripts/getvaliddaemons.php @@ -39,7 +39,6 @@ $daemons = array(); $daemons[] = INSTALLDIR.'/scripts/pluginqueuehandler.php'; $daemons[] = INSTALLDIR.'/scripts/ombqueuehandler.php'; -$daemons[] = INSTALLDIR.'/scripts/facebookqueuehandler.php'; $daemons[] = INSTALLDIR.'/scripts/pingqueuehandler.php'; if(common_config('xmpp','enabled')) { |