[opencms-dev] Correct class name for version 5.0.1 - org.opencms.security (2)

James jim at futurate.com
Tue Nov 2 11:59:28 CET 2004


Hi, sorry about the last mail (not sure what happened there!)

 

I got this login form code from Jeff Greer on this list.

 

 

<%@ page session="true" %>
<%@ page
import="java.util.*,com.opencms.core.*,com.opencms.flex.jsp.*,com.opencms.fi
le.*" %>
<%@ taglib prefix="cms" uri="HYPERLINK
"http://www.opencms.org/taglib/cms%22"http://www.opencms.org/taglib/cms" %>
 
<%
        CmsJspActionElement cms = new CmsJspActionElement(pageContext,
request, response);
        CmsObject cmso = cms.getCmsObject();
 
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        String logout = request.getParameter("logout");
        String login = request.getParameter("login");
 
        if("logout".equals(logout))
        {
               session.invalidate();
               cmso.loginUser("Guest", "");
               cms = new CmsJspActionElement(pageContext, request,
response);
        }
        else if("login".equals(login))
        {
               try
               {
                       cmso.loginUser(username, password);
                       cms = new CmsJspActionElement(pageContext, request,
response);
               }
               catch(org.opencms.security.CmsSecurityException e)
               {
                       out.println("<script
type=\"javascript\">alert(\"Login failed\n\" + e.getMessage());</script>");
               }
        }
 
        out.println("<p align=\"center\" class=\"login\">Member ID: " +
cms.user("name") + "</p>");
 
        String form = "<form method=\"POST\">";
 
        if(cms.user("name").equals("Guest"))
        {
               form += "<table class=\"login\"><tr><td align=\"right\">" +
                       "<label for=\"username\">Member ID:</label><br>" +
                       "<input type=\"text\" id=\"username\"
name=\"username\" size=\"9\"><br>" +
                       "<label for=\"username\">Password:</label><br>" +
                       "<input type=\"password\" id=\"password\"
name=\"password\" size=\"9\">" +
                       "</td></tr><tr><td align=\"right\">" +
                       "<input type=\"submit\" name=\"login\"
value=\"login\"></td></tr></table>";
        }
        else
        {
               form += "<input type=\"submit\" name=\"logout\"
value=\"logout\">";
        }
        form += "</form>";
        out.println(form);
%>

 

 

I’ve changed the imported classes from org to com, etc

I’m trying to get it to work in OpenCms version 5.0.1 but get the error:

 

 

Generated servlet error:

 

    [javac] Compiling 1 source file

 

 

 

C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\opencms\WEB-INF\jsp\offline\system\modules\com
.voluntary_matters.site\elements\login_element_jsp.java:70: package
org.opencms.security does not exist

 

                        catch(org.opencms.security.CmsSecurityException e)

 

                                          ^

 

1 error

 

 

Can anyone help?

cheers


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.786 / Virus Database: 532 - Release Date: 29/10/2004
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20041102/4e6f4f3d/attachment.htm>


More information about the opencms-dev mailing list