Recent Topics

1 Feb 25, 2009 11:07    

My b2evolution Version: 2.x

I have searched trough the forum and apologize if I have missed a thread on this topic.

I would like to change the maximum username length from 20 to 32 characters.

I can cope with:
<i>mysql> alter table evo_users modify user_login varchar(32);</i>
but when I grepped through the blogs directory, I could not find anywhere to set the username string length. It looked as if the value "20" was hardcoded in at various places. Is there a "good" way to set this value? Any pointers would be gratefully received.

Thanks in advance

2 Feb 26, 2009 06:22

Howdy rayH. Welcome to the forums! We've been waiting for you!!! There used to be a lot more people here but some folk were like "rayH ain't gonna show up so I'm going home". Their loss eh?

So: after modifying the table can you edit your login to be longer than 20 characters? If so the next bit is all you need. If not the next bit is something you'll need, and we'll have to find the rest of it somewhere else.

The registration form is limiting login length to 20 characters. /skins_adm/login/_reg_form.main.php around line 51 looks sorta like this:

$Form->text_input( 'login', $login, 16,  T_('Login'), '', array( 'maxlength'=>20, 'class'=>'input_text', 'required'=>true ) );

I'm thinking the bit that says "'maxlength' shoots an arrow at 20" would make you sing and dance if it shot an arrow at 32 instead eh?

There might be other places it is limiting like that, but I kinda think that's gonna do the deed for ya.

3 Feb 26, 2009 09:11

Thanks Eugene,

I am very new to b2evo
I had hoped that there would be a table of variables rather than having to hack away.

.../skins_adm/login/_reg_form.main.php only seems to affect the user login page. Besides changing the array maxlength from 20 to 32, I also changed the input box size from 16 to 32

I have had to modify .../inc/users/views/_user.form.php in order to change the user create/modify form in the backoffice. I also changed .../inc/collections/views/_coll_general.form.php
In both these files I changed
$edited_User->login, 20, to $edited_User->login, 32,

20 chars seems a very short limitation on the username and I think that it would be better at 60 chars.

I am adding b2evo to the members-only section of a site and have migrated the user autentication from htpasswd to apache2-mod_auth_mysql using the evo_users table. The next thing is to enable sinultaneous authentication to the site and b2evo.

4 Feb 26, 2009 09:20

rayH wrote:

Thanks Eugene

You're welcome, but that's a title. I was named after ethylene dibromide. My parents were into drugs is the thing.


Form is loading...