Minahito
minah****@users*****
2006年 4月 7日 (金) 18:03:01 JST
Index: xoops2jp/html/modules/base/class/newblocks.php diff -u xoops2jp/html/modules/base/class/newblocks.php:1.1.2.3 xoops2jp/html/modules/base/class/newblocks.php:1.1.2.4 --- xoops2jp/html/modules/base/class/newblocks.php:1.1.2.3 Thu Apr 6 15:00:25 2006 +++ xoops2jp/html/modules/base/class/newblocks.php Fri Apr 7 18:03:01 2006 @@ -95,61 +95,6 @@ var $mTable = "newblocks"; var $mPrimary = "bid"; var $mClass = "BaseNewblocksObject"; - - function insert(&$obj, $force=false) - { - if (parent::insert($obj, $force)) { - $handler =& xoops_getmodulehandler('block_module_link', 'base'); - $handler->deleteAll(new Criteria('block_id', $obj->get('bid'))); - foreach ($obj->mBmodule as $bmodule) { - $handler->insert($bmodule); - } - - // - // Insert group permissions. - // - $currentGroupid = array(); - foreach ($obj->mGroup as $group) { - $currentGroupid[] = $group->get('groupid'); - } - - $permHandler =& xoops_gethandler('groupperm'); - $criteria =& new CriteriaCompo(); - $criteria->add(new Criteria('gperm_modid', 1)); - $criteria->add(new Criteria('gperm_itemid', $obj->get('bid'))); - $criteria->add(new Criteria('gperm_name', 'block_read')); - - $gpermArr =& $permHandler->getObjects($criteria); - foreach ($gpermArr as $gperm) { - if (!in_array($gperm->get('gperm_groupid', $currentGroupid))) { - $permHandler->delete($gperm, $force); - } - } - - foreach ($obj->mGroup as $group) { - $insertFlag = true; - foreach ($gpermArr as $gperm) { - if ($gperm->get('gperm_groupid') == $group->get('group_id')) { - $insertFlag = false; - } - } - - if ($insertFlag) { - $gperm =& $permHandler->create(); - $gperm->set('gperm_modid', 1); - $gperm->set('gperm_groupid', $group->get('groupid')); - $gperm->set('gperm_itemid', $obj->get('bid')); - $gperm->set('gperm_name', 'block_read'); - - $permHandler->insert($gperm, $force); - } - } - - return true; - } - - return false; - } } ?>