Anonymous visitors can NOT see signature

manoloka - May 4, 2008 - 13:23
Project:Signatures for Forums
Version:5.x-2.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Great job, I'm glad someone improved the old basic signatures :-)

I'm not sure if this is a bug or that I'm doing something wrong.

It all seems to work fine when I'm logged in but when I log out I can only see the template with a n/a inside.

In the "signature_forum module permissions" I can only see a "administer signature" shouldn't be also something like "view signature".

If anonymous visitors aren't allowed to see the signature, I think, nothing at all should show (I can see the green square I use as a template).

Uh-mm ..... let me know.

Manuel

#1

manoloka - May 19, 2008 - 14:58

I've just noticed that it doesn't show for authenticated users neither, only shows for admin users.

That is the setting I've got for the "administer signature" permissions. I've tried giving this permission to anonymous and authenticated but it makes no difference. I still can only see the content of the signature if I'm logged as an user with admin role.

Note that however I do see the template of the signature under any role. It's only the content itself (the part added by the user within the user settings) that is not visible.

It looks like may be the same problem that the post http://drupal.org/node/246788

#2

manoloka - May 12, 2008 - 17:00

Hi there,

Wondering if there's any news about this issue ???

I deleted the old signature before I realized that I was the only one actually seeing the signature and my members aren't very happy with me :-(

Any chance of getting it working anytime soon? or should just go back to the old one and see if I can somehow recover the signature?

Thanks

Manuel

#3

Liam McDermott - May 23, 2008 - 10:38
Status:active» postponed (maintainer needs more info)

I can't reproduce this using a clean install of Drupal 6.2 and signature_forum.module so am going to need some more information.

  1. What version of PHP are you using?
  2. Is there still a problem with the latest -dev version (I've made some changes, and put this version on the project home page, the packages are created twice a day so make sure the date is today/yesterday)?
  3. Could you list the other modules you have installed?
  4. Are you using the default settings for signature_forum.module? If not, does this bug appear when you do and could you list what your settings are?

This bug is proving to be difficult to track down. :)

#4

manoloka - May 23, 2008 - 16:30

First of all, I'm using Drupal 5 not 6

1. What version of PHP are you using?

5.2.6

2. Is there still a problem with the latest -dev version (I've made some changes, and put this version on the project home page, the packages are created twice a day so make sure the date is today/yesterday)?

The modified -dev version is for Drupal 6 and I'm using Drupal 5 can you add those changes to 5 and I can try this?

3. Could you list the other modules you have installed?

- Administration
ModuleMagic

- CCK
Content
Content Copy
Content Templates
EMail
Fieldgroup
Image
Link
Node Reference
Number
Option Widgets
Text
User Reference
Zipcode - CCK

- Core - optional
Comment
Contact
Help
Menu
Profile
Search
Statistics
Taxonomy
Tracker
Upload

- Core - required (obviously all)

- Image
Imagecache

- Invite
Invite Site Report

- Javascript tools
Collapsiblock
Javascript tools

- Mail
Invite
SMTP

- Node Profile
Node Family

- Other
'me' Aliases
Account Reminder
Admin Block
Find user
Forward
Global Redirect
Google Analytics
HTMLArea
LoginToboggan
Meta tags
Modr8
Page Title
Path Redirect
Pathauto
Simple Access
Site menu
Taxonomy Access Control Lite
Taxonomy redirect
Taxonomy Role
Thickbox
Token
x_contact_option

- User goodies
Signatures for forums

- Views
Bonus: grid view
Bonus: monthly archiv
Bonus: Panels
Bonus: summary + full view
Bonus: Tag cloud summary
Bonus: Views Export
Views
Views FilterBlock
Views RSS
Views Theme Wizard
Views UI

- XML Sitemap
XML Sitemap
XML Sitemap: Engines
XML Sitemap: Node

4. Are you using the default settings for signature_forum.module? If not, does this bug appear when you do and could you list what your settings are?

I am not sure what the defaults settings were, this are the ones I use;

Input Formant --> Full HTML
Minimum content lenght --> blank (no minimum)
Show signatures one per conversation --> Always

Other Options

Line limit -> 5
Automatically add signatures to content -> ticked

I've been playing around with the settings (all of them) and it didn't make any difference.

Did you get my email yesterday?

If you suspect that any of the modules I use may be causing this, let me know which ones so I can test without it/them (I've got a betatest site so it's no problem for me to play around).

I think the first would be try with the changes you've already done (we may get lucky and it may solve it), but as I'm with 5 I can not do it until you update the 5 -dev too.

#5

Liam McDermott - May 24, 2008 - 04:19
Category:support request» bug report

I'm using Drupal 5 and this module on a production site too. It's working fine there. Sorry for the version confusion, was looking at the information on that duplicate bug.

So it seems the most likely cause is a module conflict. It's impossible to guess where though. So just turn off all the modules on your test site and see if the signatures start working.

If it is a module problem, you'll need to go through all the modules on your test site, switching them on. Group-by-group is easiest, until you hit a group that fails, then go through them one-by-one to find the offending module. Once you find the module, let me know what it is and I'll investigate.

I did get your e-mail, thanks for the details. I did try the <div  id="signbox" > %s </div><br> pattern (on D5 and D6), it works fine.

This is good, we're zero-ing in on the cause. :)

#6

manoloka - May 25, 2008 - 09:23

I spent a few hours yesterday checking stuff and I have found out a couple of things;

I did what you said and I know now that is not a module conflict :-)

I carried playing around with the settings and discovered that it's about the "Input format".

I have an extra input format which is "no follow" (basically is the same as "filtered html" but with the "nofollow" tag on links).

The signature showed for any visitor if a chose that setting :-) but it worked only on the setting "nofollow", which happens to be My Drupal default (admin/settings/filters).

I had not tried the "nofollow" input format before because I don't want the links in the signature to be a "nofollow".

So, I changed the defaults and voila Got It! :-) ... it only works when the chosen "Input format" (in signature settings) is the same as the "Drupal Input format default" .

Do you know what I mean?

Hope this will help you reproduce the problem and hopefully solve it.

This is good as a temporary solution, because at least the signature is showing. But I liked the choice of a different "input format", it is a good feature for this module.

I don't want the signature be a "nofollow" but I still want it to be my site default. I hope you'll be able to find a way to fix this :-) so I can use it.

Thanks
Manuel

P.S. Remeber that the problem doesn't exist for admin users.

#7

Liam McDermott - May 27, 2008 - 18:43

This makes sense. I'll have a look later. Thanks for the help debugging this malarkey! :)

#8

Liam McDermott - May 29, 2008 - 02:30
Status:postponed (maintainer needs more info)» fixed

Just checked in a fix for this. You'll have to wait until the package is updated on the front page (happens every ~12 hours).

I made a bunch of other small changes to the code that are untested (I've only got a six dev environment setup at the moment), so give it a test and let me know if everything stops working. Should be simple to fix. :)

#9

manoloka - May 29, 2008 - 16:25

As you expected something isn't working.

I uploaded the new files and the signature isn't showing at all.

I went to the signatures settings (admin/settings/signature_forum) and I get this message;

Note: signatures are switched off, enable them under Administer -> User management -> User settings

But in User Settings there is nothing that will allow me to switch signatures on.

I imagine this is some of the new changes you've made.

#10

Liam McDermott - May 30, 2008 - 10:55

Ahhh, pants. That was Drupal 6 functionality! I've committed a fix, and tested a little, seems to work ok. :)

#11

manoloka - May 31, 2008 - 10:21

It seemed to work fine, the signature shows up to everyone in any input format.

However PHP isn't working.

If I add

<?php Print "Hello, World!"; ?>

to my template, it doesn't show Hello World at all.

The template works and shows fine it is only the PHP functions that don't work.

Know what I mean?

#12

Liam McDermott - May 31, 2008 - 17:36

Are you adding the PHP to your template, or the little template box on the admin form? PHP won't work in that text box (wish I could remove that half-baked feature to be honest).

You'll need to override the default theme in your template.php. The function is named: theme_signature_forum(), so put the following in your template.php:

<?php
/**
* Catch the theme_signature_forum function, and redirect through the template api
*/
function phptemplate_signature_forum($signature) {
 
// Pass to phptemplate, including translating the parameters to an associative array.
  // The element names are the names that the variables
  // will be assigned within your template.
 
return _phptemplate_callback('signature_forum', array('signature' => $signature);
}
?>

Then you can create signature_forum.tpl.php in your theme directory. Start by putting this in there and build upon it as required:

<?php if (!trim($signature) == ''): ?>
<div class="signature"><?php print $signature; ?></div>
<?php endif; ?>

If that's what you're doing already, let me know. :)

#13

manoloka - May 31, 2008 - 20:02

I am adding the PHP in the template box in admin/settings/signature_forum

I have this in that box

<?php Print "Hello, World!"; ?>
<div  id="signbox" > %s </div><br>

and input format on PHP

So I imagine I do I need to do what you said above?

I'll have a go and see, let you know.

#14

Liam McDermott - June 2, 2008 - 22:44

and input format on PHP

So I imagine I do I need to do what you said above?

That should work, however you should never allow you users to enter PHP into their signature. All it will take is some smart arse to enter:

<?php
db_query
("DROP TABLE {node}");
?>

And you'll be, well and truly, shafted. :)

So yes, use the theme, as explained above.

#15

manoloka - June 3, 2008 - 18:04

I thought that must have been a security reason.

Thanks for all your help

P.S. I still haven't tried the above suggestion (I've been busy) but I will do this week.

#16

manoloka - June 3, 2008 - 18:50

I've just tried and works fine :-)

By the Way there is typo in the code above, a missing ) after the last $signature so it should be;

<?php
/**
* Catch the theme_signature_forum function, and redirect through the template api
*/
function phptemplate_signature_forum($signature) {
 
// Pass to phptemplate, including translating the parameters to an associative array.
  // The element names are the names that the variables
  // will be assigned within your template.
 
return _phptemplate_callback('signature_forum', array('signature' => $signature));
}
?>

#17

Liam McDermott - June 3, 2008 - 23:08

By the Way there is typo in the code above, a missing ) after the last $signature so it should be;

Ah, thanks. :)

#18

Anonymous (not verified) - June 17, 2008 - 23:13
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.