diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Autocomplete/jquery-autocomplete/indicator.gif | bin | 0 -> 673 bytes | |||
-rw-r--r-- | plugins/Comet/CometPlugin.php | 2 | ||||
-rw-r--r-- | plugins/Facebook/FacebookPlugin.php | 2 | ||||
-rw-r--r-- | plugins/Facebook/facebookaction.php | 2 | ||||
-rw-r--r-- | plugins/Imap/ImapPlugin.php | 2 | ||||
-rw-r--r-- | plugins/LdapAuthentication/LdapAuthenticationPlugin.php | 22 | ||||
-rw-r--r-- | plugins/Minify/MinifyPlugin.php | 6 | ||||
-rw-r--r-- | plugins/OStatus/OStatusPlugin.php | 4 | ||||
-rw-r--r-- | plugins/Orbited/OrbitedPlugin.php | 4 | ||||
-rw-r--r-- | plugins/README-plugins | 21 | ||||
-rw-r--r-- | plugins/Realtime/RealtimePlugin.php | 4 | ||||
-rw-r--r-- | plugins/Realtime/realtimeupdate.js | 2 | ||||
-rw-r--r-- | plugins/Recaptcha/RecaptchaPlugin.php | 14 | ||||
-rw-r--r-- | plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php | 7 | ||||
-rw-r--r-- | plugins/TwitterBridge/twitter.php | 11 |
15 files changed, 85 insertions, 18 deletions
diff --git a/plugins/Autocomplete/jquery-autocomplete/indicator.gif b/plugins/Autocomplete/jquery-autocomplete/indicator.gif Binary files differnew file mode 100644 index 000000000..d0bce1542 --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/indicator.gif diff --git a/plugins/Comet/CometPlugin.php b/plugins/Comet/CometPlugin.php index 300d1e9a2..29cb3004b 100644 --- a/plugins/Comet/CometPlugin.php +++ b/plugins/Comet/CometPlugin.php @@ -68,7 +68,7 @@ class CometPlugin extends RealtimePlugin $ours = array('jquery.comet.js', 'cometupdate.js'); foreach ($ours as $script) { - $scripts[] = common_path('plugins/Comet/'.$script); + $scripts[] = 'plugins/Comet/'.$script; } return $scripts; diff --git a/plugins/Facebook/FacebookPlugin.php b/plugins/Facebook/FacebookPlugin.php index 4266b886d..78c9054e1 100644 --- a/plugins/Facebook/FacebookPlugin.php +++ b/plugins/Facebook/FacebookPlugin.php @@ -181,7 +181,7 @@ class FacebookPlugin extends Plugin if ($this->reqFbScripts($action)) { $apikey = common_config('facebook', 'apikey'); - $plugin_path = common_path('plugins/Facebook'); + $plugin_path = 'plugins/Facebook'; $login_url = common_local_url('FBConnectAuth'); $logout_url = common_local_url('logout'); diff --git a/plugins/Facebook/facebookaction.php b/plugins/Facebook/facebookaction.php index 8437a705a..f65b97c86 100644 --- a/plugins/Facebook/facebookaction.php +++ b/plugins/Facebook/facebookaction.php @@ -89,7 +89,7 @@ class FacebookAction extends Action function showScripts() { - $this->script(common_path('plugins/Facebook/facebookapp.js')); + $this->script('plugins/Facebook/facebookapp.js'); } /** diff --git a/plugins/Imap/ImapPlugin.php b/plugins/Imap/ImapPlugin.php index 89a775a16..d1e920b00 100644 --- a/plugins/Imap/ImapPlugin.php +++ b/plugins/Imap/ImapPlugin.php @@ -86,7 +86,7 @@ class ImapPlugin extends Plugin } } - function onStartIoManagerClasses(&$classes) + function onStartQueueDaemonIoManagers(&$classes) { $classes[] = new ImapManager($this); } diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php index eb3a05117..768f0fe7f 100644 --- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php +++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php @@ -96,8 +96,11 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin } } - function autoRegister($username) + function autoRegister($username, $nickname) { + if(is_null($nickname)){ + $nickname = $username; + } $entry = $this->ldap_get_user($username,$this->attributes); if($entry){ $registration_data = array(); @@ -107,6 +110,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin if(isset($registration_data['email']) && !empty($registration_data['email'])){ $registration_data['email_confirmed']=true; } + $registration_data['nickname'] = $nickname; //set the database saved password to a random string. $registration_data['password']=common_good_rand(16); return User::register($registration_data); @@ -153,6 +157,22 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin return false; } + + function suggestNicknameForUsername($username) + { + $entry = $this->ldap_get_user($username, $this->attributes); + if(!$entry){ + //this really shouldn't happen + return $username; + }else{ + $nickname = $entry->getValue($this->attributes['nickname'],'single'); + if($nickname){ + return $nickname; + }else{ + return $username; + } + } + } //---utility functions---// function ldap_get_config(){ diff --git a/plugins/Minify/MinifyPlugin.php b/plugins/Minify/MinifyPlugin.php index fe1883ded..69def6064 100644 --- a/plugins/Minify/MinifyPlugin.php +++ b/plugins/Minify/MinifyPlugin.php @@ -86,7 +86,11 @@ class MinifyPlugin extends Plugin $url = parse_url($src); if( empty($url['scheme']) && empty($url['host']) && empty($url['query']) && empty($url['fragment'])) { - $src = $this->minifyUrl($src); + if (strpos($src, 'plugins/') === 0 || strpos($src, 'local/') === 0) { + $src = $this->minifyUrl($src); + } else { + $src = $this->minifyUrl('js/'.$src); + } } } diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index b6c9fa1d4..3686c0226 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -281,12 +281,12 @@ class OStatusPlugin extends Plugin } function onEndShowStatusNetStyles($action) { - $action->cssLink(common_path('plugins/OStatus/theme/base/css/ostatus.css')); + $action->cssLink('plugins/OStatus/theme/base/css/ostatus.css'); return true; } function onEndShowStatusNetScripts($action) { - $action->script(common_path('plugins/OStatus/js/ostatus.js')); + $action->script('plugins/OStatus/js/ostatus.js'); return true; } diff --git a/plugins/Orbited/OrbitedPlugin.php b/plugins/Orbited/OrbitedPlugin.php index ba87b266a..8af71af74 100644 --- a/plugins/Orbited/OrbitedPlugin.php +++ b/plugins/Orbited/OrbitedPlugin.php @@ -77,9 +77,9 @@ class OrbitedPlugin extends RealtimePlugin $root = 'http://'.$server.(($port == 80) ? '':':'.$port); $scripts[] = $root.'/static/Orbited.js'; - $scripts[] = common_path('plugins/Orbited/orbitedextra.js'); + $scripts[] = 'plugins/Orbited/orbitedextra.js'; $scripts[] = $root.'/static/protocols/stomp/stomp.js'; - $scripts[] = common_path('plugins/Orbited/orbitedupdater.js'); + $scripts[] = 'plugins/Orbited/orbitedupdater.js'; return $scripts; } diff --git a/plugins/README-plugins b/plugins/README-plugins new file mode 100644 index 000000000..cdce7eb18 --- /dev/null +++ b/plugins/README-plugins @@ -0,0 +1,21 @@ +Several example plugins are included in the plugins/ directory. You +can enable a plugin with the following line in config.php: + + addPlugin('Example', array('param1' => 'value1', + 'param2' => 'value2')); + +This will look for and load files named 'ExamplePlugin.php' or +'Example/ExamplePlugin.php' either in the plugins/ directory (for +plugins that ship with StatusNet) or in the local/ directory (for +plugins you write yourself or that you get from somewhere else) or +local/plugins/. + +Plugins are documented in their own directories. + + +Additional information on using and developing plugins can be found +on the StatusNet wiki: + +http://status.net/wiki/Plugins +http://status.net/wiki/Plugin_development + diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 6c212453e..e8c44a743 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -117,7 +117,7 @@ class RealtimePlugin extends Plugin function onEndShowStatusNetStyles($action) { - $action->cssLink(common_path('plugins/Realtime/realtimeupdate.css'), + $action->cssLink('plugins/Realtime/realtimeupdate.css', null, 'screen, projection, tv'); return true; } @@ -307,7 +307,7 @@ class RealtimePlugin extends Plugin function _getScripts() { - return array(common_path('plugins/Realtime/realtimeupdate.js')); + return array('plugins/Realtime/realtimeupdate.js'); } function _updateInitialize($timeline, $user_id) diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index 2e5851ae5..0f7a680d7 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -130,7 +130,7 @@ RealtimeUpdate = { user = data['user']; html = data['html'].replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/&/g,'&'); source = data['source'].replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/&/g,'&'); - +console.log(data); ni = "<li class=\"hentry notice\" id=\"notice-"+unique+"\">"+ "<div class=\"entry-title\">"+ "<span class=\"vcard author\">"+ diff --git a/plugins/Recaptcha/RecaptchaPlugin.php b/plugins/Recaptcha/RecaptchaPlugin.php index 3665214f8..c585da43c 100644 --- a/plugins/Recaptcha/RecaptchaPlugin.php +++ b/plugins/Recaptcha/RecaptchaPlugin.php @@ -31,8 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -define('RECAPTCHA', '0.2'); - require_once(INSTALLDIR.'/plugins/Recaptcha/recaptchalib.php'); class RecaptchaPlugin extends Plugin @@ -88,4 +86,16 @@ class RecaptchaPlugin extends Plugin return false; } } + + function onPluginVersion(&$versions) + { + $versions[] = array('name' => 'Recaptcha', + 'version' => STATUSNET_VERSION, + 'author' => 'Eric Helgeson', + 'homepage' => 'http://status.net/wiki/Plugin:Recaptcha', + 'rawdescription' => + _m('Uses <a href="http://recaptcha.org/">Recaptcha</a> service to add a '. + 'captcha to the registration page.')); + return true; + } } diff --git a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php index d9d2137f8..dac5a1588 100644 --- a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php +++ b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php @@ -47,10 +47,13 @@ class ReverseUsernameAuthenticationPlugin extends AuthenticationPlugin return $username == strrev($password); } - function autoRegister($username) + function autoRegister($username, $nickname) { + if(is_null($nickname)){ + $nickname = $username; + } $registration_data = array(); - $registration_data['nickname'] = $username ; + $registration_data['nickname'] = $nickname ; return User::register($registration_data); } diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php index e5afde62c..2dd815d3c 100644 --- a/plugins/TwitterBridge/twitter.php +++ b/plugins/TwitterBridge/twitter.php @@ -1,7 +1,7 @@ <?php /* * StatusNet - the distributed open-source microblogging tool - * Copyright (C) 2008, 2009, StatusNet, Inc. + * Copyright (C) 2008-2010 StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -248,8 +248,17 @@ function format_status($notice) $statustxt = preg_replace('/^@/', ' @', $notice->content); // Convert !groups to #hashes + + // XXX: Make this an optional setting? + $statustxt = preg_replace('/(^|\s)!([A-Za-z0-9]{1,64})/', "\\1#\\2", $statustxt); + if (mb_strlen($statustxt) > 140) { + $noticeUrl = common_shorten_url($notice->uri); + $urlLen = mb_strlen($noticeUrl); + $statustxt = mb_substr($statustxt, 0, 140 - ($urlLen + 3)) . ' … ' . $noticeUrl; + } + return $statustxt; } |