View Full Version : SMF 1.1.2 Authentication for phpRaid 3.0.7
jabari
10-25-2006, 09:29 PM
Change Log:
February 16 - Successfully tested mod with SMF 1.1.2
January 21 - Added instructions for converting a fresh install from the default PHPraid authentication to SMF with this mod.
January 15, 2007 - Changed the download links.
December 31 - Mod has been successfully tested with SMF 1.1.1.
December 11 - Successfully tested mod with SMF 1.1 Final.
October 25 - Posted mod instructions.
-----------------------------
This mod allows you to use SMF 1.1 RC3 for phpRaid authentication. I am a programmer but not a PHP programmer so fully test this mod out and backup your data before even thinking of using it for a production website. I used the working auth_smf.php file from phpRaid 2.9.5 and also the auth_phpbb.php file in phpRaid for the basis of my auth_smf.php file for phpRaid 3.0.7. I tried to make the SMF authentication work exactly like the phpBB authentication. However I made the following change from the official phpRaid distribution:
1. If I understand the programming correctly when a phpBB user logs into phpRaid, phpRaid checks to see if an existing phpRaid user profile that has the same email address as the phpBB user already exists. If it does then the user is logged into phpRaid. If a profile doesn't already exist then a phpRaid user profile is created for the user before being logged into phpRaid. My problem was that email addresses were not unique among my SMF users because I manually create my SMF users via a bridge with Joomla CMS and their email address is optional in my install of Joomla so I usually put in a bogus email of "changeme@nowhere.com" for their email address. So since phpRaid uses the email address to uniquely identify phpBB users I had to change it so that phpRaid looks for some other unique identifier for my SMF users. So I decided to use the user ID number of my SMF users for the unique identifier since phpRaid uses that number for the profile ID numbers anyway so I figured that was a good alternate choice for a unique identifier.
The SMF "SSI.php" needs to be in the root of your SMF installation directory. In addition, you must be using the same database for phpRaid and SMF.
Fresh Installation:
1. Extract the phpRaid 3.0.6 install files to your web server.
2. Ensure SSI.php is present in the root of your SMF directory.
3. Overwrite the install/install.php file with the attached SMF modified version in the file auth_smf_rc3_phpRaid306.zip.
4. Place the file auth_smf.php (also located in auth_smf_rc3_phpRaid306.zip) into the auth/ subdirectory in your phpRaid installation directory.
5. Install phpRaid 3.0.6 and choose the SMF authentication choice.
6. Log into SMF with the admin user you specified in the installation script and then go to phpRaid. Finish the normal phpRaid configuration in the configuration screen of phpRaid.
7. Apply the upgrade files for phpRaid 3.0.7.
8. Check that the phpRaid 3.0.7 upgrade worked.
9. While still leaving your browser window open to phpRaid, type in the URL to your SMF installation and load it up. If everything works fine in SMF then you are done with the mod installation. However, if when you load up your SMF installation you notice all the titles, labels, and other text missing, then you are experiencing a problem that I had with my web hosting provider so you need to refer to the next message in this thread for the fix. I beta tested this mod out with several people and none reported having this problem so you may or may not experience it.
What Doesn't Work
- The phpRaid username/password fields do not work. If you type in your username and password into these boxes you will just get an error. You need to first log into SMF and then go to phpRaid. You can edit the phpRaid template to omit the username/password field so that it does not confuse your users.
SMF Versions Confirmed Working with this Mod
- 1.1 RC3
- 1.1
- 1.1.1
- 1.1.2
Mod Files
Download Link (http://www.thetaintedguild.com/index.php?option=com_docman&task=doc_details&gid=2&Itemid=134)
- auth_smf.php
- install.php
jabari
10-25-2006, 09:29 PM
Fix For Missing Language File Text
If when you reach step 9 of the installation procedure above and your SMF installation looks like the following screenshot Link To Screenshot (http://www.thetaintedguild.com/downloads/broke_mod_phpraid.jpg), then your SMF installation is not loading the language file needed to display the text in SMF. To fix this you need to locate the phpRaid file configuration.php and rename all instances of the text "$language" to something else like "$language2". After you do this, close your web browser and reopen it. Load up a few pages in your phpRaid install and then try to view your SMF install again. The missing text problem should now be fixed.
NOTE: You may need to delete your browser cache and cookies to get rid of the problem from being displayed in your web browser. If after applying the fix you still see this problem, try deleting your browser cache and cookies and then restart your browser.
If you want, you can overwrite your configuration.php file with the one linked below. In that file I renamed all instances of "$language" to "$language2".
Files
Download Link (http://www.thetaintedguild.com/index.php?option=com_docman&task=doc_details&gid=3&Itemid=134)
- configuration.php
jabari
10-25-2006, 09:30 PM
Technical Details
- SMF 1.1 RC3 introduced a security check where you can't have post/request variables with names that are numeric. The phpRaid permissions.php page has form variables with numeric names so I had to try to find a hack for this. I wanted to keep the phpRaid files as "stock" as possible so I didn't want to alter them. So what I did was at the start of my auth_smf.php file I extract the _POST and _REQUEST variables that had numeric names. I save these variables until after the SMF code portion of the file is complete. At the end of the auth_smf.php file I restore the numeric variables so that phpRaid keeps on working like nothing happened. As I mentioned, I am not a good PHP programmer so if someone knows a better way of handling this, please post a reply here.
- The phpRaid configuration.php has a variable called $language which is also present in the SMF Settings.php file. The configuration.php file is the only file in phpRaid that has the $language variable. This name conflict seems to cause the $language variable to get erased on some hosts. The $language variable has a value of the language that SMF is set to display. So since the value of this variable gets destroyed, SMF does not know what language to load so this results in a bunch of text missing from the SMF page. So the fix is to rename the $language variable in either phpRaid or SMF so there is no longer a name conflict. This problem does not show up on all web hosts and I don't know why it happens on some and not others.
How to Convert from PHPraid Authentication Mode to SMF
Thanks to d0qtrx for figuring out these instructions. You would do this if for some reason you can't do a fresh install of PHPraid with this mod. So you would install with the default PHPraid authentication and then convert it to SMF. You would not do this for an existing install of PHPraid that already has users in it. You can try it, but I am not sure what would happen. If I would to guess, you would end up with duplicate users - the existing users which no one will be able to log in and edit any more and also the "new" SMF version of the user which people would create as they log in via SMF.
Here are his instructions for converting from PHPRaid authentication to SMF:
All you need to do is add the smf_smf.php into the /auth directory then patch a couple variables into your database.
UPDATE phpraid_config SET config_value = 'smf' WHERE config_name = 'auth_type';
INSERT INTO phpraid_config (config_name, config_value) VALUES('phpbb_prefix', 'smf_');
INSERT INTO phpraid_config (config_name, config_value) VALUES('phpbb_root_path', '../smf/');
Valience
11-12-2006, 03:24 PM
Hey Jabari,
I don't know if you're still around for support, but I tried your method of fixing the $language conflicts. And well, i'm getting errors regardless. If you could check out my site at Blood and Thunder (http://bloodandthunder-wow.net)
The forum is doing the same thing it was before i used your edited configuration.php And phpraid has a bunch of scripting showing on the page.
Now i've noticed my website homepage is showing the problem as well, as i am using joomla and the smf component for user integration.
This is what it says on my forum page:
!!Attention of wow-dk theme:
You should put "Modifications.english.php" on the "languages" directory ( http://www.bat.thelordzofwar.com/forum/Themes/wowdk11rc3f/languages/ ) in the theme of wow-dk.
Copy "Modifications.english.php" of the "languages" directory of wow-dk onto the first. Next, rename it according to the language for which you use the file.
Any help would be greatly appreciated.
****Updated****
I just realized that it's completely fubar in Firefox. If you could check it out in Firefox you'll see the problem.
jabari
11-13-2006, 01:53 PM
****Updated****
I just realized that it's completely fubar in Firefox. If you could check it out in Firefox you'll see the problem.
I checked it out on FireFox 2.0 on Windows and it worked. I first went to your homepage and then I loaded up the phpRaid url at http://bloodandthunder-wow.net/phpraid/. After I loaded up PHPRaid I went to your homepage and forums and it still looked fine. So I guess for your users everything will work fine since they can't use the admin page that causes the problem. Are you still having the problem? If so, try quiting your browser and restarting it. If it still has the problems after restarting the browser, you may need to clear your cookies for your site. I think after you apply the language fix you may have to clear your browser cache and cookies and restart your browser to get rid of the problem, otherwise it lingers in your browser. Let me know if you are still having problems. It looks like I have the EXACT same setup as you. I have Joomla with SMF authentication using the Ostiro bridge. I even have WoW Roster running in a wrapper like you. My guild's site is at: http://www.thetaintedguild.com
Valience
11-13-2006, 03:04 PM
You're right, the cookie cache cleared it, and it works in firefox now. But...In my forums page there's an error message at the top of the forum.
!!
Attention of wow-dk theme:
You should put "Modifications.english.php" on the "languages" directory ( http://www.bat.thelordzofwar.com/forum/Themes/wowdk11rc3f/languages/ ) in the theme of wow-dk.
Copy "Modifications.english.php" of the "languages" directory of wow-dk onto the first. Next, rename it according to the language for which you use the file.
What does this mean? I don't quite understand what it's telling me to do?
You'll see it in white at the top of the forum. If you don't mind have another look at Blood and Thunder (http://www.bat.thelordzofwar.com/index.php?option=com_smf&Itemid=30).
jabari
11-13-2006, 03:54 PM
You're right, the cookie cache cleared it, and it works in firefox now. But...In my forums page there's an error message at the top of the forum.
You'll see it in white at the top of the forum. If you don't mind have another look at Blood and Thunder (http://www.bat.thelordzofwar.com/index.php?option=com_smf&Itemid=30).
I don't see that error message when I look at your forums. Try viewing your forum without the Joomla wrapper by loading up the direct URL to it: http://www.bat.thelordzofwar.com/forum/. I had some strange behavior with SMF templates in Joomla wrappers so that is why I run my forum outside of a wrapper now.
Also turn off the "Use SMF CSS in other pages" option in the SMF bridge settings if you are using the Ostiro bridge. I noticed strange Joomla behavior with that settings enabled.
Valience
11-13-2006, 05:31 PM
Ok, so what i've come to realize is that the error message is there for the admin to pay attention to. Now I see. I suppose the error will stay there as I don't know how to go about fixing that.
But by the way thank you very much for your help and support. Very awesome of you to help with this.
jabari
12-11-2006, 11:47 AM
I updated my SMF 1.1 RC3 install to SMF 1.1 Final and the upgrade didn't break my PHPRaid authentication so this mod works with SMF 1.1 Final also.
starrbuck
12-31-2006, 07:37 AM
Confirmed. This mod works fine with SMF 1.1.1.
d0qtrx
01-10-2007, 04:05 PM
I'd love to use this, but when I attempt to install:
An appropriate representation of the requested resource /phpraid/install/install.php could not be found on this server.
I suppose I could see about installing on another machine then moving it over, but what a pain in my ass.
:D
d0qtrx
01-11-2007, 08:19 AM
After poking around a bit, I found you can start off with normal phpraid auth, then convert to SMF.
All you need to do is add the smf_smf.php into the /auth directory then patch a couple variables into your database.
UPDATE phpraid_config SET config_value = 'smf' WHERE config_name = 'auth_type';
INSERT INTO phpraid_config (config_name, config_value) VALUES('phpbb_prefix', 'smf_');
INSERT INTO phpraid_config (config_name, config_value) VALUES('phpbb_root_path', '../smf/');
Zugluk
01-22-2007, 10:01 AM
ok this is not working for me! :(
I followed your instructions and im logging in to SMF first and then reloading the raid page and it will not log me in. I can see my profile in the phpraid_profile table and the id matches up with that of the smf_members id.. so I don't understand why it will not log in. I had no errors or nothing I cleared out my cache, im using the bridge off of the smf homepage. Any clues?
Zugluk
01-22-2007, 10:21 AM
ok got it to work and very odd I might add..
heres what I had to do
after the install www.burninghatred.info/raid I had to goto http://www.burninghatred.info/smf login and then go back to www.burninghatred.info/raid and it was logged in.
Now whats the best way to intergrate into joomla? wrapper?
if you login in from the bridge it will NOT log it into raid..
Ryushi32
01-22-2007, 03:44 PM
ok got it to work and very odd I might add..
heres what I had to do
after the install www.burninghatred.info/raid I had to goto http://www.burninghatred.info/smf login and then go back to www.burninghatred.info/raid and it was logged in.
Now whats the best way to intergrate into joomla? wrapper?
if you login in from the bridge it will NOT log it into raid..
you could make a login module for joomla with code like this
<?php
require_once('/path/to/forum/SSI.php');
if ($context['user']['is_guest'])
{
ssi_login();
}
else
{
//You can show other stuff here. Like ssi_welcome(). That will show a welcome message like.
//Hey, username, you have 552 messages, 0 are new.
ssi_logout();
}
?>
jabari
01-22-2007, 05:19 PM
ok got it to work and very odd I might add..
heres what I had to do
after the install www.burninghatred.info/raid I had to goto http://www.burninghatred.info/smf login and then go back to www.burninghatred.info/raid and it was logged in.
Now whats the best way to intergrate into joomla? wrapper?
if you login in from the bridge it will NOT log it into raid..
You can try what Ryushi32 suggested. All I can figure is that the wrapper is causing you problems. I use the Joomla<->SMF bridge on my Joomla site as well and I don't have any problems. I can log into my Joomla site and I am automatically logged into SMF and my phpRaid install. I have had a lot of problems with wrappers and trying to put apps which require a login like phpRaid into them. So on my website I have SMF and phpRaid not running in a wrapper. I added a "Return to homepage" link to the top of my phpRaid install so that my users can get back to the Joomla website from phpRaid.
Ryushi32
01-23-2007, 03:53 AM
I dont use joomla at all and just use Smf + Tinyportal
though for phpraid i just set everyone to a group that is able to make a character and make calls to ssi.php to use the smf authentication system to allow a user to view or not view a page.
something like this
<?php
if (in_array(ID1, $user_info['groups']))
{
echo '
<div>
Some other stuff here that you want to protect.
<div>';
}
else
{
echo 'Sorry you are not allowed to see this.';
}
?>
d0qtrx
01-23-2007, 10:23 AM
I get a weird problem with this.
if a user is in a group that does not have the config permission, he can not see the site. I get the site maintenance error.
So strange.
Ryushi32
01-23-2007, 10:42 AM
I get a weird problem with this.
if a user is in a group that does not have the config permission, he can not see the site. I get the site maintenance error.
So strange.
uncheck the box in configuration
http://img90.imageshack.us/img90/619/untitled1ln9.jpg
http://www.phpraider.com/index.php?option=com_smf&Itemid=2&topic=241.msg770#msg770
Zugluk
01-23-2007, 01:53 PM
ok got it to work and very odd I might add..
heres what I had to do
after the install www.burninghatred.info/raid I had to goto http://www.burninghatred.info/smf login and then go back to www.burninghatred.info/raid and it was logged in.
Now whats the best way to intergrate into joomla? wrapper?
if you login in from the bridge it will NOT log it into raid..
you could make a login module for joomla with code like this
<?php
require_once('/path/to/forum/SSI.php');
if ($context['user']['is_guest'])
{
ssi_login();
}
else
{
//You can show other stuff here. Like ssi_welcome(). That will show a welcome message like.
//Hey, username, you have 552 messages, 0 are new.
ssi_logout();
}
?>
Hey thanks for the code but not sure how to get this into joomla since I just install mods throught the build in installer.. do I just paste that over the code thats in mod_smf_login.php?
Zhorne
03-05-2007, 02:27 PM
As the subject says... 3.0.7... I'm currently running SMF 1.1RC3 + phpRaid 3.0.7, I read the other forum about issues with phpRaid 3.0.9, I'm wondering what the caveats are for upgrading an already integrated system from 3.0.7 to 3.0.9?
Thanks.
Ryushi32
03-05-2007, 10:08 PM
I have had no problem running the smf auth with smf 1.1.2 and phpraid 3.0.9 only thing is after you run the upgrade you have to go into phpmyadmin and to the settings table for phpraid and change the auth to smf http://www.legacyguildonline.com/index.php?action=Phpraid (the one is 1.1.1 but i have run it on 1.1.2)
mickey
06-04-2007, 03:24 AM
I have a joomla component ready for PhpRaid. just PM if you want to have a look or if you are interested... :o
regards,
Mickey
screenie:
http://img264.imageshack.us/img264/5294/comraidermainmq5.jpg (http://imageshack.us)
dwoolcott
06-21-2007, 08:33 AM
I have followed the isntructions for the install and the auth portion for smf, but it is not allowing me to even login with the username/pass that was specificed in the install portion. Any suggestions?
gripster
09-07-2007, 12:16 PM
I have a joomla component ready for PhpRaid. just PM if you want to have a look or if you are interested... :o
regards,
Mickey
screenie:
http://img264.imageshack.us/img264/5294/comraidermainmq5.jpg (http://imageshack.us)
i would be interessted. could you give me some details?
rgds,
gripster
Farley
09-14-2007, 11:40 AM
I am getting an error on the "Finalize" step of the install:
Firefox: Not Acceptable
An appropriate representation of the requested resource /testforum/phpraider/install/install.php could not be found on this server.
IE: The resource you are looking for cannot be opened by your browser.
HTTP Error 406 - Not acceptable
Internet Explorer
Any help is much appreciated.
Thanks.
Farley
Kethra
10-01-2007, 08:25 AM
I'm a bit of a coding noob, so I was wondering if this method would be compatible with SMF 1.1.4 (the newest version) and phpRaid 3.1.1 (http://www.phpraider.com/index.php?topic=1940.0). Has anyone attempted it?
|
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.