From bdf0dfc30d3c44ee6117e55c1c8faef59654e596 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 24 Feb 2010 22:29:46 -0500 Subject: Improve description of what the provide_name parameter means --- plugins/LdapAuthentication/README | 5 ++++- plugins/LdapAuthorization/README | 5 ++++- plugins/ReverseUsernameAuthentication/README | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/LdapAuthentication/README b/plugins/LdapAuthentication/README index 0460fb639..c188f2dbc 100644 --- a/plugins/LdapAuthentication/README +++ b/plugins/LdapAuthentication/README @@ -9,7 +9,10 @@ to the bottom of your config.php Settings ======== -provider_name*: a unique name for this authentication provider. +provider_name*: This is a identifier designated to the connection. + It's how StatusNet will refer to the authentication source. + For the most part, any name can be used, so long as each authentication source has a different identifier. + In most cases there will be only one authentication source used. authoritative (false): Set to true if LDAP's responses are authoritative (if authorative and LDAP fails, no other password checking will be done). autoregistration (false): Set to true if users should be automatically created diff --git a/plugins/LdapAuthorization/README b/plugins/LdapAuthorization/README index 44239d8e0..3a6d8d25e 100644 --- a/plugins/LdapAuthorization/README +++ b/plugins/LdapAuthorization/README @@ -11,7 +11,10 @@ You *cannot* use this plugin without the LDAP Authentication plugin Settings ======== -provider_name*: name of the LDAP authentication provider that this plugin works with. +provider_name*: This is a identifier designated to the connection. + It's how StatusNet will refer to the authentication source. + For the most part, any name can be used, so long as each authentication source has a different identifier. + In most cases there will be only one authentication source used. authoritative (false): should this plugin be authoritative for authorization? uniqueMember_attribute ('uniqueMember')*: the attribute of a group diff --git a/plugins/ReverseUsernameAuthentication/README b/plugins/ReverseUsernameAuthentication/README index e9160ed9b..57b53219e 100644 --- a/plugins/ReverseUsernameAuthentication/README +++ b/plugins/ReverseUsernameAuthentication/README @@ -8,7 +8,10 @@ add "addPlugin('reverseUsernameAuthentication', array('setting'=>'value', 'setti Settings ======== -provider_name*: a unique name for this authentication provider. +provider_name*: This is a identifier designated to the connection. + It's how StatusNet will refer to the authentication source. + For the most part, any name can be used, so long as each authentication source has a different identifier. + In most cases there will be only one authentication source used. password_changeable*: must be set to false. This plugin does not support changing passwords. authoritative (false): Set to true if this plugin's responses are authoritative (meaning if this fails, do check any other plugins or the internal password database). autoregistration (false): Set to true if users should be automatically created when they attempt to login. -- cgit v1.2.3-54-g00ecf From 489bd935ebdaf607e18f0befe2ad85ed905728ad Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 24 Feb 2010 23:20:34 -0500 Subject: Make LDAP connection error fatal - there really is no way to recover from that. --- plugins/LdapAuthentication/LdapAuthenticationPlugin.php | 3 +-- plugins/LdapAuthorization/LdapAuthorizationPlugin.php | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php index 768f0fe7f..1b5dc92e3 100644 --- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php +++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php @@ -199,8 +199,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin $ldap->setErrorHandling(PEAR_ERROR_RETURN); $err=$ldap->bind(); if (Net_LDAP2::isError($err)) { - common_log(LOG_WARNING, 'Could not connect to LDAP server: '.$err->getMessage()); - return false; + throw new Exception('Could not connect to LDAP server: '.$err->getMessage()); } if($config == null) $this->default_ldap=$ldap; diff --git a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php index 7f48ce5e1..19aff42b8 100644 --- a/plugins/LdapAuthorization/LdapAuthorizationPlugin.php +++ b/plugins/LdapAuthorization/LdapAuthorizationPlugin.php @@ -167,7 +167,7 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin $ldap->setErrorHandling(PEAR_ERROR_RETURN); $err=$ldap->bind(); if (Net_LDAP2::isError($err)) { - common_log(LOG_WARNING, 'Could not connect to LDAP server: '.$err->getMessage()); + throw new Exception('Could not connect to LDAP server: '.$err->getMessage()); return false; } if($config == null) $this->default_ldap=$ldap; @@ -185,6 +185,9 @@ class LdapAuthorizationPlugin extends AuthorizationPlugin if($ldap==null) { $ldap = $this->ldap_get_connection(); } + if(! $ldap) { + throw new Exception("Could not connect to LDAP"); + } $filter = Net_LDAP2_Filter::create($this->attributes['username'], 'equals', $username); $options = array( 'attributes' => $attributes -- cgit v1.2.3-54-g00ecf From eb724bfdc85d0b50d6f5be60e1e11296ebe11247 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Thu, 25 Feb 2010 15:34:01 -0500 Subject: Add TabFocus (for die-hard Twitter users) plugin --- plugins/TabFocus/TabFocusPlugin.php | 57 +++++++++++++++++++++++++++++++++++++ plugins/TabFocus/tabfocus.js | 7 +++++ 2 files changed, 64 insertions(+) create mode 100644 plugins/TabFocus/TabFocusPlugin.php create mode 100644 plugins/TabFocus/tabfocus.js (limited to 'plugins') diff --git a/plugins/TabFocus/TabFocusPlugin.php b/plugins/TabFocus/TabFocusPlugin.php new file mode 100644 index 000000000..bf89c478c --- /dev/null +++ b/plugins/TabFocus/TabFocusPlugin.php @@ -0,0 +1,57 @@ +. + * + * @category Plugin + * @package StatusNet + * @author Craig Andrews + * @author Paul Irish + * @copyright 2009 Craig Andrews http://candrews.integralblue.com + * @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')) { + exit(1); +} + +class TabFocusPlugin extends Plugin +{ + function __construct() + { + parent::__construct(); + } + + function onEndShowScripts($action) + { + $action->script('plugins/TabFocus/tabfocus.js'); + } + + function onPluginVersion(&$versions) + { + $versions[] = array('name' => 'TabFocus', + 'version' => STATUSNET_VERSION, + 'author' => 'Craig Andrews and Paul Irish', + 'homepage' => 'http://status.net/wiki/Plugin:TabFocus', + 'rawdescription' => + _m('TabFocus changes the notice form behavior so that, while in the text area, pressing the tab key focuses the "Send" button, matching the behavor of Twitter.')); + return true; + } +} diff --git a/plugins/TabFocus/tabfocus.js b/plugins/TabFocus/tabfocus.js new file mode 100644 index 000000000..e2c1c6521 --- /dev/null +++ b/plugins/TabFocus/tabfocus.js @@ -0,0 +1,7 @@ +jQuery(function($){ + $('#notice_data-text').bind('keydown',function(e){ + if (e.which==9) { + setTimeout(function(){ $('#notice_action-submit').focus(); },15); + } + }); +}); -- cgit v1.2.3-54-g00ecf