[ABD] Hide memberlist to everybody but the admin

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
isloera
Registered User
Posts: 21
Joined: Thu Oct 14, 2004 10:44 pm

[ABD] Hide memberlist to everybody but the admin

Post by isloera » Sun Jun 08, 2008 6:35 pm

I looked everywhere for a mod that would hide the memberlist to everybody but the admin, but there was none, that I knew of at least, so I made my own.



This mod has the following features:
  1. Only the admin can see the memberlist and all the other users cannot.
  2. If somebody else attempts to see the memberlist, it will redirect the browser back to the index page.
  3. Only the admin can see the memberlist link on the upper menu.
  4. Everybody can see profiles, search users, etc. in other words, all the other member-related operations of memberlist.php work as usual.
Tested and working on phpBB 3.0.1

Changed Files:
  • root/memberlist.php
  • root/includes/functions.php
  • root/styles/prosilver/template/overall_header.html
Open root/memberlist.php

Find

Code: Select all

// Check our mode...
if (!in_array($mode, array('','group', 'viewprofile', 'email', 'contact', 'searchuser', 'leaders')))
{
  
		trigger_error('NO_MODE');
	
}
After, add

Code: Select all

//--------------------------------------------------------------
//Hide memberlist to everybody, but the administrator mod start 
//--------------------------------------------------------------

//If the user is not an administrator and requests to see the memberlist,
//redirect to index page
if  ((!$auth->acl_get('a_'))   && (in_array($mode, array(''))))
{
		redirect(append_sid("{$phpbb_root_path}index.$phpEx"));

}
//--------------------------------------------------------------
//Hide memberlist to everybody, but the administrator mod end
//--------------------------------------------------------------
Save and close


Open root/includes/functions.php

Find

Code: Select all

'S_REGISTERED_USER'		=> $user->data['is_registered'],
After, add

Code: Select all

//-- [+] MOD: Admin Only memberlist access -------------------------------------
		//-- add
		//
		'S_ADMIN'				=> $auth->acl_get('a_'),
		//
		//-- [-] MOD: Admin Only memberlist access -----------------------------------
Save and close

Open root/styles/prosilver/template/overall_header.html

Find and replace every

Code: Select all

<!-- IF S_MEMBERLIST_DISPLAY -->
with a

Code: Select all

<!-- IF S_ADMIN -->

Save and close

*Purge cache after these changes.

Back up your original files, just in case.
Last edited by isloera on Sun Jun 08, 2008 10:07 pm, edited 1 time in total.

User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Re: Hide memberlist to everybody but the admin

Post by stickerboy » Sun Jun 08, 2008 7:42 pm

Moved to MODs in Development.
isloera - if you are intent in actively supporting this MOD, can you please edit your topic title as per the MOD Guidelines (pink box at the top of the page).


Kenny.
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || BandCamp || phpBB Snippets ||
Formerly known as cherokee red

User avatar
MacroPhotoPro
Registered User
Posts: 94
Joined: Mon Nov 28, 2011 4:39 am
Location: Gaineville, FL
Contact:

Re: [DEV] Hide memberlist to everybody but the admin

Post by MacroPhotoPro » Wed Dec 28, 2011 8:43 pm

Considering there are over 4700 lines on the functions.php, it would be helpful to identify which lines the codes are on :D

User avatar
doktornotor
Registered User
Posts: 608
Joined: Fri Sep 09, 2011 7:41 am

Re: [DEV] Hide memberlist to everybody but the admin

Post by doktornotor » Wed Dec 28, 2011 8:55 pm

MacroPhotoPro wrote:Considering there are over 4700 lines on the functions.php, it would be helpful to identify which lines the codes are on :D
There is exactly one occurence of 'S_REGISTERED_USER' in includes/functions.php; that said, wrapping the link between <!-- IF U_ACP --><!-- ENDIF --> does the same job without any mod in includes/funtions.php.
Support requests via PM go straight to /dev/null!

User avatar
MacroPhotoPro
Registered User
Posts: 94
Joined: Mon Nov 28, 2011 4:39 am
Location: Gaineville, FL
Contact:

Re: [DEV] Hide memberlist to everybody but the admin

Post by MacroPhotoPro » Wed Dec 28, 2011 9:38 pm

Just to let folks know, this MOD worked like a Champ on version 3.09 ... and I thought I would extend the courtesy of letting interested folks know that relevant line of code was on line 4518 of the functions.php :lol:

Over and out 8-)

Jack


.

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25185
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: [DEV] Hide memberlist to everybody but the admin

Post by Paul » Thu Dec 29, 2011 10:55 am

This topic has been marked as [ABD] - Abandoned as the mod author has not been active recently. If the MOD author wishes to continue development, please PM anyone on the MOD Team to request this topic be unlocked.

Thank you,
The phpBB Modifications Team
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

Locked

Return to “[3.0.x] Abandoned MODs”