forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: iason on November 26, 2015, 12:03:03 pm

Title: Username longer than 25 characters...?
Post by: iason on November 26, 2015, 12:03:03 pm
Hello Coppermine users,

having installed the latest Coppermine Gallery, during testing, i am realizing an issue that i consider to be important. A user may not have a name with a length greater than 25 characters.
Not being good on the code, i tried to address the issue, searching this forum, and beyond, for a solution.
So:
-in the database, phpmyadmin, in the table '_users', i set the username field to varchar(255)
-and in "usermgr.php", line 729, i change the 'input' to accept 255 characters
and after these two changes, logged in as administrator, i can create/edit a user with a long name.

OK. But a user's name is shown in other pages and places inside the gallery. I do not know ALL the files that must be edited.

I need a way to fix the issue, please.
I probably need a detailed list of all the references in the code that make a user's name appear, so i can edit them.
It is probably some work, but sorry, it is not my fault. I am amazed that this simple thing has been overlooked, it was a matter of making a good choice from the beginning.

Thanks you in advance,
iason

BTW: I think one more field "Name" should be there, "Username" being another.  ;)
Title: Re: Username longer than 25 characters...?
Post by: gmc on November 26, 2015, 01:59:14 pm
I probably need a detailed list of all the references in the code that make a user's name appear, so i can edit them.
I'd suggest a tool like TextCrawler to search the code... There are 575 references in 76 files to user_name in 1.5.40...
That said, I expect most to not care about the length - only the database and form input should care (of course an excessively long username may caused interesting displays when output...)

Quote
BTW: I think one more field "Name" should be there, "Username" being another.  ;)
I'd suggest reading the docs - where you will see you have 6 fields available for your custom use in the user table/profile.  5 are defined as varchar(255) and one as text. http://documentation.coppermine-gallery.net/en/configuration.htm#admin_custom (http://documentation.coppermine-gallery.net/en/configuration.htm#admin_custom)

Quote
It is probably some work, but sorry, it is not my fault. I am amazed that this simple thing has been overlooked, it was a matter of making a good choice from the beginning.
Perhaps you might want to nicely open a feature request rather than criticize those that have written CPG that didn't have the foresight to think you might want to have your users type a 255 character username to get access to your site... ;)
Title: Re: Username longer than 25 characters...?
Post by: iason on November 26, 2015, 02:46:10 pm
Thank you for your suggestions. The documentation is something one must really dive in.

I see now that i can go with an extra custom field for the real name, but IMHO the two fields for username and name should be clearly distinguished by default, and at the same time giving the user the ability to use just one.

Yes i also think that 255 in not practical of course, however 25 for a name is probably short for someone that does not want to use both real name and username.

Thank you, be happy.  :)