Soy nueva en PHP, espero puedan ayudarme con esta error que me esta volviendo loca y atrasándome por supuesto! Jajaja
Error que marca:
[b]( ! ) Fatal error: Call to a member function isAdmin() on a non-object in C:\wamp\www\compras\modules\system\admin\users\users.php on line 9[/b]
Fragmento de código [b]users.php[/b]:
[color=#3465A4]<?php
// $Id: users.php,v 1.4 2006/05/24 18:50:58 EsseBe Exp $
// ************************************************************/
// * RUNCMS */
// * Simplicity & ease off use */
// * < http://www.runcms.org > */
// ************************************************************/
[color=#EF2929]if ( $xoopsUser->isAdmin($xoopsModule->mid()) )[/color] {
/*********************************************************/
/* Users Functions */
/*********************************************************/
include_once(XOOPS_ROOT_PATH."/class/xoopslists.php");
include_once(XOOPS_ROOT_PATH."/class/xoopsformloader.php");[/color]
[b]xoopsuser.php[/b] donde creo la función:
[color=#3465A4]<?php
// $Id: xoopsuser.php,v 1.1 2006/05/21 21:19:35 EsseBe Exp $
// -------------------------------------------------------------------------//
// RUNCMS //
// //
// reliable - Unique - Nocost & Simplicity & ease off use //
// < http://www.runcms.org > //
// -------------------------------------------------------------------------//
// Original Author: Kazumi Ono
// Author Website : http://www.mywebaddons.com/ , http://www.myweb.ne.jp
// License Type : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
if (!defined("XOOPS_USER_INCLUDED")) {
define("XOOPS_USER_INCLUDED", 1);
include_once(XOOPS_ROOT_PATH."/class/xoopsobject.php");
include_once(XOOPS_ROOT_PATH."/class/xoopsgroup.php");
//---------------------------------------------------------------------------------------//
/**
* Description
*
* @param type $var description
* @return type description
*/
Class XoopsUser extends XoopsObject {
var $inactive = false;
var $groups = array();
var $admin_groups = array();
function isAdmin($moduleid=0) {
if ($this->admin_groups[$moduleid] == TRUE)
{
return true;
}
else
{
$this->admin_groups[$moduleid] = XoopsGroup::checkRight("module", $moduleid, $this->groups(), "A");
if ($this->admin_groups[$moduleid] == TRUE)
{
return true;
}
}
return false;
}
//---------------------------------------------------------------------------------------//
} // END XOOPSUSER
// ------------------------------------------------------------------------- //
}
?>[/color]
Gracias!!!!
