1
hardyvoje
Category permisions per groups RMSOFT Downloads Plus 1.5
  • 2006/1/7 23:26

  • hardyvoje

  • Not too shy to talk

  • Posts: 123

  • Since: 2005/12/25


Is there any known way to set permisions for categories using RMSOFT Downloads Plus 1.5 module?

Is there any trick in datebase or code, anything???

Module originaly support only permisions for registrated or anonymus users... not for other groups?

HELP!!!
FreeResources Design Portal:http://www.omnetwork.net | Open Source Gaming Portal:http://www.osgamer.org

2
hardyvoje
Re: Category permisions per groups RMSOFT Downloads Plus 1.5
  • 2006/1/8 1:42

  • hardyvoje

  • Not too shy to talk

  • Posts: 123

  • Since: 2005/12/25


I've found solution on my own so i would like to share it with others:

in file rmdp_functions.php (subfolder > include)
i have added code found somewhere on forum:

function rmdp_in_group($group_name) {
global $xoopsUser;
if (!is_object($xoopsUser)) {
return false;
}
$member_handler =& xoops_gethandler('member');
$groups =& $member_handler->getGroupsByUser($xoopsUser->getVar('uid'), true);
$in_group = false;
foreach ($groups as $group) {
if ($group->getVar('name') == $group_name) {
$in_group = true;
break;
}
}
return $in_group;
}

then in file categos.php - which shows category content i have changed code like this from line 42:

include('include/rmdp_functions.php');

$xoopsTpl->assign('rss_catego',$id);

// Comprobamos el acceso a la categoría
include 'include/rmdp_access.php';

if (rmdp_check_access($id)){
// array of IDs of groups to which current user belongs
if (!rmdp_in_group("Approved members")) {
redirect_header(XOOPS_URL."/user.php?xoops_redirect=".parse_url($_SERVER['PHP_SELF']), 1, _RMDP_ERR_ACCESS);
die();}
}


later in code there is line with>
include('include/rmdp_functions.php'); should be removed.

I needed to use Approved members string to indentify user group with that name, probably others gonna use something else...

i hope that i helped someone!
FreeResources Design Portal:http://www.omnetwork.net | Open Source Gaming Portal:http://www.osgamer.org

Login

Who's Online

249 user(s) are online (146 user(s) are browsing Support Forums)


Members: 0


Guests: 249


more...

Donat-O-Meter

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

Latest GitHub Commits