Website Membership

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

By craig_bcd - February 25, 2014

Hi Guys -

I am using the website membership plug-in (1.10) and I wondered if there was a way to separate the update pages for your login profile and your password so I could have that go to two separate pages.

The code below comes from websitememberships.php and I wanted to define two separate pages /acct/acct-cp.php for updating your password and /acct/acct-ep.php for updating your profile.

// UPDATE THESE VALUES
$GLOBALS['WEBSITE_LOGIN_LOGIN_FORM_URL']  = '/home-login.php';                 // url to login form
$GLOBALS['WEBSITE_LOGIN_SIGNUP_URL']      = '';                                   // 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-cp.php';               // url to "edit my profile" 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

Thanks as always for your help!

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:

// UPDATE THESE VALUES
$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!

Cheers!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By craig_bcd - February 27, 2014

Thanks Greg - that should do it.