简体   繁体   English

当我进入admin / build / modules时,匿名用户的访问被拒绝

[英]When I go to admin/build/modules, anonymous users get access denied

I go to admin/build/modules, without changing anything, and click 'Save Configuration' 我转到admin / build / modules,不做任何更改,然后单击“保存配置”

In the database table menu_router it remove the access_callback value for items that had a value of either 1 or 'user_access'. 在数据库表menu_router中,它删除值为1或“ user_access”的项目的access_callback值。

As a result, on pages that anonymous users should be able to get to, they get a access denied message (You are not authorized to access this page). 结果,在匿名用户应该能够访问的页面上,他们会收到拒绝访问消息(您无权访问此页面)。

I was able to set the values in the database manually, but this really isn't a long term solution every time I go to admin/build/modules. 我能够在数据库中手动设置值,但是每次我进入admin / build / modules时,这都不是一个长期的解决方案。

Today is the first day this started happening. 今天是开始发生的第一天。 I did change some menu items because I wanted to update their function names. 我确实更改了一些菜单项,因为我想更新它们的功能名称。 After updating it, I went to admin/build/modules, then devel/menu/reset, then admin/settings/performance and cleared cache. 更新之后,我去了admin / build / modules,然后是devel / menu / reset,然后是admin / settings / performance并清除了缓存。 I'm not sure what exactly could have been done to cause this. 我不知道到底该怎么做才能导致这种情况。

In the file includes/database.mysql.inc, in the function db_escape_string, I had some custom code. 在文件include / database.mysql.inc中,在函数db_escape_string中,我有一些自定义代码。

function db_escape_string($text) {
  global $active_db;
  if (!is_string($text)){ return '';} //custom
  return mysql_real_escape_string($text, $active_db);
}

I commented out my custom code and it works fine now. 我注释掉了自定义代码,现在可以正常工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM