X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FReverseUsernameAuthentication%2FReverseUsernameAuthenticationPlugin.php;h=568c1c9584f0b08d4cf7781040a342970fb3924f;hb=1c05ed08453ab4f39687957ec61be61f3b978cf4;hp=d157ea067cf70def1d750451b63d6e93473dd3ae;hpb=a180658a3bfcf2b7b312058e3aa76e0e2467c2f8;p=quix0rs-gnu-social.git diff --git a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php index d157ea067c..568c1c9584 100644 --- a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php +++ b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php @@ -22,7 +22,7 @@ * @category Plugin * @package StatusNet * @author Craig Andrews - * @copyright 2009 Craig Andrews http://candrews.integralblue.com + * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ @@ -47,10 +47,25 @@ 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); } + + function onPluginVersion(&$versions) + { + $versions[] = array('name' => 'Reverse Username Authentication', + 'version' => STATUSNET_VERSION, + 'author' => 'Craig Andrews', + 'homepage' => 'http://status.net/wiki/Plugin:ReverseUsernameAuthentication', + 'rawdescription' => + // TRANS: Plugin description. + _m('The Reverse Username Authentication plugin allows for StatusNet to handle authentication by checking if the provided password is the same as the reverse of the username.')); + return true; + } }