Changeset 1179594
- Timestamp:
- 06/12/2015 12:20:44 PM (11 years ago)
- Location:
- secsign/trunk
- Files:
-
- 6 added
- 4 deleted
- 3 edited
-
SecSignIDApi.js (deleted)
-
SecSignIDApi.php (deleted)
-
curl-ca-bundle.crt (deleted)
-
jsApi (added)
-
jsApi/SecSignIDApi.js (added)
-
jsApi/phpApi (added)
-
jsApi/phpApi/SecSignIDApi.php (added)
-
jsApi/phpApi/curl-ca-bundle.crt (added)
-
jsApi/signin-bridge.php (added)
-
readme.txt (modified) (2 diffs)
-
secsignfunctions.js (modified) (3 diffs)
-
secsignid_login.php (modified) (29 diffs)
-
signin-bridge.php (deleted)
Legend:
- Unmodified
- Added
- Removed
-
secsign/trunk/readme.txt
r1147928 r1179594 3 3 Tags: two-factor authentication, two-factor, authentication, 2 factor authentication, login, sign in, single sign-on, challenge response, rsa, password, mobile, iphone, android, security, authenticator, authenticate, two step authentication, 2fa 4 4 Requires at least: 3.0.1 5 Tested up to: 4.2. 15 Tested up to: 4.2.2 6 6 Stable tag: trunk 7 7 License: GPLv2 or later … … 140 140 141 141 == Changelog == 142 143 = 1.7.5 = 144 * New version of [SecSignIDApi.js](https://github.com/SecSign/secsign-js-api) and [SecSignIDApi.php](https://github.com/SecSign/secsign-php-api) 145 * Fixed error which could interfere with some rules in Apache .htaccess 146 * Tested WP compatibility for Wordpress 4.2.2 142 147 143 148 = 1.7.4 = -
secsign/trunk/secsignfunctions.js
r1147912 r1179594 44 44 //responsive layout 45 45 window.onload = function () { 46 var secsignidplugin = document.getElementById("secsignidplugin");47 if(secsignidplugin){48 responsive(secsignidplugin.offsetWidth);46 var secsignidplugin = document.getElementById("secsignidplugin"); 47 if(secsignidplugin != null){ 48 responsive(secsignidplugin.offsetWidth); 49 49 } 50 50 frameOption(frameoption, backend); … … 53 53 window.addEventListener('resize', function () { 54 54 var secsignidplugin = document.getElementById("secsignidplugin"); 55 if(secsignidplugin){56 responsive(secsignidplugin.offsetWidth);55 if(secsignidplugin != null){ 56 responsive(secsignidplugin.offsetWidth); 57 57 } 58 58 }); … … 136 136 137 137 //Load SecSignID API 138 jQuery.getScript(secsignPluginPath + " SecSignIDApi.js", function () {138 jQuery.getScript(secsignPluginPath + "jsApi/SecSignIDApi.js", function () { 139 139 140 140 //Polling -
secsign/trunk/secsignid_login.php
r1147912 r1179594 3 3 Plugin Name: SecSign 4 4 Plugin URI: https://www.secsign.com/add-it-to-your-website/ 5 Version: 1.7. 45 Version: 1.7.5 6 6 Description: The plugin allows a user to login using a SecSign ID and his smartphone. 7 7 Author: SecSign Technologies Inc. … … 9 9 */ 10 10 11 // $Id: secsignid_login.php,v 1.25 2015/04/28 09:50:30 titus Exp $12 13 11 global $secsignid_login_text_domain; 14 12 global $secsignid_login_plugin_name; … … 18 16 19 17 include(plugin_dir_path(__FILE__) . 'secsignid_login_db.php'); 20 include(plugin_dir_path(__FILE__) . ' SecSignIDApi.php'); // include low-level interface to connector to SecSign ID Server18 include(plugin_dir_path(__FILE__) . 'jsApi/phpApi/SecSignIDApi.php'); // include low-level interface to connector to SecSign ID Server 21 19 22 20 // check if admin page is called … … 52 50 add_action('login_footer', 'secsign_custom_login_form', 0); //custom login form 53 51 add_action('wp_login_failed', 'secsign_front_end_pw_login_fail'); // hook failed login 54 add_filter('wp_enqueue_scripts', 'enqueue_secsign_scripts', 0 ); //enqueue all js scripts at website55 52 add_filter('login_enqueue_scripts', 'enqueue_secsign_scripts'); //enqueue all js scripts at admin dashboard 56 53 … … 58 55 if (!(function_exists('enqueue_secsign_scripts'))) { 59 56 /** 60 * enqueue all js scripts 61 */ 62 function enqueue_secsign_scripts() 63 { 64 secsign_print_parameters(); 65 wp_register_script('SecSignIDApi', plugins_url('/SecSignIDApi.js', __FILE__), array('jquery')); 66 wp_register_script('secsignfunctions', plugins_url('/secsignfunctions.js', __FILE__), array('jquery'), false, true); 67 wp_enqueue_script('SecSignIDApi'); 68 wp_enqueue_script('secsignfunctions'); 57 * Enqueue all js scripts 58 */ 59 function enqueue_secsign_scripts() { 60 secsign_print_parameters(); 61 wp_register_script('SecSignIDApi', plugins_url('/jsApi/SecSignIDApi.js', __FILE__), array('jquery')); 62 wp_register_script('secsignfunctions', plugins_url('/secsignfunctions.js', __FILE__), array('jquery'), false, true); 63 wp_enqueue_script('SecSignIDApi'); 64 wp_enqueue_script('secsignfunctions'); 69 65 } 70 66 } … … 73 69 if (!(function_exists('secsign_front_end_pw_login_fail'))) { 74 70 /** 75 * change referrer when frontend password login fails71 * Change referrer when frontend password login fails 76 72 */ 77 73 function secsign_front_end_pw_login_fail($username) … … 110 106 var title = "' . addslashes(get_option('secsignid_service_name')) . '"; 111 107 var secsignPluginPath = "' .addslashes($plugin_path) . '"; 112 var apiurl = secsignPluginPath +"/signin-bridge.php";108 var apiurl = secsignPluginPath + "jsApi/signin-bridge.php"; 113 109 var errormsg = "Your login session has expired, was canceled, or was denied."; 114 110 var noresponse = "The authentication server sent no response or you are not connected to the internet."; … … 118 114 119 115 if (url == "") { 120 //url = document.URL;121 116 url = "' . $wp_site_url . '"; 122 117 } … … 175 170 if (!(function_exists('secsign_id_check_login'))) { 176 171 /** 177 * this hook will be called for every password based login172 * This hook will be called for every password based login 178 173 * 179 174 * @param null|WP_USER|WP_Error $user null indicates no process has authenticated the user yet. … … 209 204 if (!(function_exists('check_session_for_bruteforce'))) { 210 205 /** 211 * the function will check a counter in session. if the counter exceeds a maximum, the session is destroyd to prevent brute force attacks.206 * The function will check a counter in session. if the counter exceeds a maximum, the session is destroyd to prevent brute force attacks. 212 207 */ 213 208 function check_session_for_bruteforce() … … 239 234 if (!(function_exists('secsign_id_init'))) { 240 235 /** 241 * init function which is hooked to wordpress init action.242 * the init function declares this php script to a widget which can be used in wordpress.243 * the overriden function widget() calls secsign_id_login($args);236 * Init function which is hooked to wordpress init action. 237 * The init function declares this php script to a widget which can be used in wordpress. 238 * The overriden function widget() calls secsign_id_login($args); 244 239 */ 245 240 function secsign_id_init() … … 274 269 if (!(function_exists('secsign_id_init_auth_cookie_check'))) { 275 270 /** 276 * init function which is hooked to wordpress init action.277 * used to check if this login is legit or not271 * Init function which is hooked to wordpress init action. 272 * Used to check if this login is legit or not 278 273 * on multisites you can otherwise bypass the authentication and use the password-based one even if deactivated 279 274 */ … … 299 294 if (!(function_exists('secsign_id_get_random_secret'))) { 300 295 /** 301 * gets a random secret from the db or creates it if not available296 * Gets a random secret from the db or creates it if not available 302 297 * @return string returns the random secret to sign the auth cookie 303 298 */ … … 319 314 if (!(function_exists('secsign_id_verify_cookie'))) { 320 315 /** 321 * verifies a user cookie316 * Verifies a user cookie 322 317 * @param string $username the user's username 323 318 * @return bool returns true if the auth cookie is ok, or false if something is wrong … … 368 363 if (!(function_exists('secsign_id_set_cookie'))) { 369 364 /** 370 * sets a secsign id auth cookie, which proves that the login was done with this plugin365 * Sets a secsign id auth cookie, which proves that the login was done with this plugin 371 366 * @param string $username the user's username 372 367 */ … … 396 391 if (!(function_exists('secsign_id_unset_cookie'))) { 397 392 /** 398 * unsets the secsign id auth cookie393 * Unsets the secsign id auth cookie 399 394 */ 400 395 function secsign_id_unset_cookie() … … 578 573 } else { 579 574 // user is logged in, show logout screen 575 576 enqueue_secsign_scripts(); 580 577 581 578 $form_post_url = secsign_id_login_post_url(); … … 628 625 if (!(function_exists('secsign_id_check_ticket'))) { 629 626 /** 630 * the actual login process.631 * the function is hooked to init action of wordpress.632 * for this reason this method is called before the widget rendering function.627 * The actual login process. 628 * The function is hooked to init action of wordpress. 629 * For this reason this method is called before the widget rendering function. 633 630 * 634 * all post parameter are available and a possible auth session can be checked if its status is AUTHENTICATED.635 * the auth session status is saved in a global variable $secsignid_login_auth_session_status631 * All post parameter are available and a possible auth session can be checked if its status is AUTHENTICATED. 632 * The auth session status is saved in a global variable $secsignid_login_auth_session_status 636 633 * 637 * if the auth session status is authenticated, the user will be logged in.634 * If the auth session status is authenticated, the user will be logged in. 638 635 * otherwise the function just will end without any effects. 639 636 */ … … 833 830 //save to the session, that the secsign id was authenticated. This will later allow the assignment to/creation of a wordpress user 834 831 $_SESSION['authenticated'] = $_POST['secsigniduserid']; 832 835 833 // release authentication session. it is not used any more 836 $secSignIDApi->releaseAuthSession($authsession); 834 try { 835 $secSignIDApi->releaseAuthSession($authsession); 836 } catch(Exception $e){ 837 //do nothing if the authentication session cannot be released, proceed with user login 838 } 837 839 838 840 $user_to_login = get_wp_user($_POST['secsigniduserid']); … … 889 891 if (!(function_exists('secsign_id_login_post_url'))) { 890 892 /** 891 * builds an url which is used for all html forms to post data to.893 * Builds an url which is used for all html forms to post data to. 892 894 */ 893 895 function secsign_id_login_post_url() … … 915 917 if (!(function_exists('secsign_id_login_remove_all_url_params'))) { 916 918 /** 917 * removes all not needed parameter (loggedout, reauth, action) from a url path919 * Removes all not needed parameter (loggedout, reauth, action) from a url path 918 920 * the second parameter is optional and returns the redirect_to value by reference if available 919 921 * Example: secsign_id_login_remove_url_param('/wp-login-php?para1=1¶2=2') … … 969 971 if (!(function_exists('get_secsignid_server_instance'))) { 970 972 /** 971 * creates an instance of the SecSignIDApi and returns it. 972 * 973 * Creates an instance of the SecSignIDApi and returns it. 973 974 * @return SecSignIDApi the SecSign ID server API 974 975 */ … … 984 985 if (!(function_exists('print_login_form'))) { 985 986 /** 986 * prints out the actual login form987 * Prints out the actual login form. 987 988 */ 988 989 function print_login_form() 989 990 { 991 enqueue_secsign_scripts(); 992 990 993 $form_post_url = secsign_id_login_post_url(); 991 994 $plugin_path = plugin_dir_url(__FILE__); … … 1178 1181 if (!(function_exists('print_wpuser_mapping_form'))) { 1179 1182 /** 1180 * prints out the WP User mapping login form1183 * Prints out the WP User mapping login form. This happens if the given secsign id is not mapped to a wordpress user and self enrollment is enabled. 1181 1184 */ 1182 1185 function print_wpuser_mapping_form() … … 1256 1259 if (!function_exists('secsignid_login_hide_wp_login')) { 1257 1260 /** 1258 * prints jQuery code to hide the normal password based login, when using the secsign id login1261 * Prints jQuery code to hide the normal password based login, when using the secsign id login. 1259 1262 */ 1260 1263 function secsignid_login_hide_wp_login() … … 1275 1278 if (!function_exists('add_error')) { 1276 1279 /** 1277 * check if the global variable error is set and is an instance of WP_Error.1280 * Check if the global variable error is set and is an instance of WP_Error. 1278 1281 * If not the function creates a new WP_Error instance and assignes it to global variable $errors. 1279 1282 * After that the given error message is added to WP_Error instance. … … 1298 1301 if (!(function_exists('print_error'))) { 1299 1302 /** 1300 * prints out an error 1301 * 1303 * Prints out an error as message 1302 1304 * @param string $error an error message 1303 1305 * @param BOOL $print_login_form Optional. if true, it prints the login form … … 1322 1324 if (!(function_exists('print_message'))) { 1323 1325 /** 1324 * prints out a message 1325 * 1326 * Prints out a message. 1326 1327 * @param string $msg the messsage 1327 1328 */ … … 1350 1351 if (!(function_exists('get_plugin_version'))) { 1351 1352 /** 1352 * Gets the version of this plugin. It pro pably costs some time to parse the plugin file. But it is better to hve another variable to keep updated.1353 * Gets the version of this plugin. It probably costs some time to parse the plugin file. But this is better than haveing another variable which needs to be updated as well. 1353 1354 */ 1354 1355 function get_plugin_version()
Note: See TracChangeset
for help on using the changeset viewer.