IPB Integration

Invision Power Board integration forum

IPB Integration

Postby Renik » Tue Sep 19, 2006 2:30 am

I suppose noone has looked into integrating this into a module for use with IPB.
Renik
WR.net Apprentice
WR.net Apprentice
 
Posts: 3
Joined: Tue Sep 19, 2006 1:22 am

IPB Integration

Postby werds » Thu Sep 28, 2006 11:24 am

there use to be a post on the old forums that was for IPB 2.0 but obviously those posts are long lost :(

and since i dunno how to get the integration working myself i just look in here on occasion hoping someone else with the understanding has =x
werds
WR.net Apprentice
WR.net Apprentice
 
Posts: 13
Joined: Thu Jul 06, 2006 12:58 am

IPB Integration

Postby Baradak » Tue Oct 17, 2006 5:45 pm

I know a fair amount about IPB. I've actually been thinking about modifying the roster code a bit, to parse logins using the IPB members database. But I always dread altering someone elses hard work. So I've been patiently waiting.
Baradak
WR.net Apprentice
WR.net Apprentice
 
Posts: 1
Joined: Tue Oct 17, 2006 5:43 pm

IPB Integration

Postby Sorian » Tue Feb 20, 2007 10:52 pm

well you can 'sort of' integrate it in terms of apearances in down what I did:
http://www.myrkridia.com/

(the actual roster page is http://www.yakuzavanu.com/wowroster/ if you can't find it in the links)

take the header and footer files and modify them basically. though I would love to see some sort of integration with IPB registered users. not necisarilly (preferably not) editing the IPB tables, but instead pulling the data from IPB to use in a Roster mod and using some of the custom fields in IPB to display roster information etc.

the same could be said for eqdkp too, I would hate to have people needing to regsiter twice, not to mention it would all flow a lot better if they were all cross integrated.
User avatar
Sorian
WR.net Apprentice
WR.net Apprentice
 
Posts: 18
Joined: Thu Nov 23, 2006 5:04 am

Re: IPB Integration

Postby Strahd » Thu Feb 22, 2007 2:50 pm

Hi, this code i'm gonna paste is simple, it's a "patch" to just use the current IPB session and check it. It works on IPB 2.2.1, the code is ugly, but it's just a test code :P. I've putted it on conf.php (i don't recomend it on a production site) and it works fine: only registered members can access the roster. You may also whant to add sone "ipb group check"...

Code: Select all
$conn=@mysql_connect("host","dbuser","dbpass");
@mysql_select_db("db");
if (isset($_COOKIE['session_id'])) {

$mid = intval($_COOKIE['member_id']);
$ses = intval($_COOKIE['session_id']);

      // Look up member
      $result = mysql_query("SELECT m.id, members_display_name, member_login_key, mgroup_others, g.g_access_cp FROM  ipb_members m, ipb_groups g WHERE id = $mid AND
m.mgroup = g.g_id");
      $member = mysql_fetch_array($result);

      // Look up session
      $result2 = mysql_query("SELECT id,member_name,member_id FROM  ipb_sessions WHERE member_id= $mid AND  id = $ses");
      $member2 = mysql_fetch_array($result2);

    // Name/password matches?
        if (($member['id'] != $mid) or ($member['member_login_key'] != $_COOKIE['pass_hash']))
        {
                echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://yoursite/index.php?act=Login&CODE=00">';
                die();
        }
}
else {
echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://yoursite/index.php?act=Login&CODE=00">';
die();
}
mysql_close($conn);



note "yoursite" and db settings and change them.

I repeat it's a small test script, but the idea should be this (working with IPB's sessions, without touching anything from database) and it works as a start script
Last edited by Strahd on Fri Feb 23, 2007 12:20 pm, edited 3 times in total.
Strahd
WR.net Apprentice
WR.net Apprentice
 
Posts: 15
Joined: Thu Feb 22, 2007 2:45 pm

IPB Integration

Postby PleegWat » Thu Feb 22, 2007 9:20 pm

please use code tags when pasting code, it improves readability.

Also conf.php is indeed a bad place to add code. This code should probably go in the bottom of Settings.php
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

IPB Integration

Postby Strahd » Fri Feb 23, 2007 12:20 pm

Cuanged to code tag, sorry bout that.

Of course, the place isn't conf.php (as I pointed, this is a total test code), i'm currently looking to put it somewhere that both wowroster and addons normally look, but I did some tests today (for this code and for a little modification to check the group also) and it works perfectly.

Also, i'm gonna check security issues (cookie temper) to see if it's possible to do some kind of sql injection in this code, just in case...

If someone can do a cleaner code (or do a propper code, using existing wowroster or IPB libraries), I would appreciate that (mine is a bit chaos, and i'm certainly not the best php devel...)

Thanks
Last edited by Strahd on Fri Feb 23, 2007 12:22 pm, edited 1 time in total.
Strahd
WR.net Apprentice
WR.net Apprentice
 
Posts: 15
Joined: Thu Feb 22, 2007 2:45 pm

IPB Integration

Postby Strahd » Fri Feb 23, 2007 12:48 pm

Ok, i've putted the new code in the last line of settings.php. The new code uses wowroaster's db library, so it's a better integration, here it is:

Code: Select all
// IPB Integration
if (isset($_COOKIE['session_id'])) {
        $mid = intval($_COOKIE['member_id']);

        // Look up member (including member match with cookie)
        $sql = "SELECT member_login_key FROM  ipb_members WHERE id = $mid";
        $results = $wowdb->query($sql);
        $member = $wowdb->fetch_array($results);
        $wowdb->free_result($results);

        // password matches?
        if ($member['member_login_key'] != $_COOKIE['pass_hash'])
        {
                echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://your.ipb.site/index.php?act=Login&CODE=00">';
                die();
        }
} else {
        echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://your.ipb.site/index.php?act=Login&CODE=00">';
        die();
}
// IPB Integration


Now you only have to change "your.ipb.site" to the propper URL. Also see if your tables are ipb_* (mines are without ipb_)

Next step would be to make it an addon, since an update of wowroaster would erase this (never done one so it'll take a while for me to do it)
Last edited by Strahd on Fri Feb 23, 2007 1:24 pm, edited 5 times in total.
Strahd
WR.net Apprentice
WR.net Apprentice
 
Posts: 15
Joined: Thu Feb 22, 2007 2:45 pm

IPB Integration

Postby PleegWat » Fri Feb 23, 2007 3:12 pm

Settings.php is the correct place for any code like this, because it loads the roster framework. All roster pages include this file quite early (usually the first thing they do).

You should probably take a look at checking the user/pass via IPB functions. You can do it via wowdb, but that restricts the mod to setups where both are in the same DB.

You can't do this in an addon. An addon can only affect its own pages. Trying to use an addon to affect all pages like this would get messy.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Re: IPB Integration

Postby Strahd » Fri Feb 23, 2007 8:24 pm

Couldn't it be done through the menu.php file of the addon? (it loads everytime)
Strahd
WR.net Apprentice
WR.net Apprentice
 
Posts: 15
Joined: Thu Feb 22, 2007 2:45 pm

IPB Integration

Postby PleegWat » Fri Feb 23, 2007 10:40 pm

That's messy in my opinion. Also, it would mean extra load on the server, since the menu is usually loaded after the page has already been put together.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Re: IPB Integration

Postby Strahd » Tue Feb 27, 2007 12:09 am

Followed your advice, and tryied to use IPB functions.

First, I used IPB SDK

You can install it in the root of the IPB, and to make it work with IPB 2.2.x, just change a pice of code:

Original ipbsdk_class.inc.php
Code: Select all
require_once ROOT_PATH   . "sources/ipsclass.php";


Altered ipbsdk_class.inc.php
Code: Select all
require_once ROOT_PATH   . "init.php";
require_once ROOT_PATH   . "sources/ipsclass.php";


That will make IPBSDK work (don't forget to look at ipbsdk_conf.inc.php!). And now, in settings.php, at the end, just put:

Code: Select all
// IPB Integration
        require_once "/path/to/ipbsdk_class.inc.php";
        $SDK =& new IPBSDK();
        if (!$SDK->is_loggedin()) {
                        echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://your.ipb.site/index.php?act=Login&CODE=00">';
                        die();
        }
// IPB Integration


Keep an eye to "/path/to/ipbsdk_class.inc.php" and "your.ipb.site"

And all set. You can also use IPBSDK to check groups or anything, really nice php set to work with IPB ;).

I think this is the best way to do it, using "IPB Funciontions" (although I use IPB SDK middleware, but it uses IPB functions so...) as you advised me.
Last edited by Strahd on Tue Feb 27, 2007 12:11 am, edited 2 times in total.
Strahd
WR.net Apprentice
WR.net Apprentice
 
Posts: 15
Joined: Thu Feb 22, 2007 2:45 pm

IPB Integration

Postby Sorian » Mon Mar 26, 2007 9:59 pm

how about the IPB Unreal blocks? anyone know how to convert some of the roster mods to IPB Unreal Portal blocks?

if people can get standalone files, that would be awesome because you can use a php include tag to display content in the block (that's how I have my TeamSpeak monitor displaying in the block)
www.myrkridia.com

I have been looking to get a GroupCalendar, top 5 PvP stats, and recruitment block but no luck :/
User avatar
Sorian
WR.net Apprentice
WR.net Apprentice
 
Posts: 18
Joined: Thu Nov 23, 2006 5:04 am

IPB Integration

Postby cwpc » Tue Jul 10, 2007 10:11 pm

Any Word on wether or not this is gonna be done?

I love to use IPB instead of PHPBB, and would love to see this using maybe the universal installer?
User avatar
cwpc
WR.net Expert
WR.net Expert
 
Posts: 151
Joined: Wed Jun 13, 2007 9:07 pm
Location: The Edge of Insanity

IPB Integration

Postby cwpc » Wed Sep 12, 2007 2:21 am

i am hoping someone can look into this for the new 2.0 version?
User avatar
cwpc
WR.net Expert
WR.net Expert
 
Posts: 151
Joined: Wed Jun 13, 2007 9:07 pm
Location: The Edge of Insanity

Next

Return to IPB

Who is online

Users browsing this forum: No registered users and 0 guests

cron