summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2008-01-25 16:19:13 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2008-01-25 16:19:13 +0000
commit85cae0d01ab9eebc2d9464e2bf0e63ed63ae9a13 (patch)
tree5b05591e21a84cca2a48bac49eaa55293f67ade8 /modules
parenta94ef1d6ebd94e2171073a0309bf26d2938074d8 (diff)
downloadbrdo-85cae0d01ab9eebc2d9464e2bf0e63ed63ae9a13.tar.gz
brdo-85cae0d01ab9eebc2d9464e2bf0e63ed63ae9a13.tar.bz2
#204411 by chx, slightly modified: heal a possible MySQL import error when the anonymous user becomes broken
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/comment.module2
-rw-r--r--modules/system/system.admin.inc8
2 files changed, 6 insertions, 4 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 222164351..017623280 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -542,7 +542,7 @@ function comment_form_alter(&$form, $form_state, $form_id) {
COMMENT_ANONYMOUS_MUST_CONTACT => t('Anonymous posters must leave their contact information')),
'#description' => t('This option is enabled when anonymous users have permission to post comments on the <a href="@url">permissions page</a>.', array('@url' => url('admin/user/permissions', array('fragment' => 'module-comment')))),
);
- if (!user_access('post comments', user_load(array('uid' => 0)))) {
+ if (!user_access('post comments', drupal_anonymous_user())) {
$form['comment']['comment_anonymous']['#disabled'] = TRUE;
}
$form['comment']['comment_subject_field'] = array(
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 8db57c824..f17e11f15 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -582,7 +582,7 @@ function _system_is_incompatible(&$incompatible, $files, $file) {
}
// The 'dependencies' key in .info files was a string in Drupal 5, but changed
// to an array in Drupal 6. If it is not an array, the module is not
- // compatible and we can skip the check below which requires an array.
+ // compatible and we can skip the check below which requires an array.
if (!is_array($file->info['dependencies'])) {
$file->info['dependencies'] = array();
$incompatible[$file->name] = TRUE;
@@ -1686,7 +1686,6 @@ function system_clean_url_settings() {
* Menu callback: displays the site status report. Can also be used as a pure check.
*
* @param $check
- *
* If true, only returns a boolean whether there are system status errors.
*/
function system_status($check = FALSE) {
@@ -1694,13 +1693,16 @@ function system_status($check = FALSE) {
include_once './includes/install.inc';
drupal_load_updates();
- // Check run-time requirements and status information
+ // Check run-time requirements and status information.
$requirements = module_invoke_all('requirements', 'runtime');
usort($requirements, '_system_sort_requirements');
if ($check) {
return drupal_requirements_severity($requirements) == REQUIREMENT_ERROR;
}
+ // MySQL import might have set the uid of the anonymous user to autoincrement
+ // value. Let's try fixing it. See http://drupal.org/node/204411
+ db_query("UPDATE {users} SET uid = uid - uid WHERE name = '' AND pass = '' AND status = 0");
return theme('status_report', $requirements);
}