Does Universal Login work?

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/59244?pagenum=1
05 November 2025, 09:00

Topic


Astralis
Does Universal Login work?
30 August 2005, 07:45


I'm trying to get the universal login mod to work. I tried it in the past and could never get it to work and thought I'd revisit it but I still cannot get it to work.
Has anyone ever had this mod operational? If so, what modifications did you make to get it to work?<

 

Replies ...


Shaggy
30 August 2005, 07:47


I've never used the mod itself because of the need for all the forum includes but I do have a custom universal login up & ruuning on both my sites. What problems are you encountering when you attempt to install it?
<
Nertz
30 August 2005, 08:34


It does work, I use it in two sites, but like shaggy said requires a bunch of forum includes including inc_header.asp which has login functionality and therefore shows up twice. I recall having to create a modifified inc_header.asp and a lot of customization on the pages that I used it. I could share some of that code when I get home tonight, just drop me an email if you want it.
cheers,
Nat<
Shaggy
30 August 2005, 08:51


One of the quickest ways to acheive this (as I have done with MeTV) is to create your own form and have it post to login.asp. No need for all the additional includes nor any custom ASP, just the basic HTML for the form.
<
Astralis
30 August 2005, 08:56


Yes, got it after your advice. The inc_header.asp was very devilish. I eventually just manually parsed through every line to figure it out after reading your advice.
The next question is what is the variable of the numerical userid?
I also created a modified inc_header. Essentially, I added a few lines to inc_header_short and now it's working.
Thanks for the support!
Shaggy, that's interesting advice but do you think it would work for my purpose which is: I'm hiding content for members only. If I send them to the login page of the forum, it will redirect to the forum. But, I agree, if it was just a universal login to the forum, posting it to that page would be the better option.
All my members are complaining about the multiple logins, and I feel their pain. I hate registering for all the different sections.
<
Shaggy
30 August 2005, 10:02


If you pass the URI of the page through you're logging in from, login.asp should redirect you to that page. Have a look at the hidden inputs of thr form in login.asp to see what they're called.
As for the MEMBER_ID, if you're calling chkUser in any of your non-forum files or their includes, it's assigned to a variable called MemberID. You'll need to set cookies to website for it to work. To check if the varibale has been assigned, try a resopnse.write on it while logged in. If it's not being assigned, have a look in inc_header.asp to see how the mlev variable is assigned using a call to chkUser. Oh, you'll also have to make sure that MemberID is declared outside the chkUser function.
<
Astralis
30 August 2005, 19:12


Cool...it's being passed. This is stored in a cookie until the user is logged-off, right?<
Shaggy
31 August 2005, 05:13


Are you being redirected to the correct pages when logging in from outside the forum.
The username and encrypted password are stored in a cookie until such a time as the member logs off or the cookie expires. Again, have a look in inc_header.asp to see how Snitz reads the cookie (search for request.cookies).
<
NiteOwl
16 September 2005, 20:55


Shaggy - I have also had a lot of grief with the Universal Login, probably because my forum and the site I want toi use the login are on different servers etc.
I would be VERY interested to know how you achieved this, as I have a website which needs to be secured using the username and passwords from my forum. Any one with suggections please feel free to respond. I am ok with ASP and have done websites for years.
<
Shaggy
19 September 2005, 06:51


NiteOwl, unfortunately, there is no way that I know of to share cookies between sites on different servers. If they are both using the same domain name then there may be some workaround. Let me know if they are and I'll look into it.
<
StephenD
19 September 2005, 07:04


You can use a different method called Ping Sessions. A company I've had some exposure to do this very well. Not free but bluddy good product. Here's a link. http://www.pingidentity.com/index.html<
gnixon14
14 October 2005, 17:18


Does anyone have this actually working on a live site?<
NiteOwl
14 October 2005, 18:52


Thanks Shaggy - I have moved my web to a sub directory of my FORUM now but still ahve the problem.
My Forum has its own Domain name ie: www.BCFMWU-Forum.com and my webspace will be a subfolder off of that, this of cource does not meet with @tomics Universal login directions which state taht the forum must be in a subfolder called forum.

Am I up a creek?
<
Classicmotorcycling
15 October 2005, 00:21


If you are talking about the Uni Login, then I have it working accross a number of sites.
Originally posted by gnixon14
Does anyone have this actually working on a live site?
I have it at www.classicmotorcycling.com.au for a demo. bigsmile <
NiteOwl
15 October 2005, 18:33


Hi - Do you have it working between different domains on different servers?
<
Classicmotorcycling
15 October 2005, 23:27


I only have it on the same domain name on the same server, just have it available on all pages of the domain.

Another site I implemented it on is www.sportsfish.com.au for the guys there. Works really good across the site.

Snitz will only allow for the Universial logon to work on the same site if you have cookies turned on for the site and not just turned on for the forum.<
NiteOwl
16 October 2005, 01:33


this is great news, so maybe I can get my site working.
The domain/forum is www.bcfmwu-forum.com/
The website I am trying to activate is www.bcfmwu-forum.com/membersweb/members.asp
(If one clicks on the above link you see that I am close but the login won't work, however if you click on the Do I have to Register and look at the URL it is not directing properly)

But @tomic says if you do not have the forum in the "Forum" folder his code will not work.
I guess my question is where are the changes, or which file do I need to modify to get my site working with Universal Login.
And Actually, all I really want to do is put some security to the members.asp file to ensure anyone who access it is a valid member of the forum. <
Shaggy
17 October 2005, 06:02


As far as I know that is because the code @tomic provided for including the forum files in non-forum pages point to a directory called "forum"; all you'd have to do is change that directory to whatever your forum directory is called.
<
gnixon14
17 October 2005, 12:33


Well I fought with universal login all weekend. I got no where, ready to shoot the computer. Who wants to give me a bid?<
Shaggy
17 October 2005, 12:41


It would help if knew where exactly "nowhere" was - what problems did you have?
<
gnixon14
17 October 2005, 12:50


Well, I used your suggestion above and have a login form on my home page (html) that goes to forum/login.asp and works great. The problem I'm running into is what files to put on a page (not in forum) to make sure a person is logged in.
Thanks for an help you can give me.<
Roger Fredriksson
17 October 2005, 13:52


If it´s on a page outside of Snitz-pages you need
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->

After that you test by using mlev
If mlev <1 then the visitor is not logged in. <
gnixon14
17 October 2005, 14:33


Great thanks, but how do I get rid of all the forum links and stuff at the top? Is there a modified inc_header.asp for that?<
AnonJr
17 October 2005, 14:50


If you dig around a little you can find the bits of code you will need to "borrow" to make your own. To the best of my knowledge there isn't a ready made option.
At this point I've just started to roll everything into the same directory and am modifying inc_header.asp to accomodate the extra sections.... but that's not always a viable solution. blush<
gnixon14
17 October 2005, 14:55


bigsmile Oh if only I was that good with code. I reckon I have to actually do some cypherin' now...<
Roger Fredriksson
17 October 2005, 15:14


Try inc_header_short.asp instead.<
AnonJr
17 October 2005, 15:25


Almost forgot about that one... I think it would work alright. Not sure though.<
Shaggy
18 October 2005, 07:22


All you need is to set the forum cookies to website, include the chkUser function somewhwre in your files and "borrow" the line that assigns the value of mlev from inc_header.asp. If someone is logged in, mlev will have a value greater than 0.
<
gnixon14
18 October 2005, 10:46


Yous guys is all geniuses...I think it works. I'll let ya know.<
pharic
03 May 2006, 10:32


Hi

I'm also trying to get this mod to work, I think it's all going ok so far but I have one question:

How can I allow only members of one particular group access to certain pages. I have a general forum and a members only forum. I don't want to allow members of the general forum access to the members area.
If anyone can help I would be very grateful

pharic<
AnonJr
03 May 2006, 11:12


To the best of my knowledge, you'll need the UserGroups MOD and some custom coding.<
pharic
10 May 2006, 05:16


I'm still trying to let onlymembers edit my other pages. I could write the code to check the FORUM_ALLOWED_MEMBERS table and check if their MEMBER_ID matches the FORUM_ID but this must already be done somewhere else
Does anyone know the variable that allows some members to see some forums and others not to be able to see them?<
AnonJr
10 May 2006, 08:22


With the UserGroups MOD you can assign users to a particular group, and then set that groups permissions for a given forum. If you wanted to extend the permissions beyond the forum itself, with a little custom coding you could check for the cookie and see if they are a member of a group that has those permissions. This has been used as a solution to similar problems at other sites.<
pharic
10 May 2006, 10:28


Thanks again AnonJr but it still seems a really complicated way of doing it. I already have a working forum with an allowed members list on the members forum, so it's hidden to others. I just want to add something to the "If mLev>0" like "And IsMember=Yes". I guess I can code if I have to, I just don't want to!<
AnonJr
10 May 2006, 10:50


It is more complex up front, but IMHO its a better solution for the long run since it allows for a little more flexibility. My experience has been that a quick solution for a simple issue almost always grows and expands and if you're not careful can quickly get unmanageable. I try to be as forward-thinking as I can... I'm not always successful at it, but it helps. =/<
pharic
10 May 2006, 20:50


Thanks again,
I finally got round to sitting down to do some code. I did this at the end of my custom inc_header:

strsql = "SELECT * FROM FORUM_ALLOWED_MEMBERS WHERE FORUM_ID = 5"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 2
IsStaff = "No"
Do While (Not rs.Eof)
memID = rs("MEMBER_ID")
If MemberID = memID then
IsStaff = "Yes"
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing

It seems to work (!) but I'm wondering if I'm going to run into trouble if something unexpected happens, I can see what you're saying about it not being forward thinking and it looks pretty rough I admit but it took me only 5 minutes even with my limited skill and brain power.<
AnonJr
11 May 2006, 08:34


On first glance, it should work fine ... as long as you don't want to expand this to other FORUM_ID's...
Like I said earlier, its easy to do a quick hack like this - and it works. However, if you ever need to expand on this its going to get more and more labyrinthine each iteration until you go back and set in a more flexible system. Just a friendly piece of advice from someone who's been down that road before. winkbigsmile
Also, as a side note, to make your code a little more efficient instead of selecting everything, just grab the MEMBER_ID since that's all you need. It will reduce your Database's workload.
[edit] Guess I should have included what I meant... Change:
Code:
strsql = "SELECT * FROM FORUM_ALLOWED_MEMBERS WHERE FORUM_ID = 5"
To:
Code:
strsql = "SELECT MEMBER_ID FROM FORUM_ALLOWED_MEMBERS WHERE FORUM_ID = 5"
Best of luck.<
Shaggy
11 May 2006, 08:48


How are staff members distinguished from other members in your MEMBERS table? You could try doing it the way I did, as explained in this topic.
<
pharic
12 May 2006, 09:57


Thanks guys

Yes, you're right about swapping MEMBER_ID for *, thanks.
Thanks Shaggy, the table I'm using is FORUM_ALLOWED_MEMBERS, all it contains is staff member ID's and forum IDs. As long as the user has access to the members forum, they can change the other members' pages on the site

Cheers for your help. I've just gotta get the header working in vcalendar now!
Pharic<
© 2000-2021 Snitz™ Communications