X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FReverseUsernameAuthentication%2FReverseUsernameAuthenticationPlugin.php;h=dac5a158841a77a483fdd488f852b39dd6a1567a;hb=08745e4eac168996567683a5b91e663a71fafecc;hp=d48283b2ee1d3ac5f7a6b4a876c187dbf877e792;hpb=a42e128c1532c45fd930d98c985f9a8d98ff6868;p=quix0rs-gnu-social.git diff --git a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php index d48283b2ee..dac5a15884 100644 --- a/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php +++ b/plugins/ReverseUsernameAuthentication/ReverseUsernameAuthenticationPlugin.php @@ -31,8 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/plugins/Authentication/AuthenticationPlugin.php'; - class ReverseUsernameAuthenticationPlugin extends AuthenticationPlugin { //---interface implementation---// @@ -49,10 +47,24 @@ 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' => + _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; + } }