1
mawi27
Module Development - Prob with Permissions
  • 2008/2/4 16:50

  • mawi27

  • Friend of XOOPS

  • Posts: 103

  • Since: 2006/1/1 1


Hi guys,

i am working on a module with simple permission.
Xoops Usergroups can either have "submit" permission or not.

I already managed to check the permission by
$gperm_handler =& xoops_gethandler('groupperm');
 if (
$gperm_handler->checkRight("submit"0$groups$module->getVar('mid')))
{
  
$maysubmit 1;
}


Now I am stuck! My problem is I cannot figure out the correct XOOPS function calls to get the permission into the group_permission table and to read out the group_permission table to display the check boxes in my admin form correctly.

If there are some XOOPS Cracks around your help would be highly appreciated!


TIA
Marco


My Permission Admin Form looks like this:

$grouplist =& $member_handler->getGroupList();
$gperm_handler =& xoops_gethandler('groupperm');
foreach (
array_keys($grouplist) as $i) {
 
$selected = array();
 
$ret_ele  ''.$grouplist[$i].'';
 
$ret_ele .= '';
 
$ret_ele .= '';
 
$ret_ele .= '';
 
$ret_ele .= _AM_XD_SUBMITMATCHES..$i.']" type="checkbox" value="1">';
 
$ret_ele .= '';
 
$ret_ele .= '';
 
$elements[] = $ret_ele;
}
$tray = new XoopsFormElementTray('');
$tray->addElement(new XoopsFormButton('''submit'_SUBMIT'submit'));
$tray->addElement(new XoopsFormButton('''reset'_CANCEL'reset'));
$ret "

nn"
;
$ret .= implode("n",$elements);
$ret .= '';
$ret .= $tray->render();
$ret .= '';
$ret .= '';
echo 
$ret;
--
Match Dart!
Darts Ranking, News, Videos, Forum and more

2
mawi27
Re: Module Development - Prob with Permissions
  • 2008/2/5 13:17

  • mawi27

  • Friend of XOOPS

  • Posts: 103

  • Since: 2006/1/1 1


solved - you can handle the group_permission table as any other table in the XOOPS db.

(seems not very elegant, though)

Marco
--
Match Dart!
Darts Ranking, News, Videos, Forum and more

Login

Who's Online

444 user(s) are online (304 user(s) are browsing Support Forums)


Members: 0


Guests: 444


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