From da4bb95df8994df98ab30d417f138c080916ee0e Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 8 Jun 2008 14:23:06 +0200 Subject: [PATCH] Prefill user information for posting comments. Signed-off-by: Florent Bruneau --- class.xorg.auth.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/class.xorg.auth.php b/class.xorg.auth.php index 08485bc..d593724 100644 --- a/class.xorg.auth.php +++ b/class.xorg.auth.php @@ -39,6 +39,15 @@ class xorgAuth extends dcAuth { $this->user_admin = ($_SESSION['auth-xorg-perms'] == 'admin'); parent::checkUser($this->user_id); $core->getUserBlogs(); + $this->setCommentCookie(); + } + } + + private function setCommentCookie() { + if (!isset($_COOKIE['comment_info_xorg']) || $_COOKIE['comment_info_xorg'] != $this->user_id) { + $cookie = $this->getInfo('user_displayname') . "\n" . $this->getInfo('user_email') . "\n" . $this->getInfo('user_url'); + setcookie('comment_info_xorg', $this->user_id, time() + 30 * 86400, '/'); + setrawcookie('comment_info', rawurlencode($cookie), time() + 30 * 86400, '/'); } } -- 2.1.4