Skip to:
Content

BuddyPress.org

Ticket #8092: 8092.2.patch

File 8092.2.patch, 31.7 KB (added by imath, 7 years ago)
  • src/bp-templates/bp-nouveau/buddypress-functions.php

    diff --git src/bp-templates/bp-nouveau/buddypress-functions.php src/bp-templates/bp-nouveau/buddypress-functions.php
    index 0a5d582ad..47cc20c19 100644
    class BP_Nouveau extends BP_Theme_Compat { 
    322322                        return;
    323323                }
    324324
    325                 // Add The password verify if needed.
    326                 if ( bp_is_active( 'settings' ) || bp_get_signup_allowed() ) {
    327                         $scripts['bp-nouveau-password-verify'] = array(
    328                                 'file'         => 'js/password-verify%s.js',
    329                                 'dependencies' => array( 'bp-nouveau', 'password-strength-meter' ),
    330                                 'footer'       => true,
    331                         );
    332                 }
    333 
    334325                foreach ( $scripts as $handle => $script ) {
    335326                        if ( ! isset( $script['file'] ) ) {
    336327                                continue;
    class BP_Nouveau extends BP_Theme_Compat { 
    372363                wp_enqueue_script( 'bp-nouveau' );
    373364
    374365                if ( bp_is_register_page() || bp_is_user_settings_general() ) {
    375                         wp_enqueue_script( 'bp-nouveau-password-verify' );
     366                        wp_enqueue_script( 'user-profile' );
    376367                }
    377368
    378369                if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) ) {
  • src/bp-templates/bp-nouveau/buddypress/members/single/settings/general.php

    diff --git src/bp-templates/bp-nouveau/buddypress/members/single/settings/general.php src/bp-templates/bp-nouveau/buddypress/members/single/settings/general.php
    index 462191faa..460187d3c 100644
     
    33 * BuddyPress - Members Settings ( General )
    44 *
    55 * @since 3.0.0
    6  * @version 3.1.0
     6 * @version 5.0.0
    77 */
    88
    99bp_nouveau_member_hook( 'before', 'settings_template' ); ?>
    1010
    1111<h2 class="screen-heading general-settings-screen">
    12         <?php _e( 'Email & Password', 'buddypress' ); ?>
     12        <?php esc_html_e( 'Email & Password', 'buddypress' ); ?>
    1313</h2>
    1414
    1515<p class="info email-pwd-info">
    16         <?php _e( 'Update your email and or password.', 'buddypress' ); ?>
     16        <?php esc_html_e( 'Update your email and or password.', 'buddypress' ); ?>
    1717</p>
    1818
    19 <form action="<?php echo esc_url( bp_displayed_user_domain() . bp_get_settings_slug() . '/general' ); ?>" method="post" class="standard-form" id="settings-form">
     19<form action="<?php echo esc_url( bp_displayed_user_domain() . bp_get_settings_slug() . '/general' ); ?>" method="post" class="standard-form" id="your-profile">
    2020
    2121        <?php if ( ! is_super_admin() ) : ?>
    2222
    23                 <label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ); ?></label>
    24                 <input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" <?php bp_form_field_attributes( 'password' ); ?>/> &nbsp;<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'buddypress' ); ?></a>
     23                <label for="pwd"><?php printf( esc_html__( 'Current Password %s', 'buddypress' ), '<span>' . esc_html__( '(required to update email or change current password)', 'buddypress' ) . '</span>' ); ?></label>
     24                <input type="password" name="pwd" id="pwd" value="" size="24" class="settings-input small" <?php bp_form_field_attributes( 'password' ); ?>/> &nbsp;<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'buddypress' ); ?></a>
    2525
    2626        <?php endif; ?>
    2727
    28         <label for="email"><?php _e( 'Account Email', 'buddypress' ); ?></label>
     28        <label for="email"><?php esc_html_e( 'Account Email', 'buddypress' ); ?></label>
    2929        <input type="email" name="email" id="email" value="<?php echo esc_attr( bp_get_displayed_user_email() ); ?>" class="settings-input" <?php bp_form_field_attributes( 'email' ); ?>/>
    3030
    3131        <div class="info bp-feedback">
    3232                <span class="bp-icon" aria-hidden="true"></span>
    33                 <p class="text"><?php esc_html_e( 'Leave password fields blank for no change', 'buddypress' ); ?></p>
     33                <p class="text"><?php esc_html_e( 'Click on the "Generate Password" button to change your password.', 'buddypress' ); ?></p>
    3434        </div>
    3535
    36         <label for="pass1"><?php esc_html_e( 'Add Your New Password', 'buddypress' ); ?></label>
    37         <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small password-entry" <?php bp_form_field_attributes( 'password' ); ?>/>
     36        <div class="user-pass1-wrap">
     37                <button type="button" class="button wp-generate-pw">
     38                        <?php esc_html_e( 'Generate Password', 'buddypress' ); ?>
     39                </button>
    3840
    39         <label for="pass2" class="repeated-pwd"><?php esc_html_e( 'Repeat Your New Password', 'buddypress' ); ?></label>
    40         <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small password-entry-confirm" <?php bp_form_field_attributes( 'password' ); ?>/>
     41                <div class="wp-pwd">
     42                        <label for="pass1"><?php esc_html_e( 'Add Your New Password', 'buddypress' ); ?></label>
     43                        <span class="password-input-wrapper">
     44                                <input type="password" name="pass1" id="pass1" size="24" class="settings-input small password-entry" value="" <?php bp_form_field_attributes( 'password', array( 'data-pw' => wp_generate_password( 24 ), 'aria-describedby' => 'pass-strength-result' ) ); ?> />
     45                        </span>
     46                        <button type="button" class="button wp-hide-pw" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password', 'buddypress' ); ?>">
     47                                <span class="dashicons dashicons-hidden" aria-hidden="true"></span>
     48                                <span class="text bp-screen-reader-text"><?php esc_html_e( 'Hide', 'buddypress' ); ?></span>
     49                        </button>
     50                        <button type="button" class="button wp-cancel-pw" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change', 'buddypress' ); ?>">
     51                                <span class="text"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></span>
     52                        </button>
     53                        <div id="pass-strength-result" aria-live="polite"></div>
     54                </div>
     55        </div>
     56
     57        <div class="user-pass2-wrap">
     58                <label class="label" for="pass2"><?php esc_html_e( 'Repeat Your New Password', 'buddypress' ); ?></label>
     59                <input name="pass2" type="password" id="pass2" size="24" class="settings-input small password-entry-confirm" value="" <?php bp_form_field_attributes( 'password' ); ?> />
     60        </div>
    4161
    42         <div id="pass-strength-result"></div>
     62        <div class="pw-weak">
     63                <label>
     64                        <input type="checkbox" name="pw_weak" class="pw-checkbox" />
     65                        <span id="pw-weak-text-label"><?php esc_html_e( 'Confirm use of potentially weak password', 'buddypress' ); ?></span>
     66                </label>
     67        </div>
    4368
    4469        <?php bp_nouveau_submit_button( 'members-general-settings' ); ?>
    4570
  • src/bp-templates/bp-nouveau/common-styles/_bp-mixins.scss

    diff --git src/bp-templates/bp-nouveau/common-styles/_bp-mixins.scss src/bp-templates/bp-nouveau/common-styles/_bp-mixins.scss
    index 898ac7203..cb0f9910b 100644
     
    532532        color: $color;
    533533}
    534534
     535@mixin pwd-strong-colors($color: inherit, $background: null, $border: null) {
     536
     537        @if $background {
     538                $background: $background;
     539        } @else {
     540                $background: $background-strong;
     541        }
     542
     543        background-color: $background;
     544
     545        @if $border {
     546                $border: $border;
     547        } @else {
     548                $border: $border-strong;
     549        }
     550
     551        border-color: $border;
     552
     553        color: $color;
     554}
     555
    535556// BP Tooltips
    536557
    537558// Bottom center tooltip - Default
  • src/bp-templates/bp-nouveau/common-styles/_bp-variables.scss

    diff --git src/bp-templates/bp-nouveau/common-styles/_bp-variables.scss src/bp-templates/bp-nouveau/common-styles/_bp-variables.scss
    index 1d97187b6..3ef12b57b 100644
    $update-success: #8a2 !default; 
    6969$pwd-background:    #eee !default;
    7070$background-short:  #ffa0a0 !default;
    7171$border-short:      #f04040 !default;
    72 $background-good:   #66d66e !default;
    73 $border-good:       #438c48 !default;
     72$background-good:   #ffec8b !default;
     73$border-good:       #fc0 !default;
     74$background-strong: #66d66e !default;
     75$border-strong:     #438c48 !default;
    7476$background-bad:    #ffb78c !default;
    7577$border-bad:        #ff853c !default;
    7678
  • src/bp-templates/bp-nouveau/common-styles/_bp_forms.scss

    diff --git src/bp-templates/bp-nouveau/common-styles/_bp_forms.scss src/bp-templates/bp-nouveau/common-styles/_bp_forms.scss
    index fa0f83c98..72b1fb1d3 100644
     
    132132                        }
    133133                }
    134134
    135                 input:not(.button-small),
     135                input:not(.small),
    136136                textarea {
    137137                        width: 100%;
    138138                }
  • src/bp-templates/bp-nouveau/common-styles/_bp_info_messages.scss

    diff --git src/bp-templates/bp-nouveau/common-styles/_bp_info_messages.scss src/bp-templates/bp-nouveau/common-styles/_bp_info_messages.scss
    index af15cd533..9ac95e156 100644
     
    259259                &.error,
    260260                &.bad {
    261261
    262                         @include pwd-bad-colors($color: $white);
     262                        @include pwd-bad-colors($color: $black);
    263263                }
    264264
    265265                &.short {
    266266
    267                         @include pwd-short-colors($color: $white);
     267                        @include pwd-short-colors($color: $black);
     268                }
     269
     270                &.good {
     271
     272                        @include pwd-good-colors($color: $black);
    268273                }
    269274
    270275                &.strong {
    271276
    272                         @include pwd-good-colors($color: $white);
     277                        @include pwd-strong-colors($color: $black);
    273278                }
    274279
    275280        } // close #pass-strength-result
  • src/bp-templates/bp-nouveau/common-styles/_bp_registration.scss

    diff --git src/bp-templates/bp-nouveau/common-styles/_bp_registration.scss src/bp-templates/bp-nouveau/common-styles/_bp_registration.scss
    index 7ba78f393..db45ec491 100644
     
    5151                        margin: 0 $marg-med $marg-sml 0;
    5252                }
    5353
     54                .wp-pwd button {
     55                        vertical-align: middle;
     56                }
     57
     58                #pass1,
     59                #pass1-text,
     60                #pass-strength-result {
     61                        width: 10em;
     62                }
     63
     64                #pass1-text,
     65                .pw-weak {
     66                        display: none;
     67                }
     68
     69                .show-password {
     70
     71                        #pass1-text {
     72                                display: inline-block;
     73                        }
     74
     75                        #pass1 {
     76                                display: none;
     77                        }
     78                }
     79
     80                .description.indicator-hint {
     81
     82                        @include font-size(14);
     83                }
     84
     85                #submit:disabled {
     86                        color: $light-text;
     87                        opacity: 0.4;
     88                }
     89
    5490                .password-entry,
    5591                .password-entry-confirm {
    5692                        border: 1px solid $bp-border-color;
     
    5995
    6096} // close .register-page
    6197
     98body.buddypress.register.js {
     99
     100        .user-pass2-wrap {
     101                display: none;
     102        }
     103}
     104
     105body.buddypress.register.no-js {
     106
     107        .wp-hide-pw {
     108                display: none;
     109        }
     110}
     111
    62112// Flex layout containers for registration sections
    63113
    64114@include medium-up() {
     
    101151                .register-page {
    102152
    103153                        .default-profile {
     154                                min-width: 14em;
    104155                                flex: 1;
    105156                                padding-right: $pad-med;
    106157                        }
  • src/bp-templates/bp-nouveau/common-styles/_bp_user_settings.scss

    diff --git src/bp-templates/bp-nouveau/common-styles/_bp_user_settings.scss src/bp-templates/bp-nouveau/common-styles/_bp_user_settings.scss
    index 8ad15fc3f..c3719f6d8 100644
     
    2828// General
    2929
    3030/*__ General __*/
     31body.buddypress.settings {
    3132
     33        .wp-pwd button {
     34                vertical-align: middle;
     35        }
     36
     37        #pass1,
     38        #pass1-text,
     39        #pass-strength-result {
     40                width: 16em;
     41        }
     42
     43        #pass1-text,
     44        .pw-weak,
     45        #pass-strength-result {
     46                display: none;
     47        }
     48
     49        .show-password {
     50
     51                #pass1-text {
     52                        display: inline-block;
     53                }
     54
     55                #pass1 {
     56                        display: none;
     57                }
     58        }
     59
     60        #your-profile {
     61
     62                #submit:disabled {
     63                        color: $light-text;
     64                        opacity: 0.4;
     65                }
     66        }
     67}
     68
     69body.buddypress.settings.js {
     70
     71        .wp-pwd,
     72        .user-pass2-wrap {
     73                display: none;
     74        }
     75}
     76
     77body.buddypress.settings.no-js {
     78
     79        .wp-generate-pw,
     80        .wp-cancel-pw,
     81        .wp-hide-pw {
     82                display: none;
     83        }
     84}
    3285
    3386// Email notifications
    3487
  • src/bp-templates/bp-nouveau/css/buddypress-rtl.css

    diff --git src/bp-templates/bp-nouveau/css/buddypress-rtl.css src/bp-templates/bp-nouveau/css/buddypress-rtl.css
    index b716e4fec..79816f493 100644
    form.ac-form .ac-reply-content input { 
    19461946        margin: 0 0 10px 15px;
    19471947}
    19481948
     1949.register-page .signup-form .wp-pwd button {
     1950        vertical-align: middle;
     1951}
     1952
     1953.register-page .signup-form #pass1,
     1954.register-page .signup-form #pass1-text,
     1955.register-page .signup-form #pass-strength-result {
     1956        width: 10em;
     1957}
     1958
     1959.register-page .signup-form #pass1-text,
     1960.register-page .signup-form .pw-weak {
     1961        display: none;
     1962}
     1963
     1964.register-page .signup-form .show-password #pass1-text {
     1965        display: inline-block;
     1966}
     1967
     1968.register-page .signup-form .show-password #pass1 {
     1969        display: none;
     1970}
     1971
     1972.register-page .signup-form .description.indicator-hint {
     1973        font-size: 14px;
     1974}
     1975
     1976.register-page .signup-form #submit:disabled {
     1977        color: #767676;
     1978        opacity: 0.4;
     1979}
     1980
    19491981.register-page .signup-form .password-entry,
    19501982.register-page .signup-form .password-entry-confirm {
    19511983        border: 1px solid #eee;
    19521984}
    19531985
     1986body.buddypress.register.js .user-pass2-wrap {
     1987        display: none;
     1988}
     1989
     1990body.buddypress.register.no-js .wp-hide-pw {
     1991        display: none;
     1992}
     1993
    19541994@media screen and (min-width: 46.8em) {
    19551995        .buddypress-wrap .register-page .layout-wrap {
    19561996                display: flex;
    form.ac-form .ac-reply-content input { 
    19722012
    19732013@media screen and (min-width: 46.8em) {
    19742014        .buddypress-wrap.extended-default-reg .register-page .default-profile {
     2015                min-width: 14em;
    19752016                flex: 1;
    19762017                padding-left: 1em;
    19772018        }
    div.bp-navs#subsubnav.bp-messages-filters .user-messages-bulk-actions { 
    32203261}
    32213262
    32223263/*__ General __*/
     3264body.buddypress.settings .wp-pwd button {
     3265        vertical-align: middle;
     3266}
     3267
     3268body.buddypress.settings #pass1,
     3269body.buddypress.settings #pass1-text,
     3270body.buddypress.settings #pass-strength-result {
     3271        width: 16em;
     3272}
     3273
     3274body.buddypress.settings #pass1-text,
     3275body.buddypress.settings .pw-weak,
     3276body.buddypress.settings #pass-strength-result {
     3277        display: none;
     3278}
     3279
     3280body.buddypress.settings .show-password #pass1-text {
     3281        display: inline-block;
     3282}
     3283
     3284body.buddypress.settings .show-password #pass1 {
     3285        display: none;
     3286}
     3287
     3288body.buddypress.settings #your-profile #submit:disabled {
     3289        color: #767676;
     3290        opacity: 0.4;
     3291}
     3292
     3293body.buddypress.settings.js .wp-pwd,
     3294body.buddypress.settings.js .user-pass2-wrap {
     3295        display: none;
     3296}
     3297
     3298body.buddypress.settings.no-js .wp-generate-pw,
     3299body.buddypress.settings.no-js .wp-cancel-pw,
     3300body.buddypress.settings.no-js .wp-hide-pw {
     3301        display: none;
     3302}
     3303
    32233304/*__ Email notifications __*/
    32243305/*__ Profile visibility __*/
    32253306/*__ Group Invites __*/
    body.buddypress.settings.data #buddypress.buddypress-wrap .item-body p a { 
    33353416        border-color: #b71717;
    33363417}
    33373418
    3338 .buddypress-wrap .standard-form input:not(.button-small),
     3419.buddypress-wrap .standard-form input:not(.small),
    33393420.buddypress-wrap .standard-form textarea {
    33403421        width: 100%;
    33413422}
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    43544435.buddypress-wrap #pass-strength-result.error, .buddypress-wrap #pass-strength-result.bad {
    43554436        background-color: #ffb78c;
    43564437        border-color: #ff853c;
    4357         color: #fff;
     4438        color: #333;
    43584439}
    43594440
    43604441.buddypress-wrap #pass-strength-result.short {
    43614442        background-color: #ffa0a0;
    43624443        border-color: #f04040;
    4363         color: #fff;
     4444        color: #333;
     4445}
     4446
     4447.buddypress-wrap #pass-strength-result.good {
     4448        background-color: #ffec8b;
     4449        border-color: #fc0;
     4450        color: #333;
    43644451}
    43654452
    43664453.buddypress-wrap #pass-strength-result.strong {
    43674454        background-color: #66d66e;
    43684455        border-color: #438c48;
    4369         color: #fff;
     4456        color: #333;
    43704457}
    43714458
    43724459.buddypress-wrap .standard-form#signup_form div div.error {
  • src/bp-templates/bp-nouveau/css/buddypress.css

    diff --git src/bp-templates/bp-nouveau/css/buddypress.css src/bp-templates/bp-nouveau/css/buddypress.css
    index 72848855d..bf353fc40 100644
    form.ac-form .ac-reply-content input { 
    19461946        margin: 0 15px 10px 0;
    19471947}
    19481948
     1949.register-page .signup-form .wp-pwd button {
     1950        vertical-align: middle;
     1951}
     1952
     1953.register-page .signup-form #pass1,
     1954.register-page .signup-form #pass1-text,
     1955.register-page .signup-form #pass-strength-result {
     1956        width: 10em;
     1957}
     1958
     1959.register-page .signup-form #pass1-text,
     1960.register-page .signup-form .pw-weak {
     1961        display: none;
     1962}
     1963
     1964.register-page .signup-form .show-password #pass1-text {
     1965        display: inline-block;
     1966}
     1967
     1968.register-page .signup-form .show-password #pass1 {
     1969        display: none;
     1970}
     1971
     1972.register-page .signup-form .description.indicator-hint {
     1973        font-size: 14px;
     1974}
     1975
     1976.register-page .signup-form #submit:disabled {
     1977        color: #767676;
     1978        opacity: 0.4;
     1979}
     1980
    19491981.register-page .signup-form .password-entry,
    19501982.register-page .signup-form .password-entry-confirm {
    19511983        border: 1px solid #eee;
    19521984}
    19531985
     1986body.buddypress.register.js .user-pass2-wrap {
     1987        display: none;
     1988}
     1989
     1990body.buddypress.register.no-js .wp-hide-pw {
     1991        display: none;
     1992}
     1993
    19541994@media screen and (min-width: 46.8em) {
    19551995        .buddypress-wrap .register-page .layout-wrap {
    19561996                display: flex;
    form.ac-form .ac-reply-content input { 
    19722012
    19732013@media screen and (min-width: 46.8em) {
    19742014        .buddypress-wrap.extended-default-reg .register-page .default-profile {
     2015                min-width: 14em;
    19752016                flex: 1;
    19762017                padding-right: 1em;
    19772018        }
    div.bp-navs#subsubnav.bp-messages-filters .user-messages-bulk-actions { 
    32203261}
    32213262
    32223263/*__ General __*/
     3264body.buddypress.settings .wp-pwd button {
     3265        vertical-align: middle;
     3266}
     3267
     3268body.buddypress.settings #pass1,
     3269body.buddypress.settings #pass1-text,
     3270body.buddypress.settings #pass-strength-result {
     3271        width: 16em;
     3272}
     3273
     3274body.buddypress.settings #pass1-text,
     3275body.buddypress.settings .pw-weak,
     3276body.buddypress.settings #pass-strength-result {
     3277        display: none;
     3278}
     3279
     3280body.buddypress.settings .show-password #pass1-text {
     3281        display: inline-block;
     3282}
     3283
     3284body.buddypress.settings .show-password #pass1 {
     3285        display: none;
     3286}
     3287
     3288body.buddypress.settings #your-profile #submit:disabled {
     3289        color: #767676;
     3290        opacity: 0.4;
     3291}
     3292
     3293body.buddypress.settings.js .wp-pwd,
     3294body.buddypress.settings.js .user-pass2-wrap {
     3295        display: none;
     3296}
     3297
     3298body.buddypress.settings.no-js .wp-generate-pw,
     3299body.buddypress.settings.no-js .wp-cancel-pw,
     3300body.buddypress.settings.no-js .wp-hide-pw {
     3301        display: none;
     3302}
     3303
    32233304/*__ Email notifications __*/
    32243305/*__ Profile visibility __*/
    32253306/*__ Group Invites __*/
    body.buddypress.settings.data #buddypress.buddypress-wrap .item-body p a { 
    33353416        border-color: #b71717;
    33363417}
    33373418
    3338 .buddypress-wrap .standard-form input:not(.button-small),
     3419.buddypress-wrap .standard-form input:not(.small),
    33393420.buddypress-wrap .standard-form textarea {
    33403421        width: 100%;
    33413422}
    body.no-js .buddypress #messages-bulk-management #select-all-messages { 
    43544435.buddypress-wrap #pass-strength-result.error, .buddypress-wrap #pass-strength-result.bad {
    43554436        background-color: #ffb78c;
    43564437        border-color: #ff853c;
    4357         color: #fff;
     4438        color: #333;
    43584439}
    43594440
    43604441.buddypress-wrap #pass-strength-result.short {
    43614442        background-color: #ffa0a0;
    43624443        border-color: #f04040;
    4363         color: #fff;
     4444        color: #333;
     4445}
     4446
     4447.buddypress-wrap #pass-strength-result.good {
     4448        background-color: #ffec8b;
     4449        border-color: #fc0;
     4450        color: #333;
    43644451}
    43654452
    43664453.buddypress-wrap #pass-strength-result.strong {
    43674454        background-color: #66d66e;
    43684455        border-color: #438c48;
    4369         color: #fff;
     4456        color: #333;
    43704457}
    43714458
    43724459.buddypress-wrap .standard-form#signup_form div div.error {
  • src/bp-templates/bp-nouveau/includes/functions.php

    diff --git src/bp-templates/bp-nouveau/includes/functions.php src/bp-templates/bp-nouveau/includes/functions.php
    index 711596337..a4cd20aa8 100644
    function bp_nouveau_get_signup_fields( $section = '' ) { 
    11611161                                'type'           => 'email',
    11621162                                'class'          => '',
    11631163                        ),
    1164                         'signup_password' => array(
    1165                                 'label'          => __( 'Choose a Password', 'buddypress' ),
    1166                                 'required'       => true,
    1167                                 'value'          => '',
    1168                                 'attribute_type' => 'password',
    1169                                 'type'           => 'password',
    1170                                 'class'          => 'password-entry',
    1171                         ),
    1172                         'signup_password_confirm' => array(
    1173                                 'label'          => __( 'Confirm Password', 'buddypress' ),
    1174                                 'required'       => true,
    1175                                 'value'          => '',
    1176                                 'attribute_type' => 'password',
    1177                                 'type'           => 'password',
    1178                                 'class'          => 'password-entry-confirm',
    1179                         ),
     1164                        'signup_password' => array(),
     1165                        'signup_password_confirm' => array(),
    11801166                ),
    11811167                'blog_details' => array(
    11821168                        'signup_blog_url' => array(
    function bp_nouveau_get_submit_button( $action = '' ) { 
    12561242                        'nonce'      => 'bp_new_signup',
    12571243                        'attributes' => array(
    12581244                                'name'  => 'signup_submit',
    1259                                 'id'    => 'signup_submit',
     1245                                'id'    => 'submit',
    12601246                                'value' => __( 'Complete Sign Up', 'buddypress' ),
    12611247                        ),
    12621248                ),
  • src/bp-templates/bp-nouveau/includes/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/template-tags.php src/bp-templates/bp-nouveau/includes/template-tags.php
    index 3cb716076..fcd8281fe 100644
    function bp_nouveau_signup_form( $section = 'account_details' ) { 
    23092309        }
    23102310
    23112311        foreach ( $fields as $name => $attributes ) {
    2312                 list( $label, $required, $value, $attribute_type, $type, $class ) = array_values( $attributes );
     2312                if ( 'signup_password' === $name ) {
     2313                        ?>
     2314                        <label for="pass1"><?php esc_html_e( 'Choose a Password (required)', 'buddypress' ); ?></label>
     2315                        <div class="user-pass1-wrap">
     2316                                <div class="wp-pwd">
     2317                                        <div class="password-input-wrapper">
     2318                                                <input type="password" data-reveal="1" name="signup_password" id="pass1" class="password-entry" size="24" value="" <?php bp_form_field_attributes( 'password', array( 'data-pw' => wp_generate_password( 12 ), 'aria-describedby' => 'pass-strength-result' ) ); ?> />
     2319                                                <button type="button" class="button wp-hide-pw">
     2320                                                        <span class="dashicons dashicons-hidden" aria-hidden="true"></span>
     2321                                                </button>
     2322                                        </div>
     2323                                        <div id="pass-strength-result" aria-live="polite"><?php esc_html_e( 'Strength indicator', 'buddypress' ); ?></div>
     2324                                </div>
     2325                                <div class="pw-weak">
     2326                                        <label>
     2327                                                <input type="checkbox" name="pw_weak" class="pw-checkbox" />
     2328                                                <?php esc_html_e( 'Confirm use of weak password', 'buddypress' ); ?>
     2329                                        </label>
     2330                                </div>
     2331                        </div>
     2332                        <?php
     2333                } elseif ( 'signup_password_confirm' === $name ) {
     2334                        ?>
     2335                        <p class="user-pass2-wrap">
     2336                                <label for="pass2"><?php esc_html_e( 'Confirm new password', 'bp-restricted-community' ); ?></label><br />
     2337                                <input type="password" name="signup_password_confirm" id="pass2" class="password-entry-confirm" size="24" value="" <?php bp_form_field_attributes( 'password' ); ?> />
     2338                        </p>
    23132339
    2314                 // Text fields are using strings, radios are using their inputs
    2315                 $label_output = '<label for="%1$s">%2$s</label>';
    2316                 $id           = $name;
    2317                 $classes      = '';
     2340                        <p class="description indicator-hint"><?php echo wp_get_password_hint(); ?></p>
     2341                        <?php
     2342                } else {
     2343                        list( $label, $required, $value, $attribute_type, $type, $class ) = array_values( $attributes );
    23182344
    2319                 if ( $required ) {
    2320                         /* translators: Do not translate placeholders. 2 = form field name, 3 = "(required)". */
    2321                         $label_output = __( '<label for="%1$s">%2$s %3$s</label>', 'buddypress' );
    2322                 }
     2345                        // Text fields are using strings, radios are using their inputs
     2346                        $label_output = '<label for="%1$s">%2$s</label>';
     2347                        $id           = $name;
     2348                        $classes      = '';
    23232349
    2324                 // Output the label for regular fields
    2325                 if ( 'radio' !== $type ) {
    23262350                        if ( $required ) {
    2327                                 printf( $label_output, esc_attr( $name ), esc_html( $label ), __( '(required)', 'buddypress' ) );
    2328                         } else {
    2329                                 printf( $label_output, esc_attr( $name ), esc_html( $label ) );
     2351                                /* translators: Do not translate placeholders. 2 = form field name, 3 = "(required)". */
     2352                                $label_output = __( '<label for="%1$s">%2$s %3$s</label>', 'buddypress' );
    23302353                        }
    23312354
    2332                         if ( ! empty( $value ) && is_callable( $value ) ) {
    2333                                 $value = call_user_func( $value );
    2334                         }
     2355                        // Output the label for regular fields
     2356                        if ( 'radio' !== $type ) {
     2357                                if ( $required ) {
     2358                                        printf( $label_output, esc_attr( $name ), esc_html( $label ), __( '(required)', 'buddypress' ) );
     2359                                } else {
     2360                                        printf( $label_output, esc_attr( $name ), esc_html( $label ) );
     2361                                }
    23352362
    2336                 // Handle the specific case of Site's privacy differently
    2337                 } elseif ( 'signup_blog_privacy_private' !== $name ) {
    2338                         ?>
    2339                                 <span class="label">
    2340                                         <?php esc_html_e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?>
    2341                                 </span>
    2342                         <?php
    2343                 }
     2363                                if ( ! empty( $value ) && is_callable( $value ) ) {
     2364                                        $value = call_user_func( $value );
     2365                                }
    23442366
    2345                 // Set the additional attributes
    2346                 if ( $attribute_type ) {
    2347                         $existing_attributes = array();
     2367                        // Handle the specific case of Site's privacy differently
     2368                        } elseif ( 'signup_blog_privacy_private' !== $name ) {
     2369                                ?>
     2370                                        <span class="label">
     2371                                                <?php esc_html_e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?>
     2372                                        </span>
     2373                                <?php
     2374                        }
    23482375
    2349                         if ( ! empty( $required ) ) {
    2350                                 $existing_attributes = array( 'aria-required' => 'true' );
     2376                        // Set the additional attributes
     2377                        if ( $attribute_type ) {
     2378                                $existing_attributes = array();
    23512379
    2352                                 /**
    2353                                  * The blog section is hidden, so let's avoid a browser warning
    2354                                  * and deal with the Blog section in Javascript.
    2355                                  */
    2356                                 if ( $section !== 'blog_details' ) {
    2357                                         $existing_attributes['required'] = 'required';
     2380                                if ( ! empty( $required ) ) {
     2381                                        $existing_attributes = array( 'aria-required' => 'true' );
     2382
     2383                                        /**
     2384                                         * The blog section is hidden, so let's avoid a browser warning
     2385                                         * and deal with the Blog section in Javascript.
     2386                                         */
     2387                                        if ( $section !== 'blog_details' ) {
     2388                                                $existing_attributes['required'] = 'required';
     2389                                        }
    23582390                                }
     2391
     2392                                $attribute_type = ' ' . bp_get_form_field_attributes( $attribute_type, $existing_attributes );
    23592393                        }
    23602394
    2361                         $attribute_type = ' ' . bp_get_form_field_attributes( $attribute_type, $existing_attributes );
    2362                 }
     2395                        // Specific case for Site's privacy
     2396                        if ( 'signup_blog_privacy_public' === $name || 'signup_blog_privacy_private' === $name ) {
     2397                                $name      = 'signup_blog_privacy';
     2398                                $submitted = bp_get_signup_blog_privacy_value();
    23632399
    2364                 // Specific case for Site's privacy
    2365                 if ( 'signup_blog_privacy_public' === $name || 'signup_blog_privacy_private' === $name ) {
    2366                         $name      = 'signup_blog_privacy';
    2367                         $submitted = bp_get_signup_blog_privacy_value();
     2400                                if ( ! $submitted ) {
     2401                                        $submitted = 'public';
     2402                                }
    23682403
    2369                         if ( ! $submitted ) {
    2370                                 $submitted = 'public';
     2404                                $attribute_type = ' ' . checked( $value, $submitted, false );
    23712405                        }
    23722406
    2373                         $attribute_type = ' ' . checked( $value, $submitted, false );
    2374                 }
     2407                        // Do not run function to display errors for the private radio.
     2408                        if ( 'private' !== $value ) {
    23752409
    2376                 // Do not run function to display errors for the private radio.
    2377                 if ( 'private' !== $value ) {
     2410                                /**
     2411                                 * Fetch & display any BP member registration field errors.
     2412                                 *
     2413                                 * Passes BP signup errors to Nouveau's template function to
     2414                                 * render suitable markup for error string.
     2415                                 */
     2416                                if ( isset( buddypress()->signup->errors[ $name ] ) ) {
     2417                                        nouveau_error_template( buddypress()->signup->errors[ $name ] );
     2418                                        $invalid = 'invalid';
     2419                                }
     2420                        }
    23782421
    2379                         /**
    2380                          * Fetch & display any BP member registration field errors.
    2381                          *
    2382                          * Passes BP signup errors to Nouveau's template function to
    2383                          * render suitable markup for error string.
    2384                          */
    2385                         if ( isset( buddypress()->signup->errors[ $name ] ) ) {
    2386                                 nouveau_error_template( buddypress()->signup->errors[ $name ] );
    2387                                 $invalid = 'invalid';
     2422                        if ( isset( $invalid ) && isset( buddypress()->signup->errors[ $name ] ) ) {
     2423                                if ( ! empty( $class ) ) {
     2424                                        $class = $class . ' ' . $invalid;
     2425                                } else {
     2426                                        $class = $invalid;
     2427                                }
    23882428                        }
    2389                 }
    23902429
    2391                 if ( isset( $invalid ) && isset( buddypress()->signup->errors[ $name ] ) ) {
    2392                         if ( ! empty( $class ) ) {
    2393                                 $class = $class . ' ' . $invalid;
    2394                         } else {
    2395                                 $class = $invalid;
     2430                        if ( $class ) {
     2431                                $class = sprintf(
     2432                                        ' class="%s"',
     2433                                        esc_attr( join( ' ', array_map( 'sanitize_html_class', explode( ' ', $class ) ) ) )
     2434                                );
    23962435                        }
    2397                 }
    23982436
    2399                 if ( $class ) {
    2400                         $class = sprintf(
    2401                                 ' class="%s"',
    2402                                 esc_attr( join( ' ', array_map( 'sanitize_html_class', explode( ' ', $class ) ) ) )
     2437                        // Set the input.
     2438                        $field_output = sprintf(
     2439                                '<input type="%1$s" name="%2$s" id="%3$s" %4$s value="%5$s" %6$s />',
     2440                                esc_attr( $type ),
     2441                                esc_attr( $name ),
     2442                                esc_attr( $id ),
     2443                                $class,  // Constructed safely above.
     2444                                esc_attr( $value ),
     2445                                $attribute_type // Constructed safely above.
    24032446                        );
    2404                 }
    24052447
    2406                 // Set the input.
    2407                 $field_output = sprintf(
    2408                         '<input type="%1$s" name="%2$s" id="%3$s" %4$s value="%5$s" %6$s />',
    2409                         esc_attr( $type ),
    2410                         esc_attr( $name ),
    2411                         esc_attr( $id ),
    2412                         $class,  // Constructed safely above.
    2413                         esc_attr( $value ),
    2414                         $attribute_type // Constructed safely above.
    2415                 );
    2416 
    2417                 // Not a radio, let's output the field
    2418                 if ( 'radio' !== $type ) {
    2419                         if ( 'signup_blog_url' !== $name ) {
    2420                                 print( $field_output );  // Constructed safely above.
    2421 
    2422                         // If it's the signup blog url, it's specific to Multisite config.
    2423                         } elseif ( is_subdomain_install() ) {
    2424                                 // Constructed safely above.
    2425                                 printf(
    2426                                         '%1$s %2$s . %3$s',
    2427                                         is_ssl() ? 'https://' : 'http://',
    2428                                         $field_output,
    2429                                         bp_signup_get_subdomain_base()
    2430                                 );
     2448                        // Not a radio, let's output the field
     2449                        if ( 'radio' !== $type ) {
     2450                                if ( 'signup_blog_url' !== $name ) {
     2451                                        print( $field_output );  // Constructed safely above.
     2452
     2453                                // If it's the signup blog url, it's specific to Multisite config.
     2454                                } elseif ( is_subdomain_install() ) {
     2455                                        // Constructed safely above.
     2456                                        printf(
     2457                                                '%1$s %2$s . %3$s',
     2458                                                is_ssl() ? 'https://' : 'http://',
     2459                                                $field_output,
     2460                                                bp_signup_get_subdomain_base()
     2461                                        );
     2462
     2463                                // Subfolders!
     2464                                } else {
     2465                                        printf(
     2466                                                '%1$s %2$s',
     2467                                                home_url( '/' ),
     2468                                                $field_output  // Constructed safely above.
     2469                                        );
     2470                                }
    24312471
    2432                         // Subfolders!
     2472                        // It's a radio, let's output the field inside the label
    24332473                        } else {
    2434                                 printf(
    2435                                         '%1$s %2$s',
    2436                                         home_url( '/' ),
    2437                                         $field_output  // Constructed safely above.
    2438                                 );
     2474                                // $label_output and $field_output are constructed safely above.
     2475                                printf( $label_output, esc_attr( $name ), $field_output . ' ' . esc_html( $label ) );
    24392476                        }
    2440 
    2441                 // It's a radio, let's output the field inside the label
    2442                 } else {
    2443                         // $label_output and $field_output are constructed safely above.
    2444                         printf( $label_output, esc_attr( $name ), $field_output . ' ' . esc_html( $label ) );
    24452477                }
    2446 
    2447                 // Password strength is restricted to the signup_password field
    2448                 if ( 'signup_password' === $name ) :
    2449                 ?>
    2450                         <div id="pass-strength-result"></div>
    2451                 <?php
    2452                 endif;
    24532478        }
    24542479
    24552480        /**
  • deleted file src/bp-templates/bp-nouveau/js/password-verify.js

    diff --git src/bp-templates/bp-nouveau/js/password-verify.js src/bp-templates/bp-nouveau/js/password-verify.js
    deleted file mode 100644
    index 6fd604501..000000000
    + -  
    1 /* jshint undef: false */
    2 /* Password Verify */
    3 /* global pwsL10n */
    4 /* @version 3.0.0 */
    5 ( function( $ ){
    6         function check_pass_strength() {
    7                 var pass1 = $( '.password-entry' ).val(),
    8                     pass2 = $( '.password-entry-confirm' ).val(),
    9                     strength;
    10 
    11                 // Reset classes and result text
    12                 $( '#pass-strength-result' ).removeClass( 'show mismatch short bad good strong' );
    13                 if ( ! pass1 ) {
    14                         $( '#pass-strength-result' ).html( pwsL10n.empty );
    15                         return;
    16                 }
    17 
    18                 strength = wp.passwordStrength.meter( pass1, wp.passwordStrength.userInputBlacklist(), pass2 );
    19 
    20                 switch ( strength ) {
    21                         case 2:
    22                                 $( '#pass-strength-result' ).addClass( 'show bad' ).html( pwsL10n.bad );
    23                                 break;
    24                         case 3:
    25                                 $( '#pass-strength-result' ).addClass( 'show good' ).html( pwsL10n.good );
    26                                 break;
    27                         case 4:
    28                                 $( '#pass-strength-result' ).addClass( 'show strong' ).html( pwsL10n.strong );
    29                                 break;
    30                         case 5:
    31                                 $( '#pass-strength-result' ).addClass( 'show mismatch' ).html( pwsL10n.mismatch );
    32                                 break;
    33                         default:
    34                                 $( '#pass-strength-result' ).addClass( 'show short' ).html( pwsL10n['short'] );
    35                                 break;
    36                 }
    37         }
    38 
    39         // Bind check_pass_strength to keyup events in the password fields
    40         $( document ).ready( function() {
    41                 $( '.password-entry' ).val( '' ).keyup( check_pass_strength );
    42                 $( '.password-entry-confirm' ).val( '' ).keyup( check_pass_strength );
    43         } );
    44 
    45 } )( jQuery );