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  '<tr align="left" valign="top"><td class="head">'.$grouplist[$i].'</td>';
 
$ret_ele .= '<td class="even">';
 
$ret_ele .= '<table class="outer">';
 
$ret_ele .= '<td class="even">';
 
$ret_ele .= _AM_XD_SUBMITMATCHES.' <input id="submit['.$i.']" type="checkbox" value="1">';
 
$ret_ele .= '</td></tr></table>';
 
$ret_ele .= '</td></tr>';
 
$elements[] = $ret_ele;
}
$tray = new XoopsFormElementTray('');
$tray->addElement(new XoopsFormButton('''submit'_SUBMIT'submit'));
$tray->addElement(new XoopsFormButton('''reset'_CANCEL'reset'));
$ret "<br><br><form name='template' id='template' method='post'>n<table width='100%' class='outer' cellspacing='1'>n";
$ret .= implode("n",$elements);
$ret .= '<tr align="left" valign="top"><td class="head"></td><td class="even">';
$ret .= $tray->render();
$ret .= '</td></tr>';
$ret .= '</table></form>';
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

211 user(s) are online (158 user(s) are browsing Support Forums)


Members: 0


Guests: 211


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