[Suche] Mod Redirect anonymous users to login
Verfasst: 07.03.2005 22:31
Hi es gibt ja folgenden Mod, der funzt auch ohne Probleme:
Weiß vielleicht jemand wie man sowas machen kann für diese Seite:
statistics.php
Ich habe Statistik Mod Version 2.1.5 auf meinem Board installiert und möchte gerne das anonyme bzw. eben Gäste sich die Statistik nicht ansehen können.
Wäre super, wenn mir da jemand weiterhelfen kann
Code: Alles auswählen
##############################################################
## MOD Title: Redirect anonymous users to login
## MOD Author: StefanKausL < stefan@kuhlins.de > (Stefan Kuhlins) http://kuhlins.de/
## MOD Description: This very simple MOD redirects anonymous
## users to the login page instead of showing member, groups,
## or profile pages. That way anonymous users can't see
## registered user's data.
## MOD Version: 1.0.3
##
## Installation Level: Easy
## Installation Time: 1 Minute
## Files To Edit: groupcp.php, memberlist.php, profile.php, viewonline.php
##
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/
##############################################################
## Author Notes:
##
## To make this MOD work, the forums must be set to registered users only.
## Go to the "Forum Permissions Control" section and
## set "View", "Read", "Post", etc. to "REG".
## This stops guests from viewing, reading, and posting.
##
## Search engines did not see posts that are for registered users only,
## but you can set some forums open to all users including search engines.
## Go to "Forum Permissions Control" in the admin section and
## set "View" and "Read" to "ALL".
##
## Intentionally I didn't put the redirect on my index and search page,
## because I want some visible forums and topics,
## especially for the rules everybody should read before registering.
## But the code will work in the files index.php and search.php as well.
## Just insert the redirect code the same way as for groupcp.php.
##
## CAUTION:
## Do not put the redirect code after init_userprefs($userdata); in
## profile.php, because that way nobody can register!
##
##############################################################
## MOD History:
##
## 2004-08-18 - Version 1.0.3
## - Updated for phpBB 2.0.10 (only the number of tabs was changed)
## - Added notes
##
## 2004-07-28 - Version 1.0.2
## - Now it follows phpBB's coding standards.
##
## 2004-07-12 - Version 1.0.1
## - Bug fix: Anonymous users could not register.
## - Improvement: Anonymous users should not see who's online.
##
## 2004-07-09 - Version 1.0.0
## - Initial version
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]---------------------------------------------
#
groupcp.php
#
#-----[ FIND ]---------------------------------------------
#
init_userprefs($userdata);
#
#-----[ AFTER, ADD ]---------------------------------------------
#
if ($userdata['user_id'] == ANONYMOUS)
{
redirect(append_sid('login.'.$phpEx));
}
#
#-----[ OPEN ]---------------------------------------------
#
memberlist.php
#
#-----[ FIND ]---------------------------------------------
#
init_userprefs($userdata);
#
#-----[ AFTER, ADD ]---------------------------------------------
#
if ($userdata['user_id'] == ANONYMOUS)
{
redirect(append_sid('login.'.$phpEx));
}
#
#-----[ OPEN ]---------------------------------------------
#
viewonline.php
#
#-----[ FIND ]---------------------------------------------
#
init_userprefs($userdata);
#
#-----[ AFTER, ADD ]---------------------------------------------
#
if ($userdata['user_id'] == ANONYMOUS)
{
redirect(append_sid('login.'.$phpEx));
}
#
#-----[ OPEN ]---------------------------------------------
#
profile.php
#
#-----[ FIND ]---------------------------------------------
#
if ( $mode == 'viewprofile' )
{
#
#-----[ AFTER, ADD ]---------------------------------------------
#
if ($userdata['user_id'] == ANONYMOUS)
{
redirect(append_sid('login.'.$phpEx));
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
statistics.php
Ich habe Statistik Mod Version 2.1.5 auf meinem Board installiert und möchte gerne das anonyme bzw. eben Gäste sich die Statistik nicht ansehen können.
Wäre super, wenn mir da jemand weiterhelfen kann