Currently, if you want to disable the Registration page in the website that generated with PHPMaker, then you have to adjust the related setting from PHPMaker application, afterwards you have to re-generate the related script files to apply the changes.
The following customization will make the ability to disable or enable the Registration page by simply adjusting the related constant value from your configuration file. In other words, we don't have to re-generate the script files each time we want to enable/disable the Registration page.
I have added a new constant in the configuration file. If you want to disable the Registration page, then adjust the constant value to FALSE. If you want to enable it again, then simply switch it back to TRUE. The customization will also handle if users is trying to access the Registration page directly if the Registration page has been disabled (even the Register link has been hidden on the Login page). User will be automatically redirected back to the Login page if this condition is met.
After implementing this customization, then you don't need to re-generate your script files using PHPMaker each time you want to enable or disable the Registration page.
[hidepost]
-
Open your /Script/ewcfg.php file, and find this code:
// User table filters
after that line, please insert the following code:
<!--## If PROJ.SecRegisterPage Then ##--> define("EW_USER_REGISTRATION", TRUE, TRUE); // change the second parameter to FALSE if you want to disable the Registration page <!--## End If ##--> -
Open your /Script/login.php file, and find this code:
<a href="<!--##=sFnRegister##-->"><!--##@Register##--></a>
then replace it with the following code:
<?php if (EW_USER_REGISTRATION) { ?> <a href="<!--##=sFnRegister##-->"><!--##@Register##--></a> <?php } ?> -
Open your /Script/phpcommon-scripts.php file, and find this code:
$UserProfile = new cUserProfile();
after that line, please insert the following code:
<!--## If LCase(CTRL.CtrlID) = "register" Then ##--> if (EW_USER_REGISTRATION==FALSE) { header("Location: login.php"); } <!--## End If ##--> - Finally, re-generate your script files, especially the ewcfg8.php, login.php, and register.php files, using PHPMaker application.
[/hidepost]
Leave a Reply
You must be logged in to post a comment.