%@ page session="false"
import="org.apache.roller.pojos.WebsiteData,
org.apache.roller.ui.core.RollerRequest,
org.apache.roller.util.DateUtil,
java.text.DateFormat,
java.util.Date,
java.util.Locale,
java.util.TimeZone"
%><%
String msg = "You are not logged in.";
HttpSession session = request.getSession(false);
if (session != null)
{
RollerRequest rreq = RollerRequest.getRollerRequest(request);
if (rreq != null)
{
try
{
WebsiteData website = rreq.getWebsite();
if (website != null)
{
Date creationTime = new Date( session.getCreationTime() );
Date accessedTime = new Date( session.getLastAccessedTime() );
DateFormat sdf = DateFormat.getDateTimeInstance(
DateFormat.MEDIUM, DateFormat.FULL, website.getLocaleInstance() );
String creationStr = sdf.format( creationTime );
String accessedStr = sdf.format( accessedTime );
msg = "You have been logged in since " + creationStr + ". ";
msg += "Last access was at " + accessedStr + ".";
}
}
catch (Exception e)
{
msg = "You are currently logged in.";
}
}
}
%><%= msg %>