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

    Hello,
    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.
    Regards,
    Slink
     
  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:

    http://xenforo.com/community/thread...tom-field-in-kotomi-script.35003/#post-397648
     
  3. Slink

    Slink New Member

    No, I dont mean that. I want they login out side of xenforo.
    Like,
    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:
    HTML:
    [isnotmember]
    <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>
     
     
        <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>
            </dd>
        </dl>
     
       
       
     
        <dl class="ctrlUnit submitUnit">
            <dt></dt>
            <dd>
                <input type="submit" class="button connect" value="Se connecter">
                <a href="../../../forums/lost-password/" class="frm_OverlayTrigger OverlayCloser">Mot de passe oublié ?</a>
            </dd>
        </dl>
     
       
           
            <dl class="ctrlUnit">
                <dt></dt>
                <dd><a href="../../../forums/register/facebook?reg=1" class="frm_fbLogin"><span>Se connecter via Facebook</span></a></dd>
            </dl>
     
     
        <dl class="frm_hanglie">
            <dt> Vous n'êtes pas encore membre ?</dt>
            <dd>
                <input type="submit" class="button register" value="Rejoignez-nous !">
            </dd>
        </dl>
       
       
        <input type="hidden" name="cookie_check" value="1">
        <input type="hidden" name="redirect" value="../../..">
        <input type="hidden" name="_xfToken" value="">
     
    </form>
    </div>
    [/isnotmember]
    [ismember]
    <br />
    <div style="text-align:center">Vous êtes déjà connecté</div>
    [/ismember]
    The most important part is this one:
    Code:
    <form action="../../../forums/login/login" method="post" id="pageLogin">
    You need to target the XenForo login page.

    And this one (redirection once logged)
    Code:
    <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

    http://xenforo.com/community/threads/login-redirect.41978/#post-452463

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

Share This Page