[xoops-cvslog 5727] CVS update: xoops2jp/html/modules/legacy/admin/actions

Back to archive index

Minahito minah****@users*****
2006年 11月 9日 (木) 16:23:40 JST


Index: xoops2jp/html/modules/legacy/admin/actions/ActSearchAction.class.php
diff -u xoops2jp/html/modules/legacy/admin/actions/ActSearchAction.class.php:1.1.2.2 xoops2jp/html/modules/legacy/admin/actions/ActSearchAction.class.php:1.1.2.3
--- xoops2jp/html/modules/legacy/admin/actions/ActSearchAction.class.php:1.1.2.2	Sun Oct 15 00:46:40 2006
+++ xoops2jp/html/modules/legacy/admin/actions/ActSearchAction.class.php	Thu Nov  9 16:23:40 2006
@@ -98,26 +98,19 @@
 
 		$db=&$controller->getDB();
 
-		//
-		// TODO : We don't use handler and write sql directly.
-		//
 		$mod = $db->prefix("modules");
 		$perm = $db->prefix("group_permission");
 		$groups = implode(",", $xoopsUser->getGroups());
-		
-		//
-		// FIXME ActiveCheck
-		//
-//		$sql = "SELECT ${mod}.* FROM ${mod},${perm} " .
-//			"WHERE ${perm}.gperm_modid=1 AND ${mod}.mid=${perm}.gperm_itemid AND ${perm}.gperm_name='module_admin' AND ${perm}.gperm_groupid IN (${groups}) " .
-//			"ORDER BY ${mod}.weight";
-
-		$handler =& xoops_gethandler('groupperm');
-		$midArr = $handler->getItemIds('module_admin', $xoopsUser->getGroups());
+						 
+		$sql = "SELECT DISTINCT ${mod}.mid FROM ${mod},${perm} " .
+		       "WHERE ${mod}.isactive=1 AND ${mod}.mid=${perm}.gperm_itemid AND ${perm}.gperm_name='module_admin' AND ${perm}.gperm_groupid IN (${groups}) " .
+		       "ORDER BY ${mod}.weight, ${mod}.mid";
 
+		$result=$db->query($sql);
+		
 		$handler =& xoops_gethandler('module');
-		foreach ($midArr as $mid) {
-			$module =& $handler->get($mid);
+		while ($row = $db->fetchArray($result)) {
+			$module =& $handler->get($row['mid']);
 			$adapter =& new Legacy_ModuleAdapter($module); // FIXMED
 			
 			$this->mModules[] =& $adapter;


xoops-cvslog メーリングリストの案内
Back to archive index