All of a sudden: Access Denied. You are not authorized to access this page.

Hi there
I have come across a most unusual problem. (for me anyway)

Our site has been up and running for some time now as you might note from the release version below. Unfortunately the heavy modifications made have led to it falling behind on the upgrades but even so we have had very little problems at all. User and abuser (xmlrpc) problems being the sum of them.

However over the last few days anonymous users have started getting the error "Access Denied. You are not authorized to access this page." Also we have started experiencing new mysql problems not least of which is huge load on the server and pages not being returned but errors such as: "Warning: mysql_connect(): Too many connections in /var/www/htdocs/drupal1/includes/database.mysql.inc on line 31 Too many connections".

To my knowledge and having questioned anybody else who might have access to the configuration no changes were made and the only 'out of the ordinary' occurance which might have precipitated the problem was a user/post being deleted - a spam troll.

I have been up and down (and up and down) the configuration and I can see no changes that might have accidently occured which could be restricting access.
I have searched the support archives for both the errors above but could not find anything relevant to our specific problem although I did check out the 'node privacy byrole module' and replaced it to no avail.

RPF: Real Estate Module

Looking to have real estate module created. Module would be run on an existing drupal site (4.5, waiting for 4.7 to upgrade??). Current setup uses flexinode, which may just need to be modified. The following already exists (except the last two), but does need to be modified.

Recent comment block modified

I have been trying to modify my "Recent Comments" block all day to show the 1) the title of the comment and 2) the author of the comment. I've gotten really close to having it work out ok, but there is a weird glitch - about 20% of the comments are showing as having no author. The weirdest part is that there is no pattern to what causes it to do this (e.g., it's not just certain users who are getting bypassed nor just specific nodes). At this point it appears totally random. While I'm sure it's not, I also am out of ideas. Below is the current code I have in the comment.module - any tips anyone has would be really great! (Drupal v. 4.5.2, btw)

function comment_block($op = 'list', $delta = 0) {
  if ($op == 'list') {
    $blocks[0]['info'] = t('Recent comments');
    return $blocks;
  }
  else if (user_access('access comments')) {
    $result = db_query_range('SELECT * FROM {comments} WHERE status = 0 ORDER BY timestamp DESC', 0, 20);
    $items = array();
    while ($comment = db_fetch_object($result)) {
     
     $items[] = ''.l($comment->subject, 'node/'. $comment->nid, NULL, NULL, "comment-$comment->cid").''.'
'.' by '.$comment->name; } $block['subject'] = t('Recent comments'); $block['content'] = theme('item_list', $items); return $block; } }

Installing modules on shared host without a console

It's been a pleasant experience finding how much could be done Drupal without writing any code ( got it auto installed by host's Fantastico )

Is it practical to add modules on a shared host with no command line console, the simple mysql command like this one:

mysql -u username -ppassword drupal < flexinode.mysql

is the problem for my. Installing phpMyAdmin as a solution looks more complicated than the problem.

Thanks All

Show cumulative comment rating score?

Ok, I've tried this before many months ago - I've searched drupal.org tonight - and I still can't figure out the exact code I need to put, and WHERE to put it to get a comment score to show up for each comment. The closest I found to what I need seemed to be this...

"From the archive I found a solution. Editing the theme file (eg marvin.theme) and adding a print line which includes comment->score works well."

...but I still don't know exactly what that means and/or should look like. Any help anyone can give will be much appreciated.

why 'group by' when fetching comment?

Here is a part of code from comments module in the function function comment_render

=====================================
........
........
..........

if ($cid) {
// Single comment view.
$result = db_query('SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.picture, u.data, c.score, c.users FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, u.picture, c.homepage, u.uid, u.name, u.picture, u.data, c.score, c.users', $cid, COMMENT_PUBLISHED);

if ($comment = db_fetch_object($result)) {
$comment->name = $comment->uid ? $comment->registered_name : $comment->name;
$output .= theme('comment_view', $comment, module_invoke_all('link', 'comment', $comment, 1));
}
}
else {
// Multiple comment view
$query .= "SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.picture, u.data, c.score, c.users, c.thread FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d AND c.status = %d";

$query .= ' GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, u.picture, c.homepage, u.uid, u.name, u.picture, u.data, c.score, c.users, c.thread';

Pages

Subscribe with RSS Subscribe to RSS - Drupal 4.5.x or older