|
Post by Wormopolis on Dec 31, 2008 22:09:18 GMT -8
Browser Tested: IE and FF placement: global footer
changes links to certain member groups profile links to keep guests/non-staff from seeing. useful to hide admin or mod info from guests/non-staff. registered members still able to see profiles as normal if variable set to false.
<script type="text/javascript"> <!-- // Prevent viewing profiles of certain groups by guests // By Wormopolis // Do not repost - Keep Header intact // wormocodes.proboards.com // version 1.21
//set to true if you want non-staff members to not see these profiles as well var membRestrict = true;
// Usergroups seperated by |. admin is usually group 1. new members are 0. var secGroups="1|2|3|4";
// No need to edit below var adm=false; tdS=document.getElementsByTagName('td'); for (m=0; m<tdS.length; m++) { if (tdS[m].className=='menubg' && tdS[m].firstChild && tdS[m].firstChild.innerHTML && !tdS[m].firstChild.innerHTML.match(/ion=admin/i)) { adm=true; } } if (pb_username=="Guest" || (membRestrict && !adm)) { vlnks=document.getElementsByTagName('a'); for (j=0; j<vlnks.length; j++) { if (vlnks[j].href.match(/ion=viewprofile/i) && vlnks[j].className) { cname=vlnks[j].className; cgrp=cname.substring(5,cname.length); if (cgrp.match(new RegExp('^(' +secGroups+ ')$',''))) { if (vlnks[j].href==location.href) { document.body.style.display="none"; alert("You are not authorized to view this profile"); location.href="/index.cgi"; } vlnks[j].href="javascript:alert('You are not authorized to view this profile');"; } } } } //--> </script>
preview: not really needed.. it just pops up an alert.
version 1.2: added ability to hide profiles from non-staff
next version: restrict specific usergroups even if staff/non-staff
|
|
scooter09
Not New Member
Posts: 2
scooter09 said 0 great things
|
Post by scooter09 on Feb 16, 2009 12:58:40 GMT -8
The only downside is that the members can still click on the Members button and view the members profiles.
|
|
|
Post by Wormopolis on Feb 17, 2009 21:28:37 GMT -8
I'll see what I can do.
|
|
scooter09
Not New Member
Posts: 2
scooter09 said 0 great things
|
Post by scooter09 on Feb 27, 2009 8:34:51 GMT -8
Thanks. It also will allow members to click on members profiles the only thing it prevents them from doing is clicking on the Staff's Profiles.
|
|
|
Post by Wormopolis on Feb 27, 2009 8:43:24 GMT -8
you changed the numbers is here right?
var secGroups=/(1|2|3|4)/;
|
|