Plugin Directory

Changeset 697763


Ignore:
Timestamp:
04/15/2013 11:11:08 AM (13 years ago)
Author:
OptimalDevs
Message:

2.2 update

  • Registration form is optional.
  • Lost Password form is optional.
  • Added verification of form fields with HTML5.
  • Improved a few details of style.
  • New design on admin side.
  • Improved the focus on forms.
  • Removed maximum limit for the width of the widget.
  • Removed maximum and minimum limit for the width of the Avatar.
  • Improved SSL (Special thanks to jason102178).
Location:
sexy-login
Files:
25 added
12 edited

Legend:

Unmodified
Added
Removed
  • sexy-login/trunk/inc/activation.php

    r672961 r697763  
    2727        'redirect_login_url'    => '',
    2828        'redirect_logout'       => 'current',
    29         'redirect_logout_url'   => ''
     29        'redirect_logout_url'   => '',
     30        'registration_enabled'  => TRUE,
     31        'lostpwd_enabled'       => TRUE
    3032    );
    3133    $old_options    = get_option( 'sl_options' );
  • sexy-login/trunk/inc/admin/class-sexy-login-admin.php

    r672961 r697763  
    22class Sexy_Login_Admin {
    33   
     4    private $page_hook;
     5   
    46    public function __construct() {
    57       
    6         add_action( 'admin_init', array( $this, 'sl_options_init' ) );
    7         add_action( 'admin_menu', array( $this, 'sl_options_add_page' ) );
    8        
    9     }
    10    
    11     function sl_options_init(){
     8        $this->upgrade();
     9       
     10        add_action( 'admin_menu', array( $this, 'add_to_menu' ) );
     11        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
     12       
     13    }
     14   
     15    function add_to_menu() {
     16   
    1217        register_setting( 'sl_options', 'sl_options', array( $this, 'sl_options_validate' ) );
    13     }
    14 
    15     function sl_options_add_page() {
    16         add_options_page( __( 'Sexy Login Options', 'sl-domain' ), __( 'Sexy Login Options', 'sl-domain' ), 'manage_options', 'sl_options', array( $this, 'sl_options_do_page' ) );
     18        $this->page_hook    = add_options_page( __( 'Sexy Login Options', 'sl-domain' ), __( 'Sexy Login Options', 'sl-domain' ), 'manage_options', 'sl_options', array( $this, 'sl_options_do_page' ) );
     19   
     20    }
     21
     22    function enqueue_scripts( $hook ) {
     23   
     24        if( $hook != $this->page_hook )
     25            return;
     26       
     27        wp_register_script( 'sl-admin-js', SL_PLUGIN_ROOT_URL . 'js/admin.js', array( 'jquery' ), '1.0' );
     28        wp_enqueue_script( 'sl-admin-js' );
     29       
    1730    }
    1831
     
    2134        $sl_options         = get_option( 'sl_options' );
    2235        $captcha_enabled    = ( $sl_options['enable_captcha'] ) ? 'block' : 'none';
    23         $login_custom_url   = ( $sl_options['redirect_login'] == 'current' ) ? 'none;' : 'block;' ;
    24         $logout_custom_url  = ( $sl_options['redirect_logout'] == 'current' ) ? 'none;' : 'block;' ;
    2536        $uri                = parse_url( get_option( 'siteurl' ) );
    2637        ?>
     
    3041            <div id="icon-tools" class="icon32"></div>
    3142           
    32             <p><h2>Sexy Login Options</h2></p>
     43            <h2>Sexy Login Options</h2>
    3344           
    3445            <form method="post" action="options.php">
     
    3647                <?php settings_fields( 'sl_options' ); ?>
    3748               
    38                 <p>
    39                     <table class="widefat" style="width:700px !important;">
    40                         <thead>
    41                             <th colspan="2"><?php echo esc_html( 'ReCaptcha' ); ?></th>
    42                         </thead>
    43                         <tbody>
    44                             <tr>
    45                                 <td style="width:150px;">
    46                                     <label for="enable-captcha"><?php esc_html_e( 'Enable Captcha', 'sl-domain' ); ?></label>
    47                                 </td>
    48                                 <td>
    49                                     <input type="checkbox" name="sl_options[enable_captcha]" id="enable-captcha" value="1" <?php checked( '1', $sl_options['enable_captcha'] ); ?> onClick="slShowCaptchaOptions( this.form );"/>
    50                                 </td>
    51                             </tr>
    52                             <tr class="captcha-options" style="display: <?php echo esc_attr( $captcha_enabled ); ?>;">
    53                                 <td colspan="2" >
    54                                     <p><?php esc_html_e( 'The next keys are required before you are able to use ReCaptcha. You can get the keys in', 'sl-domain' ); ?> <a href="<?php echo recaptcha_get_signup_url( $uri['host'], 'sexy-login' );?>" ><?php echo recaptcha_get_signup_url( $uri['host'], 'sexy-login' ); ?></a></p>
    55                                     <p><?php esc_html_e( 'Note: the keys are not interchangeable.', 'sl-domain' ); ?></p>
    56                                 </td>
    57                             </tr>
    58                             <tr class="captcha-options" style="display: <?php echo esc_attr( $captcha_enabled ); ?>;">
    59                                 <td style="width:150px;">
    60                                     <label for="recaptcha_public_key"><?php esc_html_e( 'Public Key' ); ?></label>
    61                                 </td>
    62                                 <td>
    63                                     <input type="text" name="sl_options[recaptcha_public_key]" id="recaptcha_public_key" size="90" value="<?php echo esc_attr( $sl_options['recaptcha_public_key'] )?>" />
    64                                 </td>
    65                             </tr>
    66                             <tr class="captcha-options" style="display: <?php echo esc_attr( $captcha_enabled ); ?>;">
    67                                 <td style="width:150px;">
    68                                     <label for="recaptcha_private_key"><?php esc_html_e( 'Private Key' ); ?></label>
    69                                 </td>
    70                                 <td>
    71                                     <input type="text" name="sl_options[recaptcha_private_key]" id="recaptcha_private_key" size="90" value="<?php echo esc_attr( $sl_options['recaptcha_private_key'] )?>" />
    72                                 </td>
    73                             </tr>
    74                         </tbody>
    75                     </table>
    76                 </p>
    77                
    78                 <p>
    79                     <table class="widefat" style="width:700px!important;">
    80                         <thead>
    81                             <th colspan="2"><?php esc_html_e( 'Sexy Login Wrap', 'sl-domain' ); ?></th>
    82                         </thead>
    83                         <tr>
    84                             <td style="width:150px;">
    85                                 <label for="wrap_width"><?php esc_html_e( 'Width' ); ?></label>
    86                             </td>
    87                             <td>
    88                                 <input type="number" min="140" max="240" name="sl_options[wrap_width]" id="wrap_width" value="<?php echo esc_attr( $sl_options['wrap_width'] );?>" />
    89                             </td>
    90                         </tr>
    91                     </table>
    92                 </p>
    93                
    94                 <p>
    95                     <table class="widefat" style="width:700px!important;">
    96                         <thead>
    97                             <th colspan="2"><?php esc_html_e( 'General Options', 'sl-domain' ); ?></th>
    98                         </thead>
    99                         <tr>
    100                             <td style="width:150px;">
    101                                 <label for="show_avatar"><?php esc_html_e( 'Show Avatar', 'sl-domain' ); ?></label>
    102                             </td>
    103                             <td >
    104                                 <input type="checkbox" name="sl_options[show_avatar]" id="show_avatar" value="1" <?php checked( '1', $sl_options['show_avatar'] ); ?> />
    105                             </td>
     49                <h3><?php esc_html_e( 'General Options', 'sl-domain' ); ?></h3>
     50               
     51                <table class="form-table">
     52                    <tbody>
     53                   
     54                        <tr valign="top">
     55                            <th scope="row"><?php esc_html_e( 'Avatar', 'sl-domain' ); ?></th>
     56                            <td>
     57                                <fieldset>
     58                                    <legend class="screen-reader-text"><span><?php esc_html_e( 'Avatar', 'slp-domain' ); ?></span></legend>
     59                                   
     60                                    <input type="checkbox" name="sl_options[show_avatar]" id="show_avatar" value="1" <?php checked( '1', $sl_options['show_avatar'] ); ?> />
     61                                    <label for="show_avatar"><?php esc_html_e( 'Show Avatar', 'sl-domain' ); ?></label>
     62                                    <br />
     63                                    <input type="number" min="0" max="9999" maxlength="4" size="5" name="sl_options[avatar_size]" id="avatar_size" value="<?php echo esc_attr( $sl_options['avatar_size'] );?>" />
     64                                    <label for="avatar_size"><?php esc_html_e( 'Max Avatar Size', 'sl-domain' ); ?></label>
     65                                </fieldset>
     66                            </td>
     67                        </tr>
     68                       
     69                        <tr valign="top">
     70                            <th scope="row"><?php esc_html_e( 'User Buttons', 'sl-domain' ); ?></th>
     71                            <td>
     72                                <fieldset>
     73                                    <legend class="screen-reader-text"><span><?php esc_html_e( 'User Buttons', 'slp-domain' ); ?></span></legend>
     74                                   
     75                                    <input type="checkbox" name="sl_options[show_nickname]" id="show_nickname" value="1" <?php checked( '1', $sl_options['show_nickname'] ); ?> />
     76                                    <label for="show_nickname"><?php esc_html_e( 'Show Nickname', 'sl-domain' ); ?></label>
     77                                    <br />
     78                                    <input type="checkbox" name="sl_options[show_dashboard]" id="show_dashboard" value="1" <?php checked( '1', $sl_options['show_dashboard'] ); ?> />
     79                                    <label for="show_dashboard"><?php esc_html_e( 'Show "Dashboard"', 'sl-domain' ); ?></label>
     80                                    <br />
     81                                    <input type="checkbox" name="sl_options[show_profile]" value="1" id="show_profile" <?php checked( '1', $sl_options['show_profile'] ); ?> />
     82                                    <label for="show_profile"><?php esc_html_e( 'Show "Edit My Profile"', 'sl-domain' ); ?></label>
     83                                </fieldset>
     84                            </td>
     85                        </tr>
     86                       
     87                        <tr valign="top">
     88                            <th scope="row"><?php esc_html_e( 'Wrap', 'sl-domain' ); ?></th>
     89                            <td>
     90                                <input type="number" min="140" max="9999" maxlength="4" size="5" name="sl_options[wrap_width]" id="wrap_width" value="<?php echo esc_attr( $sl_options['wrap_width'] );?>" />
     91                                <label for="wrap_width"><?php esc_html_e( 'Max-Width', 'sl-domain' ); ?></label>
     92                            </td>
     93                        </tr>
     94                        <tr valign="top">
     95                            <th scope="row"><?php esc_html_e( 'Registration Settings', 'sl-domain' ); ?></th>
     96                            <td>
     97                                <input type="checkbox" name="sl_options[registration_enabled]" value="1" id="sl-registration-enabled" <?php checked( '1', $sl_options['registration_enabled'] ); ?> />
     98                                <label for="sl-registration-enabled"><?php esc_html_e( 'Enable Registration Form', 'sl-domain' );?></label>
     99                            </td>
     100                        </tr>
     101                        <tr valign="top">
     102                            <th scope="row"><?php esc_html_e( 'Lost Password Settings', 'sl-domain' ); ?></th>
     103                            <td>
     104                                <input type="checkbox" name="sl_options[lostpwd_enabled]" value="1" id="sl-lostpwd-enabled" <?php checked( '1', $sl_options['lostpwd_enabled'] ); ?> />
     105                                <label for="sl-lostpwd-enabled"><?php esc_html_e( 'Enable Lost Password Form', 'sl-domain' );?></label>
     106                            </td>
     107                        </tr>
     108                    </tbody>
     109                </table>
     110               
     111                <h3><?php esc_html_e( 'Redirects', 'sl-domain' ); ?></h3>
     112               
     113                <table class="form-table">
     114                    <tbody>
     115                   
     116                        <tr valign="top">
     117                            <th scope="row"><?php esc_html_e( 'Login Redirection', 'sl-domain' ); ?></th>
     118                            <td>
     119                                <fieldset>
     120                                    <legend class="screen-reader-text"><span><?php esc_html_e( 'Login Redirection', 'slp-domain' ); ?></span></legend>
     121                                   
     122                                    <input type="radio" name="sl_options[redirect_login]" <?php checked( $sl_options['redirect_login'], 'current' ); ?> value="current" id="sl-redirect-login-current" /><label for="sl-redirect-login-current"><?php esc_html_e( 'Current URL', 'sl-domain' ); ?></label>
     123                                    <br />
     124                                    <input type="radio" name="sl_options[redirect_login]" <?php checked( $sl_options['redirect_login'], 'custom' ); ?> value="custom" id="sl-redirect-login-custom" /><label for="sl-redirect-login-custom"><?php esc_html_e( 'Custom URL', 'sl-domain' ); ?></label>
     125                                    <br />
     126                                    <input id="sl-redirect-login-url" type="text" name="sl_options[redirect_login_url]" size="55" value="<?php echo esc_url_raw( $sl_options['redirect_login_url'] ); ?>"  placeholder="<?php esc_attr_e( 'Custom URL to go after login.', 'sl-domain' ); ?>"/>
     127                                </fieldset>
     128                            </td>
     129                        </tr>
     130                       
     131                        <tr valign="top">
     132                            <th scope="row"><?php esc_html_e( 'Logout Redirection', 'sl-domain' ); ?></th>
     133                            <td>
     134                                <fieldset>
     135                                    <legend class="screen-reader-text"><span><?php esc_html_e( 'Logout Redirection', 'sl-domain' ); ?></span></legend>
     136                                   
     137                                    <input type="radio" name="sl_options[redirect_logout]" <?php checked( $sl_options['redirect_logout'], 'current' ); ?> value="current" id="sl-redirect-logout-current" /><label for="sl-redirect-logout-current"><?php esc_html_e( 'Current URL', 'sl-domain' ); ?></label>
     138                                    <br />
     139                                    <input type="radio" name="sl_options[redirect_logout]" <?php checked( $sl_options['redirect_logout'], 'custom' ); ?> value="custom" id="sl-redirect-logout-custom" /><label for="sl-redirect-logout-custom"><?php esc_html_e( 'Custom URL', 'sl-domain' ); ?></label>
     140                                    <br />
     141                                    <input id="sl-redirect-logout-url" type="text" name="sl_options[redirect_logout_url]" size="55" value="<?php echo esc_url_raw( $sl_options['redirect_logout_url'] ); ?>"  placeholder="<?php esc_attr_e( 'Custom URL to go after log out.', 'sl-domain' ); ?>"/>
     142                                </fieldset>
     143                            </td>
     144                        </tr>
     145                       
     146                    </tbody>
     147                </table>
     148               
     149                <h3><?php echo esc_html( 'ReCaptcha' ); ?></h3>
     150               
     151                <input type="checkbox" name="sl_options[enable_captcha]" id="enable-captcha" value="1" <?php checked( '1', $sl_options['enable_captcha'] ); ?> />
     152                <label for="enable-captcha"><?php esc_html_e( 'Enable Captcha', 'sl-domain' ); ?></label>
    106153                               
    107                         </tr>
    108                         <tr>
    109                             <td style="width:150px;">
    110                                 <label for="avatar_size"><?php esc_html_e( 'Avatar Size', 'sl-domain' ); ?></label>
    111                             </td>
    112                             <td>
    113                                 <input type="number" min="1" max="220" name="sl_options[avatar_size]" id="avatar_size" value="<?php echo esc_attr( $sl_options['avatar_size'] );?>" />
    114                             </td>
    115                         </tr>
    116                         <tr>
    117                             <td style="width:150px;">
    118                                 <label for="show_nickname"><?php esc_html_e( 'Show Nickname', 'sl-domain' ); ?></label>
    119                             </td>
    120                             <td>
    121                                 <input type="checkbox" name="sl_options[show_nickname]" id="show_nickname" value="1" <?php checked( '1', $sl_options['show_nickname'] ); ?> />
    122                             </td>
    123                         </tr>
    124                         <tr>
    125                             <td style="width:150px;">
    126                                 <label for="show_dashboard"><?php esc_html_e( 'Show "Dashboard"', 'sl-domain' ); ?></label>
    127                             </td>
    128                             <td >
    129                                 <input type="checkbox" name="sl_options[show_dashboard]" id="show_dashboard" value="1" <?php checked( '1', $sl_options['show_dashboard'] ); ?> />
    130                             </td>
    131                         </tr>
    132                         <tr>
    133                             <td style="width:150px;">
    134                                 <label for="show_profile"><?php esc_html_e( 'Show "Edit My Profile"', 'sl-domain' ); ?></label>
    135                             </td>
    136                             <td>
    137                                 <input type="checkbox" name="sl_options[show_profile]" value="1" id="show_profile" <?php checked( '1', $sl_options['show_profile'] ); ?> />
    138                             </td>
    139                         </tr>
    140                     </table>
    141                 </p>
    142                 <p>
    143                     <table class="widefat" style="width:700px!important;">
    144                         <thead>
    145                             <th colspan="3"><?php esc_html_e( 'Redirect', 'sl-domain' ); ?></th>
    146                         </thead>
    147                         <tr>
    148                             <td style="width:150px;">
    149                                 <label for="sl-redirect-login"><?php esc_html_e( 'Login redirect to', 'sl-domain' ); ?></label>
    150                             </td>
    151                             <td>
    152                                 <select id="sl-redirect-login" name="sl_options[redirect_login]" onChange="slShowCustomUrl( this.id, this.form )">
    153                                     <option value="current" <?php selected( $sl_options['redirect_login'], 'current' ); ?> ><?php esc_html_e( 'Current URL', 'sl-domain' ); ?></option>
    154                                     <option value="custom" <?php selected( $sl_options['redirect_login'], 'custom' ); ?> ><?php esc_html_e( 'Custom URL', 'sl-domain' ); ?></option>
    155                                 </select>
    156                             </td>
    157                             <td>
    158                                 <input id="sl-redirect-login-url" style="display: <?php echo esc_attr( $login_custom_url ); ?>;" type="text" name="sl_options[redirect_login_url]" size="65" value="<?php echo $sl_options['redirect_login_url']?>" />
    159                             </td>
    160                         </tr>
    161                         <tr>
    162                             <td style="width:150px;">
    163                                 <label for="sl-redirect-logout"><?php esc_html_e( 'Logout redirect to', 'sl-domain' ); ?></label>   
    164                             </td>
    165                             <td>
    166                                 <select id="sl-redirect-logout" name="sl_options[redirect_logout]" onChange="slShowCustomUrl( this.id, this.form )">
    167                                     <option value="current" <?php selected( $sl_options['redirect_logout'], 'current' ); ?> ><?php esc_html_e( 'Current URL', 'sl-domain' ); ?></option>
    168                                     <option value="custom" <?php selected( $sl_options['redirect_logout'], 'custom' ); ?> ><?php esc_html_e( 'Custom URL', 'sl-domain' ); ?></option>
    169                                 </select>
    170                             </td>
    171                             <td>
    172                                 <input id="sl-redirect-logout-url" style="display: <?php echo esc_attr( $logout_custom_url ); ?>;" type="text" name="sl_options[redirect_logout_url]" size="65" value="<?php echo $sl_options['redirect_logout_url']?>" />
    173                             </td>
    174                         </tr>
    175                     </table>
    176                 </p>
     154                <span id="captcha-options" style="display: <?php echo esc_attr( $captcha_enabled ); ?>;">
     155                    <p><?php esc_html_e( 'The next keys are required before you are able to use ReCaptcha. You can get the keys in', 'sl-domain' ); ?> <a href="<?php echo recaptcha_get_signup_url( $uri['host'], 'sexy-login' );?>" target="_blank"><?php echo recaptcha_get_signup_url( $uri['host'], 'sexy-login' ); ?></a>
     156                    <br />
     157                    <strong><?php esc_html_e( 'Note: the keys are not interchangeable.', 'sl-domain' ); ?></strong></p>
     158                   
     159                    <p><label for="recaptcha_public_key"><?php esc_html_e( 'Public Key' ); ?>: </label>
     160                    <input type="text" name="sl_options[recaptcha_public_key]" id="recaptcha_public_key" size="90" value="<?php echo esc_attr( $sl_options['recaptcha_public_key'] )?>" /></p>
     161                   
     162                    <p><label for="recaptcha_private_key"><?php esc_html_e( 'Private Key' ); ?>: </label>
     163                    <input type="text" name="sl_options[recaptcha_private_key]" id="recaptcha_private_key" size="90" value="<?php echo esc_attr( $sl_options['recaptcha_private_key'] )?>" /></p>
     164                </span>
     165               
    177166                <p class="submit">
    178167                    <input type="submit" class="button-primary" value="<?php _e( 'Save Changes' ) ?>" />
    179168                </p>
     169               
    180170            </form>
     171       
    181172        </div>
    182         <?php   
     173        <?php
     174       
    183175    }
    184176
    185177    function sl_options_validate( $input ) {
    186 
    187         $input['enable_captcha']        = ( 1 == $input['enable_captcha'] ? 1 : 0 );
    188         $input['show_dashboard']        = ( 1 == $input['show_dashboard'] ? 1 : 0 );
    189         $input['show_profile']          = ( 1 == $input['show_profile'] ? 1 : 0 );
    190         $input['show_avatar']           = ( 1 == $input['show_avatar'] ? 1 : 0 );
    191         $input['show_nickname']         = ( 1 == $input['show_nickname'] ? 1 : 0 );
    192         $input['redirect_login']        =  esc_html( $input['redirect_login'] );
    193         $input['redirect_logout']       =  esc_html( $input['redirect_logout'] );
    194         $input['redirect_login_url']    =  esc_url( $input['redirect_login_url'] );
    195         $input['redirect_logout_url']   =  esc_url( $input['redirect_logout_url'] );
    196         $input['recaptcha_public_key']  =  esc_html( $input['recaptcha_public_key'] );
    197         $input['recaptcha_private_key'] =  esc_html( $input['recaptcha_private_key'] );
    198        
    199         $input['avatar_size']           = ( (  $input['avatar_size'] <= 220 && is_numeric( $input['avatar_size'] ) )  ? esc_html( $input['avatar_size'] ) : 220 );
    200         $input['wrap_width']            = ( (  $input['wrap_width'] <= 240 && is_numeric( $input['wrap_width'] ) )  ? esc_html( $input['wrap_width'] ) : 240 );
    201        
    202         if ( $input['enable_captcha'] == 1  && ( empty( $input['recaptcha_public_key'] ) || empty( $input['recaptcha_private_key'] ) ) ){
     178       
     179        $input['enable_captcha']        = ( 1 == $input['enable_captcha'] ) ? 1 : 0;
     180        $input['show_dashboard']        = ( 1 == $input['show_dashboard'] ) ? 1 : 0;
     181        $input['show_profile']          = ( 1 == $input['show_profile'] ) ? 1 : 0;
     182        $input['show_avatar']           = ( 1 == $input['show_avatar'] ) ? 1 : 0;   
     183        $input['registration_enabled']  = ( 1 == $input['registration_enabled'] ) ? 1 : 0;
     184        $input['show_nickname']         = ( 1 == $input['show_nickname'] ) ? 1 : 0;
     185        $input['lostpwd_enabled']       = ( 1 == $input['lostpwd_enabled'] ) ? 1 : 0;
     186        $input['redirect_login']        = ( $input['redirect_login'] == 'custom' && empty( $input['redirect_login_url'] ) ) ? 'current' : $input['redirect_login'];
     187        $input['redirect_logout']       = ( $input['redirect_logout'] == 'custom' && empty( $input['redirect_logout_url'] ) ) ? 'current' : $input['redirect_logout'];
     188        $input['redirect_login_url']    =  esc_url_raw( $input['redirect_login_url'] );
     189        $input['redirect_logout_url']   =  esc_url_raw( $input['redirect_logout_url'] );
     190        $input['recaptcha_public_key']  =  sanitize_text_field( $input['recaptcha_public_key'] );
     191        $input['recaptcha_private_key'] =  sanitize_text_field( $input['recaptcha_private_key'] );
     192       
     193        $input['avatar_size']           = ( ctype_digit( $input['avatar_size'] ) && $input['avatar_size'] >= 0 ) ? $input['avatar_size'] : 220;
     194        $input['wrap_width']            = ( ctype_digit( $input['wrap_width'] ) && $input['wrap_width'] >= 140 ) ? $input['wrap_width'] : 240 ;
     195       
     196        if ( $input['enable_captcha'] == 1  && ( empty( $input['recaptcha_public_key'] ) || empty( $input['recaptcha_private_key'] ) ) ) {
    203197       
    204198            $input['enable_captcha']    = 0;
    205199            $update_message             = __( 'ReCaptcha was disabled because you have not entered any key', 'sl-domain' );
    206             add_settings_error( 'general', 'settings_updated', $update_message, 'error');
     200            add_settings_error( 'general', 'recaptcha', $update_message, 'error');
    207201           
    208202        }
    209203
    210204        return $input;
     205       
    211206    }
    212207   
     
    214209   
    215210        $config             = get_option( 'sl_config' );
    216         $current_version    =  isset( $config['version'] ) ? $config['version'] : '1.0';
     211        $current_version    = isset( $config['version'] ) ? $config['version'] : '1.0';
    217212
    218213        if ( version_compare( $current_version, SL_VERSION, '==' ) )
     
    264259       
    265260        } // END < 2.1
     261       
     262        if ( version_compare( $current_version, '2.2', '<' ) ) {
     263           
     264            $options                            = get_option( 'sl_options' );
     265            $options['registration_enabled']    = TRUE;
     266            $options['lostpwd_enabled']         = TRUE;
     267   
     268            update_option( 'sl_options', $options );
     269       
     270        } // END < 2.2
    266271
    267272        $config             = get_option( 'sl_config' );
  • sexy-login/trunk/inc/ajax.php

    r671843 r697763  
    22function sexy_login_ajax() {
    33
    4     check_ajax_referer(  'nonce', SL_NONCE_SECURITY );
     4    check_ajax_referer( SL_NONCE_SECURITY, 'nonce' );
    55   
    66    $redirect_to    = $_REQUEST['redirect_to'];
     
    3030        $creds['user_password'] = $_REQUEST['pwd'];
    3131        $creds['remember']      = ( isset( $_REQUEST['rememberme'] ) ) ? $_REQUEST['rememberme'] : false;
    32         $secure_cookie          = ( force_ssl_admin() ) ? true : false;
     32        $secure_cookie          = ( force_ssl_admin() || ( 0 === strpos( $redirect_to, 'https' ) ) ) ? true : false;
    3333       
    3434        if ( ! $secure_cookie ) {
     
    4242        }
    4343       
    44         if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) )
    45             $secure_cookie = false;
    46        
    4744        $login = wp_signon($creds, $secure_cookie);
    4845           
     
    5451           
    5552        } else {
    56        
    57             $result['error']    = ( $login->errors ) ? $login->get_error_message() : '<strong>ERROR</strong>: ' . esc_html__( 'Please enter your username and password to login.', 'sl-domain' );
     53            $to_search = array( '?', '¿' );
     54            $result['error']    = ( $login->errors ) ? str_replace( $to_search, '', eregi_replace( "<a[^>]*>.*</a>", '', $login->get_error_message() ) ) : '<strong>ERROR</strong>: ' . esc_html__( 'Please enter your username and password to login.', 'sl-domain' );
    5855            $result['captcha']  = ( $sl_options['enable_captcha'] && $attempts->update_attempts() >= SL_LOGIN_ATTEMPTS ) ? true : false;
    5956       
     
    7067}
    7168
    72 function sexy_register_ajax() {
    73    
    74     check_ajax_referer(  'nonce', SL_NONCE_SECURITY );
     69function sexy_registration_ajax() {
     70   
     71    check_ajax_referer( SL_NONCE_SECURITY, 'nonce' );
    7572   
    7673    $result         = array();
     
    159156function sexy_lostpwd_ajax() {
    160157
    161     check_ajax_referer( 'nonce', SL_NONCE_SECURITY );
     158    check_ajax_referer( SL_NONCE_SECURITY, 'nonce' );
    162159   
    163160    $result     = array();
  • sexy-login/trunk/inc/class-sexy-login-widget.php

    r672961 r697763  
    6868        } else {
    6969       
    70             $attempts       = new Sexy_Login_Attempts();
    71             $login_captcha  = ( $sl_options['enable_captcha'] && $attempts->get_attempts() >= SL_LOGIN_ATTEMPTS ) ? 'block' : 'none';
    72             $redirect_to    = ( $sl_options['redirect_login'] == 'custom' ) ? $sl_options['redirect_login_url'] : $this->current_url();
    73             $can_register   = get_option('users_can_register');
     70            $attempts           = new Sexy_Login_Attempts();
     71            $login_captcha      = ( $sl_options['enable_captcha'] && $attempts->get_attempts() >= SL_LOGIN_ATTEMPTS ) ? 'block' : 'none';
     72            $redirect_to        = ( $sl_options['redirect_login'] == 'custom' ) ? $sl_options['redirect_login_url'] : $this->current_url();
     73            $can_register       = get_option('users_can_register');
     74            $show_registration  = $sl_options['registration_enabled'];
     75            $show_lostpwd       = $sl_options['lostpwd_enabled'];
     76            $login_tab_width    = ( ! $can_register || ! $show_registration ) ? '100' : '50';
    7477            ?>
    7578            <div id="sexy-login-tabs">
    7679           
    77                 <a class="sexy-login-tab selected" name="sl-tab-login" href="#" <?php if ( ! $can_register ) echo 'style="width: 100%;"'; ?> ><?php esc_html_e( 'Log in' ) ?></a>
    78 
    79                 <?php if ( $can_register ): ?>
    80                     <a class="sexy-login-tab" style="border-left: 1px solid #ccc; margin-left: -1px;" name="sl-tab-register" href="<?php echo esc_url( site_url( 'wp-login.php?action=register' ) ); ?>" ><?php esc_html_e( 'Register' ) ?></a>
     80                <a class="sexy-login-tab selected" name="sl-tab-login" href="#" style="width: <?php echo esc_attr( $login_tab_width ); ?>%;" ><?php esc_html_e( 'Log in' ) ?></a>
     81
     82                <?php if ( $can_register && $show_registration ): ?>
     83                    <a class="sexy-login-tab" style="border-left: 1px solid #ccc; margin-left: -1px;" name="sl-tab-registration" href="<?php echo esc_url( site_url( 'wp-login.php?action=register' ) ); ?>" ><?php esc_html_e( 'Register' ) ?></a>
    8184                <?php endif;?>
    8285               
     
    8487           
    8588            <div id="sexy-login-content-tab">
    86 
    87                 <div id="sexy-login-register-form" class="sexy-login-form-wrap">
    88                    
    89                     <form id="sl-register-form" action="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login_post' ) ); ?>" method="post">
    90                         <p>
    91                             <!--[if IE ]><label for="user_login"><?php esc_html_e( 'Username' ); ?>: </label><![endif]-->
    92                             <input type="text" name="user_login" size="20" id="user_login" placeholder="<?php esc_attr_e( 'Username' ); ?>"  tabindex="1"/>
    93                         </p>
    94                         <p>
    95                             <!--[if IE ]><label for="user_email"><?php esc_html_e( 'E-mail' ); ?>: </label><![endif]-->
    96                             <input type="text" name="user_email" size="25" id="user_email" placeholder="<?php esc_attr_e( 'E-mail' ); ?>"  tabindex="2"/>
    97                         </p>
    98                         <p>
    99                             <div id="sexy-register-recaptcha" class="sexy-div-captcha" style="display: <?php echo ( $sl_options['enable_captcha'] ) ? esc_attr( 'block' ) : esc_attr( 'none' );?>;"></div>
    100                             <input type="submit" name="user-submit" value="<?php esc_html_e( 'Register' ); ?>" />
    101                             <?php wp_nonce_field( 'nonce', SL_NONCE_SECURITY ); ?>
     89           
     90                <?php if ( $can_register && $show_registration ): ?>
     91               
     92                <div id="sexy-login-registration-form" class="sexy-login-form-wrap">
     93                   
     94                    <form id="sl-registration-form" action="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login_post' ) ); ?>" method="post">
     95                        <p>
     96                            <!--[if lte IE 9]><label for="sl-first-input-registration"><?php esc_html_e( 'Username' ); ?>: </label><![endif]-->
     97                            <input type="text" name="user_login" size="20" class="sl-input" id="sl-first-input-registration" placeholder="<?php esc_attr_e( 'Username' ); ?>"  tabindex="421" required/>
     98                        </p>
     99                        <p>
     100                            <!--[if lte IE 9]><label for="user_email"><?php esc_html_e( 'E-mail' ); ?>: </label><![endif]-->
     101                            <input type="email" name="user_email" class="sl-input" id="sl-user-email" size="25" placeholder="<?php esc_attr_e( 'E-mail' ); ?>"  tabindex="422" required/>
     102                        </p>
     103                        <p>
     104                            <div id="sexy-registration-recaptcha" class="sexy-div-captcha" style="display: <?php echo ( $sl_options['enable_captcha'] ) ? esc_attr( 'block' ) : esc_attr( 'none' );?>;"></div>
     105                            <input type="submit" name="user-submit" value="<?php esc_attr_e( 'Register' ); ?>"  tabindex="424"/>
     106                            <?php wp_nonce_field( SL_NONCE_SECURITY, 'nonce'  ); ?>
    102107                            <input type="hidden" name="url" value="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login_post' ) ); ?>" />
    103                             <input type="hidden" name="redirect_to" value="" />
     108                            <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
    104109                        </p>
    105110                    </form>
     
    107112                </div>
    108113               
     114                <?php endif;?>
     115               
     116                <?php if ( $show_lostpwd ): ?>
     117               
    109118                <div id="sexy-login-lostpwd-form" class="sexy-login-form-wrap">
    110119               
     
    115124                    <form id="sl-lostpwd-form" method="post" action="<?php echo site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ?>">
    116125                        <p>
    117                             <input type="text" name="user_login" size="20" id="user_login" placeholder="<?php esc_attr_e( 'Username or E-mail' ); ?>" />
    118                         </p>
    119                         <p>
    120                             <input type="submit" name="user-submit" value="<?php esc_attr_e( 'Get New Password' ); ?>"/>
    121                             <?php wp_nonce_field( 'nonce', SL_NONCE_SECURITY ); ?>
    122                             <input type="hidden" name="redirect_to" value="" />
     126                            <input type="text" name="user_login" size="20" class="sl-input" id="sl-first-input-lostpwd" placeholder="<?php esc_attr_e( 'Username or E-mail' ); ?>" required  tabindex="421"/>
     127                        </p>
     128                        <p>
     129                            <input type="submit" name="user-submit" value="<?php esc_attr_e( 'Get New Password' ); ?>" tabindex="422"/>
     130                            <?php wp_nonce_field( SL_NONCE_SECURITY, 'nonce' ); ?>
     131                            <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
    123132                        <p>
    124133                    </form>
     
    126135                </div>
    127136               
     137                <?php endif;?>
     138               
    128139                <div id="sexy-login-login-form" class="sexy-login-form-wrap" style="display: block;">
    129140               
    130141                    <form id="sl-login-form" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
    131142                        <p>
    132                             <!--[if IE ]><label for="user_login"><?php esc_html_e( 'Username' ); ?>:</label><![endif]-->
    133                             <input type="text" name="log" id="user_login" size="20" placeholder="<?php esc_attr_e( 'Username' ); ?>"  tabindex="1" />
    134                         </p>
    135                         <p>
    136                             <!--[if IE ]><label for="user_pass"><?php esc_html_e( 'Password' ); ?>:</label><![endif]-->
    137                             <input type="password" name="pwd" id="user_pass" size="20" placeholder="<?php esc_attr_e( 'Password' ); ?>" tabindex="2" />
     143                            <!--[if lte IE 9]><label for="sl-first-input-login"><?php esc_html_e( 'Username' ); ?>:</label><![endif]-->
     144                            <input type="text" name="log" id="sl-first-input-login" size="20" placeholder="<?php esc_attr_e( 'Username' ); ?>"  tabindex="421" required />
     145                        </p>
     146                        <p>
     147                            <!--[if lte IE 9]><label for="sl-user-pass-login"><?php esc_html_e( 'Password' ); ?>:</label><![endif]-->
     148                            <input type="password" name="pwd" id="sl-user-pass-login" size="20" placeholder="<?php esc_attr_e( 'Password' ); ?>" tabindex="422" required />
    138149                        </p>
    139150                       
    140151                        <div id="sexy-login-recaptcha" class="sexy-div-captcha" style="display: <?php echo esc_attr( $login_captcha ); ?>;"></div>
    141152                       
    142                         <input type="submit" name="wp-submit" id="wp-submit" class="submit-button" value="<?php esc_attr_e( 'Log In' ); ?>">
    143                        
    144                         <input type="hidden" name="rememberme" id="rememberme" value="forever" />
     153                        <input type="submit" name="wp-submit" class="submit-button" value="<?php esc_attr_e( 'Log In' ); ?>" tabindex="424">
     154                       
     155                        <input type="hidden" name="rememberme" value="forever" />
    145156                        <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
    146                         <?php wp_nonce_field( 'nonce', SL_NONCE_SECURITY ); ?>
     157                        <?php wp_nonce_field( SL_NONCE_SECURITY, 'nonce' ); ?>
    147158                       
    148159                    </form>
    149160               
    150                     <a name="sl-tab-lostpwd" href="<?php echo esc_url( site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" title="<?php esc_attr_e( 'Lost your password?' ); ?>" ><?php esc_html_e( 'Lost your password?' ) ?></a>
     161                    <?php if ( $show_lostpwd ): ?>
     162                        <a name="sl-tab-lostpwd" href="<?php echo esc_url( site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" title="<?php esc_attr_e( 'Lost your password?' ); ?>" tabindex="425" ><?php esc_html_e( 'Lost your password?' ) ?></a>
     163                    <?php endif;?>
    151164                   
    152165                </div>
  • sexy-login/trunk/js/admin.js

    r671843 r697763  
    1 function slShowCustomUrl( thisId, thisForm ) {
     1jQuery( function() {
     2
     3    jQuery( '#enable-captcha' ).change(function() {
    24   
    3     if ( thisId == 'sl-redirect-logout' ) var displayCustom = jQuery( '#sl-redirect-logout-url', thisForm );
    4     else var displayCustom = jQuery( '#sl-redirect-login-url', thisForm );
     5        var captchaOptions  = jQuery( '#captcha-options' );
     6       
     7        if( jQuery( '#enable-captcha' ).is( ':checked' ) )
     8            captchaOptions.show();
     9        else
     10            captchaOptions.hide();
     11       
     12    });
    513   
    6     if ( jQuery( '#' + thisId, thisForm ).val() == 'custom' ) displayCustom.show();
    7     else displayCustom.hide();
    8    
    9 }
    10 
    11 function slShowCaptchaOptions( thisForm ) {
    12 
    13     var captchaOptions = jQuery( '.captcha-options', thisForm );
    14     if( jQuery( '#enable-captcha' ).is( ':checked' ) ) captchaOptions.show();
    15     else captchaOptions.hide();
    16    
    17 }
     14});
  • sexy-login/trunk/js/sexy-login.js

    r671843 r697763  
    1111            '</div>' +
    1212            '<!--[if IE ]><label for="recaptcha_response_field">' + sexy_loginl_data.captcha_enter + ':</label><![endif]-->' +
    13             '<input type="text" id="recaptcha_response_field" tabindex="3" name="recaptcha_response_field" placeholder="' + sexy_loginl_data.captcha_enter + '..." />' +
     13            '<input type="text" id="recaptcha_response_field" tabindex="423" name="recaptcha_response_field" placeholder="' + sexy_loginl_data.captcha_enter + '..." required/>' +
    1414        '</div>'
    1515    );
     
    4141    if ( tab != 'lostpwd' &&  jQuery( '#sexy-' + tab + '-recaptcha' ).css( 'display' ) == 'block' )
    4242        slRecaptchaCreate( tab );
     43       
     44    jQuery( '#sl-first-input-' + tab ).focus();
     45    jQuery( '.sl-input' ).val('');
    4346   
    4447}
     
    9093    });
    9194   
    92     jQuery('a[name=sl-tab-register]').click( function(e) {
    93        
    94         e.preventDefault();
    95         slTabChange( 'register' );
     95    jQuery('a[name=sl-tab-registration]').click( function(e) {
     96       
     97        e.preventDefault();
     98        slTabChange( 'registration' );
    9699       
    97100    });
     
    156159    }); // END sl-login-form submit.
    157160   
    158     jQuery('.sexy_login_widget #sl-register-form').submit( function( e ) {
     161    jQuery('.sexy_login_widget #sl-registration-form').submit( function( e ) {
    159162               
    160163        e.preventDefault();
     
    163166       
    164167            url:        sexy_loginl_data.ajaxurl,
    165             data:       jQuery( this ).serialize() + '&action=sexy_register_hook',
     168            data:       jQuery( this ).serialize() + '&action=sexy_registration_hook',
    166169            type:       'POST',
    167170            dataType:   'json',
     
    188191                    errorDiv.html(result.error);
    189192                   
    190                     if ( jQuery( '#sexy-register-recaptcha' ).css( 'display' ) == 'block' )
     193                    if ( jQuery( '#sexy-registration-recaptcha' ).css( 'display' ) == 'block' )
    191194                        Recaptcha.reload();
    192195                       
     
    205208        });
    206209   
    207     }); // END sl-register-form
     210    }); // END sl-registration-form
    208211   
    209212    jQuery('.sexy_login_widget #sl-lostpwd-form').submit( function( e ) {
  • sexy-login/trunk/lang/sl-domain-es_ES.po

    r672961 r697763  
    22msgstr ""
    33"Project-Id-Version: Sexy Login 1.0\n"
    4 "POT-Creation-Date: 2013-02-25 11:48+0100\n"
    5 "PO-Revision-Date: 2013-02-25 12:42+0100\n"
     4"POT-Creation-Date: 2013-04-15 12:38+0100\n"
     5"PO-Revision-Date: 2013-04-15 12:44+0100\n"
    66"Last-Translator: \n"
    77"Language-Team: optimaldevs.com <[email protected]>\n"
     
    2727msgstr "Obtener otro Captcha"
    2828
    29 #: inc/ajax.php:23 inc/ajax.php:86
     29#: sexy-login-init.php:115
     30msgid "Settings"
     31msgstr ""
     32
     33#: inc/ajax.php:23 inc/ajax.php:83
    3034msgid "Invalid Captcha: Try again."
    3135msgstr "Captcha Incorrecto: Intentalo otra vez."
    3236
    33 #: inc/ajax.php:57
     37#: inc/ajax.php:54
    3438msgid "Please enter your username and password to login."
    3539msgstr "Porfavor introduce tu nombre de usuario y tu contraseña para loguearte"
    3640
    37 #: inc/ajax.php:98
     41#: inc/ajax.php:95
    3842msgid "<strong>ERROR</strong>: Please enter a username."
    3943msgstr ""
    4044
    41 #: inc/ajax.php:100
     45#: inc/ajax.php:97
    4246msgid ""
    4347"<strong>ERROR</strong>: This username is invalid because it uses illegal "
     
    4549msgstr ""
    4650
    47 #: inc/ajax.php:103
     51#: inc/ajax.php:100
    4852msgid ""
    4953"<strong>ERROR</strong>: This username is already registered. Please choose "
     
    5155msgstr ""
    5256
    53 #: inc/ajax.php:108
     57#: inc/ajax.php:105
    5458msgid "<strong>ERROR</strong>: Please type your e-mail address."
    5559msgstr ""
    5660
     61#: inc/ajax.php:107
     62msgid "<strong>ERROR</strong>: The email address isn&#8217;t correct."
     63msgstr ""
     64
    5765#: inc/ajax.php:110
    58 msgid "<strong>ERROR</strong>: The email address isn&#8217;t correct."
    59 msgstr ""
    60 
    61 #: inc/ajax.php:113
    6266msgid ""
    6367"<strong>ERROR</strong>: This email is already registered, please choose "
     
    6569msgstr ""
    6670
    67 #: inc/ajax.php:132
     71#: inc/ajax.php:129
    6872#, php-format
    6973msgid ""
     
    7276msgstr ""
    7377
    74 #: inc/ajax.php:143
     78#: inc/ajax.php:140
    7579msgid "Registration complete. Please check your e-mail."
    7680msgstr "Registro completado. Porfavor comprueba tu e-mail"
    7781
    78 #: inc/ajax.php:170
     82#: inc/ajax.php:167
    7983msgid "<strong>ERROR</strong>: Enter a username or e-mail address."
    8084msgstr ""
    8185
    82 #: inc/ajax.php:174
     86#: inc/ajax.php:171
    8387msgid ""
    8488"<strong>ERROR</strong>: There is no user registered with that email address."
    8589msgstr ""
    8690
    87 #: inc/ajax.php:191
     91#: inc/ajax.php:188
    8892msgid "<strong>ERROR</strong>: Invalid username or e-mail."
    8993msgstr ""
    9094
    91 #: inc/ajax.php:208
     95#: inc/ajax.php:205
    9296msgid "Password reset is not allowed for this user"
    9397msgstr ""
    9498
    95 #: inc/ajax.php:222
     99#: inc/ajax.php:219
    96100msgid "Before requesting a new password must wait"
    97101msgstr "Antes de solicitar una nueva contraseña debe esperar"
    98102
    99 #: inc/ajax.php:222
     103#: inc/ajax.php:219
    100104msgid "minutes"
    101105msgstr "minutos"
    102106
    103 #: inc/ajax.php:236
     107#: inc/ajax.php:233
    104108msgid "Someone requested that the password be reset for the following account:"
    105109msgstr ""
    106110
    107 #: inc/ajax.php:238
     111#: inc/ajax.php:235
    108112#, php-format
    109113msgid "Username: %s"
    110114msgstr ""
    111115
    112 #: inc/ajax.php:239
     116#: inc/ajax.php:236
    113117msgid "If this was a mistake, just ignore this email and nothing will happen."
    114118msgstr ""
    115119
    116 #: inc/ajax.php:240
     120#: inc/ajax.php:237
    117121msgid "To reset your password, visit the following address:"
    118122msgstr ""
    119123
    120 #: inc/ajax.php:250
     124#: inc/ajax.php:247
    121125#, php-format
    122126msgid "[%s] Password Reset"
    123127msgstr ""
    124128
    125 #: inc/ajax.php:258
     129#: inc/ajax.php:255
    126130msgid "The e-mail could not be sent."
    127131msgstr "El email no se ha podido enviar."
    128132
    129 #: inc/ajax.php:258
     133#: inc/ajax.php:255
    130134msgid "Possible reason: your host may have disabled the mail() function..."
    131135msgstr ""
    132136
    133 #: inc/ajax.php:263
     137#: inc/ajax.php:260
    134138msgid "Check your e-mail for your new password."
    135139msgstr "Recibirás una nueva contraseña, comprueba tu correo."
    136140
    137 #: inc/class-sexy-login-widget.php:77
     141#: inc/class-sexy-login-widget.php:80
    138142msgid "Log in"
    139143msgstr ""
    140144
    141 #: inc/class-sexy-login-widget.php:80 inc/class-sexy-login-widget.php:100
     145#: inc/class-sexy-login-widget.php:83 inc/class-sexy-login-widget.php:105
    142146msgid "Register"
    143147msgstr ""
    144148
    145 #: inc/class-sexy-login-widget.php:91 inc/class-sexy-login-widget.php:92
    146 #: inc/class-sexy-login-widget.php:132 inc/class-sexy-login-widget.php:133
     149#: inc/class-sexy-login-widget.php:96 inc/class-sexy-login-widget.php:97
     150#: inc/class-sexy-login-widget.php:143 inc/class-sexy-login-widget.php:144
    147151msgid "Username"
    148152msgstr ""
    149153
    150 #: inc/class-sexy-login-widget.php:95 inc/class-sexy-login-widget.php:96
     154#: inc/class-sexy-login-widget.php:100 inc/class-sexy-login-widget.php:101
    151155msgid "E-mail"
    152156msgstr ""
    153157
    154 #: inc/class-sexy-login-widget.php:111 inc/class-sexy-login-widget.php:150
     158#: inc/class-sexy-login-widget.php:120 inc/class-sexy-login-widget.php:162
    155159msgid "Lost your password?"
    156160msgstr ""
    157161
    158 #: inc/class-sexy-login-widget.php:113
     162#: inc/class-sexy-login-widget.php:122
    159163msgid ""
    160164"Please enter your username or email address. You will receive a link to "
     
    162166msgstr ""
    163167
    164 #: inc/class-sexy-login-widget.php:117
     168#: inc/class-sexy-login-widget.php:126
    165169msgid "Username or E-mail"
    166170msgstr ""
    167171
    168 #: inc/class-sexy-login-widget.php:120
     172#: inc/class-sexy-login-widget.php:129
    169173msgid "Get New Password"
    170174msgstr ""
    171175
    172 #: inc/class-sexy-login-widget.php:136 inc/class-sexy-login-widget.php:137
     176#: inc/class-sexy-login-widget.php:147 inc/class-sexy-login-widget.php:148
    173177msgid "Password"
    174178msgstr ""
    175179
    176 #: inc/class-sexy-login-widget.php:142
     180#: inc/class-sexy-login-widget.php:153
    177181msgid "Log In"
    178182msgstr ""
    179183
    180 #: inc/class-sexy-login-widget.php:179
     184#: inc/class-sexy-login-widget.php:192
    181185msgid "Title"
    182186msgstr ""
    183187
    184 #: inc/admin/class-sexy-login-admin.php:16
     188#: inc/admin/class-sexy-login-admin.php:18
    185189msgid "Sexy Login Options"
    186190msgstr "Opciones Sexy Login"
    187191
    188 #: inc/admin/class-sexy-login-admin.php:46
     192#: inc/admin/class-sexy-login-admin.php:49
     193msgid "General Options"
     194msgstr "Opciones Generales"
     195
     196#: inc/admin/class-sexy-login-admin.php:55
     197#: inc/admin/class-sexy-login-admin.php:58
     198msgid "Avatar"
     199msgstr "Avatar"
     200
     201#: inc/admin/class-sexy-login-admin.php:61
     202msgid "Show Avatar"
     203msgstr "Mostrar Avatar"
     204
     205#: inc/admin/class-sexy-login-admin.php:64
     206msgid "Max Avatar Size"
     207msgstr "Tamaño Máximo del Avatar"
     208
     209#: inc/admin/class-sexy-login-admin.php:70
     210#: inc/admin/class-sexy-login-admin.php:73
     211msgid "User Buttons"
     212msgstr "Botones de Usuario"
     213
     214#: inc/admin/class-sexy-login-admin.php:76
     215msgid "Show Nickname"
     216msgstr "Mostrar Alias"
     217
     218#: inc/admin/class-sexy-login-admin.php:79
     219msgid "Show \"Dashboard\""
     220msgstr "Mostrar \"Escritorio\""
     221
     222#: inc/admin/class-sexy-login-admin.php:82
     223msgid "Show \"Edit My Profile\""
     224msgstr "Mostrar \"Editar Mi Perfil\""
     225
     226#: inc/admin/class-sexy-login-admin.php:88
     227msgid "Wrap"
     228msgstr "Contenedor"
     229
     230#: inc/admin/class-sexy-login-admin.php:91
     231msgid "Max-Width"
     232msgstr "Ancho Máximo"
     233
     234#: inc/admin/class-sexy-login-admin.php:95
     235msgid "Registration Settings"
     236msgstr "Ajustes de Registro"
     237
     238#: inc/admin/class-sexy-login-admin.php:98
     239msgid "Enable Registration Form"
     240msgstr "Activar Formulario de Registro"
     241
     242#: inc/admin/class-sexy-login-admin.php:102
     243msgid "Lost Password Settings"
     244msgstr "Ajustes de Recuperar Contraseña"
     245
     246#: inc/admin/class-sexy-login-admin.php:105
     247msgid "Enable Lost Password Form"
     248msgstr "Activar Formulario de Recuperar Contraseña"
     249
     250#: inc/admin/class-sexy-login-admin.php:111
     251msgid "Redirects"
     252msgstr "Redirecciones"
     253
     254#: inc/admin/class-sexy-login-admin.php:117
     255#: inc/admin/class-sexy-login-admin.php:120
     256msgid "Login Redirection"
     257msgstr "Redirección al iniciar sesión"
     258
     259#: inc/admin/class-sexy-login-admin.php:122
     260#: inc/admin/class-sexy-login-admin.php:137
     261msgid "Current URL"
     262msgstr "URL Actual"
     263
     264#: inc/admin/class-sexy-login-admin.php:124
     265#: inc/admin/class-sexy-login-admin.php:139
     266msgid "Custom URL"
     267msgstr "URL Personalizada"
     268
     269#: inc/admin/class-sexy-login-admin.php:126
     270msgid "Custom URL to go after login."
     271msgstr "URL a redireccionar tras inicio sesión."
     272
     273#: inc/admin/class-sexy-login-admin.php:132
     274#: inc/admin/class-sexy-login-admin.php:135
     275msgid "Logout Redirection"
     276msgstr "Redirección al cerrar sesión"
     277
     278#: inc/admin/class-sexy-login-admin.php:141
     279msgid "Custom URL to go after log out."
     280msgstr "URL a redireccionar tras cerrar sesión."
     281
     282#: inc/admin/class-sexy-login-admin.php:152
    189283msgid "Enable Captcha"
    190284msgstr "Activar Captcha"
    191285
    192 #: inc/admin/class-sexy-login-admin.php:54
     286#: inc/admin/class-sexy-login-admin.php:155
    193287msgid ""
    194288"The next keys are required before you are able to use ReCaptcha. You can get "
     
    198292"puedes obtener en"
    199293
    200 #: inc/admin/class-sexy-login-admin.php:55
     294#: inc/admin/class-sexy-login-admin.php:157
    201295msgid "Note: the keys are not interchangeable."
    202296msgstr "Nota: las claves no son intercambiables."
    203297
    204 #: inc/admin/class-sexy-login-admin.php:60
     298#: inc/admin/class-sexy-login-admin.php:159
    205299msgid "Public Key"
    206300msgstr ""
    207301
    208 #: inc/admin/class-sexy-login-admin.php:68
     302#: inc/admin/class-sexy-login-admin.php:162
    209303msgid "Private Key"
    210304msgstr ""
    211305
    212 #: inc/admin/class-sexy-login-admin.php:81
    213 msgid "Sexy Login Wrap"
    214 msgstr "Contenedor de Sexy Login"
    215 
    216 #: inc/admin/class-sexy-login-admin.php:85
    217 msgid "Width"
    218 msgstr ""
    219 
    220 #: inc/admin/class-sexy-login-admin.php:98
    221 msgid "General Options"
    222 msgstr "Opciones Generales"
    223 
    224 #: inc/admin/class-sexy-login-admin.php:102
    225 msgid "Show Avatar"
    226 msgstr "Mostrar Avatar"
    227 
    228 #: inc/admin/class-sexy-login-admin.php:111
    229 msgid "Avatar Size"
    230 msgstr "Tamaño del Avatar"
    231 
    232 #: inc/admin/class-sexy-login-admin.php:119
    233 msgid "Show Nickname"
    234 msgstr "Mostrar Alias"
    235 
    236 #: inc/admin/class-sexy-login-admin.php:127
    237 msgid "Show \"Dashboard\""
    238 msgstr "Mostrar \"Escritorio\""
    239 
    240 #: inc/admin/class-sexy-login-admin.php:135
    241 msgid "Show \"Edit My Profile\""
    242 msgstr "Mostrar \"Editar Mi Perfil\""
    243 
    244 #: inc/admin/class-sexy-login-admin.php:146
    245 msgid "Redirect"
    246 msgstr "Redirección"
    247 
    248 #: inc/admin/class-sexy-login-admin.php:150
    249 msgid "Login redirect to"
    250 msgstr "Redirección al loguearse"
    251 
    252 #: inc/admin/class-sexy-login-admin.php:154
    253 #: inc/admin/class-sexy-login-admin.php:168
    254 msgid "Current URL"
    255 msgstr "URL Actual"
    256 
    257 #: inc/admin/class-sexy-login-admin.php:155
    258 #: inc/admin/class-sexy-login-admin.php:169
    259 msgid "Custom URL"
    260 msgstr "URL Personalizada"
    261 
    262 #: inc/admin/class-sexy-login-admin.php:164
    263 msgid "Logout redirect to"
    264 msgstr "Redirección al  cerrar sesión"
    265 
    266 #: inc/admin/class-sexy-login-admin.php:179
     306#: inc/admin/class-sexy-login-admin.php:167
    267307msgid "Save Changes"
    268308msgstr ""
    269309
    270 #: inc/admin/class-sexy-login-admin.php:206
     310#: inc/admin/class-sexy-login-admin.php:199
    271311msgid "ReCaptcha was disabled because you have not entered any key"
    272312msgstr "ReCaptcha ha sido desactivado porque no has introducido las key."
    273313
    274 #~ msgid "Buttons"
    275 #~ msgstr "Botones"
     314#~ msgid "Max Avatar Size ( max allowed: 220 )"
     315#~ msgstr "Tamaño Máximo del Avatar (máximo permitido: 220 )"
     316
     317#~ msgid "Max-Width ( max allowed: 240 )"
     318#~ msgstr "Ancho Máximo (máximo permitido: 240 )"
     319
     320#~ msgid "Sexy Login Wrap"
     321#~ msgstr "Contenedor de Sexy Login"
    276322
    277323#~ msgid "ReCaptcha"
  • sexy-login/trunk/readme.txt

    r672961 r697763  
    11=== Plugin Name ===
    2 Contributors: OptimalDevs
     2Contributors: OptimalDevs, Alejandro Galvez, Andy Hernandez
    33Donate link: http://optimaldevs.com/
    44Tags: login, register, sexy, ajax, authentication, captcha, sidebar, widget, user, ssl, secury, admin bar, ReCaptcha, cross browser, lost password
    55Requires at least: 3.0
    66Tested up to: 3.5.1
    7 Stable tag: 2.1
     7Stable tag: 2.2
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    3333* Languages: the same of your WordPress! (It’s multi-language). English or spanish in back-end.
    3434
    35 [Try Demo](http://optimaldevs.com/demo/ "Try Sexy Login demo.")
     35[Try Demo](http://optimaldevs.com/demo/ "Try Sexy Login demo.")
     36
    3637Note: A new pro version is coming stay tune in http://optimaldevs.com/
    3738
     
    5657Check that you've correctly entered both private and public keys in the "Sexy Login" plugin options.
    5758
     59= I have problems with the Sexy Login redirects and i use a cache system plugin.  =
     60
     61That's one of the problems of cache systems. We can't modify third party plugins.
     62
    5863== Changelog ==
     64
     65= 2.2 =
     66* Registration form is optional.
     67* Lost Password form is optional.
     68* Added verification of form fields with HTML5.
     69* Improved a few details of style.
     70* New design on admin side.
     71* Improved the focus on forms.
     72* Removed maximum limit for the width of the widget.
     73* Removed maximum and minimum limit for the width of the Avatar.
     74* Improved SSL (Special thanks to jason102178).
    5975
    6076= 2.1 =
  • sexy-login/trunk/sexy-login-init.php

    r672961 r697763  
    33Plugin Name: Sexy Login
    44Plugin URI: http://wordpress.org/extend/plugins/sexy-login/
    5 Description: The sexiest widget login for Wordpress!
    6 Version: 2.1
     5Description: The sexiest login widget for Wordpress!
     6Version: 2.2
    77Author: OptimalDevs
    88Author URI: http://optimaldevs.com/
     
    2020    load_plugin_textdomain( 'sl-domain', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
    2121   
    22     require_once( 'inc/class-sexy-login-attempts.php' );
    23     require_once( 'inc/class-sexy-login-widget.php' );
     22    sl_import_class( 'Sexy_Login_Attempts', 'inc/class-sexy-login-attempts.php' );
     23    sl_import_class( 'Sexy_Login_Widget', 'inc/class-sexy-login-widget.php' );
    2424           
    2525    register_widget( 'Sexy_Login_Widget' );
     
    3434            add_action( 'wp_ajax_nopriv_sexy_login_hook', 'sexy_login_ajax' );
    3535           
    36             add_action( 'wp_ajax_sexy_register_hook', 'sexy_register_ajax' );
    37             add_action( 'wp_ajax_nopriv_sexy_register_hook', 'sexy_register_ajax' );
     36            add_action( 'wp_ajax_sexy_registration_hook', 'sexy_registration_ajax' );
     37            add_action( 'wp_ajax_nopriv_sexy_registration_hook', 'sexy_registration_ajax' );
    3838           
    3939            add_action( 'wp_ajax_sexy_lostpwd_hook', 'sexy_lostpwd_ajax' );
     
    9797   
    9898    if ( is_admin() ) {
    99    
    100         wp_register_script( 'sl-admin-js', plugin_dir_url( __FILE__ ) . 'js/admin.js', array( 'jquery' ), '1.0' );
    101         wp_enqueue_script( 'sl-admin-js' );
    10299       
    103         require_once( 'inc/admin/class-sexy-login-admin.php' );
     100        sl_import_class( 'Sexy_Login_Admin', 'inc/admin/class-sexy-login-admin.php' );
    104101       
    105102        if ( ! function_exists( 'recaptcha_get_html' ) )
     
    107104           
    108105        $admin_init = new Sexy_Login_Admin();
    109         $admin_init->upgrade();
     106       
     107        add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'sexy_login_settings_link' );
    110108       
    111109    } // END is_admin()
    112110   
    113111}
     112
     113function sexy_login_settings_link( $links ) {
     114
     115    $settings_link  = '<a href="options-general.php?page=sl_options">' . esc_html__( 'Settings' ) . '</a>';
     116    array_unshift( $links, $settings_link );
     117    return $links;
     118 
     119}
     120
     121function sl_import_class( $class, $file ) {
     122   
     123    if ( ! class_exists( $class ) )
     124        require_once( $file );
     125   
     126}
    114127?>
  • sexy-login/trunk/sl-config.php

    r672961 r697763  
    77define( 'SL_LOGIN_ATTEMPTS_LAPSE', 10 );
    88define( 'SL_LOSTPWD_TIME_LAPSE', 10 );
    9 define( 'SL_VERSION', '2.1' );
     9define( 'SL_VERSION', '2.2' );
     10define( 'SL_PLUGIN_ROOT_URL', plugin_dir_url( __FILE__ ) );
    1011
    1112?>
  • sexy-login/trunk/style.css

    r672961 r697763  
    4343#sexy-login-wrap #sexy-login-tabs {
    4444    width: 100%;
    45     margin: 0 0 5px;
     45    margin: 0;
    4646    border-bottom: 1px solid #c6c6c6;
    4747    height: auto;
     
    9898}
    9999
    100 #sexy-login-content-tab input[type="text"], #sexy-login-content-tab input[type="password"] {
     100#sexy-login-content-tab input[type="text"], #sexy-login-content-tab input[type="password"], #sexy-login-content-tab input[type="email"] {
    101101    color: #555;
    102102    font: 13px "Helvetica Neue", Helvetica, Arial, sans-serif;
     
    113113}
    114114
    115 #sexy-login-content-tab input[type="text"]:hover, #sexy-login-content-tab input[type="password"]:hover {
     115#sexy-login-content-tab input[type="text"]:hover, #sexy-login-content-tab input[type="password"]:hover, #sexy-login-content-tab input[type="email"]:hover {
    116116    border: 1px solid #999;
    117117}
     
    127127#sexy-login-content-tab input[type="submit"], #sexy-login-user a, #sexy-recaptcha-container a {
    128128    width: 100%;
    129     margin-bottom: 4px;
    130129    text-align: center;
    131130    text-decoration: none;
Note: See TracChangeset for help on using the changeset viewer.