Website Membership

3 posts by 2 authors in: Forums > CMS Builder
Last Post: February 27, 2014   (RSS)

By gregThomas - February 26, 2014

Hi Craig,

I'm guessing that you want a user to initially be taken to the edit profile page, then have a link to change their password on a separate page? 

The best way to do this would be to add your own global to the top of website membership for the password page:

$GLOBALS['WEBSITE_LOGIN_LOGIN_FORM_URL']  = '/login.php';                 // url to login form
$GLOBALS['WEBSITE_LOGIN_SIGNUP_URL']      = '/signup.php';                // signup url linked to from the login page
$GLOBALS['WEBSITE_LOGIN_REMINDER_URL']    = '/user-password-request.php';      // password reminder url linked to from the login page
$GLOBALS['WEBSITE_LOGIN_RESET_URL']       = '/user-password-reset.php';        // password reminder url linked to from the login page
$GLOBALS['WEBSITE_LOGIN_PROFILE_URL']     = '/acct/acct-ep.php';               // url to "edit my profile" page
$GLOBALS['WEBSITE_LOGIN_PASSWORD_URL']    = '/acct/acct-cp.php';                //The url required to access the edit password page
$GLOBALS['WEBSITE_LOGIN_REQUIRED_FIELDS'] = array('agree_tos','agree_legal');  // if user is logged in and any of these fields exist and are blank (or zero) they will be redirected to the profile url with ?missing_fields=1 set

Now on your user profile page you can have a link to the change password page using something like this:

<a href="<?php echo $GLOBALS['WEBSITE_LOGIN_PASSWORD_URL']; ?>" >Change your password</a>

Creating the change password page should be fairly straight forward. The websiteMembership code generator for the user profile page already separates the change password and update user details into different forms. So it's just a case of copying the appropriate form and php code into acct-cp.php.

Let me know if you have any questions!



Greg Thomas

PHP Programmer -

By craig_bcd - February 27, 2014

Thanks Greg - that should do it.