This is an issue I previously reported (v1.1?) and I think it was fixed, but it's crept back in. It is a problem in 1.2.3 and it looks like it's in the 1.3 SVN as well.
If a user is not permissioned for the message module, the online.php block does not send the username to the template. In v1.2.3:
Code
$msgmodule = pnConfigGetVar('messagemodule', '');
if (SecurityUtil::checkPermission($msgmodule.'::', '::', ACCESS_READ) && pnUserLoggedIn()) {
$pnr->assign('username', pnUserGetVar('uname'));
// check if message module is available and add the necessary info
$pnr->assign('msgmodule', $msgmodule);
if (pnModAvailable($msgmodule)) {
$pnr->assign('messages', pnModAPIFunc($msgmodule, 'user', 'getmessagecount'));
} else {
$pnr->assign('messages', array());
}
}
if (SecurityUtil::checkPermission($msgmodule.'::', '::', ACCESS_READ) && pnUserLoggedIn()) {
$pnr->assign('username', pnUserGetVar('uname'));
// check if message module is available and add the necessary info
$pnr->assign('msgmodule', $msgmodule);
if (pnModAvailable($msgmodule)) {
$pnr->assign('messages', pnModAPIFunc($msgmodule, 'user', 'getmessagecount'));
} else {
$pnr->assign('messages', array());
}
}
should be:
Code
$msgmodule = pnConfigGetVar('messagemodule', '');
$pnr->assign('username', pnUserGetVar('uname'));
if (SecurityUtil::checkPermission($msgmodule.'::', '::', ACCESS_READ) && pnUserLoggedIn()) {
// check if message module is available and add the necessary info
$pnr->assign('msgmodule', $msgmodule);
if (pnModAvailable($msgmodule)) {
$pnr->assign('messages', pnModAPIFunc($msgmodule, 'user', 'getmessagecount'));
} else {
$pnr->assign('messages', array());
}
}
$pnr->assign('username', pnUserGetVar('uname'));
if (SecurityUtil::checkPermission($msgmodule.'::', '::', ACCESS_READ) && pnUserLoggedIn()) {
// check if message module is available and add the necessary info
$pnr->assign('msgmodule', $msgmodule);
if (pnModAvailable($msgmodule)) {
$pnr->assign('messages', pnModAPIFunc($msgmodule, 'user', 'getmessagecount'));
} else {
$pnr->assign('messages', array());
}
}
