>>  Site Map >>  Forums >>  Unanswered

Forum module - topics in forum:



Unanswered - <font color=red>Posts that are still unaswered (after 7 days) are in here, unless someone provides an answer, then they'll be put back in the relevant forum.</font>



Module works with 7.5 but not 7.7/8

Hi

I write modules for Nuke systems (although admitedly I develop primarily for DragonFly rather than PHPNuke) and I have a problem I hope someone can help me with.

In the interests of making my modules cross-compatible with DragonFly and PHPNuke I have this piece of code at the start:-

Code: :

$mrCMS = '';
$mrAdmin = 0;

if (defined('CPG_NUKE')) {
  $mrCMS = (version_compare(CPG_NUKE, '9', '<')) ? 'cpg-nuke' : 'dragonfly';
} else {
  $mrCMS = 'php-nuke';
}

switch ($mrCMS)
{
  case 'dragonfly':
  case 'cpg-nuke':
    if ($mrCMS=='cpg-nuke') { global $admin; }
    $mrAdmin = ($mrCMS=='cpg-nuke') ? is_admin($admin) : is_admin() ;
  break;
 
  case 'php-nuke':
    global $admin;
    $mrAdmin = is_admin($admin);
  break;
}


(there's actually a fair bit of other stuff in there, but this is the bit that's giving me problems)

The idea being that I end up with a variable, $mrAdmin, which if set means the currently logged in user is an Admin, regardless of whether it's running under PHPNuke, DragonFly or DragonFly's predecessor CPGNuke.

This all works fine on all versions of PHPNuke I've tried up to 7.5, but in 7.7 and 7.8 the variable $mrAdmin remains set to zero, which kinda makes me think 7.7/8 isn't making the $admin variable global.

Is there some other way in which I'm supposed to be able to test if the current user is an Admin in 7.7/8?




Attention! You are currently viewing sitemap page!
We strongly suggest to look at original content

Search from web

Valid HTML 4.01 Valid CSS