/** * Password reset forms. * * This function creates both password reset and forgotten * password forms for page=password shortcode. * * @since 2.7.6 * * @param string $wpmem_regchk * @param string $content * @return string $content */ function wpmem_page_pwd_reset($wpmem_regchk, $content) { if (is_user_logged_in()) { switch ($wpmem_regchk) { case "pwdchangempty": $content = wpmem_inc_regmessage($wpmem_regchk, __('Password fields cannot be empty', 'wp-members')); $content = $content . wpmem_inc_changepassword(); break; case "pwdchangerr": $content = wpmem_inc_regmessage($wpmem_regchk); $content = $content . wpmem_inc_changepassword(); break; case "pwdchangesuccess": $content = $content . wpmem_inc_regmessage($wpmem_regchk); break; default: $content = $content . wpmem_inc_changepassword(); break; } } else { switch ($wpmem_regchk) { case "pwdreseterr": $content = $content . wpmem_inc_regmessage($wpmem_regchk) . wpmem_inc_resetpassword(); $wpmem_regchk = ''; // Clear regchk. break; case "pwdresetsuccess": $content = $content . wpmem_inc_regmessage($wpmem_regchk); $wpmem_regchk = ''; // Clear regchk. break; default: $content = $content . wpmem_inc_resetpassword(); break; } } return $content; }
/** * Password reset forms. * * This function creates both password reset and forgotten * password forms for page=password shortcode. * * @since 2.7.6 * * @global object $wpmem * @param string $wpmem_regchk * @param string $content * @return string $content */ function wpmem_page_pwd_reset($wpmem_regchk, $content) { global $wpmem; if (is_user_logged_in()) { switch ($wpmem_regchk) { case "pwdchangempty": $content = wpmem_inc_regmessage($wpmem_regchk, $wpmem->get_text('pwdchangempty')); $content = $content . wpmem_inc_changepassword(); break; case "pwdchangerr": $content = wpmem_inc_regmessage($wpmem_regchk); $content = $content . wpmem_inc_changepassword(); break; case "pwdchangesuccess": $content = $content . wpmem_inc_regmessage($wpmem_regchk); break; default: $content = $content . wpmem_inc_changepassword(); break; } } else { // If the password shortcode page is set as User Profile page. if ('getusername' == $wpmem->action) { return wpmem_page_forgot_username($wpmem_regchk, $content); } else { switch ($wpmem_regchk) { case "pwdreseterr": $content = $content . wpmem_inc_regmessage($wpmem_regchk) . wpmem_inc_resetpassword(); $wpmem_regchk = ''; // Clear regchk. break; case "pwdresetsuccess": $content = $content . wpmem_inc_regmessage($wpmem_regchk); $wpmem_regchk = ''; // Clear regchk. break; default: $content = $content . wpmem_inc_resetpassword(); break; } } } return $content; }