Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorwohoo
    • CommentTimeApr 30th 2008 edited
     # 1
    Currently, after a user registers (I give 'member' status without admin approving), he/she is automatically logged in and redirected to the forum index. I'd like to redirect them to the account page instead, basically giving them a little nudge so they'd immediately customize their account, thus make them more tied to the community.

    How would such a redirect be possible? Thanks!
    • CommentAuthorsirlancelot
    • CommentTimeApr 30th 2008 edited
     # 2
    In your conf/settings.php change the setting FORWARD_VALIDATED_USER_URL to the full URL of your account page.

    Since the default Vanilla theme uses the current URI when a user clicks the "Sign In" button, you will need to either change that behavior (in themes/menu.php @ line 10), or make an extension to override it:<?php
    /*
    Extension Name: Return URL Override
    Extension Url: http://lussumo.com/
    Description: Forces Users to go to the configured URL upon login
    Version: 0.1
    Author: sirlancelot
    Author Url: http://lussumo.com/
    */

    function SignInForm_ChangeReturnUrl(&$SignInForm) {
    $Context =& $SignInForm->Context;
    $SignInForm->PostBackParams->Add('ReturnUrl', $Context->Configuration['FORWARD_VALIDATED_USER_URL']);
    }
    $Context->AddDelegate('SignInForm', 'PreNoPostBackRender', 'SignInForm_ChangeReturnUrl');
    ?>
    I think that should do it. I've never written an extension before so someone should back me up here :)

    Update: Added Extension metadata to make it identify in Vanilla.
    • CommentAuthorwohoo
    • CommentTimeApr 30th 2008
     # 3
    Thank you! No idea about creating an extension but I'm using GuestSignIn which adds a login form to the panel, and it must be using its own URL after logging in, so getting directed to account.php when logging in is not a problem for me.

    Would love to see this made into a quick extension though.
    •  
      CommentAuthorHamed
    • CommentTimeApr 30th 2008
     # 4
    very nice idea
  1.  # 5
    I just made it in to a quick extension :-/

    Copy that code in to a file named default.php and place it in a folder inside the extensions folder: extensions/ReturnUrl/default.php

    Then just enable it through Vanilla's configuration.
    •  
      CommentAuthorHamed
    • CommentTimeMay 1st 2008
     # 6
    i tried it
    but it does not show up in the extension page
    T_T
  2.  # 7
    Oh... so apparently you need all the meta-data for the extension to be valid; I added the rest, hopefully it will work now.
    •  
      CommentAuthorHamed
    • CommentTimeMay 1st 2008
     # 8
    aaaa i see thank you
    so this takes you to the specified account.php (the admins maybe) or the members? (i think it is the individual members account, right?)
  3.  # 9
    account.php loads the current logged in user's profile page if no parameters are given. By default all this extension will do is ignore where the user came from before they logged in and force them to go a page; the page defined in the FORWARD_VALIDATED_USER_URL configuration variable.
    •  
      CommentAuthorHamed
    • CommentTimeMay 3rd 2008
     # 10
    oh your right
    my bad
    what was i thinking
    • CommentAuthormiquel
    • CommentTimeMay 13th 2008
     # 11
    i think that the requested functionality is far much easier than making an express extension: for changing the page the user is redirected when given membership, just change $Configuration['FORWARD_VALIDATED_USER_URL'] to the desired url.

    this way, the user is only redirected once, not everytime s/he logs in
    • CommentAuthormiquel
    • CommentTimeMay 14th 2008
     # 12
    mmm, i think i didn't took much testing, cause my proposed solution just redirects every time a user is registered and also when a registered user logs in, soo sorry, i thought i'd found a nice solution :(
Add your comments
    Username Password
  • Format comments as