Comunidad de diseño web y desarrollo en internet online

Fatal error: Call to a member function isAdmin() on a non-ob

Citar            
MensajeEscrito el 20 Oct 2009 04:06 pm
Hola, Buenos días!!!
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!!!!

Por lily55

1 de clabLevel



 

msie
Citar            
MensajeEscrito el 21 Oct 2009 01:11 am
Simple. $xoopsUser no es un objeto. Es lo que te dice el error. Probablemente porque no está inicializado.

Por DriverOp

Claber

2510 de clabLevel



 

opera

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.