 |
|
|
|

| Autor |
Nachricht |
kaas
phpBB2.de User

Anmeldungsdatum: 03.02.2005
Beiträge: 20
|
Verfasst am:
Fr 20 Jan, 2006 15:21 |
  |
Hi there.
I am making an intranet (but still online).
I found this code and pasted it into my portal.php and again into index.php. This code force visitors to login, cause I will have NO guests.
| Code: |
if (!$userdata['session_logged_in'])
{
redirect(append_sid("login.$phpEx?redirect=portal.$phpEx", true));
} |
My problem is that any guest can still surf around in my portal, by using direct links like www.mydomain.com/phpbb2/calendar.php.
Do I really have to put this code into every php-file in my root or is there another (and more simple) way to stop guests from using direct links and force them to login? |
|
|
   |
 |
Google
|
Verfasst am:
|
 |
|
|
 |
kaas
phpBB2.de User

Anmeldungsdatum: 03.02.2005
Beiträge: 20
|
Verfasst am:
Fr 20 Jan, 2006 15:36 |
  |
Found out
| Code: |
##############################################################
## MOD Title: Enforced Login
## MOD Author: MLimburg <mlimburg@users.sourceforge.net> (Mark Limburg)
## MOD Description: Force all users to login!
## MOD Version: 1.0.0
##
## Installation Level: (easy)
## Installation Time: 1 Minute
## Files To Edit: page_header.php
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Author Notes: A simple mod which forces all non-logged in
## users to the login.php page. This will turn
## turn your phpBB install into a 'members only' site. I also
## recommend using a MOD to allow an Admin to add users manually!
##############################################################
## MOD History: 31-Mar-2003 Initial Coding and Release
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
$u_login_logout = 'login.'.$phpEx;
$l_login_logout = $lang['Login'];
#
#-----[ BEFORE, ADD ]------------------------------------------
#
if((basename($HTTP_SERVER_VARS['SCRIPT_NAME']) != 'login.'.$phpEx) && (basename($HTTP_SERVER_VARS['SCRIPT_NAME']) != 'profile.'.$phpEx))
{
$n = "\n";
echo '<HTML>'.$n
.'<HEAD>'.$n
.'<META HTTP-EQUIV="refresh" content="0;URL='.append_sid('login.'.$phpEx).'">'.$n
.'</HEAD>'.$n
.'</HTML>'.$n;
exit;
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
|
|
|
|
   |
 |
Texan78
phpBB2.de User

Anmeldungsdatum: 22.03.2005
Beiträge: 205
|
Verfasst am:
Mo 23 Jan, 2006 04:53 |
  |
|
    |
 |
|
|
|
|
|
Nächstes Thema anzeigen
Vorheriges Thema anzeigen
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
| |