Welcome Guest, Not a member yet? Register   Sign In
phpBB Auto Login User After External Registry
#1

[eluser]JavaJunky[/eluser]
Hi,

I've been working on my site that integrates the phpBB library.
http://codeigniter.com/wiki/phpBB3_library/

Everything is working fine so far. I'm able to register externally in CI and retrieve phpBB user data in CI. What I'm trying to get working is after registering a new user, I want CI to login the new user and go back to my CI home page. I'm not very experienced in phpBB. I tried sending the user to a page after the registering passes that has a login form prepopulated with the username and password from the post variables and auto submitting the form with javascript, but for some reason that doesn't work. I'm using the exact same form from my external login.

This is the js:
Code:
setTimeout('document.loginform.submit()',1000);

This is the form that should submit after the timeout:
Code:
<form  name="loginform" action="http://mySite.com/forum/ucp.php?mode=login" method="post">  
    <p>Username</p>
    &lt;input type="text" name="username" value="newUsername" id="username" class="home-field"  /&gt;  
    <p>Password</p>
    &lt;input type="password" name="password" value="newPassword" id="password" class="home-field"  /&gt;    
    &lt;input type="hidden" name="redirect" value="http://mySite.com/redirect/home/" /&gt;
    <div class="button">
        <button type="submit" name="login" class="login-btn">Login</button>      
    </div>
&lt;/form&gt;

When the javascript submits the form, all it does is send me to the phpbb login form. Comment out the javascript and hit the submit button manually, it works and I am logged in. Does anyone have a solution? Is there a simple way to login the user with php instead of my adhoc javascript method? I don't know phpbb well enough to hack at it.

Thanks,
Wil




Theme © iAndrew 2016 - Forum software by © MyBB