/**
  * _setUserForm
  *
  * @return  void
  **/
 private function _setUserForm()
 {
     // create user form
     $member_handler =& xoops_gethandler('member');
     $mHandler = $this->_getHandler();
     $criteria = new Criteriacompo();
     $criteria->add(new criteria('forum_id', $this->forum_id));
     $criteria->add(new criteria('groupid', NULL));
     $criteria->add(new criteria('uid', 0, '>'));
     $criteria->setSort('uid', 'ASC');
     $mFuserAccObj = $mHandler->getObjects($criteria);
     $fuAccObj = array();
     foreach ($mFuserAccObj as $userObj) {
         $uid = $userObj->get('uid');
         $user = $member_handler->getUser($uid);
         $uname = $user->get('uname');
         $fuAccObj[$uid] = new Xcforum_ForumaccessObject();
         $fuAccObj[$uid]->initVar('uid', XOBJ_DTYPE_INT, $uid, false);
         $fuAccObj[$uid]->initVar('uname4disp', XOBJ_DTYPE_STRING, htmlspecialchars($uname, ENT_QUOTES, _CHARSET), false);
         $fuAccArr = unserialize($userObj->get('permissions'));
         foreach ($fuAccArr as $key => $val) {
             $fuAccObj[$uid]->initVar($key, XOBJ_DTYPE_INT, $val, false);
         }
     }
     $this->usrAccList = $mFuserAccObj;
     // to Form object
     $this->usrAccObj = $fuAccObj;
     // got from db
     //adump($fuAccObj);
 }
Ejemplo n.º 2
0
 /**
  * _setGroups
  *
  * @return	array
  **/
 private function _getGroups()
 {
     // get all groups
     $group_handler =& xoops_gethandler('group');
     $criteria = new Criteriacompo();
     $criteria->setSort('groupid', 'DESC');
     $groups =& $group_handler->getObjects($criteria);
     // make Access Control array by Groups
     $grpNames = array();
     foreach ($groups as $group) {
         $gid = (int) $group->getVar('groupid');
         $grpNames[$gid] = $group->getVar('name');
     }
     return $grpNames;
 }