PDA

View Full Version : Password Protecting FAQ Section?


topianno
03-03-2009, 04:32 PM
Hello,
I was wondering if there is a way to setup user permissions for who can and who cannot view certain areas of the FAQ section? Is there any software add-on anyone knows of I could use to achieve this objective?

Our organization has FAQ information that is proprietary that we wish to only disclose to our clients and not the general public. Does anyone know of a way to integrate such a system with vBulletin?

Thanks ahead of time!

-Gabe

Lynne
03-03-2009, 04:41 PM
I have not seen any modifications to password protect your FAQ. You may, of course, add code to the file (or maybe a plugin at faq_start?) to only allow certain usergroups to view it, but I don't know of a way to password protect it (although, you could probably do a plugin for that if you coded it).

topianno
03-03-2009, 04:59 PM
Hi,
That is exactly what I want to do. I only want certain user groups to be able to access the FAQ section. How would I go about adding code or a plugin to achieve this objective?

Thanks so much for your feedback!

-Gabe

Lynne
03-03-2009, 08:02 PM
add in a plugin at faq_start like this:

if (!isset($vbulletin->userinfo['userid']) OR $vbulletin->userinfo['userid'] == 0 OR !is_member_of($vbulletin->userinfo,x,y,z))
{
print_no_permission();
}
where x,y, and z are usergroups allowed to see it.

You can also put a condition around the faq link in the navbar so only certain usergroups see it.

I haven't tested this, so make sure you test it out after to do it.

topianno
03-03-2009, 08:27 PM
Hi,
I tried the code you provided and it works to keep other users out, but its giving me the following error when logged in as a user with permission to view the FAQ.

ERROR MESSAGE: Parse error: syntax error, unexpected T_STRING in /home2/kuriban/public_html/forum/faq.php on line 65

I am using the following code:// SETTING PERMISSIONS ON WHO CAN VIEW FAQ
if (!isset($vbulletin->userinfo['userid']) OR $vbulletin->userinfo['userid'] == 1 OR !is_member_of($vbulletin->userinfo,Administrators,Patients,Moderators,Super Modertators))
{
print_no_permission();
}

Any ideas?

Gabe

Lynne
03-03-2009, 08:49 PM
x,y, and z need to be usergroup ids, not names. Sorry I didn't specify that.

topianno
03-03-2009, 08:54 PM
Hi there,
Thanks! I changed it and it works great!

How can I put a condition around the FAQ link so it does not appear to users that do not have permission to view it?

Thanks again!

Gabe

Lynne
03-03-2009, 09:33 PM
In the navbar template, find every instance of (only one instance in a default template):
<td class="vbmenu_control"><a rel="help" href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>And change to this:
<if condition="is_member_of($bbuserinfo,x,y,z)">
<td class="vbmenu_control"><a rel="help" href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>
</if>