From 421129d7a8287e1666b41d35b811659cc3bbb4fe Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 2 Feb 2009 19:18:43 +0000 Subject: Resolve Trac Ticket #32 --- modules/comment/controllers/comments.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'modules/comment/controllers') diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index d04ba60c..b4d7d24a 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -80,10 +80,18 @@ class Comments_Controller extends REST_Controller { $form->add_comment->email->value, $form->add_comment->url->value); - $form->add_comment->inputs["name"]->value(""); + $active = user::active(); + if ($active->guest) { + $form->add_comment->inputs["name"]->value(""); + $form->add_comment->email->value(""); + $form->add_comment->url->value(""); + } else { + $form->add_comment->inputs["name"]->value($active->full_name); + $form->add_comment->email->value($active->email); + $form->add_comment->url->value($active->url); + } + $form->add_comment->text->value(""); - $form->add_comment->email->value(""); - $form->add_comment->url->value(""); print json_encode( array("result" => "success", "resource" => ($comment->state == "published" -- cgit v1.2.3