You are missing our premiere tool bar navigation system! Register and use it for FREE!

•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
· Home
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 279 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
How to disable registration

18.6.4. How to disable registration

If you want to make registration of users impossible, you can apply a variation of the solution in Section 18.6.2: you can redirect the users to the main page (index.php) whenever they try to register (e.g. by clicking on some registration link). Note that just by deleting the registration links from the code (see Section 26.5 on how to find them), you still can't prevent a determined user from entering

in the URL box of his browser by hand, thus triggering the "operation new_user" in PHP-Nuke. By this, it becomes clear that a real solution must at least change the behaviour of PHP-Nuke for the value "new_user" of the op URL parameter.

Again, instead of chasing links in the code, there is a more elegant solution:

In modules/Your_Account/index.php find the lines:

case "new_user":

and replace them with with:

case "new_user":
Header("Refresh: 0; url=index.php");

This will only disable registration from the Your Account module (more accurately: it will redirect every registration attempt to the main index.php page).

To disable it in the Forums too, edit modules/Forums/profile.php. Find

else if ( $mode == 'editprofile' || $mode == 'register' )
        if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
                $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/",
                $_SERVER["SERVER_SOFTWARE"]) ) ? "Refresh: 0; URL=" : "Location: ";
                header($header_location .

and change it to something like:

else if ( $mode == 'editprofile' || $mode == 'register' )
        Header("Refresh: 0; url=index.php");

i.e. we again redirect the user to the index.php page. See also How to disable registration.

Tip It's also possible without programming!

As so often in life, it all depends on what you want. You can of course achieve a similar effect, without any programming, if you make the Your Account module accessible to admins only, from the modules administration, in the administration panel.

If you want users to be registered directly, without confirmation mails, see Section 18.6.5. If you want to approve every user who applied for registration, you can use the Approve Membership module (see Section 8.3.4).

Help us make a better PHP-Nuke HOWTO!

Want to contribute to this HOWTO? Have a suggestion or a solution to a problem that was not treated here? Post your comments on my PHP-Nuke Forum!

Chris Karakas, Maintainer PHP-Nuke HOWTO

Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.170 Seconds - 316 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded ( ::