1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Implemantation one login page outside of xenforo directory

Discussion in 'XenForo Questions and Support' started by Slink, Oct 23, 2012.

  1. Slink

    Slink New Member

    I want to implement one login page outside of xenforo directory.
    If one user login in that page he will also got login in xenforo and redirect to xenforo indexpage.
    If some one dont login there he cant access the xenforo directory and got redirect to that login page.
    No registration implement. Only login.
    I tried. But i cant got success. Any one here who can help me.
    Thanks in advance.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    If you disable this permission:

    Admin CP -> Users -> List User Groups -> Unregistered / Unconfirmed

    Screen shot 2012-10-23 at 12.29.40 AM.png

    ...then guests won't be able to view anything. It will show them a login form and nothing else.

    If you want to display the login form from an external directory then one option is to just redirect users to the forum from that external directory. XenForo will then display a login form if the user is not logged in. Otherwise you can create an external script. This will help:

  3. Slink

    Slink New Member

    No, I dont mean that. I want they login out side of xenforo.
    If my xenforo installed into site.com/xenforo/
    Then i want he could login into site.com/login.php
    and will redirect to site.com/xenforo as logged in user.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Slink likes this.
  5. cclaerhout

    cclaerhout Well-Known Member

    The following code is in French, but it should help you:
    <br />
    <div id="xenlogin">
    <form action="../../../forums/login/login" method="post" id="pageLogin">
        <dl class="ctrlUnit">
            <dt><label for="ctrl_pageLogin_login">Votre nom ou E-mail :</label></dt>
            <dd><input type="text" name="login" value="" id="ctrl_pageLogin_login" class="frm_textCtrl"></dd>
        <dl class="ctrlUnit">
            <dt><label for="ctrl_pageLogin_registered">Votre mot de passe :</label></dt>
            <dd><input type="password" name="password" class="frm_textCtrl" id="ctrl_pageLogin_password">                   
                <div><label for="ctrl_pageLogin_remember" class="frm_rememberPassword"><input type="checkbox" name="remember" value="1" id="ctrl_pageLogin_remember"> Mémorisation de la connexion ?</label></div>
        <dl class="ctrlUnit submitUnit">
                <input type="submit" class="button connect" value="Se connecter">
                <a href="../../../forums/lost-password/" class="frm_OverlayTrigger OverlayCloser">Mot de passe oublié ?</a>
            <dl class="ctrlUnit">
                <dd><a href="../../../forums/register/facebook?reg=1" class="frm_fbLogin"><span>Se connecter via Facebook</span></a></dd>
        <dl class="frm_hanglie">
            <dt> Vous n'êtes pas encore membre ?</dt>
                <input type="submit" class="button register" value="Rejoignez-nous !">
        <input type="hidden" name="cookie_check" value="1">
        <input type="hidden" name="redirect" value="../../..">
        <input type="hidden" name="_xfToken" value="">
    <br />
    <div style="text-align:center">Vous êtes déjà connecté</div>
    The most important part is this one:
    <form action="../../../forums/login/login" method="post" id="pageLogin">
    You need to target the XenForo login page.

    And this one (redirection once logged)
    <input type="hidden" name="redirect" value="../../..">
    Good luck.
    LPH, Digital Doctor and Slink like this.
  6. Slink

    Slink New Member

    I got my answer. Thanks a lot.
  7. LPH

    LPH Well-Known Member

    Sorry to pick up on an old thread .. but this looks interesting.

    I'm thinking of using twitter bootstrap to pretty up an inline login form sitting at the top of all pages and have the action go to /community/login.

    My question, though, is regarding the redirect. Is there a way to put in a php script in the value line so that the redirection is to return to the same page currently showing the login form? What would that php script look like?

    So .. if user is on .. /community/pages/xxxx then they are returned to that page after form submission?

    Hopefully that makes sense.
  8. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member


    That redirect code should do that. {$requestPaths.requestUri} is the address of the current page.
    LPH likes this.

Share This Page