Firefox PHP

[5.2.7] Patch: Disable/Enable user registration

Posted by Tblue 
[5.2.7] Patch: Disable/Enable user registration
May 14, 2008 06:23PM
Hello,

I've just installed Phorum and found it quite nice. I missed only one feature: Disabling the user registration. In the support forums I've found the recommendation to delete registration.php, but I think that's not the best solution because all the links to the registration page will remain visible (and will be broken). So I've made a patch.

My patch adds a new configuration option Enable registration in the admin control panel under General Settings -> User Settings. It this option is disabled, new users cannot register themselves, only confirming accounts is possible.
The patch also defines a new template variable RegEnabled which makes it easy to hide any links that point to the registration page. Furthermore, a new language variable RegDisabled is used. The variable should contain the appropriate error message which will be shown to users trying to register.

I've already modified the three standard templates of Phorum and the English language file. I've also changed the German language files of Oliver Riesen.

You can download the patch for Phorum 5.2.7 here. Of course there is no warranty for correct operation. I'm not responsible for any damage that can occur due the use of my patch, you are using it on your own risk.

Installation instructions for Linux (and possibly other operating systems):
  • Back up your existing Phorum installation.
  • Be sure to have the program patch installed. Normally you can install it with your package manager (e.g. apt, pacman, ...).
  • Download the patch file (above).
  • In Phorum's root directory (the directory which holds, for example, the files common.php and register.php), execute the following command: patch -p1 < path/to/the/patch-file.patch.
  • You're done! Try to disable the registration to see if the patch works.

Please let me know what do you think about this patch.
You can consider this thread as a feature request, if you wish. :-) It would be great if this feature would be included in future Phorum versions.

Tblue

P. S.: I'm sorry if my english isn't the best, I'm from germany. Feel free to correct me. :-)



Edited 3 time(s). Last edit at 05/14/2008 06:37PM by Tblue.
Re: [5.2.7] Patch: Disable/Enable user registration
May 15, 2008 10:26PM
Hi Tblue,

Quote
Tblue
I missed only one feature: Disabling the user registration.

I think it's also possible to do that with a module, there's no need for a patch.

Quote
Tblue
My patch adds a new configuration option Enable registration in the admin control panel under General Settings -> User Settings. It this option is disabled, new users cannot register themselves, only confirming accounts is possible.
The patch also defines a new template variable RegEnabled which makes it easy to hide any links that point to the registration page. Furthermore, a new language variable RegDisabled is used. The variable should contain the appropriate error message which will be shown to users trying to register.

These things you can do easily with a small module (and some documented templates changes).

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: [5.2.7] Patch: Disable/Enable user registration
May 16, 2008 07:58PM
Thanks, I've managed it to write a little module that does the same thing as my patch. After reading the Phorum docs about modules I've found the right hooks... Sorry, haven't thought about that before.
So if someone is interested, here is the module (works only with Phorum >= 5.2.7). Simply activate it and the registration will be disabled. The module also sets the template variable RegDisabled to true, so that all links to register.php and the registration form itself can be hidden easily.



Edited 2 time(s). Last edit at 05/16/2008 08:16PM by Tblue.
Re: [5.2.7] Patch: Disable/Enable user registration
May 27, 2008 08:21PM
@Tblue :

You can create a topic here :
[www.phorum.org]

Your module look great !
Sorry, only registered users may post in this forum.

Click here to login