<form method="post"
action="http://blog.merck.com/roller//stevelihn/entry/google_released_we
b_toolkit_enabling" focus="name"
name="form" onsubmit="fixURL(this); return
validateComments(this)">
...
var author = getCookie("commentAuthor");
var email = getCookie("commentEmail");
var url = getCookie("commentUrl");
// check each field - IE will render "null"
if (author) {
document.forms['commentForm'].name.value = author;
}
if (email) {
document.forms['commentForm'].email.value = email;
}
if (url) {
document.forms['commentForm'].url.value = url;
}
--
A few question on this segment of HTML. First, is it possible to set
commentAuthor Cookie from commentAuthenticator's getHTML? If yes, how?
There is no response object from that method.
Second, where is commentForm? The form name seems to be "form"? Is this
a bug?
Steve Lihn
-----Original Message-----
From: Dave [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 13, 2006 5:38 PM
To: [email protected]
Subject: Re: Is it possible to authenticate the commenters
On 12/13/06, Lihn, Steve <[EMAIL PROTECTED]> wrote:
> We are encountering an enterprise issue with the commenters being
> anonymous. Is it possible to authenticate the commenters, say via
LDAP, in order
> for that person to write comments?
>
> I know this is stretching Roller very far. Any help is appreciated.
Yes, you'll need to do a little Java coding, but it is possible to
implement your own comment authenticator. Here are the steps:
1) Implement the CommentAuthenticator interface below and in it,
check for LDAP login.
2) Put your implementation into the Roller classpath (e.g. in a jar in
WEB-INF/lib)
3) In your roller-custom.properties file override the property
'comment.authenticator.classname' and set it to your classname.
And here's the interface CommentAuthenticator.java:
package org.apache.roller.ui.rendering.util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.roller.pojos.CommentData;
import org.apache.velocity.context.Context;
/**
* Interface for comment authentication plugin.
*/
public interface CommentAuthenticator {
/**
* Plugin should write out HTML for the form fields and other UI
elements
* needed to display the comment authentication widget.
* @param request comment form request object
*/
public String getHtml(HttpServletRequest request);
/**
* Plugin should return true only if comment posting passes the
* authentication test.
* @param request comment posting request object
* @return true if authentication passed, false otherwise
*/
public boolean authenticate(HttpServletRequest request);
}
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and then
delete it from your system.
------------------------------------------------------------------------------