• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Prevent Gender Change

James

Well-known member
This modification will prevent users from changing their gender once it has been set.

If a user's gender is unspecified, the user will be allowed to change their gender. Once a gender is specified (either male/female) the user cannot change their gender at all.

Installation Instructions
  • Download the attached zip file
  • Upload the library folder to your XF root
  • Install the addon-NoGenderChange.xml by going to ACP -> Install Add-on
Uninstallation Instructions
  • Uninstall the Prevent Gender Change add-on from your ACP -> List Add-ons
  • Delete the NoGenderChange directory from the library directory
Notes
This add-on uses one phrase named NoGenderChange_cannot_change_gender_once_set which you are free to edit at leisure.
Feedback is appreciated!

Enjoy :)
 

Attachments

Can someone confirm this bug with this mod enabled:
Changing/Adding/Deleting Identity Services doesn't work.

I've experienced it on my install, looking at a fix but I'm baffled atm!
 
James getting a few database errors on 1.0.3

all-time pass-by-reference has been deprecated


library/NoGenderChange/ControllerPublic/Account.php:16
 
James getting a few database errors on 1.0.3

all-time pass-by-reference has been deprecated

library/NoGenderChange/ControllerPublic/Account.php:16
Will look into this tomorrow. In the meantime, can you remove the ampersand from &$errors in the function parameters and see if that resolves it?
 
I wonder, is this add-on still required in 1.1?

I noticed that the Custom User Fields video (02:02) shows an option for "Editable only once", and wondered if this could now be used on the Gender field as stock? I don't have 1.1 so can't look into it myself.. :coffee:
 
Gender isn't a custom user field, plus this add-on needs updating and bugfixing which is on my list.
 
I was aware of that, but wondered if the functionality had been extended to non-custom fields.

I'm using 1.0.2, so haven't run in to the reported bugs with the add-on.. :)
 
I moved host, and appear to have bumped in to the above mentioned error.
I don't know if you've now bumped in to it youself and have the full error, but I noticed it wasn't posted here, so...

In full;
Code:
An exception occurred: Call-time pass-by-reference has been deprecated in /public_html/library/NoGenderChange/ControllerPublic/Account.php on line 16

XenForo_Application::handlePhpError() in XenForo/Autoloader.php at line 119
XenForo_Autoloader::autoload() in XenForo/Autoloader.php at line 119
XenForo_Autoloader->autoload() in XenForo/Application.php at line 852
XenForo_Application::autoload() in XenForo/Application.php at line 397
XenForo_Application::resolveDynamicClass() in XenForo/FrontController.php at line 402
XenForo_FrontController->_getValidatedController() in XenForo/FrontController.php at line 302
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
XenForo_FrontController->run() in /public_html/index.php at line 13
I can also confirm that removing the ampersand from two instances of &$errors doesn't work.
 
Top Bottom