good afternoon I'm trying to work Xplorer module in XOOPS 2.4 and in the Administration Menu module, when I try to give the respective Permissions to each user group (to move, edit, delete files, etc..) it does't displays any option.
This module works perfectly until version 2.3 of xoops, but I assume that changed the way it manages the Permissions
Here I give you the code that uses Xplorer for managing permissions:
both are placed in the Xplorer/admin folder
"groupperm.php":
include '../../../include/cp_header.php';
include_once XOOPS_ROOT_PATH .'/class/xoopsform/grouppermform.php';
include_once '../perms.inc.php';
$title_of_form = "Permisos para el Módulo Explorador de Formatos";
$perm_desc = 'Seleccione los Permisos de Acceso para los Grupos:';
$form = new XoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc);
foreach ($cats as $item_id => $item_name) {
$form->addItem($item_id, $item_name);
}
//xoops_cp_header();
$xoopsTpl->assign('content',$form->render());
//xoops_cp_footer();
?>
"admin.php":
// $Id: $
// ------------------------------------------------------------------------ //
// ------------------------------------------------------------------------ //
include("admin_header.php");
require_once(MOD_PATH."/admin/admin_cptabs.php");
/**
* used to hold all page data that is collected for display
* @var array $post
*/
$page = array();
/**
used to hold an array of submitted data to the page
@var array $post
*/
$post = array();
$posterror = false;
import_request_variables('gp','');
/**
Set up our admin tabs
*/
error_reporting(E_ALL);
// ********************************************************* admin smarty start
global $xoopsModule;
xoops_cp_header();
require_once XOOPS_ROOT_PATH.'/class/template.php';
if ( !isset($xoopsTpl) ) { // Just in case, for new releases
$xoopsTpl = new XoopsTpl();
$oldsystem = true;
}else $oldsystem = false;
$xoopsOption['template_main'] = 'admin/admin.html'; // To be compatible with existing system.
// ********************************************************* admin smarty start
switch ($tab) {
case TAB_PERMS :
$mainTabs->setCurrent('permission','tabs');
$xoopsTpl->assign('tplpage','groupperm');
include "groupperm.php";
break;
case TAB_INDEX :
default :
$mainTabs->setCurrent('index','tabs');
break;
}
$xoopsTpl->assign( 'tabs', $mainTabs->getSet() );
// ********** admin smarty close
$xoopsTpl->assign('mod_dir', $xoopsModule->dirname() );
$xoopsTpl->assign('mod_mid', $xoopsModule->getVar('mid'));
if ($oldsystem) { // Don't execute if newer versions has smarty implemented.
if (isset($xoopsOption['template_main'])) {
$xoopsTpl->xoops_setCaching(0);
$xoopsTpl->display('db:'.$xoopsOption['template_main']);
}
}
xoops_cp_footer();
// ********************************************************* admin smarty close
?>
perms.inc.php (placed in xplorer folder)
$perm_name = 'XplorerPerms';
if ($xoopsUser) $groups = $xoopsUser->getGroups();
else $groups = XOOPS_GROUP_ANONYMOUS;
$module_id = $xoopsModule->getVar("mid");
$gperm_handler = & xoops_gethandler('groupperm');
define('PERM_COPY', 1);
define('PERM_MOVE', 2);
define('PERM_DELETE', 3);
define('PERM_UPLOAD', 4);
define('PERM_SEARCH', 5);
define('PERM_CREATE', 6);
define('PERM_EDITFILE', 7);
$cats = array( '1' => 'Copiar',
'2' => 'Mover',
'3' => 'Borrar',
'4' => 'Cargar',
'5' => 'Buscar',
'6' => 'Crear',
'7' => 'Editar');
?>
if anyone knows how to solve this, or failing that a specific module that manages access permissions, please tell me to study it... Thanks
I'm from Venezuela, so please excuse my english
...bye