1
marcan
Modules not permited in the search function
  • 2004/3/25 21:04

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


Hi !

Let's say anonymous users don't have access to the forum. If they perform a search and the keywords they entered matcj a post in the forum, this post will be display in the result of the search. Is there a way to hide the results for modules that the users don't have the appropriate permissions.

Thanks !

2
Mithrandir
Re: Modules not permited in the search function

That would be the responsibility of the individual modules (and quite a valid point)

The search function for the forum is in include/search.inc.php and you would need to find the forums, visible to the user, and only include those forums in the search.

Another way would be to do a check on each found entry AFTER the SQL, to check if the user was permitted in the forum - but that would mean an excessive amount of check-ups.

Basically, the group permissions system needs to be updated to support this, I think (something, I also have been asking for)

3
Mithrandir
Re: Modules not permited in the search function

FS, I am getting really really annoyed with the lack of overview of the code!

Here I am, asking for functionality which is already there and noone has been able to point that out to me.

XoopsGroupPermHandler::getItemIds($gperm_name, $gperm_groupid, $gperm_modid = 1) WILL return those categories, a certain group is permitted in a certain module with a certain permission name.

Now I only need one, which takes a group array and does the same - but anyways, this is somewhere to start.

Edit: Groups CAN be an array... so all requested functionality is there - why does this have to be such a secret???

4
marcan
Re: Modules not permited in the search function
  • 2004/3/26 1:03

  • marcan

  • Just can't stay away

  • Posts: 824

  • Since: 2003/10/8


I Mithrandir, since I'm not really a coder, how could this help me solve the initial problem of this post?

Thanks !

5
Mithrandir
Re: Modules not permited in the search function

I don't know exactly how the forum finds out, who can go where (and I did get carried away a little) - but I assume that it will use group permissions at least in the next version.

Then it is a matter of finding the forums that the user can access and add a little to the search function in include/search.inc.php:
$availableForums Some_function_to_get_forums($xoopsUser);

$sql "SELECT .... WHERE ... AND forum_id IN (".$availableForumsInCommaSeparatedString.")";

Login

Who's Online

267 user(s) are online (154 user(s) are browsing Support Forums)


Members: 0


Guests: 267


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits