[TYPO3-dev] Custom module shows blank page with non-admin users.

Jason Alexander jalexander at digipen.edu
Fri Jan 29 22:11:41 CET 2010


Hello All,

Now this issue has been discussed here: http://lists.typo3.org/pipermail/typo3-english/2009-February/057821.html but there was no resolution of the issue. So let me try and explain my issue. I have built a few backend modules with the Kickstarter extension and they are viewable just fine for admin users. But for any other BE user, when you click on the module from the left hand side. The module page title shows up. But the rest of the page is blank. The previous discussion did say to look at the index.php file and search for the word "access" and to check BE users explicit permissions to access these modules. The access permission are setup properly and tested and the lines of code related to the word "access" in the index.php match other known modules that work. Here are some code snippets from my index.php that are related to the word "access"


$BE_USER->modAccess($MCONF,1);	// This checks permissions and exits if the users has no permission for entry. 

// Access check!
// The page will show only if there is a valid page and if this page may be viewed by the user
$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
$access = is_array($this->pageinfo) ? 1 : 0;
				
if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id))	{

// Draw the header.
$this->doc = t3lib_div::makeInstance('mediumDoc');
$this->doc->backPath = $BACK_PATH;
$this->doc->form='<form action="" method="post" enctype="multipart/form-data">';

...additional code

}

 else {
// If no access or if ID == zero 
$this->doc = t3lib_div::makeInstance('mediumDoc');
$this->doc->backPath = $BACK_PATH;

$this->content.=$this->doc->startPage($LANG->getLL('title'));
$this->content.=$this->doc->header($LANG->getLL('title'));
$this->content.=$this->doc->spacer(5);
$this->content.=$this->doc->spacer(10);
}

It looks like it is going to the else statement. But I am not sure why. Looking at the conf.php on other modules I noticed these lines of code:

<?php
// DO NOT REMOVE OR CHANGE THESE 3 LINES:
define('TYPO3_MOD_PATH', '../typo3conf/ext/dr_wiki/mod1/');  <--THIS LINE
$BACK_PATH='../../../../typo3/';  <-- THIS LINE
$MCONF["name"]="web_txdrwikiM1";

## If the flag was set the value is "admin", otherwise "user,group"
$MCONF["access"]="user,group";
$MCONF["script"]="index.php";  <--THIS LINE

$MLANG["default"]["tabs_images"]["tab"] = "moduleicon.gif";
$MLANG["default"]["ll_ref"]="LLL:EXT:dr_wiki/mod1/locallang_mod.php";
?>

The code that Kickerstarter generated for me didn't have the define() line or the $BACK_PATH. Instead it looks like this:

<?php
// DO NOT REMOVE OR CHANGE THESE 2 LINES:

$MCONF['name'] = 'txdigipenmainM1';
$MCONF['script'] = '_DISPATCH';  <-- HAS THIS INSTEAD OF index.php
	
$MCONF['access'] = 'user,group';

$MLANG['default']['tabs_images']['tab'] = 'moduleicon.gif';
$MLANG['default']['ll_ref'] = 'LLL:EXT:digipen_main/mod1/locallang_mod.xml';
?>

Now I am not sure if the conf.php is the issue as I am still getting my bearings when it comes to developing Typo3 extensions. But would any of you known where I could look further. Any suggestions would be greatly appreciated. Sorry for the long post, I just wanted to cover all aspects of my issue.

Thanks in Advance,

Jason R Alexander
using: Typo3 Version 4.2.10









More information about the TYPO3-dev mailing list