Add Comment: Can you get the name/email from the session?

chad

Joined: 2003-01-08
Posts: 4
Posted: Sun, 2003-06-08 19:02

The source code of add_comment.php seems to suggest (I'm new to PHP) that Gallery will take the user's name from their log in to fill in the name/email form field.

BUT

With my Gallery 1.3.3 install (and also the the one at Open CMS.org) this does not happen...

Should it work this way? If not is there an easy way to make it work? I'd like to lock it out all together with a hidden form field so that users can't use names different than their login's...

thanks for any help!

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 314
Posted: Sun, 2003-06-08 23:10

It is supposed to work like in your install, people can enter anything in the username field for comments.

However, in this thread there's a hack so only logged in users can add comments.

I just realised that wasn't exactly what you're looking for, although it might help. You'd have to modify add_comment.php slightly so that Gallery uses the username of the current user. A patch file to do this is added as an attachment.

 
chad

Joined: 2003-01-08
Posts: 4
Posted: Tue, 2003-06-10 09:41

Thank so much for the code! It works perfectly! Now I'm going to study what you did, so hopefully I can improve my understanding of php and also contribute back to the Gallery effort...

thanks again!