From: Reini U. <ru...@x-...> - 2004-11-19 13:06:14
|
Charles Corrigan schrieb: > I found that the AllUsers plugin/page did not list anything on my mysql > based implementation of phpwiki (CVS version from a few days ago). > > After some time hunting around I found a fix for me that is probably > incomplete for the wider world... > > In lib/WikiGroup.php - class WikiGroup, function _allUsers(), I found that > no data was retrieved from the database and tracked it to the line: > } elseif (isa($dbi, 'WikiDB_backend_PearDB')) { > > Note that there are two occurrances of this particular line, one to query > the users and another to query the user preferences. > > I changed both to: > } elseif (isa($dbi, 'WikiDB_backend_PearDB') or isa($dbi, 'DB_mysql')) { > and it worked for me. > > I suspect that: > } elseif (isa($dbi, 'WikiDB_backend_PearDB') or isa($dbi, 'DB_common')) { > would be more appropriate. Good catch! This looks wrong. > However, I suspect that this patch is wrong/incomplete, because: > 1 - I am not certain that $dbi can ever be a 'WikiDB_backend_PearDB', so > the code perhaps the change should be: > } elseif (isa($dbi, 'DB_common')) { We have 2 different SQL methods to list our SQL-only users, and only these. Not dba and file. We should either check dbi->_backend or better against 'WikiDB_SQL' and 'WikiDB_ADODB'. > 2 - Just a couple of lines above, there is the start of the if statement: > if (isa($dbi, 'WikiDB_backend_ADODB')) { > My thoughts are if $dbi can not be a 'WikiDB_backend_PearDB' then it is > possible that checking for 'WikiDB_backend_ADODB' is also incorrect. Indeed. A backend is a backend :) > Moving on to a more general issue, the documentation suggests that > AllUsers shows users that have a login AND a homepage AND have saved their > preferences. Docs are old. Code is right. AllUsers should display all once-authenticated users, and not those which are stored in each and every backend. Saving their prefs will lead to inclusion into AllUsers, but there exist other ways also to get listed. The whole bunch of externally authenticated users, if such a method (list users via SQL or LDAP or File) exists. > The actual code structure seems to be that it will show > users that have a login OR a homepage OR have saved their preferences. > > This means that the CategoryHomePages page lists users that have a login > but no homepage are listed with the trailing "?". This is good. So external users (external prefs: db) can create their homepages to be accessible. > Also, it seems that WikiDB->isUserPage is not returning true for any page. > This may be an artefact of storing user preferences in a database rather > than actually in a user page - I am not certain whether this is a real > issue. I will look into this. I bleieve it should only return true for page-stored prefs, not for db-stored prefs. -- Everyone ought to worship God according to his own inclinations, and not to be constrained by force. (Flavius Josephus, Life) |