[SOLVED] How to change web maximum login name field?

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

[SOLVED] How to change web maximum login name field?

Postby mikenol » Thu Jul 04, 2013 1:08 am

Hello folks. I am new to TestLink. It was very easy to setup and get running but I ran into something I cannot figure out.

I am using TestLink 1.9 and Uniform Server 8.8.6. It appears that the web login name field only allows 30 characters to be entered. We will be using LDAP so the users name can/will exceed 30 characters (firstname.lastname@corp.companyname.com).

Is there a configuration option to change the length of this field? I searched the forum, web, users guide, etc. but couldn't find anything.

Thanks for any help.
Mike
mikenol
TestLink user
 
Posts: 7
Joined: Wed Jul 03, 2013 9:20 pm

Re: How to change web maximum login name field?

Postby fman » Mon Jul 08, 2013 7:19 pm

hmm have you did some search on sql scripts provided to setup the db?
I'm sure your are going to find part of answers there.
Return here for with your findings, please
fman
Member of TestLink Community
 
Posts: 3063
Joined: Tue Nov 15, 2005 7:19 am

Re: How to change web maximum login name field?

Postby mikenol » Thu Jul 11, 2013 11:57 am

Thanks fman. I was hoping there was a standard configuration option for it.

I found "login varchar(30) NOT NULL" in install/sql/mssql/testlink_create_tables.sql.
Am assuming that is the correct field and it would require that I change that value and then recreate the database correct (not a database guru so don't know if I can just change the length of an existing field)?

I still cannot seem to find where the web page is limiting the field. I would think it is in a PHP file somewhere unless they are doing something tricky and reading the length of the database field dynamically. Any idea where that is?
Mike
mikenol
TestLink user
 
Posts: 7
Joined: Wed Jul 03, 2013 9:20 pm

Re: How to change web maximum login name field?

Postby mikenol » Thu Jul 11, 2013 4:10 pm

I started over installing testlink and changed the "login varchar(30) NOT NULL" in install/sql/mssql/testlink_create_tables.sql to "login varchar(50) NOT NULL" so the database would be correct.

I then hunted around and found and changed the following...
lib\functions\tlUser.class.php:
$this->maxLoginLength = 30; -> $this->maxLoginLength = 50;
lib\usermanagement\usersEdit.php:
"login" => array(tlInputParameter::STRING_N,0,30), -> "login" => array(tlInputParameter::STRING_N,0,50),
firstLogin.php:
"login" => array(tlInputParameter::STRING_N,0,30), -> "login" => array(tlInputParameter::STRING_N,0,50),
login.php:
"tl_login" => array(tlInputParameter::STRING_N,0,30), -> "tl_login" => array(tlInputParameter::STRING_N,0,50),
lostPassword.php:
$iParams = array("login" => array(tlInputParameter::STRING_N,0,30)); -> $iParams = array("login" => array(tlInputParameter::STRING_N,0,50));

Still no joy. The "Login Name" field on the all three pages (main, new user, lost password) still only allows 30 characters. Really thought all of that was going to work.

Anyone have any ideas on what else to try?
Mike
mikenol
TestLink user
 
Posts: 7
Joined: Wed Jul 03, 2013 9:20 pm

Re: How to change web maximum login name field?

Postby mikenol » Thu Jul 11, 2013 4:39 pm

I finally found it!!!

It was LOGIN_MAXLEN=30 in gui\templates\input_dimensions.conf. Changed that to 50 and viola!

Think I needed to modify the other files and fields and recreate the database for it all to work properly anyway so left them with the current edits.

Will see if I run into any other snags.
Mike
mikenol
TestLink user
 
Posts: 7
Joined: Wed Jul 03, 2013 9:20 pm

Re: How to change web maximum login name field?

Postby mikenol » Thu Jul 11, 2013 10:59 pm

A final update.

If you are using Uniform Server, it comes with MySQL not MS SQL so you have to modify `login` varchar(30) NOT NULL default '', (change to 50) in install/sql/mysql/testlink_create_tables.sql, not the one in the install/mssql file. Oops....

The good news is because I modified the wrong file initially, I went ahead and figured out how to modify the existing database field. I was able to change the login field of the users table to be 50 instead of 30. For reference, here are the SQL commands I used.

Start the MySQL console using the button on the GUI after running "Start_as_Program.exe" or "Start_as_Service.exe" in the root of Uniform Server directory.
Run the following commands:
mysql -h localhost -u root -p
Enter the database root account password
show databases;
use {your_testlink_database}
Where {your_testlink_database} is the database name you provided during the testlink setup, "use mytestlink" for example
The name will be listed in the output of the show databases command you ran above
show tables;
SELECT * FROM users;
Shows the current users in the database
show columns from users;
Shows login field is 30 characters
alter table users modify login VARCHAR (50);
Changes login field of users table from 30 to 50 characters
show columns from users;
Shows login field is now 50 characters

Everything seems to be working now. I can create users with names longer than 30 characters and successfully log in with said accounts.

Hope this helps other folks.
Mike
mikenol
TestLink user
 
Posts: 7
Joined: Wed Jul 03, 2013 9:20 pm


Return to Installation and configuration



Who is online

Users browsing this forum: No registered users and 1 guest