integrate phorum with other systems
Posted by pilu
integrate phorum with other systems September 07, 2004 09:19AM |
Registered: 19 years ago Posts: 8 |
I would like to know how to activate a phorum user from my site. This is because i have already a user system management and i'd like that when a user enter in my site doesn't have to re-login to enter in the phorum too.
How have i to do to obtain this? Maybe activate the right sessions variabiles?
thx
Edited 2 time(s). Last edit at 09/07/2004 09:20AM by pilu.
How have i to do to obtain this? Maybe activate the right sessions variabiles?
thx
Edited 2 time(s). Last edit at 09/07/2004 09:20AM by pilu.
Re: integrate phorum with other systems September 07, 2004 10:32AM |
Moderator Registered: 19 years ago Posts: 634 |
There are varying ways to do this. You can "mirror" the user database, so that if somebody registers on your sites system it will add them to Phorum also.
You can rewrite the Phorum user system to use yours instead, but this is a ton of work.
You can require that somebody be logged in to your site to use your Phorum by the use of a module in Phorum, and not use Phorum's user system at all.
Or you can take the route I went: go the other way. I just made the rest of my site use Phorum's user system, because it was a lot better then the one I had before. :)
You can rewrite the Phorum user system to use yours instead, but this is a ton of work.
You can require that somebody be logged in to your site to use your Phorum by the use of a module in Phorum, and not use Phorum's user system at all.
Or you can take the route I went: go the other way. I just made the rest of my site use Phorum's user system, because it was a lot better then the one I had before. :)
September 07, 2004 10:54AM |
Admin Registered: 22 years ago Posts: 4,495 |
Re: integrate phorum with other systems September 08, 2004 04:00AM |
Registered: 19 years ago Posts: 8 |
Tridus Wrote:
-------------------------------------------------------
>
> Or you can take the route I went: go the other
> way. I just made the rest of my site use Phorum's
> user system, because it was a lot better then the
> one I had before. :)
Ok, but in the case i'll use this way, how many unuseful libraries i'll have to import in my system to let it works?
thx
-------------------------------------------------------
>
> Or you can take the route I went: go the other
> way. I just made the rest of my site use Phorum's
> user system, because it was a lot better then the
> one I had before. :)
Ok, but in the case i'll use this way, how many unuseful libraries i'll have to import in my system to let it works?
thx
Re: integrate phorum with other systems September 08, 2004 04:21AM |
Admin Registered: 21 years ago Posts: 9,240 |
how are they unuseful?
for starters, I used this layer to load everything I need for user-auth in another app
You can use everything from include/users.php then.
Thomas Seifert
for starters, I used this layer to load everything I need for user-auth in another app
<?PHP $safe_id=$i; $phorum5dir="/home/XXX/forum_v50/"; $PHORUM['session_path']="/"; $PHORUM['session_domain']="XXX.de"; $PHORUM["session_timeout"]=365; $PHORUM["use_cookies"]=true; $PHORUM['PROFILE_FIELDS']=array("real_name","icq","aol","msn","yahoo","jabber","image","webpage","delete_info"); $PHORUM['enable_pm']=0; $PHORUM['track_user_activity']=1; include $phorum5dir.'include/constants.php'; include $phorum5dir.'include/db/config.php'; include $phorum5dir.'include/db/mysql.php'; include $phorum5dir.'include/users.php'; $i = $safe_id; ?>
You can use everything from include/users.php then.
Thomas Seifert
Re: integrate phorum with other systems September 08, 2004 05:49AM |
Registered: 19 years ago Posts: 8 |
i have problem passing the session variabiles to my application. I don't see user data: when i'm logged into the phorum and i go to my application and return to phorum again the user is non logged...i loose users session informations.
How can i extend global scope to users variabiles to my application?
thx
How can i extend global scope to users variabiles to my application?
thx
September 08, 2004 12:49PM |
Admin Registered: 22 years ago Posts: 4,495 |
We will need to know more about what you have done and what you are looking for to help you on this.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
I have a site running since 1997 (www.bmwe30.net) where I'm currently installing Drupal;
I've been using Webbbs for ages, which needs to be replaced, and since Drupal's forum isn't really a forum (it sucks, basically), I decided to use Phorum5, which looks great (I'm just sorry I didn't find it before).
I also need to integrate it with Drupal's authentication system...
> You can require that somebody be logged in to your
> site to use your Phorum by the use of a module in
> Phorum, and not use Phorum's user system at all.
This seems to be the way to go, for me, but since I'm not a programmer, don't have a clue where to start...
Can you give me any pointers?
Thanks for any help
I've been using Webbbs for ages, which needs to be replaced, and since Drupal's forum isn't really a forum (it sucks, basically), I decided to use Phorum5, which looks great (I'm just sorry I didn't find it before).
I also need to integrate it with Drupal's authentication system...
> You can require that somebody be logged in to your
> site to use your Phorum by the use of a module in
> Phorum, and not use Phorum's user system at all.
This seems to be the way to go, for me, but since I'm not a programmer, don't have a clue where to start...
Can you give me any pointers?
Thanks for any help
Re: Drupal September 09, 2004 01:14PM |
Moderator Registered: 19 years ago Posts: 634 |
Gustavo Wrote:
-------------------------------------------------------
> > You can require that somebody be logged in to
> your
> > site to use your Phorum by the use of a
> module in
> > Phorum, and not use Phorum's user system at
> all.
>
> This seems to be the way to go, for me, but since
> I'm not a programmer, don't have a clue where to
> start...
>
> Can you give me any pointers?
>
> Thanks for any help
I can give you some ideas on how to do this, but ultimately it will require some programming to do it.
Your module would effectively need to be able to do authentication with Drupal's user system in order to figure out if someone is logged in or not. If they are, then they can get into Phorum and post and such. If not, you would effectively want to bounce them to a "you must login" page, and block them from using Phorum at all.
-------------------------------------------------------
> > You can require that somebody be logged in to
> your
> > site to use your Phorum by the use of a
> module in
> > Phorum, and not use Phorum's user system at
> all.
>
> This seems to be the way to go, for me, but since
> I'm not a programmer, don't have a clue where to
> start...
>
> Can you give me any pointers?
>
> Thanks for any help
I can give you some ideas on how to do this, but ultimately it will require some programming to do it.
Your module would effectively need to be able to do authentication with Drupal's user system in order to figure out if someone is logged in or not. If they are, then they can get into Phorum and post and such. If not, you would effectively want to bounce them to a "you must login" page, and block them from using Phorum at all.
Re: Drupal September 09, 2004 06:24PM |
Registered: 19 years ago Posts: 10 |
And what about the phorum username, email address, etc? would that also come from drupal side?
I'm also asking for help on the Drupal forums, to see if I can figure out how Drupal handles authentication.
I think such a module would help a lot of other people since Drupal is wonderful, but, like I said, its forum is awful... and phorum looks like what I've been looking for for years!
Thank you for your help,
Gustavo Melo
I'm also asking for help on the Drupal forums, to see if I can figure out how Drupal handles authentication.
I think such a module would help a lot of other people since Drupal is wonderful, but, like I said, its forum is awful... and phorum looks like what I've been looking for for years!
Thank you for your help,
Gustavo Melo
Re: integrate phorum with other systems September 09, 2004 07:44PM |
Moderator Registered: 19 years ago Posts: 634 |
Re: integrate phorum with other systems [SOLVED] September 16, 2004 05:14AM |
Registered: 19 years ago Posts: 4 |
Hello,
I've the same kind of problem.
I've my own authentication system and I want to hide the Phorum (5.0.10) authentication process when my users are logging in.
For this I maintain 2 tables of users. Each time I add a user in my table, I add him in the Phorum_user table with a sql script.
At the end of my authentication process I start the Phorum authentication process by (I wrote tthp for the address to let you see the real code!!)
die(header("Location: tthp://my_site/phorum/phorum-5.0.10/login_my_site.php?f_username=$username&f_password=$password&foreign_ident=YES&f_redir=$redir"));
I obtained the login_my_site.php file by doing these minor changes in the login.php file to take into account the foreign_id and f_redir parameters.
if($foreign_ident="YES"){
$username=$f_username;
$password=$f_password;
$GLOBALS["PHORUM"]["user"]["username"] = $user;
$GLOBALS["PHORUM"]["user"]["password"] = $password;
$PHORUM["user"]["username"] = $username;
$PHORUM["user"]["password"] = $password;
}else{
$username=$_POST["username"];
$password=$_POST["password"];
}
Then I call the phorum_user_check_login function with the previous variables rather than with the $POST variables comming from your login.php form:
if(phorum_user_check_login($username, $password)){
At the en of the phorum authenication process I use the value of the f_redir parameter rather your redir variable if the login script know the foreign_ident variable :
if($foreign_ident="YES")
header("Location: $f_redir");
else
header("Location: $redir");
So, at the end of this process my users can use my site with Phorum inside it, but they are not logged in Phorum.
The checking of the username/password is well done by the call to phorum_user_check_login($username, $password) but I mean that the phorum_user_create_session() which follows always return false and no "PHORUM" session is created for my users.
Am I rigth?
Which other $GLOBALS variables or $PHORUM variables have I to set up to do it work better?
Thank's a lot
Soory for this silly question .. the solution was here!!
After a more attentive look at a previous post of Thomas I found the solution:
To do it work, I've just added these variables in my test
if($foreign_ident="YES"){
$username=$f_username; ...BLA BLA;
$PHORUM['session_path']="/";
$PHORUM['session_domain']="my_site.org";
$PHORUM["session_timeout"]=365;
$PHORUM["use_cookies"]=true;
$PHORUM['PROFILE_FIELDS']=array("real_name","icq","aol","msn","yahoo","jabber","image","webpage","delete_info");
$PHORUM['enable_pm']=0;
$PHORUM['track_user_activity']=1;
}else{
$username=$_POST["username"];
$password=$_POST["password"];
}
if(phorum_user_check_login($username, $password)){ ..... BLA BLA BLA;
If you think this post can be usefull for someone, keep it otherwise remove it when you want .
Sorry again for the embarras.
Koala
Edited 2 time(s). Last edit at 09/16/2004 06:17AM by koala.
I've the same kind of problem.
I've my own authentication system and I want to hide the Phorum (5.0.10) authentication process when my users are logging in.
For this I maintain 2 tables of users. Each time I add a user in my table, I add him in the Phorum_user table with a sql script.
At the end of my authentication process I start the Phorum authentication process by (I wrote tthp for the address to let you see the real code!!)
die(header("Location: tthp://my_site/phorum/phorum-5.0.10/login_my_site.php?f_username=$username&f_password=$password&foreign_ident=YES&f_redir=$redir"));
I obtained the login_my_site.php file by doing these minor changes in the login.php file to take into account the foreign_id and f_redir parameters.
if($foreign_ident="YES"){
$username=$f_username;
$password=$f_password;
$GLOBALS["PHORUM"]["user"]["username"] = $user;
$GLOBALS["PHORUM"]["user"]["password"] = $password;
$PHORUM["user"]["username"] = $username;
$PHORUM["user"]["password"] = $password;
}else{
$username=$_POST["username"];
$password=$_POST["password"];
}
Then I call the phorum_user_check_login function with the previous variables rather than with the $POST variables comming from your login.php form:
if(phorum_user_check_login($username, $password)){
At the en of the phorum authenication process I use the value of the f_redir parameter rather your redir variable if the login script know the foreign_ident variable :
if($foreign_ident="YES")
header("Location: $f_redir");
else
header("Location: $redir");
So, at the end of this process my users can use my site with Phorum inside it, but they are not logged in Phorum.
The checking of the username/password is well done by the call to phorum_user_check_login($username, $password) but I mean that the phorum_user_create_session() which follows always return false and no "PHORUM" session is created for my users.
Am I rigth?
Which other $GLOBALS variables or $PHORUM variables have I to set up to do it work better?
Thank's a lot
Soory for this silly question .. the solution was here!!
After a more attentive look at a previous post of Thomas I found the solution:
To do it work, I've just added these variables in my test
if($foreign_ident="YES"){
$username=$f_username; ...BLA BLA;
$PHORUM['session_path']="/";
$PHORUM['session_domain']="my_site.org";
$PHORUM["session_timeout"]=365;
$PHORUM["use_cookies"]=true;
$PHORUM['PROFILE_FIELDS']=array("real_name","icq","aol","msn","yahoo","jabber","image","webpage","delete_info");
$PHORUM['enable_pm']=0;
$PHORUM['track_user_activity']=1;
}else{
$username=$_POST["username"];
$password=$_POST["password"];
}
if(phorum_user_check_login($username, $password)){ ..... BLA BLA BLA;
If you think this post can be usefull for someone, keep it otherwise remove it when you want .
Sorry again for the embarras.
Koala
Edited 2 time(s). Last edit at 09/16/2004 06:17AM by koala.
September 17, 2004 10:02AM |
Admin Registered: 22 years ago Posts: 4,495 |
If you have your own auth system and your own session system, you don't really need to use the phorum functions to create the user session. All you need to do is create the $PHORUM["user"] variable with enough information that Phorum will be happy with it.
I think you can do with as little as:
$PHORUM["user"]["user_id"]
$PHORUM["user"]["username"]
$PHORUM["user"]["email"]
There are a couple of drawbacks. Functions like having replies emailed would require additional module work.
I think you can do with as little as:
$PHORUM["user"]["user_id"]
$PHORUM["user"]["username"]
$PHORUM["user"]["email"]
There are a couple of drawbacks. Functions like having replies emailed would require additional module work.
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: integrate phorum with other systems [SOLVED] September 17, 2004 10:07AM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: integrate phorum with other systems November 03, 2004 02:00PM |
Registered: 19 years ago Posts: 3 |
I've been working on integrating phorum, and decided to go with using the Phorum User system.
On most pages I have a login option, and got that working fine by posting to login.php.
I can check if a user is logged in by including the common.php and checking, $PHORUM["DATA"]["LOGGEDIN"].
The problem I get is that although this all works fine, when my page's are located in the phorum main directory, when I try to include common.php from an outside directory I naturally get the problem of having all the other files out of reach.
I.e failed connection stream errors.
I tried changing the include_once and include's in common.php and other files, to use the full path from the root folder and hard-code it into script, instead of "./" , but noticed somewhat of a slow down after doing this.
I was wondering if anyone could help in figuring out another way of accomplishing the above without sacraficing the speed.
Also should it be suffering a slow down because of the full root paths versus using the relative (./) paths?
Thanks for any help.
Edited 1 time(s). Last edit at 11/03/2004 02:00PM by shinda.
On most pages I have a login option, and got that working fine by posting to login.php.
I can check if a user is logged in by including the common.php and checking, $PHORUM["DATA"]["LOGGEDIN"].
The problem I get is that although this all works fine, when my page's are located in the phorum main directory, when I try to include common.php from an outside directory I naturally get the problem of having all the other files out of reach.
I.e failed connection stream errors.
I tried changing the include_once and include's in common.php and other files, to use the full path from the root folder and hard-code it into script, instead of "./" , but noticed somewhat of a slow down after doing this.
I was wondering if anyone could help in figuring out another way of accomplishing the above without sacraficing the speed.
Also should it be suffering a slow down because of the full root paths versus using the relative (./) paths?
Thanks for any help.
Edited 1 time(s). Last edit at 11/03/2004 02:00PM by shinda.
Re: integrate phorum with other systems November 03, 2004 02:02PM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: integrate phorum with other systems November 03, 2004 02:36PM |
Registered: 19 years ago Posts: 3 |
Re: integrate phorum with other systems May 01, 2005 04:16PM |
Registered: 19 years ago Posts: 683 |
Re: integrate phorum with other systems May 01, 2005 04:23PM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: integrate phorum with other systems May 01, 2005 04:59PM |
Registered: 19 years ago Posts: 683 |
Re: integrate phorum with other systems May 01, 2005 05:03PM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: integrate phorum with other systems May 02, 2005 03:42AM |
Registered: 19 years ago Posts: 683 |
Re: integrate phorum with other systems May 02, 2005 03:44AM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: integrate phorum with other systems May 02, 2005 03:49AM |
Registered: 19 years ago Posts: 683 |
Hi Thomas,
> you shouldn't run code directly in the
> include-folder.
> thats why its called "include", only includes used
> in other files there.
Thats all "I" wanna do - as I said I just use your code:
(...)
include $phorum5dir.'include/constants.php';
include $phorum5dir.'include/db/config.php';
include $phorum5dir.'include/db/mysql.php';
include $phorum5dir.'include/users.php';
thanx
pat
> you shouldn't run code directly in the
> include-folder.
> thats why its called "include", only includes used
> in other files there.
Thats all "I" wanna do - as I said I just use your code:
(...)
include $phorum5dir.'include/constants.php';
include $phorum5dir.'include/db/config.php';
include $phorum5dir.'include/db/mysql.php';
include $phorum5dir.'include/users.php';
thanx
pat
Re: integrate phorum with other systems May 02, 2005 04:02AM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: integrate phorum with other systems May 07, 2005 02:05PM |
Registered: 19 years ago Posts: 683 |
Hi Thomas,
thank you so far - the 403 is gone now (it was really a stupid mistake of mine!) but the thing is still not working for me.
I put this in a separate file in the main phorum-folder but it gives me no values for $PHORUM other than the ones given in the script itself. And my check of session gives me "Session not active".
<?PHP
$safe_id=$i;
$phorum5dir="./";
$PHORUM['session_path']="/";
$PHORUM['session_domain']="";
$PHORUM["session_timeout"]=365;
$PHORUM["use_cookies"]=true;
$PHORUM['PROFILE_FIELDS']=array("real_name","delete_info");
$PHORUM['enable_pm']=0;
$PHORUM['track_user_activity']=1;
include $phorum5dir.'include/constants.php';
include $phorum5dir.'include/db/config.php';
include $phorum5dir.'include/db/mysql.php';
include $phorum5dir.'include/users.php';
$i = $safe_id;
print_r ($PHORUM);
if ( phorum_user_check_session() ) {echo ("Session active");} else {echo ("Session not active");}
?>
Do you know why.
thanx
pat
thank you so far - the 403 is gone now (it was really a stupid mistake of mine!) but the thing is still not working for me.
I put this in a separate file in the main phorum-folder but it gives me no values for $PHORUM other than the ones given in the script itself. And my check of session gives me "Session not active".
<?PHP
$safe_id=$i;
$phorum5dir="./";
$PHORUM['session_path']="/";
$PHORUM['session_domain']="";
$PHORUM["session_timeout"]=365;
$PHORUM["use_cookies"]=true;
$PHORUM['PROFILE_FIELDS']=array("real_name","delete_info");
$PHORUM['enable_pm']=0;
$PHORUM['track_user_activity']=1;
include $phorum5dir.'include/constants.php';
include $phorum5dir.'include/db/config.php';
include $phorum5dir.'include/db/mysql.php';
include $phorum5dir.'include/users.php';
$i = $safe_id;
print_r ($PHORUM);
if ( phorum_user_check_session() ) {echo ("Session active");} else {echo ("Session not active");}
?>
Do you know why.
thanx
pat
Re: integrate phorum with other systems May 08, 2005 10:44AM |
Admin Registered: 21 years ago Posts: 9,240 |
Hmm, maybe just because the session is not active? :)
Are you sure the user is logged in? are you sure that the cookie is available for that directory where you start your script in?
ah, there comes something to my mind:
put this on top of the script before including any other file:
define("PHORUM",1);
Thomas Seifert
Are you sure the user is logged in? are you sure that the cookie is available for that directory where you start your script in?
ah, there comes something to my mind:
put this on top of the script before including any other file:
define("PHORUM",1);
Thomas Seifert
Re: integrate phorum with other systems May 08, 2005 12:33PM |
Registered: 19 years ago Posts: 683 |
Re: integrate phorum with other systems May 08, 2005 12:35PM |
Admin Registered: 21 years ago Posts: 9,240 |
Sorry, only registered users may post in this forum.