Add options for reset password mail redirects

parent ba5be614
...@@ -71,8 +71,12 @@ if(!class_exists('SexhackPmsPasswordDataLeak')) { ...@@ -71,8 +71,12 @@ if(!class_exists('SexhackPmsPasswordDataLeak')) {
//If entered username or email is valid (no errors), email the password reset confirmation link //If entered username or email is valid (no errors), email the password reset confirmation link
if ( count( pms_errors()->get_error_codes() ) == 0 && !$error) { if ( count( pms_errors()->get_error_codes() ) == 0 && !$error) {
$mailpage = get_option('sexhack_registration_mail_endpoint', false);
send_changepwd_mail($user); if($mailpage) {
$page = get_page($mailpage);
$mailpage = $page->post_name;
}
send_changepwd_mail($user, $mailpage);
/* /*
if (is_object($user)) { //user data is set if (is_object($user)) { //user data is set
$requestedUserID = $user->ID; $requestedUserID = $user->ID;
...@@ -130,6 +134,12 @@ if(!class_exists('SexhackPmsPasswordDataLeak')) { ...@@ -130,6 +134,12 @@ if(!class_exists('SexhackPmsPasswordDataLeak')) {
} }
} }
$SEXHACK_SECTION = array('class' => 'SexhackPmsPasswordDataLeak', 'description' => 'Fix Pay Member Subscription password-reset data leak', 'name' => 'sexhackme_pms_resetfix'); $SEXHACK_SECTION = array('class' => 'SexhackPmsPasswordDataLeak',
'description' => 'Fix Pay Member Subscription password-reset data leak',
'name' => 'sexhackme_pms_resetfix',
'require-page' => array(
array('post_type' => 'page', 'title' => 'Reset password page', 'option' => 'sexhack_reset_pwd_fix')
)
);
?> ?>
...@@ -95,7 +95,12 @@ if(!class_exists('PmsWoocommerceRegistrationIntegration')) { ...@@ -95,7 +95,12 @@ if(!class_exists('PmsWoocommerceRegistrationIntegration')) {
public function send_register_email_reset_password($user_data) public function send_register_email_reset_password($user_data)
{ {
send_changepwd_mail($user_data["user_login"]); $mailpage = get_option('sexhack_registration_mail_endpoint', false);
if($mailpage) {
$page = get_page($mailpage);
$mailpage = $page->post_name;
}
send_changepwd_mail($user_data["user_login"], $mailpage);
} }
// XXX 8==D // XXX 8==D
...@@ -115,6 +120,9 @@ $SEXHACK_SECTION = array( ...@@ -115,6 +120,9 @@ $SEXHACK_SECTION = array(
'class' => 'PmsWoocommerceRegistrationIntegration', 'class' => 'PmsWoocommerceRegistrationIntegration',
'description' => 'Integrate woocommerce account page and sexhack modified registration form on pms to send password change link by email', 'description' => 'Integrate woocommerce account page and sexhack modified registration form on pms to send password change link by email',
'name' => 'sexhackme_pmswooregistration', 'name' => 'sexhackme_pmswooregistration',
'require-page' => array(
array('post_type' => 'page', 'title' => 'Set password mail page', 'option' => 'sexhack_registration_mail_endpoint')
),
'slugs' => array('account', 'register', 'login', 'password-reset') 'slugs' => array('account', 'register', 'login', 'password-reset')
); );
......
...@@ -380,7 +380,7 @@ if(!class_exists('SexHackVideoGallery')) { ...@@ -380,7 +380,7 @@ if(!class_exists('SexHackVideoGallery')) {
$SEXHACK_SECTION = array( $SEXHACK_SECTION = array(
'class' => 'SexHackVideoGallery', 'class' => 'SexHackVideoGallery',
'description' => 'Create Video galleries for Sexhack Video products', 'description' => 'Create Video galleries for Sexhack Video products',
'require-page' => true, //'require-page' => true,
'name' => 'sexhackme_videogallery' 'name' => 'sexhackme_videogallery'
); );
......
...@@ -50,8 +50,10 @@ function send_changepwd_mail($user_login, $baseurl=false){ ...@@ -50,8 +50,10 @@ function send_changepwd_mail($user_login, $baseurl=false){
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n"; $message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n";
$message .= __('To reset your password, visit the following address:') . "\r\n\r\n"; $message .= __('To reset your password, visit the following address:') . "\r\n\r\n";
// XXX Seriously? hardcoded?
$message .= '<' . network_site_url("/password-reset/?key=$key&loginName=" . rawurlencode($user_login), 'login') . ">\r\n"; // XXX This is an hardcoded default. Do I really like it that way?
if(!$baseurl) $baseurl='password-reset';
$message .= '<' . network_site_url("/$baseurl/?key=$key&loginName=" . rawurlencode($user_login), 'login') . ">\r\n";
//$message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n"; //$message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment