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
http://www.yourdomain.com/modules.php?name=Your_Account&op=new_user
|
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":
new_user();
break;
|
and replace them with with:
case "new_user":
Header("Refresh: 0; url=index.php");
break;
|
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 .
append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile",
true));
exit;
}
include("includes/usercp_register.php");
exit;
}
|
and change it to something like:
else if ( $mode == 'editprofile' || $mode == 'register' )
{
Header("Refresh: 0; url=index.php");
exit;
}
|
i.e. we again redirect the user to the index.php page. See also How to disable registration.
 |
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).