// // ------------------------------------------------------------------------ // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation; either version 2 of the License, or // // (at your option) any later version. // // // // You may not change or alter any portion of this comment or credits // // of supporting developers from this source code or any supporting // // source code which is considered copyrighted (c) material of the // // original comment or credit authors. // // // // This program is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------ // // Author: Kazumi Ono (AKA onokazu) // // URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ // // Project: The XOOPS Project // // ------------------------------------------------------------------------- // if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) { exit("Access Denied"); } /*********************************************************/ /* Admin/Authors Functions */ /*********************************************************/ function displayGroups() { xoops_cp_header(); //OpenTable(); echo "

"._AM_EDITADG."

"; $member_handler =& xoops_gethandler('member'); $groups =& $member_handler->getGroups(); echo ""; $count = count($groups); for ($i = 0; $i < $count; $i++) { $id = $groups[$i]->getVar('groupid'); echo ''; echo ''; } else { echo ' '._AM_DELETE.''; } } echo "
"._AM_EDITADG."
'.$groups[$i]->getVar('name').''._AM_MODIFY.''; if (XOOPS_GROUP_ADMIN == $id || XOOPS_GROUP_USERS == $id || XOOPS_GROUP_ANONYMOUS == $id) { echo '
"; $name_value = ""; $desc_value = ""; $s_cat_value = ''; $a_mod_value = array(); $r_mod_value = array(); $r_block_value = array(); $op_value = "add"; $submit_value = _AM_CREATENEWADG; $g_id_value = ""; $type_value = ""; $form_title = _AM_CREATENEWADG; include XOOPS_ROOT_PATH."/modules/system/admin/groups/groupform.php"; //CloseTable(); xoops_cp_footer(); } function modifyGroup($g_id) { $userstart = $memstart = 0; if ( !empty($_POST['userstart']) ) { $userstart = intval($_POST['userstart']); } elseif (!empty($_GET['userstart'])) { $userstart = intval($_GET['userstart']); } if ( !empty($_POST['memstart']) ) { $memstart = intval($_POST['memstart']); } elseif (!empty($_GET['memstart'])) { $memstart = intval($_GET['memstart']); } xoops_cp_header(); //OpenTable(); echo ''. _AM_GROUPSMAIN .' »» '. _AM_MODIFYADG.'

'; $member_handler =& xoops_gethandler('member'); $thisgroup =& $member_handler->getGroup($g_id); $name_value = $thisgroup->getVar("name", "E"); $desc_value = $thisgroup->getVar("description", "E"); $moduleperm_handler =& xoops_gethandler('groupperm'); $a_mod_value =& $moduleperm_handler->getItemIds('module_admin', $thisgroup->getVar('groupid')); $r_mod_value =& $moduleperm_handler->getItemIds('module_read', $thisgroup->getVar('groupid')); $gperm_handler =& xoops_gethandler('groupperm'); $r_block_value =& $gperm_handler->getItemIds('block_read', $g_id); $op_value = "update"; $submit_value = _AM_UPDATEADG; $g_id_value = $thisgroup->getVar("groupid"); $type_value = $thisgroup->getVar("group_type", "E"); $form_title = _AM_MODIFYADG; if (XOOPS_GROUP_ADMIN == $g_id) { $s_cat_disable = true; } $sysperm_handler =& xoops_gethandler('groupperm'); $s_cat_value =& $sysperm_handler->getItemIds('system_admin', $g_id); include XOOPS_ROOT_PATH."/modules/system/admin/groups/groupform.php"; echo "

"._AM_EDITMEMBER."

"; $usercount = $member_handler->getUserCount(new Criteria('level', 0, '>')); $member_handler =& xoops_gethandler('member'); $membercount = $member_handler->getUserCountByGroup($g_id); if ($usercount < 200 && $membercount < 200) { // do the old way only when counts are small $mlist = array(); $members =& $member_handler->getUsersByGroup($g_id, false); if (count($members) > 0) { $member_criteria = new Criteria('uid', "(".implode(',', $members).")", "IN"); $member_criteria->setSort('uname'); $mlist = $member_handler->getUserList($member_criteria); } $criteria = new Criteria('level', 0, '>'); $criteria->setSort('uname'); $userslist =& $member_handler->getUserList($criteria); $users =& array_diff($userslist, $mlist); echo '
'._AM_NONMEMBERS.'
'; echo '
'._AM_MEMBERS.'
'; echo '
'; echo "
".$GLOBALS['xoopsSecurity']->getTokenHTML()."
".$GLOBALS['xoopsSecurity']->getTokenHTML()."
"; echo ""; echo '
'; } else { $members =& $member_handler->getUsersByGroup($g_id, false, 200, $memstart); $mlist = array(); if (count($members) > 0) { $member_criteria = new Criteria('uid', "(".implode(',', $members).")", "IN"); $member_criteria->setSort('uname'); $mlist = $member_handler->getUserList($member_criteria); } echo ''._AM_FINDU4GROUP.'
'; echo '
'._AM_MEMBERS.'
'; $nav = new XoopsPageNav($membercount, 200, $memstart, "memstart", "fct=groups&op=modify&g_id=".$g_id); echo $nav->renderNav(4); echo "
".$GLOBALS['xoopsSecurity']->getTokenHTML()."
"; } //CloseTable(); xoops_cp_footer(); } ?>