[BETA] External Group[s] Authenication

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
Sir AL
Registered User
Posts: 195
Joined: Sat Mar 15, 2003 3:35 am

[BETA] External Group[s] Authenication

Post by Sir AL » Tue Mar 18, 2003 3:47 am

This a Update I've made to a mod in the old database. I've kept his name on the code as the author and me as an Editor because all I did was upgrade it. (a LOT)

Features I added:
1. I made it allow Multiple External Group Authenication instead of just from one group.
2. I made it so that you can change run more then one check at once.
3. I made it so that you can turn off the need for login. (Made to work with feature below)
4. I made it so that you can tell the program to put the value of the user's group status into a constant of your choosing. (Best used for if you want to have member or admin buttons or content you want to "Disappear" or "Reappear")
5. I made it so that you can eather declare the group by Name or ID
6. I made it so that you can change the message that the user can see when he is rejected as not being a member of any of the groups.
7. The Script include its own login page that can be customized so that it matches the style of your site.
8. I made it so that you can turn off group checking. (To allow only registered users.)
9. Added the ability to check security with a function instead of just a page call so you can call it as many times as you want.

This MOD consists of 5 files.
install.txt
security.php
security_function.php
security_login.php
includes/security_sessions.php

Last Update: Fri Dec 30, 2005
DOWNLOAD
Last edited by Sir AL on Sat Dec 31, 2005 3:43 am, edited 18 times in total.

Sir AL
Registered User
Posts: 195
Joined: Sat Mar 15, 2003 3:35 am

Fixed a bug in the Script Above.

Post by Sir AL » Thu Mar 20, 2003 1:37 pm

Bug Fix.
Fixed the bug were it checks for a group id that equals "" if you are using the Group Name feature.

User avatar
Suede
Registered User
Posts: 342
Joined: Sat Dec 14, 2002 7:40 pm

Post by Suede » Sun Mar 23, 2003 8:06 am

great work :)

Sir AL
Registered User
Posts: 195
Joined: Sat Mar 15, 2003 3:35 am

2.0.4

Post by Sir AL » Tue Mar 25, 2003 11:47 pm

I only have version 2.0.2 so could someone let me know if this works in version 2.0.4 ?

hemsoe
Registered User
Posts: 5
Joined: Thu Apr 04, 2002 8:43 pm

Re: 2.0.4

Post by hemsoe » Tue Jun 10, 2003 9:55 pm

Hi...

I trying to use external auth login... but i can redirect to the correct folder when I have loggede in... I'm being redirected to a folder inside phpBB...

Is there someone who has a solution on my problem...???


And I have a problem using group names... but the group ID works.. :-)


But great work anyway...


Sir AL wrote: I only have version 2.0.2 so could someone let me know if this works in version 2.0.4 ?



Dan....

Sir AL
Registered User
Posts: 195
Joined: Sat Mar 15, 2003 3:35 am

Post by Sir AL » Wed Jun 11, 2003 3:07 am

I'm not quite sure what you mean but what I think your saying is that when you try to go to a page thats protected and your not logged in it takes you to the login page. Once you login instead of takeing you back to the page you originated at it takes you some were else.

If thats the case I don't know why it would do that. I didn't edit that part of the coding so it should work right and from what I can see it is right at least on this side.

hemsoe
Registered User
Posts: 5
Joined: Thu Apr 04, 2002 8:43 pm

..

Post by hemsoe » Wed Jun 11, 2003 9:35 am

Hi....

That is what I mean.....
And it is only in 2.0.4 i won't work...

I have another forum that use 2.0.3, and there is no problem, so I think it is 2.0.4 that is the problem....

but I won't make any quick conclusion... :-)


Dan

Sir AL
Registered User
Posts: 195
Joined: Sat Mar 15, 2003 3:35 am

Post by Sir AL » Thu Jun 12, 2003 12:21 am

I made some changes to the group name. It might fix the Name problem you had. Also the name needs to be entered exatically except for capitalization I think. Also the names need to have Single Quotes around them and between the names you need a comma and around everything you need brackets so it looks like "('Name One','Name Two')".

I couldn't figure anything that could be wrong with the login redirect. Maybe the URL to the protected page includes a "?" or "&" which might mess things up.

If you could please put in the URL of the protected page and were you go after you login. You don't have to include your domain just put "http://www.some-where.com/" for your domain.

Thank You

hemsoe
Registered User
Posts: 5
Joined: Thu Apr 04, 2002 8:43 pm

.

Post by hemsoe » Mon Jun 16, 2003 4:04 pm

Hi....


The redirect to login works fine..:

http://devel.blaasommer.dk/forum/login. ... f0835dafa7

Then I log in..
And being redirecte back to..:

http://devel.blaasommer.dk/forum/BS99-p ... f0835dafa7


But I should be redirectet to..:

http://devel.blaasommer.dk/BS99-pics/in ... f0835dafa7


Why it is doing that, I don't know....


Dan

Sir AL
Registered User
Posts: 195
Joined: Sat Mar 15, 2003 3:35 am

Post by Sir AL » Tue Jun 17, 2003 12:33 am

I can't tell you why its doing what it's doing but its not from this coding but it is from the coding in the login page.

You'd have to look at hows it is redirecting. It looks like it is just taking the redirect and go to that instead of putting the domain before it.

hartlijn
Registered User
Posts: 36
Joined: Sat Oct 20, 2001 11:32 pm

Post by hartlijn » Fri Jun 27, 2003 10:01 pm

nice mod!

but what if I'd like on 1 page:

require ('auth_group1.php');
echo 'text mentioned only for group 1';
require ('auth_group2.php');
echo 'text mentioned only for group 2';
require ('auth_admin.php');
echo 'text mentioned only for admins';
require ('auth_regged.php');
echo 'text mentioned for all regged users';

echo 'text for everybody';


Is that possible with your mod?

Sir AL
Registered User
Posts: 195
Joined: Sat Mar 15, 2003 3:35 am

Post by Sir AL » Fri Jun 27, 2003 11:16 pm

I'm not quite sure what your asking exsaciacally but I don't think it can do it in this form. The MOD is designed to check if someone is in a cirtain group. If so it allows the page to be viewed if they aren't in any of the groups then it stops them from viewing the page and displays a text message to that effect.

I myself have a couple versions of the code that allows me to different things like checking if they are in the group without killing and one that protects just a portion of the page. They are both basicallly this code but taking out and changing a couple things.

Please tell me if this helps at all.

hartlijn
Registered User
Posts: 36
Joined: Sat Oct 20, 2001 11:32 pm

Post by hartlijn » Sun Jun 29, 2003 12:16 pm

that sounds like what I would like to have.
protect a part of the page without asking to login.

so a link for example is only shown to a particular group.

I like to use this for some kind of address-list I am using.

That list contains groups of addresses, for example 'friends', in phpbb I have this group 'friends' created. On the address-page I want to show ' please login first' to people who are not logged in at all, for peopel who are logged in I wanna show the normal list of everybody, to the people who are in friends I wanna show a link 'edit' after the addresses from group 'friends', and to Admins I wanna show an edit and delete link after every address.

I know there comes more code here than you must have, but I have a nice start if I can protect just a part of a page for special groups, without being redirected to the login-screen.

Thanks for the help.

Sir AL
Registered User
Posts: 195
Joined: Sat Mar 15, 2003 3:35 am

Post by Sir AL » Sun Jun 29, 2003 1:19 pm

I quicky edited the code from above to check if the user is logged in and if they have access rights to the group. To check the if logged in use the "$logincheck" variable "0" if no, "1" if yes. Same with the "$accesscheck" variable.

This code can only be used once per page or it will bring an error. If you need to check more then one group seperately tell me and I'll get you another code that can be used after this one is called.

Code: Select all

Outdated Code Removed
Last edited by Sir AL on Wed Jan 07, 2004 11:46 pm, edited 2 times in total.

TVK_Pitfall
Registered User
Posts: 6
Joined: Wed Jul 02, 2003 7:39 pm

Post by TVK_Pitfall » Wed Jul 02, 2003 7:45 pm

hi, i have a problem using this script ...if include the script on a page i want to secure, the following error message appears: Fatal error: Cannot redeclare class template in /homepages/15/d18725003/htdocs/tvk/forum/includes/template.php on line 30

I´m using version 2.0.4.

Any Ideas ?

Thank u in advance

Post Reply

Return to “[2.0.x] MODs in Development”