• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How integrate the forum

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we have a webpage where the user has to be identified with another username and password in order to enter to the site. In this site we have a link to the forum but the problem is when the user reaches the forum he has to login again. We want that the username and password is valid and connected to the forum, so you don�t need to login again when you need to enter the forum.

How do I connect the forum to the website??

Thx

I almost forget: I am using Tomcat 5.5, mysql 4.1. The passwords in the sites�s database are not encrypted.




[originally posted on jforum.net by jarkaos]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at

net.jforum.view.forum.UserAction#validateLogin()
net.jforum.ControllerUtils

Then you will understand how authentication works - basically, for your case, setting the UserSession and the session attribute "logged" as "1" should do the job.

Also, please read http://www.jforum.net/confluence/display/sso

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rafael

I can�t find the lines you said? are they in the SystemGlobals.properties file?

thx


[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i found it , no problem


[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

it have(had) the same problem. I wanted to integrate that marvelous
forum (version 2.1.4) to my webpage. Problem 1 was, that each user
would have to register for website AND Forum. Problem 2 was to
do the sso with that version. (Dont have a clue how the Database
would have changed and I already using 2.1.4 for a while)

Problem1 (register for website and forum at the same time):

Actually I tried to build some static Methods to achieve that. But I
failed in some case. So I did it another way:

I just added a user to theJForum-DB on my own. The only thing you have
to do is to insert one row to jforum_users. (That one have a lot of olumns,
but the only important things are uername, user_password, user_email,
user_regdate).

Insert it somehow to DB (I used torque http://db.apache.org/torque/ as DB-Mapper! But only because I'm
already using it! It's nice! You have some XML that describes the DB-Schema and torque generates Java-Classes with a lot of nice
methods (foreignkey and so on) to insert/update/delete data in DB.)

Now you have to add that new user to a group. Insert a row in table
jforum_user_groups. There are only two columns in there.
Set group_id to 1 (cause that is the id of the default-group)
and set user_id to the value the user got you just added before.

That's it! Now you could login with the account you created from outside.

PS: I used MD5.crypt(..) to encode the password as it happens when
a 'real' JForum-User registers. (I need this afterwards)


Problem2 (Login with your websites login)

Well, this is not such a problem! (in 2.1.5 i heard the will be sso but as
i told, i used 2.1.4 already and didnt want to migrate)

When you login to my website I (the tomcat) put a user-object in
the session. Now there comes one little modification in the UserAction-Class (package net.jave.jform.view.forum).


So it should look before:


There the method validateLogin is called from somewhere with username
and password as parameters. That one is passed through to the
usermodel that have an instance of the LoginAuthenticator, that says
YES you ARE permitted to enter the site or NOT.

My approach is to look in session if a user-object is in there. If not
do as usual, but if yes take username and password of the Session-User-Object (not the Jforum-User, the Site-User) and pass
it to the Authenticator instead of the parameters:



On the website use the following link:

/jforum.page?username=a&password=a&module=user&action=validateLogin&autologin=on&login=Eingeben

with using that link you a trying to login as user 'a' with password 'a' but if there is a user in the session the UserAction will use the username and password of the session-user.

So, first of all I hope you did understand what I wanted to say and hope
it will help you a little bit. And I hope Rafael wont dislike my approach....

greetz, TOM

[originally posted on jforum.net by ttrocha2]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm wonderering how to start?
i have website with login and now the forum, and i want to have the same login to them both. i have read some tips to how to that but im not sure how to begin.

i have tomcat 5.5 and jforum 2.1.4
[originally posted on jforum.net by Starknight]
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic