stupidly, i messed up my code somehow in either node.module, page.module, or user.module, or some combination. so, now i cannot change "anonymous" user settings in permissions. i can change the settings by clicking on "access content" and so on, and the database registers the changes, but somehow the information is not being retrieved and implemented. "anonymous" users see the "page not found" message unless they log in.

i can see how and where the authenticated users get access to content, or whatever else, but i have searched all over the forums and spent many hours, and i cannot decipher how the anonymous user permissions work.

does anyone know where, or what exactly i might be looking for to make the anonymous user permission settings function properly once again?

thanks much in advance,
eva

Comments

eva’s picture

i found a post at http://drupal.org/node/view/4831#7482 - "Page not found error" that suggested two queries. it happens that my role id#'s are ok, but when i run this query:

SELECT p.perm FROM role r, permission p WHERE r.rid = p.rid AND r.rid = 1

i'm coming up with this error. anybody know what it means?

Error

SQL-query :

SELECT *
FROM `role`
WHERE `perm` = 'access comments, access content, search content'

MySQL said:

Unknown column 'perm' in 'where clause'

when i run the first query:

SELECT * FROM role

i just get the role table back again saying, "showing rows 0-1"
with the anonymous rid as 1
and the authenticated rid as 2

anyone, please, a lead???

thanks,
eva

eva’s picture

this error doesn't seem to affect the authenticated user permissions, so i am guessing it's not really causing the broken anonymous user permissions. i've replaced all files that i altered with original module files and anonymous users still get 'page not found'. i am very frustrated because i have no idea what i did, and no clue how to figure it out. can anyone please help??

eva

eva’s picture

i reinstalled all the files in the module folder - created another drupal database to compare with mine and it looks exactly the same as what i have in role, permission, and node tables. if it's not in the code nor the database (or is that an incorrect assumption??) where the heck else would the problem be?

eva

eva’s picture

when i look in user.module at about line 205, this seems to be the line that determines the permissions according to the role:

$perm = db_result(db_query("SELECT p.perm FROM {role} r, {permission} p WHERE r.rid = p.rid AND r.rid = %d", $user->rid), 0);

if i change %d to "1" - the anonymous user settings display instead of the "page not found" message. so, for some reason, the db is not being asked for the anonymous user role settings. why would %d work before, and not now? is there something else that i could change %d to that would ask for anonymous as well as authenticated or other user roles???

i am a newbie (probably already obvious:) and learning as i am going - could someone PLEASE point me in a helpful direction???

eva

eva’s picture

well, turns out 2:00am logic is not a wonderful asset - i'd deleted the uid "0" row in the user table- and, well, software doesn't work well when it doesn't have the info it needs....arrrrgggghh. hope i can save someone else the huge headache this error caused me...

eva

MrKippel’s picture

I had the same problem.

I'm sure I havent deleted user with uid = 0. It started to fail when updated to 4.4.1 from 4.2.0. Didnt check if in 4.2.0 uid=0 wasnt used or if it was deleted in upgrade process. Dunno.

Anyway, thanks :)

drumm’s picture

I can not help with any code you changed because it is simply too time consuming to figure out what you did. Put the files and database back the way they were before any manual changes and go to the permissions administration page and enable the access content permission for anonymous users. Drupal 4.4 does not make a distinction between not found and access denied, but this has been fixed for the upcoming 4.5 release.