UBB.Dev
Posted By: coloradok5 Use of features by group - 09/28/2002 7:05 PM
Is there a way to restrict features by group, such as:

PM's
uploading
posting pics in threads
Search function
Posted By: Aglavalin Re: Use of features by group - 09/29/2002 2:06 AM
You would have to put in group checks all over the place. This would be quite a bit of work in many files to get all these things checked.
Posted By: JoshPet Re: Use of features by group - 09/29/2002 2:19 AM
Right,

Probably PM's and Searches would be easiest to restrict.

The others would involve lots of checks.
Posted By: coloradok5 Re: Use of features by group - 09/29/2002 4:46 AM
Anybody have a hack to disable the Search by group?
Posted By: JoshPet Re: Use of features by group - 09/29/2002 5:06 AM
I've got an idea....

No promises.... but let me test something.

I think I can do this easily.
Posted By: JoshPet Re: Use of features by group - 09/29/2002 5:51 AM
OK - here's how to restrict the Search function to a certain usergroup:
code:

#
# In search.php find this:
#

// -----------------
// Get the user info
$userob = new user;
$user = $userob -> authenticate("U_Groups");
if (!$user['U_Groups']) {
$user['U_Groups'] = "-4-";
}



#
# Change to this
#

// -----------------
// Get the user info
$userob = new user;
$user = $userob -> authenticate("U_Groups");
if (!$user['U_Groups']) {
$user['U_Groups'] = "-4-";
}

if (preg_match("/-5-/",$user['U_Groups'])) {
// change the -5- above to the number of the usergroup that is allowed to use search


#
# Find this:
#

if (!$debug) {
include("$thispath/templates/$tempstyle/search.tmpl");
}
$html -> send_footer();


#
# Change to:
#

if (!$debug) {
include("$thispath/templates/$tempstyle/search.tmpl");
}
}
else {
$html = new html;
$html -> not_right("Only Group XXXX can use the Search Feature.",$Cat);
}
$html -> send_footer();




You need to change the -5- to the usergroup number that is allowed to search. You also need to customize the 'not_right' message to whatever you like and/or move it to the language files if needed.

Could do something like that to restrict the sending of private messages.....
It would be more difficult to restrict the receiving of Private message.
But you could easily restrict the viewing of Private Messages.

How do you think that should be handled?
Posted By: coloradok5 Re: Use of features by group - 09/30/2002 4:15 AM
Thank's, I will try that right after I upgrade to 6.1, I think I will leave the PM thing alone because that would effect Members as well but I like the idea of reg users not being able to search, just another incentive to join.
Posted By: Watchdog Re: Use of features by group - 10/13/2002 8:24 PM
How do I determine what a user group number is?
And how would the coding look for multiple groups i.e. Admins, moderators and users.
Posted By: JoshPet Re: Use of features by group - 10/14/2002 5:09 AM
Run this SQL command from you admin menu...
substitute the exact group name.

It will then show you the Group number.


SELECT G_Id
FROM w3t_Groups
WHERE G_Name = 'groupnamehere'
© UBB.Developers