diff options
Diffstat (limited to 'inc/infoutils.php')
-rw-r--r-- | inc/infoutils.php | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/inc/infoutils.php b/inc/infoutils.php index 5f406aa3e..786661d01 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -176,7 +176,8 @@ function check(){ } if($conf['authtype'] == 'plain'){ - if(is_writable(DOKU_CONF.'users.auth.php')){ + global $config_cascade; + if(is_writable($config_cascade['plainauth.users']['default'])){ msg('conf/users.auth.php is writable',1); }else{ msg('conf/users.auth.php is not writable',0); @@ -238,6 +239,36 @@ function check(){ Make sure this directory is properly protected (See <a href="http://www.dokuwiki.org/security">security</a>)',-1); } + + // Check for corrupted search index + $lengths = idx_listIndexLengths(); + $index_corrupted = false; + foreach ($lengths as $length) { + if (count(idx_getIndex('w', $length)) != count(idx_getIndex('i', $length))) { + $index_corrupted = true; + break; + } + } + + foreach (idx_getIndex('metadata', '') as $index) { + if (count(idx_getIndex($index.'_w', '')) != count(idx_getIndex($index.'_i', ''))) { + $index_corrupted = true; + break; + } + } + + if ($index_corrupted) + msg('The search index is corrupted. It might produce wrong results and most + probably needs to be rebuilt. See + <a href="http://www.dokuwiki.org/faq:searchindex">faq:searchindex</a> + for ways to rebuild the search index.', -1); + elseif (!empty($lengths)) + msg('The search index seems to be working', 1); + else + msg('The search index is empty. See + <a href="http://www.dokuwiki.org/faq:searchindex">faq:searchindex</a> + for help on how to fix the search index. If the default indexer + isn\'t used or the wiki is actually empty this is normal.'); } /** |