Page 1 of 1

Registered users and comments

Posted: Thu Jun 29, 2006 1:24 pm
by Fabien
When a registered user posts a comment, the comment appears on the blog (and in the database) with the username.
When the same post an article, it apperas with the real name.

It's confusing for the readers because they don't know that it's the same person.

Is it a bug? Design? Or did I made an error somewhere?

Cheers, Fabien

Re: Registered users and comments

Posted: Thu Jun 29, 2006 1:43 pm
by garvinhicking
Hi!

Thanks for reporting this. Actually this is more like a bug, you are right. Serendipity does not fetch the realname for the cookie data.

I committed this patch to the 1.1 serendipity version, you can change your file correspondig to that:

http://svn.berlios.de/viewcvs/serendipi ... 99&r2=1300

Also you'll need the updated adduser plugin, which I committed as version 2.15 an dwhich should be available within the next 24 hours.

Best regards,
Garvin

Re: Re: Registered users and comments

Posted: Thu Oct 12, 2006 7:16 pm
by jdwarren
I'm running into this problem -- or at least what I'm encountering sounds like this problem.

The value used for the "Name" when I try to post a comment (I'm the admin of my blog) is my username and not my realname.

Versions are:
Serendipity 1.1-beta1
PHP 4.3.11
Login sidebar plugin version: 1.05
Validates authors login event plugin version: 1.01
User Self-Registration event plugin version: 2.18

Settings for the User Self-Registration are:
Only registered users may post comments? No
Prevent identity faking? No

From my perspective, the "prevent identity faking" option shouldn't really matter if the "realname" value was utilized for comments. However from what it sounded like this was fixed in the 2.15 version of the adduser plugin -- perhaps it's been "undone" accidentally somewhere between 2.15 and 2.18? Or perhaps I misread... it's been one of those weeks. :-)

BTW, I am able to go into the Admin tool and edit the name information on the comments, but this is less than optimum. But it works.

Re: Re: Registered users and comments

Posted: Thu Oct 12, 2006 9:53 pm
by garvinhicking
Hi jdwarren!

Uh, could you describe your problem more detailed, what you mean?

Best regards,
Garvin

Posted: Thu Oct 12, 2006 10:05 pm
by jdwarren
I was referring to the original poster's problem...
When a registered user posts a comment, the comment appears on the blog (and in the database) with the username.
When the same post an article, it apperas with the real name.

It's confusing for the readers because they don't know that it's the same person.

Is it a bug? Design? Or did I made an error somewhere?
When a registered user (namely me) posts a comment, the value for the "name" field is the username -- not the real name -- value.

For specifics, when I'm logged into my blog my username is "jdwarren" and my real name is "Jon Warren". This is what is configured on the user admin screen. The real name value has the note "The full name of the author. This is the name seen by readers". I've italicized the part that is leading me to believe there is a problem with the comments system.

The "real name" is used when I create posts, but the "user name" is used when I post comments. As the OP stated "It's confusing for the readers because they don't know that it's the same person."

What I'd expect (and maybe it's just me) is that the value of the "real name" for the currently logged in user is used for both posts and comments and that the value of the "user name" is only used for logging into the blog. Perhaps I'm missing something in my understanding of this issue -- or have a setting mis-configured.

Hope that helped provide more details... if not let me know.

Posted: Fri Oct 13, 2006 10:17 am
by garvinhicking
Hi!

Ah, many thanks for your explanation. Now I understand. :)

This is the piece of code of the serendipity_event_adduser.php which corresponds to your problem:

Code: Select all

       $serendipity['COOKIE']['name']  = (isset($_SESSION['serendipityRealname']) ? $_SESSION['serendipityRealname'] : $_SESSION['serendipityUser']);
       $serendipity['COOKIE']['email'] = $_SESSION['serendipityEmail'];
       if ($serendipity['POST']['comment']) {
           $serendipity['POST']['name']  = $serendipity['COOKIE']['name'];
           $serendipity['POST']['email'] = $serendipity['COOKIE']['email'];
       }
So this means it first checks for $_SESSION['serendipityRealname'] and tries to use that - and only if that variable is not set, it falls back to the username.

$_SESSION['serendipityRealname'] might not be set in your serendipity version? Please check your include/functions_config.inc.php file in the function serendipity_authenticate_author you should see:

Code: Select all

            serendipity_setCookie('old_session', session_id());
            $_SESSION['serendipityUser']        = $serendipity['serendipityUser']         = $username;
            $_SESSION['serendipityRealname']    = $serendipity['serendipityRealname']     = $row['realname'];
            $_SESSION['serendipityPassword']    = $serendipity['serendipityPassword']     = $password;
            $_SESSION['serendipityEmail']       = $serendipity['serendipityEmail']        = $row['email'];
            $_SESSION['serendipityAuthorid']    = $serendipity['authorid']                = $row['authorid'];
            $_SESSION['serendipityUserlevel']   = $serendipity['serendipityUserlevel']    = $row['userlevel'];
            $_SESSION['serendipityAuthedUser']  = $serendipity['serendipityAuthedUser']   = true;
            $_SESSION['serendipityRightPublish']= $serendipity['serendipityRightPublish'] = $row['right_publish'];
            serendipity_load_configuration($serendipity['authorid']);
            return true;
Is that the case? Which s9y version are you using?

HTH,
Garvin

Posted: Fri Oct 13, 2006 8:47 pm
by jdwarren
I'm using the 1.1-beta1 version of Serendipity.

The problem lies with the following line in the include/functions_config.inc.php file.
garvinhicking wrote:

Code: Select all

            $_SESSION['serendipityRealname']    = $serendipity['serendipityRealname']     = $row['realname'];
In my version of the file it was this (note the extra '$' before row).

Code: Select all

            $_SESSION['serendipityRealname']    = $serendipity['serendipityRealname']     = $$row['realname'];
Thanks much for pointing me to where the cookie is set -- oh and thanks for all your work on such a great tool. :-)

Posted: Mon Oct 16, 2006 7:53 pm
by judebert
I assume Garvin did it, but that is now fixed in SVN.