Forums | Mahara Community
Support
/
Changing required fields for user accounts
13 March 2018, 10:52
Hi,
I'm running a Mahara 17.10.3 instance on CentOS 7.4.1708, with PHP 7.1.14, MariaDB 5.5.56 and Apache 2.4.6
In our usage scenario there is no need for the users to enter their real name, so we want to make it optional. I've scrolled through the manual and the options, but I didn't stumble upon anything that would do the trick for me.
Is there an option to modify the required fields for user accounts? If so, how would I go about making first and last name optional fields?
Thanks
Arvid
19 March 2018, 17:04
Hello Arvid,
This may not be a simple change as it's not possible to make the field optional through the front-end at /admin/extensions/pluginconfig.php?plugintype=artefact&pluginname=internal&type=profile
A quick fix would be for you to make the display name mandatory and allow people to hide their real name (Admin -> Configure site -> User settings -> Say "Yes" for "Users can hide real names"). Then regular users would only see the display name of another person, which doesn't have to be their full name. Only admins and staff would be able to see the real names.
If that is not enough, more digging would be needed.
Cheers
Kristina
20 March 2018, 1:45
Hi Kristina,
thank you for your reply. I've actually already enabled the option you are talking about.
The thing is that we don't want to save any more data than needed (and aren't really allowed to). When you are talking about more digging, are you talking about changing some database values or does this imply deeper modifications?
If there is a way to disable real names being mandatory, how would I go about finding it?
If it is really time-consuming or hard, I wouldn't mind to use a workaround like entering an obviously fake name for those accounts. Our expected user base is not that big, keeping such a solution manageable.
Thanks
Arvid
20 March 2018, 16:27
Hello Arvid,
With "more digging" I meant that someone with code knowledge would be needed to provide insight. There is no possibility in the site settings to disable the last name.
Cheers
Kristina
17 April 2018, 9:35
Hi Arvid,
Unfortunately there are many places in the Mahara system that expect the firstname/lastname fields to be filled in. Things like emailing users, displaying ownership etc.
If you didn't want the users to set firstname/lastname values you could adjust the fields in the database so that they were filled in by default with a generic value, say 'Mahara User'
To do so you'd need to run a command like (for postgres)
ALTER TABLE usr ALTER COLUMN firstname SET DEFAULT 'Mahara';
ALTER TABLE usr ALTER COLUMN lastname SET DEFAULT 'User';
Let me know if that helps/works
Cheers
Robert