The MU forums have moved to WordPress.org

How to get a login on the front page - a la iblogs.com (95 posts)

  1. andrewbillits
    Member
    Posted 18 years ago #

    Welp, I was trying to avoid having to use my old wp-login.php hack because it requires adding a line to the .htaccess and blah blah blah. But it looks as though i'm going to have to. I'll see if I can edit my old hack to work without htaccess and i'll upload it tomorrow.

    All I can say guys is that we're making progress atleast. If the current method works with your site then I would recomend using it because it's clean and simple. However if it doesn't the other way will definetly work because it bypasses wp-login.php altogther.

  2. Farms
    Member
    Posted 18 years ago #

    You;re a legend ab... just one this funny with my install, it doesn't actually logs usres in... just takes them to their (correct) login address and fills the U and P forms with their (correct) information so they hav eto hit 'Login' again.

    Any idea why this might be happening?

  3. Farms
    Member
    Posted 18 years ago #

    But this is the *really* freaky thing... it works fine with uniblogs.org and learnerblogs.org but not with edublogs.org... with edublogs.org it tries to sign you into the temp account and then gives you a 'no permission' message as you don't have permission to view the temp account details (even though you;re signed into that blog)

    Hmmmm, I worry about the user system in edublogs sometimes (having started on a pretty old version back in the day) whereas with learner & uni which will redirect you to your blog with edublogs you are able, as any user, to log into the main blog (you just don't have any rights).

    Could this be something to do with the database... it's a pain in the arse but is it fixable do ya reckon?

  4. zeug
    Member
    Posted 18 years ago #

    Yes, the joys of using pre-alpha code in active development ... my frontlogin returns wp-login for the right domain after being redirected from the tempaccount. You then login from there.

    There are a heap of changes after the 6/11 build I'm using and I was waiting until things bedded in a bit before updating the site. Does frontlogin only work with the latest builds?

    At the moment it only works for me if the user goes straight to their wp-login without a redirect... so for the meanwhile here's a dirty js hack. I took andrewbillits lead and rewrote it in Javascript so the form posts straight to the right subdomain:

    function ActionURL()
    {

    var blog = document.loginform.log.value;
    var server = 'YOUR.DOMAIN.COM';

    document.loginform.action = ('http://' + blog + '.' + server + '/wp-login.php');

    return true;
    }

    with onClick="return ActionURL();" in the submit input. Works for me at the moment although wrong username returns the fatal error blog not found message which is messy. And admin can't login from front page, which I kind of like anyways.

    Like I said, a dirty interim hack, but why are some sites redirecting to wp-login while others log into wp-admin?

  5. andrewbillits
    Member
    Posted 18 years ago #

    hmm, i'm having problems getting my other method to work correctly also. Seems it only works on older versions. I guess i'll just have to write my own version of wp-login that will allow for what we want to do. I'll work on it through the week and post after thanksgiving. Like I said though, atleast we're making progress.

  6. zeug
    Member
    Posted 18 years ago #

    Any idea why wp-login doesn't post log and pwd along with the subdomain redirect? It seems to rely on the cookie which gets written on the first form post but for me doesn't get picked up after the redirect... either using your frontlogin or wp-login itself. Although this apparently works on other sites ... confusing.

  7. andrewbillits
    Member
    Posted 18 years ago #

    yeah, that's why i'm just going to write a script and call if wp-fp-login.php. It will basically just be wp-login but with a hook that allows us to login fromt the front page.

  8. Farms
    Member
    Posted 18 years ago #

    Hell yeh, very positive progress too. Thanks for all the work on this ab, much appreciated by all.

  9. Farms
    Member
    Posted 18 years ago #

    Hiya, is there a latest version of this or does anyone have it working properly yet (apologies if I missed this on another thread)?

  10. andrewbillits
    Member
    Posted 18 years ago #

    well, when I noticed wordpress.com having a login on the frontpage I stopped working on my little script because I figured it would make it into the nightly releases. I guess I should have known better... I'll finish my script this weekend.

  11. dbasulto
    Member
    Posted 18 years ago #

    anyone knows which image uploading-handling plugin iblog uses? is it released to public?

  12. samchng
    Member
    Posted 18 years ago #

    What image uploading plugin are you referring to?
    Any difference from what WPMU currently offers?

  13. dbasulto
    Member
    Posted 18 years ago #

    Samchng, it provides drag and drop features, which aren't available on the 2006-04-19 build at least...
    i ask this because the current uploader doesn't work for me, even after fixing .htaccess file, as stated on this post:
    http://mu.wordpress.org/forums/topic.php?id=936&replies=4

  14. samchng
    Member
    Posted 18 years ago #

    I used the Mar build and it seems fine with drag and drop.
    Use ITDamager's .htaccess and it will work.

  15. suleiman
    Member
    Posted 18 years ago #

    Have there been any updates to this? I'm anxious to get it installed on my own site.

  16. thatposhgirl
    Member
    Posted 18 years ago #

    I did what ivanhoe mentioned pasting the form from wp-login.php into my home page. It looks good and works as far as I can tell. The only thing is is that it doesn't work real well for logging into the admin account. It logs the admin in but doesn't take them to the admin control panel. If I click on the url and then hit enter it continues on logging in. Users logging in don't appear to have this problem:

    <form name="loginform" id="loginform" action="wp-login.php" method="post">
    <label><?php _e('Username:') ?>
    <input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1); ?>" size="20" tabindex="1" /></label>
    <label><?php _e('Password:') ?>
    <input type="password" name="pwd" id="pwd" value="" size="20" tabindex="2" /></label>

    <label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />
    <?php _e('Remember me'); ?></label>
    <p class="submit">
    <input type="submit" name="submit" id="submit" value="<?php _e('Login'); ?> »" tabindex="4" />
    <input type="hidden" name="redirect_to" value="<?php echo wp_specialchars($redirect_to); ?>" />

    </form>

    You can check it out: http://Screenwriters.LA (but the site is incomplete atm)

  17. ladeem
    Member
    Posted 17 years ago #

    I have the same issue as far as it not working for the admin account. If that could get fixed, it would be awesome. But honestly, I don't care - as long as my soon-to-be new bloggers can use it! ;)

  18. andrea_r
    Moderator
    Posted 17 years ago #

  19. ladeem
    Member
    Posted 17 years ago #

    andrea - you are so awesome! ;)

  20. kdesilva
    Member
    Posted 17 years ago #

    How do you get the page to redirect to the users dashboard rather than just redisplay the main site's page

  21. hempsworth
    Member
    Posted 17 years ago #

    If you are using andrea's code snippet...
    FIND:

    <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>"/>

    IN LINE FIND:

    <?php echo $_SERVER['REQUEST_URI']; ?>

    REPLACE WITH:

    <?php echo get_settings('siteurl'); ?>/wp-admin/

    That should work, but I havent tried it out.
    Try it out! :P

  22. macuser9214
    Member
    Posted 17 years ago #

    I get this:

    Fatal error: Call to undefined function: get_currentuserinfo() in (path to index.php)

    HELP!

  23. ekusteve
    Member
    Posted 17 years ago #

    I used hempsworth's change above and it seems to work on my site...thanks. I did paste it in incorrectly a couple of times before figuring out what I was doing wrong. You need to make sure the changed line ends up looking like this:

    <input type="hidden" name="redirect_to" value="<?php echo get_settings('siteurl'); ?>/wp-admin/"/></div>

    Steve

  24. macuser9214
    Member
    Posted 17 years ago #

    Heres what I have...

    <li id="login">
    <?php
    global $user_ID, $user_identity;
    get_currentuserinfo();
    if (!$user_ID):
    ?>
    <h2><?php _e('Login'); ?></h2>
    <form name="loginform" id="loginform" action="<?php echo get_settings('http://macuser9214.com/blog'); ?>/wp-login.php" method="post">
    <div><label><?php _e('Login') ?>:
    <input type="text" name="log" id="log" value="" size="20" tabindex="7" /></label>
    <label><?php _e('Password') ?>:
    <input type="password" name="pwd" id="pwd" value="" size="20" tabindex="8" /></label>
    <label><input type="checkbox" name="rememberme" value="forever" tabindex="9" /> <?php _e("Remember me"); ?></label>
    <input type="submit" name="submit" value="<?php _e('Login'); ?> »" tabindex="10" />
    <?php wp_register('', ''); ?>
    <input type="hidden" name="redirect_to" value="<?php echo get_settings('http://macuser9214.com/blog'); ?>/wp-admin/"/></div>
    </form>
    <?php
    else:
    ?>
    <h2><?php echo $user_identity; ?></h2>

    <?php
    endif;
    ?>

    Don't know why it's not working.

    To clarify, wordpress is in another directory.

    I want the login page on http://macuser9214.com
    and the blog is on http://macuser9214.com/blog

    and for (siteurl) I put the blog address.

    Any other ideas?

  25. macuser9214
    Member
    Posted 17 years ago #

    Anyone? Come on! SOMEONE KNOWS!!

  26. demonicume
    Member
    Posted 17 years ago #

    what error message are you seeing?

    and how is this different than the homeland stupidity hack, i'm not seeing a real difference. i've got that running on my site.

  27. macuser9214
    Member
    Posted 17 years ago #

    I'm getting this:

    Fatal error: Call to undefined function: get_currentuserinfo() in (path to index.php)

  28. macuser9214
    Member
    Posted 17 years ago #

    ANYONE?????

  29. suleiman
    Member
    Posted 17 years ago #

    here's my recommendation buddy:

    http://www.americanheretic.com/2007/02/15/authentication-ui-plugin-for-wordpress/

    Follow his instructions. It's a three step process. You should be all set to jet ;)

  30. macuser9214
    Member
    Posted 17 years ago #

    I installed the plug-in, but how do I put it on my front page?

    Step 2, Don't understand....

    Thanks.

About this Topic

  • Started 18 years ago by Farms
  • Latest reply from franz.skaaning