WordPress.org

Plugin Directory

Changeset 626308


Ignore:
Timestamp:
11/16/12 22:18:20 (17 months ago)
Author:
Ipstenu
Message:

tagging 1.2

Location:
join-my-multisite
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • join-my-multisite/tags/1.2/README.md

    r613778 r626308  
    4242##Changelog## 
    4343 
     44### 1.2 ### 
     45 
     4613 November, 2012 by Ipstenu 
     47 
     48* Fixed issues as noted by [dokkaebi](http://wordpress.org/support/topic/problems-and-workarounds-using-v-11-on-wordpress-342) 
     49* Added in option for login form 
     50* i18n 
     51 
    4452### 1.1 ### 
    455312 October, 2012 by Ipstenu 
  • join-my-multisite/tags/1.2/admin/defines.php

    r611734 r626308  
    3737// This is what controls how people get added. 
    3838    $jmm_options = get_option( 'helfjmm_options' ); 
    39     if ($jmm_options['type'] == 1) { add_action('init','jmm_joinsite'); } 
     39    if ($jmm_options['type'] == 1) { add_action('init', array('JMM','join_site')); } 
    4040    if ($jmm_options['type'] == 2) { add_action( 'widgets_init', 'jmm_load_add_user_widgets' ); } 
    4141 
  • join-my-multisite/tags/1.2/admin/help.php

    r613778 r626308  
    4545        '<p><a href="http://wordpress.org/support/plugin/join-my-multisite">' . __('Support', 'jmm' ) . '</a></p>' . 
    4646        '<p><a href="http://codex.wordpress.org/Roles_and_Capabilities">' . __('WordPress Roles & Capabilities', 'jmm' ) . '</a></p>' . 
    47         '<p><a href="http://wordpress.org/extend/plugins/multisite-user-management/">' . __('Plugin: Multisite User Management', 'jmm' ) . '</a></p>' 
     47        '<p><a href="http://wordpress.org/extend/plugins/multisite-user-management/">' . __('Plugin: Multisite User Management', 'jmm' ) . '</a></p>' . 
     48        '<p><a href="http://justintadlock.com/archives/2012/10/16/how-i-run-a-membership-site">' . __('Advice On Running a Membership Site', 'jmm' ) . '</a></p>' 
    4849        ); 
    4950 
  • join-my-multisite/tags/1.2/admin/settings.php

    r613778 r626308  
    7070                     
    7171                    <?php 
     72                    // Registration Options: 
     73                     
    7274                    if ( get_option('users_can_register') == 1 ): 
    7375                    ?> 
     
    7678                        <th scope="row"><?php _e('Registration:', 'helfjmm'); ?></th> 
    7779                        <td><p> 
    78                             <input type="checkbox" name="jmm_persite" value="1" <?php if ($jmm_options['persite'] == 1) echo 'checked="checked"'; ?>> <label for="jmm-persite"><?php _e('Per-Site Registration.', 'helfjmm'); ?></label> 
     80                            <input type="checkbox" name="jmm_persite" value="1" <?php if ($jmm_options['persite'] == 1) echo 'checked="checked"'; ?>> <label for="jmm-persite"><?php _e('Per-Site', 'helfjmm'); ?></label> 
    7981                        </p></td> 
    8082                        <td><p class="description"><?php _e('Check this box if you want to use a shortcode to customize per-site registration. If unchecked, registrations will be sent to the network registration page.', 'helfjmm'); ?></p></td> 
     
    9294                        </td> 
    9395                         
    94                         <td><p class="description"><?php _e('Non-logged in users will be redirected to the perpage you select from the dropdowns. Only top-level pages may be used. Use the following shortcode to display the login form:', 'helfjmm'); ?><br /> 
     96                        <td><p class="description"><?php _e('Users who are not logged in will be redirected to the perpage you select from the dropdowns. Only top-level pages may be used. Use the following shortcode to display the login form:', 'helfjmm'); ?><br /> 
    9597                            <code>[join-my-multisite]</code> 
    9698                        </td> 
    9799                    </tr> 
    98                     <?php } ?> 
    99                      
    100                     <?php  
     100                    <?php }  
    101101                     
    102102                    endif; // End check for if registration is on for the network. 
    103                      
    104103                    ?> 
    105                      
    106104                    <tr>  
    107105                        <th scope="row"><?php _e('New User Default Role:', 'helfjmm'); ?></th> 
  • join-my-multisite/tags/1.2/joinmymultisite.php

    r613778 r626308  
    44Plugin URI: http://halfelf.org/plugins/join-my-multisite/ 
    55Description: Allow logged in users to add themselves to sites (or auto-add them to all sites). 
    6 Version: 1.1 
     6Version: 1.2 
    77Author: Mika Epstein (Ipstenu) 
    88Author URI: http://ipstenu.org/ 
  • join-my-multisite/tags/1.2/lib/signuppage.php

    r611734 r626308  
    2121    die(); 
    2222} 
    23  
    24 $jmm_options = get_option( 'helfjmm_options' ); 
    25     if ( !is_null($jmm_options['perpage']) && $jmm_options['perpage'] != "XXXXXX"  ) 
    26         {$goto = get_permalink($jmm_options['perpage']); } 
    27     else 
    28         {$goto = '/wp-signup.php';} 
    2923?> 
    3024    <style type="text/css"> 
     
    7771    global $current_site, $active_signup; 
    7872 
     73    $jmm_options = get_option( 'helfjmm_options' ); 
     74        if ( !is_null($jmm_options['perpage']) && $jmm_options['perpage'] != "XXXXXX"  ) 
     75            {$goto = get_permalink($jmm_options['perpage']); } 
     76        else 
     77            {$goto = '/wp-signup.php';} 
     78 
    7979    if ( !is_wp_error($errors) ) 
    8080        $errors = new WP_Error(); 
     
    8888    $errors = $filtered_results['errors']; 
    8989     
    90     $blog_details = get_blog_details($blog_id); 
     90    $blog_details = get_blog_details($current_site->blog_id); 
    9191 
    9292    ?> 
  • join-my-multisite/tags/1.2/lib/widget.php

    r611707 r626308  
    2222} 
    2323 
    24 // Register the widget 
    25 register_widget( 'jmm_JMM_Widget' ); 
    26  
    27 // This is the widget! 
     24// Basic JMM Widget 
    2825class jmm_JMM_Widget extends WP_Widget { 
    2926 
     
    4340        $member = $instance['member']; 
    4441        $welcome = $instance['welcome']; 
     42        $show_form = $instance['show_form']; 
    4543        $jmm_options = get_option( 'helfjmm_options' ); 
    46         global $current_user, $blog_id; 
    47          
     44        global $current_user, $blog_id, $user_login; 
     45 
    4846        /* Before widget (defined by themes). */ 
    4947        echo $before_widget; 
     
    5250        if ( $title ) 
    5351            echo $before_title . $title . $after_title; 
    54  
     52             
    5553            if( isset($_POST['jmm-join-site']) || isset($_POST['join-site']) ){ 
    5654                // This is the magic sauce. 
     
    7371                        echo '<input type="submit" value="'.$notregistered.'" name="join-site" id="join-site" class="button">'; 
    7472                        echo '</form>'; 
     73                         
     74                        // Do we show the inline login form? 
     75                        if ( $show_form == 'on' ) { 
     76                            echo '<br /><h3 class="widget-title">'. __("Log in") .'</h3>'; 
     77                            wp_login_form(array( 'value_remember' => 1));                           
     78                        } 
     79                         
    7580                    } 
    7681                    // If we don't allow registration, we show nothing. On to the next one! 
     
    96101        /* Strip tags (if needed) and update the widget settings. */ 
    97102        $instance['title'] = strip_tags( $new_instance['title'] ); 
     103 
    98104        $instance['notreg'] = strip_tags( $new_instance['notreg'] ); 
    99105        $instance['notmember'] = strip_tags( $new_instance['notmember'] ); 
     106 
    100107        $instance['member'] = strip_tags( $new_instance['member'] ); 
    101108        $instance['welcome'] = strip_tags( $new_instance['welcome'] ); 
    102  
     109        $instance['loginform'] = strip_tags( $new_instance['loginform'] ); 
     110 
     111        $instance['show_form'] = $new_instance['show_form'];       
    103112        return $instance; 
    104113    } 
     
    107116 
    108117        /* Set up some default widget settings. */ 
    109         $defaults = array( 'title' => 'Join up!', 'notreg' => 'Signup for an account!', 'notmember' => 'Join this site!', 'member' => 'Nice to see you again.', 'welcome' => 'Hi, new member!' ); 
     118        $defaults = array( 'title' => 'Welcome to My Site', 'notreg' => 'Register for an account', 'notmember' => 'Join this site', 'member' => 'Nice to see you again.', 'welcome' => 'Hi, new member.', 'loginform' => 'Log in', 'show_form' => 0 ); 
    110119        $instance = wp_parse_args( (array) $instance, $defaults ); ?> 
    111120 
    112121        <p> 
    113             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><strong><?php _e( 'Title:', 'helfjmm' )?></strong></label> 
     122            <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'helfjmm' )?></label> 
    114123            <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:90%;" /> 
    115124        </p> 
    116125 
     126        <hr> 
     127 
     128        <p><strong><?php _e( 'Button Text', 'helfjmm' )?></strong></label> 
     129 
     130        <?php if (get_option('users_can_register')) { ?> 
    117131        <p> 
    118132            <label for="<?php echo $this->get_field_id( 'notreg' ); ?>"><?php _e( 'Not registered on the network:', 'helfjmm' )?></label> 
    119133            <input id="<?php echo $this->get_field_id( 'notreg' ); ?>" name="<?php echo $this->get_field_name( 'notreg' ); ?>" value="<?php echo $instance['notreg']; ?>" style="width:90%;" /> 
    120134        </p> 
    121  
     135        <p> 
     136            <input class="checkbox" type="checkbox" <?php checked( $instance['show_form'], 'on' ); ?> id="<?php echo $this->get_field_id( 'show_form' ); ?>" name="<?php echo $this->get_field_name( 'show_form' ); ?>" />  
     137            <label for="<?php echo $this->get_field_id( 'show_form' ); ?>"><?php _e( 'Show in-line login form.', 'helfjmm' )?></label> 
     138        </p> 
     139         
     140        <?php } ?> 
    122141        <p> 
    123142            <label for="<?php echo $this->get_field_id( 'notmember' ); ?>"><?php _e( 'Not a member of this site:', 'helfjmm' )?></label> 
     
    125144        </p> 
    126145 
     146        <hr> 
     147 
     148        <p><strong><?php _e( 'Welcome Message Text', 'helfjmm' )?></strong></label> 
     149 
    127150        <p> 
    128151            <label for="<?php echo $this->get_field_id( 'member' ); ?>"><?php _e( 'Existing members:', 'helfjmm' )?></label> 
     
    131154 
    132155        <p> 
    133             <label for="<?php echo $this->get_field_id( 'welcome' ); ?>"><?php _e( 'Welcome to new member:', 'helfjmm' )?></label> 
     156            <label for="<?php echo $this->get_field_id( 'welcome' ); ?>"><?php _e( 'New member (shown on signup):', 'helfjmm' )?></label> 
    134157            <input id="<?php echo $this->get_field_id( 'welcome' ); ?>" name="<?php echo $this->get_field_name( 'welcome' ); ?>" value="<?php echo $instance['welcome']; ?>" style="width:90%;" /> 
    135158        </p> 
     159 
    136160<?php  
    137161        } 
    138162} 
     163 
     164// Register the widget 
     165register_widget( 'jmm_JMM_Widget' ); 
     166 
     167function jmm_front_end_login_fail( $username ) { 
     168    $referrer = $_SERVER['HTTP_REFERER']; 
     169      
     170    // if there's a valid referrer, and it's not the default log-in screen 
     171    if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) { 
     172        wp_redirect(home_url() . '/?jmm=failed' );  
     173        exit; 
     174     } 
     175          
     176        if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) { 
     177            if ( !strstr($referrer,'jmm=failed') ) { // don’t append twice 
     178                if(!strstr($referrer, '?')){ 
     179                    wp_redirect( $referrer . '?jmm=failed' );  
     180                } else { 
     181                    wp_redirect( $referrer . '&jmm=failed' );  
     182                } 
     183            } else { 
     184                wp_redirect( $referrer ); 
     185            } 
     186        exit; 
     187        } 
     188 
     189    // Filtering wp_authenticate becuase it's an idiot and wp_login_failed doesn't think that blank fields is a fail... 
     190    // http://wordpress.stackexchange.com/questions/28786/action-wp-login-failed-not-working-if-only-one-field-is-filled-out 
     191    if( ! function_exists('wp_authenticate') ) { 
     192        function wp_authenticate($username, $password) { 
     193            $username = sanitize_user($username); 
     194            $password = trim($password); 
     195            $user = apply_filters('authenticate', null, $username, $password); 
     196      
     197            if ( is_wp_error($user) ) { 
     198                do_action('wp_login_failed', $username); 
     199            } 
     200      
     201            return $user; 
     202        } 
     203    } 
     204} 
  • join-my-multisite/tags/1.2/readme.txt

    r613778 r626308  
    3030 
    3131==Changelog== 
     32 
     33= 1.2 = 
     34 
     3513 November, 2012 by Ipstenu 
     36 
     37* Fixed issues as noted by [dokkaebi](http://wordpress.org/support/topic/problems-and-workarounds-using-v-11-on-wordpress-342) 
     38* Added in option for login form 
     39* i18n 
    3240 
    3341= 1.1 = 
  • join-my-multisite/trunk/README.md

    r613778 r626308  
    4242##Changelog## 
    4343 
     44### 1.2 ### 
     45 
     4613 November, 2012 by Ipstenu 
     47 
     48* Fixed issues as noted by [dokkaebi](http://wordpress.org/support/topic/problems-and-workarounds-using-v-11-on-wordpress-342) 
     49* Added in option for login form 
     50* i18n 
     51 
    4452### 1.1 ### 
    455312 October, 2012 by Ipstenu 
  • join-my-multisite/trunk/admin/defines.php

    r611734 r626308  
    3737// This is what controls how people get added. 
    3838    $jmm_options = get_option( 'helfjmm_options' ); 
    39     if ($jmm_options['type'] == 1) { add_action('init','jmm_joinsite'); } 
     39    if ($jmm_options['type'] == 1) { add_action('init', array('JMM','join_site')); } 
    4040    if ($jmm_options['type'] == 2) { add_action( 'widgets_init', 'jmm_load_add_user_widgets' ); } 
    4141 
  • join-my-multisite/trunk/admin/help.php

    r613778 r626308  
    4545        '<p><a href="http://wordpress.org/support/plugin/join-my-multisite">' . __('Support', 'jmm' ) . '</a></p>' . 
    4646        '<p><a href="http://codex.wordpress.org/Roles_and_Capabilities">' . __('WordPress Roles & Capabilities', 'jmm' ) . '</a></p>' . 
    47         '<p><a href="http://wordpress.org/extend/plugins/multisite-user-management/">' . __('Plugin: Multisite User Management', 'jmm' ) . '</a></p>' 
     47        '<p><a href="http://wordpress.org/extend/plugins/multisite-user-management/">' . __('Plugin: Multisite User Management', 'jmm' ) . '</a></p>' . 
     48        '<p><a href="http://justintadlock.com/archives/2012/10/16/how-i-run-a-membership-site">' . __('Advice On Running a Membership Site', 'jmm' ) . '</a></p>' 
    4849        ); 
    4950 
  • join-my-multisite/trunk/admin/settings.php

    r613778 r626308  
    7070                     
    7171                    <?php 
     72                    // Registration Options: 
     73                     
    7274                    if ( get_option('users_can_register') == 1 ): 
    7375                    ?> 
     
    7678                        <th scope="row"><?php _e('Registration:', 'helfjmm'); ?></th> 
    7779                        <td><p> 
    78                             <input type="checkbox" name="jmm_persite" value="1" <?php if ($jmm_options['persite'] == 1) echo 'checked="checked"'; ?>> <label for="jmm-persite"><?php _e('Per-Site Registration.', 'helfjmm'); ?></label> 
     80                            <input type="checkbox" name="jmm_persite" value="1" <?php if ($jmm_options['persite'] == 1) echo 'checked="checked"'; ?>> <label for="jmm-persite"><?php _e('Per-Site', 'helfjmm'); ?></label> 
    7981                        </p></td> 
    8082                        <td><p class="description"><?php _e('Check this box if you want to use a shortcode to customize per-site registration. If unchecked, registrations will be sent to the network registration page.', 'helfjmm'); ?></p></td> 
     
    9294                        </td> 
    9395                         
    94                         <td><p class="description"><?php _e('Non-logged in users will be redirected to the perpage you select from the dropdowns. Only top-level pages may be used. Use the following shortcode to display the login form:', 'helfjmm'); ?><br /> 
     96                        <td><p class="description"><?php _e('Users who are not logged in will be redirected to the perpage you select from the dropdowns. Only top-level pages may be used. Use the following shortcode to display the login form:', 'helfjmm'); ?><br /> 
    9597                            <code>[join-my-multisite]</code> 
    9698                        </td> 
    9799                    </tr> 
    98                     <?php } ?> 
    99                      
    100                     <?php  
     100                    <?php }  
    101101                     
    102102                    endif; // End check for if registration is on for the network. 
    103                      
    104103                    ?> 
    105                      
    106104                    <tr>  
    107105                        <th scope="row"><?php _e('New User Default Role:', 'helfjmm'); ?></th> 
  • join-my-multisite/trunk/joinmymultisite.php

    r613778 r626308  
    44Plugin URI: http://halfelf.org/plugins/join-my-multisite/ 
    55Description: Allow logged in users to add themselves to sites (or auto-add them to all sites). 
    6 Version: 1.1 
     6Version: 1.2 
    77Author: Mika Epstein (Ipstenu) 
    88Author URI: http://ipstenu.org/ 
  • join-my-multisite/trunk/lib/signuppage.php

    r611734 r626308  
    2121    die(); 
    2222} 
    23  
    24 $jmm_options = get_option( 'helfjmm_options' ); 
    25     if ( !is_null($jmm_options['perpage']) && $jmm_options['perpage'] != "XXXXXX"  ) 
    26         {$goto = get_permalink($jmm_options['perpage']); } 
    27     else 
    28         {$goto = '/wp-signup.php';} 
    2923?> 
    3024    <style type="text/css"> 
     
    7771    global $current_site, $active_signup; 
    7872 
     73    $jmm_options = get_option( 'helfjmm_options' ); 
     74        if ( !is_null($jmm_options['perpage']) && $jmm_options['perpage'] != "XXXXXX"  ) 
     75            {$goto = get_permalink($jmm_options['perpage']); } 
     76        else 
     77            {$goto = '/wp-signup.php';} 
     78 
    7979    if ( !is_wp_error($errors) ) 
    8080        $errors = new WP_Error(); 
     
    8888    $errors = $filtered_results['errors']; 
    8989     
    90     $blog_details = get_blog_details($blog_id); 
     90    $blog_details = get_blog_details($current_site->blog_id); 
    9191 
    9292    ?> 
  • join-my-multisite/trunk/lib/widget.php

    r611707 r626308  
    2222} 
    2323 
    24 // Register the widget 
    25 register_widget( 'jmm_JMM_Widget' ); 
    26  
    27 // This is the widget! 
     24// Basic JMM Widget 
    2825class jmm_JMM_Widget extends WP_Widget { 
    2926 
     
    4340        $member = $instance['member']; 
    4441        $welcome = $instance['welcome']; 
     42        $show_form = $instance['show_form']; 
    4543        $jmm_options = get_option( 'helfjmm_options' ); 
    46         global $current_user, $blog_id; 
    47          
     44        global $current_user, $blog_id, $user_login; 
     45 
    4846        /* Before widget (defined by themes). */ 
    4947        echo $before_widget; 
     
    5250        if ( $title ) 
    5351            echo $before_title . $title . $after_title; 
    54  
     52             
    5553            if( isset($_POST['jmm-join-site']) || isset($_POST['join-site']) ){ 
    5654                // This is the magic sauce. 
     
    7371                        echo '<input type="submit" value="'.$notregistered.'" name="join-site" id="join-site" class="button">'; 
    7472                        echo '</form>'; 
     73                         
     74                        // Do we show the inline login form? 
     75                        if ( $show_form == 'on' ) { 
     76                            echo '<br /><h3 class="widget-title">'. __("Log in") .'</h3>'; 
     77                            wp_login_form(array( 'value_remember' => 1));                           
     78                        } 
     79                         
    7580                    } 
    7681                    // If we don't allow registration, we show nothing. On to the next one! 
     
    96101        /* Strip tags (if needed) and update the widget settings. */ 
    97102        $instance['title'] = strip_tags( $new_instance['title'] ); 
     103 
    98104        $instance['notreg'] = strip_tags( $new_instance['notreg'] ); 
    99105        $instance['notmember'] = strip_tags( $new_instance['notmember'] ); 
     106 
    100107        $instance['member'] = strip_tags( $new_instance['member'] ); 
    101108        $instance['welcome'] = strip_tags( $new_instance['welcome'] ); 
    102  
     109        $instance['loginform'] = strip_tags( $new_instance['loginform'] ); 
     110 
     111        $instance['show_form'] = $new_instance['show_form'];       
    103112        return $instance; 
    104113    } 
     
    107116 
    108117        /* Set up some default widget settings. */ 
    109         $defaults = array( 'title' => 'Join up!', 'notreg' => 'Signup for an account!', 'notmember' => 'Join this site!', 'member' => 'Nice to see you again.', 'welcome' => 'Hi, new member!' ); 
     118        $defaults = array( 'title' => 'Welcome to My Site', 'notreg' => 'Register for an account', 'notmember' => 'Join this site', 'member' => 'Nice to see you again.', 'welcome' => 'Hi, new member.', 'loginform' => 'Log in', 'show_form' => 0 ); 
    110119        $instance = wp_parse_args( (array) $instance, $defaults ); ?> 
    111120 
    112121        <p> 
    113             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><strong><?php _e( 'Title:', 'helfjmm' )?></strong></label> 
     122            <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'helfjmm' )?></label> 
    114123            <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:90%;" /> 
    115124        </p> 
    116125 
     126        <hr> 
     127 
     128        <p><strong><?php _e( 'Button Text', 'helfjmm' )?></strong></label> 
     129 
     130        <?php if (get_option('users_can_register')) { ?> 
    117131        <p> 
    118132            <label for="<?php echo $this->get_field_id( 'notreg' ); ?>"><?php _e( 'Not registered on the network:', 'helfjmm' )?></label> 
    119133            <input id="<?php echo $this->get_field_id( 'notreg' ); ?>" name="<?php echo $this->get_field_name( 'notreg' ); ?>" value="<?php echo $instance['notreg']; ?>" style="width:90%;" /> 
    120134        </p> 
    121  
     135        <p> 
     136            <input class="checkbox" type="checkbox" <?php checked( $instance['show_form'], 'on' ); ?> id="<?php echo $this->get_field_id( 'show_form' ); ?>" name="<?php echo $this->get_field_name( 'show_form' ); ?>" />  
     137            <label for="<?php echo $this->get_field_id( 'show_form' ); ?>"><?php _e( 'Show in-line login form.', 'helfjmm' )?></label> 
     138        </p> 
     139         
     140        <?php } ?> 
    122141        <p> 
    123142            <label for="<?php echo $this->get_field_id( 'notmember' ); ?>"><?php _e( 'Not a member of this site:', 'helfjmm' )?></label> 
     
    125144        </p> 
    126145 
     146        <hr> 
     147 
     148        <p><strong><?php _e( 'Welcome Message Text', 'helfjmm' )?></strong></label> 
     149 
    127150        <p> 
    128151            <label for="<?php echo $this->get_field_id( 'member' ); ?>"><?php _e( 'Existing members:', 'helfjmm' )?></label> 
     
    131154 
    132155        <p> 
    133             <label for="<?php echo $this->get_field_id( 'welcome' ); ?>"><?php _e( 'Welcome to new member:', 'helfjmm' )?></label> 
     156            <label for="<?php echo $this->get_field_id( 'welcome' ); ?>"><?php _e( 'New member (shown on signup):', 'helfjmm' )?></label> 
    134157            <input id="<?php echo $this->get_field_id( 'welcome' ); ?>" name="<?php echo $this->get_field_name( 'welcome' ); ?>" value="<?php echo $instance['welcome']; ?>" style="width:90%;" /> 
    135158        </p> 
     159 
    136160<?php  
    137161        } 
    138162} 
     163 
     164// Register the widget 
     165register_widget( 'jmm_JMM_Widget' ); 
     166 
     167function jmm_front_end_login_fail( $username ) { 
     168    $referrer = $_SERVER['HTTP_REFERER']; 
     169      
     170    // if there's a valid referrer, and it's not the default log-in screen 
     171    if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) { 
     172        wp_redirect(home_url() . '/?jmm=failed' );  
     173        exit; 
     174     } 
     175          
     176        if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) { 
     177            if ( !strstr($referrer,'jmm=failed') ) { // don’t append twice 
     178                if(!strstr($referrer, '?')){ 
     179                    wp_redirect( $referrer . '?jmm=failed' );  
     180                } else { 
     181                    wp_redirect( $referrer . '&jmm=failed' );  
     182                } 
     183            } else { 
     184                wp_redirect( $referrer ); 
     185            } 
     186        exit; 
     187        } 
     188 
     189    // Filtering wp_authenticate becuase it's an idiot and wp_login_failed doesn't think that blank fields is a fail... 
     190    // http://wordpress.stackexchange.com/questions/28786/action-wp-login-failed-not-working-if-only-one-field-is-filled-out 
     191    if( ! function_exists('wp_authenticate') ) { 
     192        function wp_authenticate($username, $password) { 
     193            $username = sanitize_user($username); 
     194            $password = trim($password); 
     195            $user = apply_filters('authenticate', null, $username, $password); 
     196      
     197            if ( is_wp_error($user) ) { 
     198                do_action('wp_login_failed', $username); 
     199            } 
     200      
     201            return $user; 
     202        } 
     203    } 
     204} 
  • join-my-multisite/trunk/readme.txt

    r613778 r626308  
    3030 
    3131==Changelog== 
     32 
     33= 1.2 = 
     34 
     3513 November, 2012 by Ipstenu 
     36 
     37* Fixed issues as noted by [dokkaebi](http://wordpress.org/support/topic/problems-and-workarounds-using-v-11-on-wordpress-342) 
     38* Added in option for login form 
     39* i18n 
    3240 
    3341= 1.1 = 
Note: See TracChangeset for help on using the changeset viewer.