X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FLdapAuthentication%2FLdapAuthenticationPlugin.php;h=0efaec99b201b8b6d61e0d42f54070242393bfec;hb=546a03b5eac5f172d543a889625e2f4de446e8b7;hp=0dfc4c63be15437841b6705871da3af637088eca;hpb=d57e1deaec7406c63f70b8a5664746d18c1125ff;p=quix0rs-gnu-social.git diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php index 0dfc4c63be..0efaec99b2 100644 --- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php +++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.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/ */ @@ -36,22 +36,26 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin function onInitializePlugin(){ parent::onInitializePlugin(); if(!isset($this->attributes['nickname'])){ - throw new Exception("must specify a nickname attribute"); + // TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration. + throw new Exception(_m('You must specify a nickname attribute.')); } if($this->password_changeable && (! isset($this->attributes['password']) || !isset($this->password_encoding))){ - throw new Exception("if password_changeable is set, the password attribute and password_encoding must also be specified"); + // TRANS: Exception thrown when initialising the LDAP Auth plugin fails because of an incorrect configuration. + throw new Exception(_m('If password_changeable is set, the password attribute and password_encoding must also be specified.')); } $this->ldapCommon = new LdapCommon(get_object_vars($this)); } function onAutoload($cls) - { + { switch ($cls) { case 'LdapCommon': require_once(INSTALLDIR.'/plugins/LdapCommon/LdapCommon.php'); return false; } + + return parent::onAutoload($cls); } function onEndShowPageNotice($action) @@ -63,11 +67,13 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin { case 'register': if($this->autoregistration) { - $instr = 'Have an LDAP account? Use your standard username and password.'; + // TRANS: Instructions for LDAP authentication. + $instr = _m('Do you have an LDAP account? Use your standard username and password.'); } break; case 'login': - $instr = 'Have an LDAP account? Use your standard username and password.'; + // TRANS: Instructions for LDAP authentication. + $instr = _m('Do you have an LDAP account? Use your standard username and password.'); break; default: return true; @@ -79,7 +85,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin } return true; } - + //---interface implementation---// function checkPassword($username, $password) @@ -108,7 +114,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin } $registration_data['nickname'] = $nickname; //set the database saved password to a random string. - $registration_data['password']=common_good_rand(16); + $registration_data['password']=common_random_hexstr(16); return User::register($registration_data); }else{ //user isn't in ldap, so we cannot register him @@ -136,13 +142,14 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin return common_nicknamize($nickname); } - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $versions[] = array('name' => 'LDAP Authentication', - 'version' => STATUSNET_VERSION, + 'version' => GNUSOCIAL_VERSION, 'author' => 'Craig Andrews', 'homepage' => 'http://status.net/wiki/Plugin:LdapAuthentication', 'rawdescription' => + // TRANS: Plugin description. _m('The LDAP Authentication plugin allows for StatusNet to handle authentication through LDAP.')); return true; }