02 Aug

Login With Ajax

Description

Login With Ajax is for sites that need user logins or registrations and would like to avoid the normal wordpress login pages, this plugin adds the capability of placing a login widget in the sidebar with smooth AJAX login effects.

Some of the features:

  • AJAX Login without refreshing your screen.
  • AJAX Registration without refreshing your screen.
  • AJAX Registration Password retrieval without refreshing your screen.
  • Compatible with Wordpress, Wordpress MU and BuddyPress (BuddyPress supports logins only, no registrations yet).
  • Will work with forced SSL logins.
  • Customizable, upgrade-safe widgets.
  • Redirect users to custom URLs on Login and Logout
  • Redirect users with different roles to custom URLs
  • shortcode and template tags available
  • Fallback mechanism, will still work on javascript-disabled browsers
  • Widget specific option to show link to profile page
  • Now translatable (currently only Spanish is available, please contact me to contribute)

If you have any problems with the plugins, please visit our http://netweblogic.com/forums/ for further information and provide some feedback first, we may be able to help. It's considered rude to just give low ratings and nothing reason for doing so.

If you find this plugin useful and would like to say thanks, a link, digg, or some other form of recognition to the plugin page on our blog would be appreciated.

Translated Languages Available

Here's a list of currently translated languages. Translations that have been submitted are greatly appreciated and hopefully make this plugin a better one. If you'd like to contribute, please have a look at the POT file in the langs folder and send us your translations.

  • Finnish - Jaakko Kangosjärvi
  • Russian - Виталий Капля - http://dropbydrop.org.ua/
  • French - Geoffroy Deleury http://wall.clan-zone.dk
  • German - Linus Metzler
  • Chinese - Simon Lau - http://fashion-bop.com
  • Italian - Marco aka teethgrinder
  • Romanian - Gabriel Berzescu
  • Danish - Christian B.
  • Dutch - Sjors Spoorendonk
  • Brazilian - Humberto S. Ribeiro, Diogo Goncalves, Fabiano Arruda
  • Turkish - Mesut Soylu
  • Polish - Ryszard Rysz
  • Lithuanian - Gera Dieta - http://www.kulinare.lt/

Download

Requires At Least : 2.8
Test Up To : 3.0
Current Version : 3.0b2
Download latest version

Installation

  1. Upload this plugin to the /wp-content/plugins/ directory and unzip it, or simply upload the zip file within your wordpress installation.

  2. Activate the plugin through the 'Plugins' menu in WordPress

  3. If you want login/logout redirections, go to Settings > Login With Ajax in the admin area and fill out the form.

  4. Add the login with ajax widget to your sidebar, or use loginwithajax() in your template.

  5. Happy logging in!

Frequently Asked Questions

How do I use SSL with this plugin?

Yes, see the notes section.

Do you have a shortcode or template tag?

Yes, see the notes section.

For further questions and answers (or to submit one yourself) go to our http://netweblogic.com/forums/.

Screenshots

screenshot-0

Add a fully customizable login widget to your sidebars.

screenshot-1

Smoothen the process via ajax login, avoid screen refreshes on failures.

screenshot-2

If your login is unsuccessful, user gets notified without loading a new page!

screenshot-3

Customizable login/logout redirection settings.

screenshot-4

Choose what your users see once logged in.

Changelog

2.1

  • Added translation POT files.
  • Spanish translation (quick/poor attempt on my part, just to get things going)
  • Fixed result bug on [http://netweblogic.com/forums/topic/undefined-error-on-logging-in-with-wp-29]
  • Fixed bug on [http://wordpress.org/support/topic/355406]

2.1.1

  • Added Finnish, Russian and French Translations
  • Made JS success message translatable
  • Fixed encoding issue (e.g. # fails in passwords) in the JS

2.1.2

  • Added German Translations
  • Fixed JS url encoding issue

2.1.3

  • Added Italian Translations
  • Added space in widget after "Hi" when logged in.
  • CSS compatability with themes improvement.

2.1.4

  • Added Chinese Translations
  • CSS compatability with themes improvement.

2.1.5

  • Changed logged in widget to fix avatar display issue for both BuddyPress and WP. (Using ID instead of email for get_avatar and changed depreciated BP function).
  • Added Danish Translation

2.2

  • Added Polish, Turkish and Brazilian Translation
  • Fixed buddypress avatar not showing when logged in
  • Removed capitalization of username in logged in widget
  • Fixed all other known bugs
  • Added placeholders for redirects (e.g. %USERNAME% for username when logged in)
  • Added seamless login, screen doesn't refresh upon successful login.

2.21

  • Redirect bug fix
  • Hopefully fixed encoding issue

3.0b

  • Various bug fixes
  • Improved JavaScript code
  • Ajax Registration Option

3.0 (coming soon)

  • Option to choose from various widget templates.

Support

Visit our support forums

If you liked this post, why not share it?

  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Reddit
  • RSS
  • StumbleUpon
  • Technorati
  • Twitter
  • I would definitely love to see that. And thank you once again.
  • Hi Marcus,

    I want to show the avatar (profile pic) from facebook instead of a random pic (from gravatar) when users log in through Facebook Connect. How can I do that?
    Also, the entire page refreshes when logging in. I'm using login_with_ajax('') to call it. But of course when I added it as a widget in the sidebar, it works perfectly fine (no page refreshing whatsoever).

    And btw, thanks a ton for the plugin.
  • I can't comment on the facebook connect avatar, as I've not run into that problem (yet). The avatar uses either the get_avatar or bp_loggedinuser_avatar_thumbnail if using buddypress, I'd have thought it automatically retrieves that?

    What javascript errors do you get when it doesn't refresh?
  • I don't get any errors. It's just that the entire page refreshes again. But I think I can live with it. :)
  • Do you mean the page refreshes again when it logs in successfully? That happens on purpose, since the members area may have more links etc. on the page. The point of the plugin is for logins to only refresh if successful, not when there's an error..
  • It says on top (in green) "Login Successful. redirecting..." and then the entire page refreshes; only after that the 'Hi ADMIN' and other logged in features like avatar, profile link, etc appear. Is that how it's supposed to be?
  • Yep, that's right.

    I guess it might be a nice idea to provide a setting option so that there's no refresh, but an updated login box.... something for a future version.
  • How can I get rid of the register, or how can I change it that will be linked to my sign up page. I'm using aMemeber software for membership site so I don't want them to register through that link "register" I'd rather send them to sign up page or get rid of it.
  • Create a widget template as described above, then modify the link to the register page.
  • dsankov
    Hi, do you know of a way to disable the "Login with Ajax" settings in "Settings"? I'm using this plugin in a Wordpress MU environment and it's working great, but I don't want regular users to be able to edit the settings for Login with Ajax, such as "Global Login Redirect", "Show profile link to wp-admin", etc. It would be great to keep these settings for Site Admins, but have them not available to regular users/authors.
  • hmmm.... yes, I see what you mean, good point. I'll have to add that to 2.1 as I'm not able to do that right now.
  • gregory478
    Good morning!
    I am using your plugin v1.3.1 wp v2.8.4a
    I saw this issue earlier in the posts here but I am recieveing the same stall at login.
    Logout works great . . .
    Login acepts the password and I get the spinning graphic but have to refreash the page to see that I have logged in.

    My PHP versions:
    php-mcrypt-5.1.6-15.el5.centos.1
    php-5.1.6-23.2.el5_3
    php-pdo-5.1.6-23.2.el5_3
    php-mysql-5.1.6-23.2.el5_3
    php-cli-5.1.6-23.2.el5_3
    php-ldap-5.1.6-23.2.el5_3
    php-common-5.1.6-23.2.el5_3
  • Hi, see this comment and get back to me with that info. Hopefully I figure out what's going on then.
  • gregory478
    It seems to stop here:
    http://the51percent.us/wp-login.php?callback=js...

    --- I can create a temp login for you if that would help ??
  • Hi, I'm not getting any errors via firebug, so I'll need you to show me the PHP errors it throws in your log files.
  • gregory478
    I'm running CentOS v5.3 where can I find the error log for PHP?
    g.
  • It depends on your setup... do you have a control panel? Usually they have an option to show you the logs.
  • I'd like to insert the login form into a post, but for some reason it puts the form at the top of post every time, despite the fact that the shortcode is at the bottom of the post.

    Why is it doing that? Any way to make it show up where I put it?

    Thanks.
  • Hi Brance, well spotted, how wierd.... I'll investigate that and I should be able to get that fixed within the week for the new version.
  • BCW
    FWIW, I commented out those lines, and all is working as expected.
  • BCW
    Thanks much - I'll give it a whirl.
  • BCW
    Thanks for the quick reply. Any insight you can pass along regarding what might be causing this? Is it a fix I could try inserting into the code? I am in the process of testing various solutions to an Ajax login today, and your plugin seems the most promising so far, except of course for the error!

    Thanks again.
  • A quick and dirty hack, you can delete lines 49-63 and 67-89 from widget/widget_in.php, that should solve your problem.
  • BCW
    I've installed the plugin, and activated it within a subdomain (WPMU 2.8.1) but am getting the following errors after login:

    Warning: Invalid argument supplied for foreach() in /home/usr/public_html/wp-content/plugins/login-with-ajax/widget/widget_in.php on line 52

    Fatal error: Call to undefined function bp_core_get_notifications_for_user() in /home/usr/public_html/wp-content/plugins/login-with-ajax/widget/widget_in.php on line 70

    Line 52 reads: foreach($bp->bp_nav as $nav_item){

    Line 70 reads: $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id );

    The plugin looks great, so any thoughts about why it is throwing these errors would be appreciated.
  • Thanks for the info. Pretty sure I get why that's happening, so I'll make sure to patch that up in the next release, which should be within a couple of days.
  • dsankov
    The plugin is working great, but when I try to use the "Forgotten Password" feature, it just hangs and doesn't do anything. The ajax loading screen appears, but it just keeps spinning. Any ideas?
  • See this comment and get back to me with that info. Hopefully I figure out what's going on then.
  • Hey Marcus, nice plugin.
    Would love to see:
    • multiple widget instances.
    • ability to customise what the widget displays from the backend. ie change welcome message, and display other content via a generic code box that displays underneath when logged in. This would provide a good level of customisation without having to build the structure in a standard text widget.

    thanks
  • Multiple widgets coming within days. It's actually ready but I'm testing it out currently.

    I like the idea of some custom html for those that don't want to create a template.

    Do you mean you'd like a text box for the widget which can contain html and it then gets displayed underneath the avatar, etc? That and customizing the title sounds like the best way to go to me... open to suggestions here.
  • chrisyork
    Hey, I pasted this "<?php if( function_exists('login_with_ajax') ) login_with_ajax(); ?>" into my header and I keep getting "call to undefined function" errors. Can you give me instructions on how to get this to work?
  • Can you paste the error text? What you pasted shouldn't be causing an error if the function doesn't exist.
  • chrisyork
    Fatal error: Call to undefined function: loginwithajax() in /home/viral6/public_html/wp-content/themes/eGallery/header.php on line 82
  • That's your problem right there. You're calling loginwithajax() when you should be calling login_with_ajax()
  • Steve
    Hi,

    Great plugin! I have a small problem though.

    I am running WP 2.8.2 and when I try to login I just get an endless spinner. If I refresh the page then I am logged in, logout works fine at that point too. I read through the posts and I saw a comment about someone hosting under PHP4, but I am running PHP5. Any idea? Thanks in advance.

    ~Steve
  • If you could supply me these two bits of information I may be able to help:

    Can you find out the response during the AJAX call? You can do this using Firebug for firefox and seeing the console window when you log in.

    Are there any errors in your error log?

    Thanks
  • Ahsan
    I am having the same problem
    the error i get is

    Error: missing ; before statement
    Line: 1, Column: 3
    Source Code:
    Fatal error: Call to undefined function: json_encode() in /html/wp-content/plugins/login-with-ajax/login-with-ajax.php on line 224
  • Please make sure you have the newest version. Newer versions have a PHP4-safe json_encode function.
  • A little confused, I used the template tag <?php login_with_ajax(); ?> and got the following error:

    Warning: Missing argument 1 for login_with_ajax(), called in /homepages/33/d296593956/htdocs/wordpress/wp-content/themes/corporate_20/page_subscribe.php on line 26 and defined in /homepages/33/d296593956/htdocs/wordpress/wp-content/plugins/login-with-ajax/login-with-ajax.php on line 285

    not sure what i did wrong here
  • For now, try passing an empty string, so login_with_ajax(''). I'll make sure it accepts no arguments next release.
  • Hi, the translation function in subsequent versions plugins to translate different languages to scale
    Thanks!
blog comments powered by Disqus