Changeset 830388
- Timestamp:
- 12/30/2013 07:08:19 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
google-authenticator/trunk/google-authenticator.php
r648435 r830388 5 5 Description: Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry app as One Time Password generator. 6 6 Author: Henrik Schack 7 Version: 0.4 47 Version: 0.45 8 8 Author URI: http://henrik.schack.dk/ 9 Compatibility: WordPress 3. 59 Compatibility: WordPress 3.8 10 10 Text Domain: google-authenticator 11 11 Domain Path: /lang … … 19 19 Thanks to Dion Hulse for his bugfixes. 20 20 Thanks to Aldo Latino for his Italian translation. 21 Thanks to Kaijia Feng for his Simplified Chinese translation. 21 Thanks to Kaijia Feng for his Simplified Chinese translation. 22 Thanks to Ian Dunn for fixing some depricated function calls. 23 Thanks to Kimmo Suominen for fixing the iPhone description issue. 22 24 23 25 ---------------------------------------------------------------------------- … … 114 116 $value = $value & 0x7FFFFFFF; 115 117 $value = $value % 1000000; 116 if ( $value == $thistry ) {118 if ( $value === $thistry ) { 117 119 return true; 118 120 } … … 142 144 echo "\t<p>\n"; 143 145 echo "\t\t<label title=\"".__('If you don\'t have Google Authenticator enabled for your WordPress account, leave this field empty.','google-authenticator')."\">".__('Google Authenticator code','google-authenticator')."<span id=\"google-auth-info\"></span><br />\n"; 144 echo "\t\t<input type=\"text\" name=\"googleotp\" id=\"user_email\" class=\"input\" value=\"\" size=\"20\" /></label>\n";146 echo "\t\t<input type=\"text\" name=\"googleotp\" id=\"user_email\" class=\"input\" value=\"\" size=\"20\" style=\"ime-mode: inactive;\" /></label>\n"; 145 147 echo "\t</p>\n"; 146 148 } … … 169 171 // Get information on user, we need this in case an app password has been enabled, 170 172 // since the $user var only contain an error at this point in the login flow. 171 $user = get_user databylogin($username );173 $user = get_user_by( 'login', $username ); 172 174 173 175 // Does the user have the Google Authenticator enabled ? 174 if ( trim(get_user_option( 'googleauthenticator_enabled', $user->ID ) ) == 'enabled' ) {176 if ( isset( $user->ID ) && trim(get_user_option( 'googleauthenticator_enabled', $user->ID ) ) == 'enabled' ) { 175 177 176 178 // Get the users secret … … 254 256 255 257 // Create URL for the Google charts QR code generator. 256 $chl = urlencode( "otpauth://totp/{$GA_description}?secret={$GA_secret}");258 $chl = rawurlencode( 'otpauth://totp/'.rawurlencode( $GA_description ).'?secret='.rawurlencode( $GA_secret ) ); 257 259 $qrcodeurl = "https://chart.googleapis.com/chart?cht=qr&chs=300x300&chld=H|0&chl={$chl}"; 258 260 … … 376 378 377 379 $GA_enabled = ! empty( $_POST['GA_enabled'] ); 378 $GA_description = trim( $_POST['GA_description']);380 $GA_description = trim( sanitize_text_field($_POST['GA_description'] ) ); 379 381 $GA_relaxedmode = ! empty( $_POST['GA_relaxedmode'] ); 380 382 $GA_secret = trim( $_POST['GA_secret'] );
Note: See TracChangeset
for help on using the changeset viewer.