OK, I looked into zentrack a little bit closer on PHP 5.4.8 and WampServer: - as expected, this is a very old code - a lot of issues were caused by using "" instead of ">?php" tags - there is also tons of short tags that are being used instead of echo. It works on PHP 5.4, but it won't work on PHP 5.3, at least not for me. (see description of the issue
here). - the lack of permissions that you're getting is due to some strange code in the DB files in the module: a) in the db.class.php, we have a call to "getArray"
$vars = $recordSet->getArray();
b) this call goes to adodb.inc.php file:
function &GetArray($nRows = -1)
{
global $ADODB_EXTENSION; if ($ADODB_EXTENSION) return adodb_getall($this,$nRows);
$results = array();
$cnt = 0;
while (!$this->EOF && $nRows != $cnt) {
$results[] = $this->fields;
$this->MoveNext();
$cnt++;
}
return $results;
}
The problem is that this function checks for EOF and number of rows. Before we call the function, we execute the query searching for the user, and the $recordSet is at EOF. As a result, the "getArray" function will return an empty array, so you never get the permission. When I reset it to the first row before running the "while" loop
$this->MoveFirst();
so it looks like this: Quote:
function &GetArray($nRows = -1) { global $ADODB_EXTENSION; if ($ADODB_EXTENSION) return adodb_getall($this,$nRows); $results = array(); $cnt = 0; $this->MoveFirst(); while (!$this->EOF && $nRows != $cnt) { $results[] = $this->fields; $this->MoveNext(); $cnt++; } return $results; }
it works now. The files are now updated in
SourceForge SVN, and you can check them out using TortoiseSVN, or you can download them with
this little tool using the link:
http://svn.code.sf.net/p/xoops/svn/XoopsModules/zentrack/trunk/
Please note, you need PHP 5.4 to run it. Do some testing and let us know if it works. However, you can try to add this line:
$this->MoveFirst();
in your code, as I did above, and see if it works.