Changeset 1271308
- Timestamp:
- 10/22/2015 07:28:13 PM (10 years ago)
- Location:
- els-ajax-login/trunk
- Files:
-
- 1 added
- 3 edited
-
els-ajax-login.php (modified) (1 diff)
-
js/els-ajax-login-def.js (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
screenshot-3.png (added)
Legend:
- Unmodified
- Added
- Removed
-
els-ajax-login/trunk/els-ajax-login.php
r1269709 r1271308 150 150 151 151 152 #-----------------------------------------------------------------# 153 # Backend login modify 154 #-----------------------------------------------------------------# 155 function appendScriptOnLoginHead() 156 { 157 if( is_user_logged_in() ) 158 { 159 header("location:".admin_url()); 160 } 161 else{ 162 wp_enqueue_script('jquery'); 163 wp_enqueue_style('els-ajax-login-css', plugin_dir_url(__FILE__).'css/els-ajax-login-css.css', '', '1.0.1'); 164 wp_enqueue_script('els-ajax-login-def', plugin_dir_url(__FILE__).'js/els-ajax-login-def.js', array('jquery'), '1.0.1', TRUE); 165 wp_localize_script('els-ajax-login-def', 'els_backend_obj', array( 166 'els_create_nonce' => wp_create_nonce('els-ajax-login-nonce'), 167 'dashboard' => admin_url(), 168 'ajaxurl' => admin_url( 'admin-ajax.php' ), 169 'checking_msg' => __('Checking Authentication, Please wait...'), 170 'img_URL' => plugin_dir_url(__FILE__).'img/redirecting.gif', 171 )); 172 } 173 } 174 add_action('login_footer', 'appendScriptOnLoginHead'); -
els-ajax-login/trunk/js/els-ajax-login-def.js
r1269709 r1271308 94 94 }); 95 95 96 /** 97 | Backend login 98 */ 99 $(window).load(function(){ 100 $('#loginform').prepend('<p class="elsLoginStatus"></p>'); 101 }); 102 103 $('#wp-submit').click(function(){ 104 var token = els_backend_obj.els_create_nonce; 105 //alert(token); 106 107 $('.elsLoginStatus').show(); 108 $('.elsLoginStatus').text(''); 109 $.ajax({ 110 type: 'POST', 111 dataType: 'json', 112 url: els_backend_obj.ajaxurl, 113 data: { 114 'action': 'elsAjaxLogin', //calls wp_ajax_nopriv_ajaxlogin 115 'username': $('#loginform #user_login').val(), 116 'password': $('#loginform #user_pass').val(), 117 'els_form_token': token 118 }, 119 success: function(data){ 120 if (data.loggedin == true) 121 { 122 $('body').prepend("<div class='els-popup-overlay'><img class='elsLoadingImg' src='"+els_backend_obj.img_URL+"' alt='Redirecting...' /></div>"); 123 setTimeout(function(){ 124 $('.els-popup-overlay').remove(); 125 setTimeout(statusMsg, 300); 126 document.location.href = els_backend_obj.dashboard; 127 }, 3000); 128 } 129 else if (data == 0) 130 { 131 $('.elsLoginStatus').text('You are already logged in!'); 132 } 133 else{ 134 $('body').prepend("<div class='els-popup-overlay'><img class='elsLoadingImg' src='"+els_backend_obj.img_URL+"' alt='Redirecting...' /></div>"); 135 setTimeout(function(){ 136 $('.els-popup-overlay').remove(); 137 setTimeout(statusMsg, 300); 138 }, 3000); 139 } 140 function statusMsg(){ 141 $('.elsLoginStatus').text(data.message); 142 } 143 } 144 }); 145 146 147 return false; 148 149 }); 150 96 151 }); -
els-ajax-login/trunk/readme.txt
r1269745 r1271308 1 1 === Ajax Login === 2 Contributors: sagor.touch 2 Contributors: sagor.touch, sagortouch 3 3 Tags: ajax-login, sidebar-ajax-login, page-login, admin-login, ajax-admin-login 4 4 Requires at least: 4.0 5 5 Tested up to: 4.3.1 6 Stable tag: 1. 06 Stable tag: 1.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 18 18 Plugin Features: 19 19 20 * Click to Loading a progress bar and redirect to admin page. 20 * Click to Loading a progress bar and redirect to admin page. 21 * Enable ajax login in wp-login.php page. 22 * Add ajax login widget. 21 23 * Ajax'y applications. 22 24 * Added WP Security. … … 46 48 2. You can use this login form on sidebar widget. 47 49 50 3. Enable ajax login in wp-login.php page. 51 52 = 1.2 = 53 * Enable ajax login in wp-login.php page. 48 54 49 55 = 1.0 =
Note: See TracChangeset
for help on using the changeset viewer.