Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How do I increase the user handle size?

+1 vote
196 views
asked Mar 15, 2013 in Q2A Core by mbentley
I have a site set up with LDAP.  It works great for most North American names.  

Unfortunately, we have several staff with names longer than 20 characters.  Besides widening the qa_users.handle field, any suggestions for what else I should be looking at to get the Q2A core to work with a wider handle (say 64 chars)?
Q2A version: 1.5.4
commented Apr 29, 2013 by mbentley
Any suggestions anyone?  I suspect that this is messing up a number of other users as well.
commented Apr 28, 2016 by Scott
How does your integration work? Are you using a login module? Q2A's character limit shouldn't matter.

1 Answer

+2 votes
answered Apr 28, 2016 by Praneeth Nilanga Pei
selected May 1, 2016 by mbentley
 
Best answer

In qa-include\plugins\qa-filter-basic.php (around line 52)

if (qa_strlen($handle) > QA_DB_MAX_HANDLE_LENGTH) {
    return qa_lang_sub('main/max_length_x', QA_DB_MAX_HANDLE_LENGTH);
}

This means, it gets the values from QA_DB_MAX_HANDLE_LENGTH.

There are two things you should do.

  1. Change the handle field in the user table.
    • Go to phpMyAdmin (or equivalent) and locate the table named <prefix>_users (i.e.qa_users)
    • Change the length of the field named "handle" to the desired length
  2. define the value for QA_DB_MAX_HANDLE_LENGTH
    • Locate the config file and add the following line.
    • define('QA_DB_MAX_HANDLE_LENGTH', 64);
...