NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 06-02-2005 16:21:43

schwpz
New member

Attempted phpbb integration - log in issue

Hello,

first of all thank you for providing such an excellent software and for all the hard work you guys have putted in coding this. It's truly great, keep it up! big_smile

I have just recently installed a Wacintaki board and I'm trying to find a way to make it share the same user table as the one from my phpbb forum. My intention is to make the users able to use the same username and password on both the Wacintaki board and the forum. I'm not especially good at coding, but I have done my best and gone through all the individual files changing the code so it points to the table phpbb_users instead of op_oekaki, along with changing the name of the different table entries (such as username instead of usrname). However I'm having a problem with the login. Whenever I try to log in it gives me the error "Access Denied: Your password is invalid, or you are still a pending member". I have of course double-checked both the username and password (and caps-lock wink) and they both work fine on the forum.

While trying to find a solution for my problem I stumbled upon a post that said that "You'll need to change the password encryption and verification methods (pretty easy to find every instance, just search for "$saltenc" in all your files) to follow phpBB's".
Unfortunately I'm not quite grasping what I need to do (as I said I'm not much of a coder), but I assume it has something to do with the way the password is encrypted.

Here's the log in sequence from function.php:




// Login (from header.php)
if ($action == 'login') {
$username = $_POST['username'];
$pass     = $_POST['pass'];
$usrpass3 = crypt ($pass, $saltenc);

$result = mysql_query ("SELECT username, user_password, usrflags FROM phpbb_users WHERE username='$username'");

if ($result) {
  $row = mysql_fetch_array ($result);

  //check if passwords are correct and that the user is a non-pending member
  if (($usrpass3 == $row['user_password']) && !strstr($row['usrflags'], 'P')) {
   //create a cookie that contains the username of the person who logged in
   setcookie ('OekakiU', $row['username'], time() + 1209600, $cookie_path);
   setcookie ('OekakiPass', $usrpass3, time() + 1209600, $cookie_path);
   all_done();
  } else {
   report_err($langop_functions_err13);
  }
}
}



// Logoff (from header.php)
if ($mode == 'logoff') {
//kill all cookies
setcookie('OekakiU', '', time() - 1209600, $cookie_path);
setcookie('OekakiPass', '', time() - 1209600, $cookie_path);

// Take user off online list
$online = mysql_query ("DELETE FROM {$OekakiPoteto_MemberPrefix}oekakionline WHERE onlineusr='$OekakiU'");

all_done();
}


I have altered username and user_password for the table phpbb_user (I have made a new row in phpbb_user named usr_flags so I didn't change it).

Does anyone have any ideas or suggestions on how to make the log in function to work?
I'm really stucked here so any thoughts on this matter are appreciated.

Thanks for reading this and have a great day ^^

Offline

#2 06-03-2005 02:26:16

schwpz
New member

Re: Attempted phpbb integration - log in issue

It just stroked me that while the phpbb_users user_password is a VARCHAR (32) not null the op_oekaki usrpass is TEXT null, default null.
Maybe that's the reason why the oekaki board wont accept the password upon login. Any idea what (and where) I need to chance in the oekaki board code to fix this?

Once again thank you for your time and best of luck with your own oekaki board. smile

Offline

#3 06-03-2005 05:32:45

Waccoon
Administrator

Re: Attempted phpbb integration - log in issue

phpbb uses a completetly different encryption system than OP (I don't think it uses the "crypt" function at all).  The way the database is set up doesn't matter that much.

I'll take a look into it this weekend, as I'm working very inconsistent 3rd shift hours during the week.

Offline

#4 06-03-2005 09:54:46

schwpz
New member

Re: Attempted phpbb integration - log in issue

Thank you so much for your reply Waccoon, it would be wonderful if you could look into it. smile

Here's the login.php file from the phpbb forum in case it's relevant. Please feel free to email me if you should need any other files or information.

I'm looking very forward to hear from you again. Thanks a bunch for taking the time to do this. ^^

Offline

#5 06-03-2005 16:17:14

Schwepsi
Member

Re: Attempted phpbb integration - log in issue

Waccoon wrote:

phpbb uses a completetly different encryption system than OP (I don't think it uses the "crypt" function at all).  The way the database is set up doesn't matter that much.

This is correct, it uses MD5 ... it should be easier to decrypt the PW and send it to phpBB...

That are only 5 or 6 lines of code... but i have deleted it months ago u_u
phpBB and an oekaki aren't that optimal

Offline

#6 06-05-2005 16:28:21

schwpz
New member

Re: Attempted phpbb integration - log in issue

Schwepsi wrote:

This is correct, it uses MD5 ... it should be easier to decrypt the PW and send it to phpBB...

Do you know how I can do that?
As I said I'm not much of a coder, so unfortunately I'm not quite sure how to do what you just said. ^^;

By the way, a bit off topic but you're the first user I have ever met who has such a similar nick to my self. smile


I'm looking so forward to open the Oekaki board, I'm positive that it will become so popular among my forum users.
Thanks to the both of you for replying! ^_^

Offline

#7 06-06-2005 15:58:16

Schwepsi
Member

Re: Attempted phpbb integration - log in issue

schwpz wrote:

Schwepsi wrote:

This is correct, it uses MD5 ... it should be easier to decrypt the PW and send it to phpBB...

Do you know how I can do that?
As I said I'm not much of a coder, so unfortunately I'm not quite sure how to do what you just said. ^^;

By the way, a bit off topic but you're the first user I have ever met who has such a similar nick to my self. smile


I'm looking so forward to open the Oekaki board, I'm positive that it will become so popular among my forum users.
Thanks to the both of you for replying! ^_^

i only know the Mod for the original oekaki, but it was not that difficult (has learned it at that time too.

Look in the login PHP-File, there you look where you got logged in.
directly after that you must save login & PW
and instead of that you send a form filled with this information and the variable redirect=index_file_wacintaki to login.php of phpBB
now you see the form, your PW and Name are filled in and you only have to press submit. (ok, a 2nd time, the other way is a bit more difficult, you have to make lot of codechanges)
After submitting you got back to wacintaki

that should work there as well as in the Mod.

Offline

#8 06-06-2005 23:57:47

Schwepsi
Member

Re: Attempted phpbb integration - log in issue

ok, I looked up and remeber what I've done

give me 2 days and you get all needed code
but a warning before:
updates of phpBB and Wacintaki Poteto must be done by hand from this time on !!
You will get the code for Wacintaki Poteto 1.1.5 & phpBB 2.0.15

...

or are you using phpBB plus or something else? any mods installed?
Please tell first, than i will start

Offline

#9 06-07-2005 00:02:30

Diskmaster
New member

Re: Attempted phpbb integration - log in issue

It's an md5 hash, actually, not true md5.

Offline

#10 06-07-2005 01:30:38

Schwepsi
Member

Re: Attempted phpbb integration - log in issue

Diskmaster wrote:

It's an md5 hash, actually, not true md5.

the important thing is uses another method of encrypting. I just send after login the PW to the other form, and redirect back. So it is not important which method is used. It get encrypted for each board by itself.

Offline

#11 06-07-2005 03:15:50

schwpz
New member

Re: Attempted phpbb integration - log in issue

Thank you so much for all your help, you're very kind! smile

I'm using phpbb v2.0.15. It's a very heavily modded board so I'm used to make updates by hand, but none of the mods I have installed should affect the login system in any way.
By the way, if you have a website or something please post it here or PM me so I can post it in my updates logg once the Oekaki board is up, in order to give you proper credit for your help. It's the very least I can do for all the work you are doing by helping me out! ^^


Thanks again! smile

Offline

#12 06-09-2005 17:02:57

Schwepsi
Member

Re: Attempted phpbb integration - log in issue

schwpz wrote:

Thank you so much for all your help, you're very kind! smile

I'm using phpbb v2.0.15. It's a very heavily modded board so I'm used to make updates by hand, but none of the mods I have installed should affect the login system in any way.
By the way, if you have a website or something please post it here or PM me so I can post it in my updates logg once the Oekaki board is up, in order to give you proper credit for your help. It's the very least I can do for all the work you are doing by helping me out! ^^


Thanks again! smile

And sorry again.
I will not make it within the next days, nor I will be online...
I am lying down with a very bad headache and a little fever
Sorry u_u

After that I can make it.
But I didn't know when I am back.

Last edited by Schwepsi (06-09-2005 17:04:33)

Offline

#13 06-14-2005 04:08:11

schwpz
New member

Re: Attempted phpbb integration - log in issue

Sorry to hear that you got sick, how unfortunate for you! sad
I hope you'll get well soon, headaches are no fun at all.
Please let me know if you could perhaps help me when you get well again, but until then try to take good care of your self and focus on your health. That's after all the most important thing. smile

*sends lots of virtual chicken soup* ^^

Offline

#14 06-14-2005 10:15:16

Schwepsi
Member

Re: Attempted phpbb integration - log in issue

I am back and healthy (i hope ;P). But it will take a day or two more because i now have to catch up the household, my forum, the backups, mails, ....
(I think you know many other things I forgot to mention, like to cut the grass).

After that i will give it a try.
If you want to try yourself:

look what happens after login in wacintaki. convert these lines into phpBB and put them into their login (it should be the encryption of the password and and sql line). Try it.
If all things work allright do change the login in wacintaki to a normal link to phpBB login.php?redirect=path/wacintaki_index_file

ready to log in
a thingie I never solved:
registrations. This should be a lot more work, I never tried this


And btw:
thanks for the getting-well-wishes. Seems like they worked XD

Offline

#15 06-20-2005 06:25:34

Schwepsi
Member

Re: Attempted phpbb integration - log in issue

sorry... that was too much

try this, but I haven't tested it. I haven't a unix server anymore.

Wacintaki 1.2
->Header.php

Search:
    <form name="form1" action="functions.php" method="post" style="margin: 0; text-align: center;">
        <input name="action" type="hidden" value="login" />

        <?=$langop_word_name?>:
        <input name="username" type="text" class="multiline" />

        <?=$langop_install_password?>:
        <input name="pass" type="password" class="multiline" />
        <input name="login" type="submit" value="Login" class="submit" />
    </form>

Replace with:
<form name="form1" action="***PHPBB_LOGIN***?redirect=wacintaki_path_to_index.php" method="post" style="margin: 0; text-align: center;">
        <input name="login" type="submit" value="Login" class="submit" />
    </form>



PHPBB 2.0.15
Login.php

Search:
        $username = isset($HTTP_POST_VARS['username']) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';
        $password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : '';

ADD after:

    $pass     = $password;
    $usrpass3 = crypt ($pass, ***ENCRYPTION CODE, look into your config ***);

    $result = mysql_query ("SELECT usrname, usrpass, usrflags FROM ***OekakiPoteto_MemberPrefix***oekaki WHERE usrname='$username'");

    if ($result) {
        $row = mysql_fetch_array ($result);

        //check if passwords are correct and that the user is a non-pending member
        if (($usrpass3 == $row['usrpass']) && !strstr($row['usrflags'], 'P')) {
            //create a cookie that contains the username of the person who logged in
            setcookie ('OekakiU', $row['usrname'], time() + 1209600, $cookie_path);
            setcookie ('OekakiPass', $usrpass3, time() + 1209600, $cookie_path);
            all_done();
        } else {
            message_die(GENERAL_ERROR, 'COULD NOT LOGIN');
        }
    }

Last edited by Schwepsi (06-20-2005 07:07:38)

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB