[wp-hackers] Forget Commenter's Info
Carthik Sharma
carthik at gmail.com
Thu Oct 14 21:33:14 UTC 2004
Mark,
You could file a bug report for a feature improvement, so it doesn't
get drowned in the general flow of conversation in this list.
Carthik.
On Mon, 11 Oct 2004 23:41:19 -0400, Mark Jaquith
<mark.wordpress at txfx.net> wrote:
> I wrote this hack for an optional "forget_cookie" option in the comments
> form that will prevent the commenter's info from being saved to a cookie
> (for public computer situations). I also wrote a function to manually
> forget a user's info (without submitting a comment) in the case that a
> user sees that their info has been saved and wants to get rid of it.
> The first part is about 4 extra lines of code in wp-comments-post.php
>
> Carthik thought it might be worth putting in the core, but honestly I
> kind of forgot about it until now.
>
> http://www.scriptygoddess.com/archives/2004/06/29/forget-user-info/
>
> Included is a patch for current CVS with slightly updated code (using
> COOKIEPATH instead of $cookiepath, mostly).
>
>
> Index: wp-comments-post.php
> ===================================================================
> RCS file: /cvsroot/cafelog/wordpress/wp-comments-post.php,v
> retrieving revision 1.19
> diff -u -r1.19 wp-comments-post.php
> --- wp-comments-post.php 11 Oct 2004 22:07:09 -0000 1.19
> +++ wp-comments-post.php 12 Oct 2004 03:38:49 -0000
> @@ -87,9 +87,15 @@
> wp_notify_postauthor($comment_ID, 'comment');
> }
>
> +if($_POST['forget_cookie'] == 'forget'){
> +setcookie('comment_author_' . COOKIEHASH, '', time()-60000, COOKIEPATH);
> +setcookie('comment_author_email_' . COOKIEHASH, '', time()-60000, COOKIEPATH);
> +setcookie('comment_author_url_' . COOKIEHASH, '', time()-60000, COOKIEPATH);
> +} else {
> setcookie('comment_author_' . COOKIEHASH, stripslashes($author), time() + 30000000, COOKIEPATH);
> setcookie('comment_author_email_' . COOKIEHASH, stripslashes($email), time() + 30000000, COOKIEPATH);
> setcookie('comment_author_url_' . COOKIEHASH, stripslashes($url), time() + 30000000, COOKIEPATH);
> +}
>
> header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
> header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
>
>
> _______________________________________________
> hackers mailing list
> hackers at wordpress.org
> http://wordpress.org/mailman/listinfo/hackers_wordpress.org
>
>
>
--
When nothing is done, nothing is left undone -- 老子 Lǎozi
University of Central Florida
<a href="http://www.spreadfirefox.com/?q=affiliates&id=2904&t=1">Get
Firefox!</a>
Homepage: http://carthik.net
More information about the hackers
mailing list