[外掛]限制觀看會員列表和群組頁<加強版>

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
ckm
竹貓好朋友
竹貓好朋友
文章: 10
註冊時間: 2002-05-02 22:57
來自: 遙遠的宇宙
聯繫:

[外掛]限制觀看會員列表和群組頁<加強版>

文章 ckm »

這個和之前darwinnis
所貼的「禁止訪客觀看會員列表和會員群組」類似\r
但這個mod會把網頁指向登入頁面\r
登入會再回到會員列表或群組頁

代碼: 選擇全部

############################################################## 
## MOD Title: Restrict Memberlist / Usergroup Pages 
## MOD Author: Flipper <Flipper@pogoworld.co.uk> http://php.pogoworld.co.uk 
## MOD Description: Allows only registered users view Memberlist and/or Usergroups pages. 
## MOD Version: 1.0.0
## 
## Installation Level: Easy 
## Installation Time: 2 Minutes 
## Files To Edit: memberlist.php, groupcp.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: If a user is not logged in and they wish to view the memberlist and/or Usergroup pages they will simply be redirected to the login page. If log in is successful, they will be redirected back to Memberlist and/or Usergroup pages. Instructions are given on how to apply this mod to both Memberlist and Usergroups, however you can install it to just the Memberlist or Grouplist page if you wish. 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ OPEN ]------------------------------------------ 
#

memberlist.php

# 
#-----[ FIND ]------------------------------------------ 
#
 
//
// End session management
//

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// Begin 'Restrict Memberlist/Grouplist' MOD
if ( !$userdata['session_logged_in'] )
	{
		$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
		header($header_location . append_sid("login.$phpEx?redirect=memberlist.php", true));
		exit;
	}
// End 'Restrict Memberlist/Grouplist' MOD

#-----[ OPEN ]------------------------------------------ 
#

groupcp.php

# 
#-----[ FIND ]------------------------------------------ 
#
 
//
// End session management
//

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// Begin 'Restrict Memberlist/Grouplist' MOD
if ( !$userdata['session_logged_in'] )
	{
		$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
		header($header_location . append_sid("login.$phpEx?redirect=groupcp.php", true));
		exit;
	}
// End 'Restrict Memberlist/Grouplist' MOD

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
Seize the day and create a better future
ckm@NTHU Blog
動機不明
喝咖啡的綠皮猴
喝咖啡的綠皮猴
文章: 1179
註冊時間: 2002-03-06 20:37
來自: GOP (重啟)

文章 動機不明 »

補強一個地方

開啟 profile.php

尋找\r
[php]<?php
if ( $mode == 'viewprofile' )
{
include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx);
exit;
}
?>[/php]

取代為\r
[php]<?php
if ( $mode == 'viewprofile' )
{
// Begin 'Restrict Memberlist/Grouplist' MOD
if ( !$userdata['session_logged_in'] )
{
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=profile.php", true));
exit;
}
// End 'Restrict Memberlist/Grouplist' MOD

include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx);
exit;
}
?>[/php]


這樣便連個人資料,訪客都無法取得了
非官方外掛問題區公告: [必看]請配合發問格式及明確主題發問(2006 02/24更新)
七點要求:
1. 發問前先搜尋,確定沒有重複後再發表
2. 主題要明確
3. 依照發問格式
4. 禁連續推文
5. 請盡量減少使用地方性語言
6. 解決問題後請修改第一篇主題,並感謝曾經幫過你的前輩們 ^^
7. 請不要將檔案內容完整貼出喔! 只要提供問題行及上下各五行就可以了
主題已鎖定

回到「非官方認證外掛」