[Ils-source] r1461 - trunk/styles/FarmersMonthly

dominick at crosswire.org dominick at crosswire.org
Mon May 16 17:20:24 MST 2016


Author: dominick
Date: 2016-05-16 17:20:24 -0700 (Mon, 16 May 2016)
New Revision: 1461

Added:
   trunk/styles/FarmersMonthly/certificate.jsp
   trunk/styles/FarmersMonthly/header.jsp
   trunk/styles/FarmersMonthly/login.jsp
Log:
Added "login.jsp", "certificate.jsp", and "header.jsp" to custom style folder. Also, modified logo size in all three files.


Added: trunk/styles/FarmersMonthly/certificate.jsp
===================================================================
--- trunk/styles/FarmersMonthly/certificate.jsp	                        (rev 0)
+++ trunk/styles/FarmersMonthly/certificate.jsp	2016-05-17 00:20:24 UTC (rev 1461)
@@ -0,0 +1,203 @@
+<%@ page
+    language="java"
+    contentType="text/html;charset=utf-8"
+%>
+<%@ page import="com.resolutions.ils.*" %>
+<%@ page import="com.resolutions.ils.data.*" %>
+<%@ page import="java.util.Vector" %>
+<%@ page import="java.util.Date" %>
+<%@ page import="java.io.File" %>
+<%@ page import="java.net.URL" %>
+<%@ page import="java.text.SimpleDateFormat" %>
+
+<%
+    ILSSession ilsSession = (ILSSession)session.getAttribute("ilsSession");
+    if (ilsSession == null) {
+        out.print("<html><head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=login.jsp\"></head></html>");
+        return;
+    }
+    int caID = -1;
+    try {
+        caID = Integer.parseInt(request.getParameter("ca"));
+    }
+    catch (Exception e) {}
+
+    if (caID < 0) {
+        out.print("<html><body><h1>Invalid Request</h1></body></html>");
+        return;
+    }
+    CourseAttempt ca = CourseAttempt.getCourseAttempt(ilsSession, caID);
+    Course cc = Course.getCourse(ilsSession, ca.getCourseAttemptCourseID());
+    UserProfile up = UserProfile.getUserProfile(ilsSession, ca.getCourseAttemptUserProfileID());
+
+    SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
+
+%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Untitled Document</title>
+
+<style type="text/css" media="print">
+<!--
+.noprint {
+     display:none;
+};
+-->
+</style>
+
+<style type="text/css">
+<!--
+.cert_text {
+    font-family: Georgia, "Times New Roman", Times, serif;
+    font-size: 34px;
+    color: #333333;
+    text-align: center;
+    border-bottom-width: thin;
+    border-bottom-style: solid;
+    border-bottom-color: #CCCCCC;
+    font-style: oblique;
+    border-top-width: thin;
+    border-top-style: solid;
+    border-top-color: #CCCCCC;
+    background-color: #F4F4F4;
+}
+.text {
+    font-family: Georgia, "Times New Roman", Times, serif;
+    font-size: 14px;
+    font-style: normal;
+    color: #333333;
+    text-align: center;
+    padding: 15px;
+}
+.nametxt {
+    font-family: Georgia, "Times New Roman", Times, serif;
+    font-style: normal;
+    line-height: 25px;
+    text-transform: uppercase;
+    color: #333333;
+    text-align: center;
+    font-weight: bold;
+    font-size: 18px;
+}
+.coursetxt {
+    font-family: Georgia, "Times New Roman", Times, serif;
+    font-style: normal;
+    line-height: 25px;
+    text-transform: uppercase;
+    color: #333333;
+    text-align: center;
+    font-weight: bold;
+    font-size: 16px;
+}
+.tableoutline {
+    border: thin solid ##333333;
+    background-repeat: repeat;
+}
+.sigline {
+    border-bottom-width: thin;
+    border-bottom-style: solid;
+    border-bottom-color: #999999;
+}
+.siglinetxt {
+    font-family: Georgia, "Times New Roman", Times, serif;
+    font-size: 10px;
+    text-transform: uppercase;
+    color: #333333;
+    text-align: center;
+}
+.formbtn {
+	font-family: Arial, Helvetica, sans-serif;
+	font-size: 12px;
+	text-transform: none;
+	color: #666666;
+	padding: 4px 4px 8px;
+	font-weight: bold;
+	text-decoration: none;
+	border: none;
+}
+
+.formbtn:hover {
+	text-decoration: underline;
+}
+-->
+</style>
+</head>
+
+<body>
+
+<div class="noprint">
+    <table width="100%" border="0">
+      <tr>
+        <td width="75%"><div align="right"><a href="javascript:void(window.print())" target="_top"><img border="0" src="images/print_btn.gif" width="24" height="24" alt=""/></a></div></td>
+        <td width="15%"><a class="formbtn" href="javascript:void(window.print())" target="_top">Print Certificate </a></td>
+      </tr>
+    </table>
+</div>
+
+<table width="600" border="0" align="center">
+  <tr>
+    <td class="tableoutline"><table width="100%" border="0" cellspacing="1">
+      <tr>
+        <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="1" class="tableoutline">
+            <tr>
+              <td colspan="2" bgcolor="#283C7A">&nbsp;</td>
+            </tr>
+            <tr>
+              <td colspan="2" class="cert_text">Certificate of Completion </td>
+            </tr>
+            <tr>
+              <td colspan="2" class="text">This Certifies that </td>
+            </tr>
+            <tr>
+              <td colspan="2" class="nametxt"><%=up.getUserProfileFirstName() %> <%=up.getUserProfileLastName()%></td>
+            </tr>
+            <tr>
+              <td colspan="2" class="text">has successfully completed the following course </td>
+            </tr>
+            <tr>
+              <td colspan="2" class="coursetxt"><%=cc.getCourseName() %></td>
+            </tr>
+            <tr>
+              <td colspan="2" class="text">on</td>
+            </tr>
+            <tr>
+              <td colspan="2" class="coursetxt"><%= ca.getCourseAttemptCompleteDate() != null ? df.format(ca.getCourseAttemptCompleteDate()) : "" %></td>
+            </tr>
+            <tr>
+              <td colspan="2" class="coursetxt">&nbsp;</td>
+            </tr>
+            <tr>
+              <td width="50%"><table width="250" border="0" align="center" cellspacing="1">
+                <tr>
+                  <td class="sigline">&nbsp;</td>
+                </tr>
+                <tr>
+                  <td class="siglinetxt">Signature</td>
+                </tr>
+              </table></td>
+              <td width="50%"><div align="center">
+                <table width="250" border="0" cellspacing="1">
+                    <tr>
+                      <td class="sigline">&nbsp;</td>
+                    </tr>
+                    <tr>
+                      <td class="siglinetxt">Title</td>
+                    </tr>
+                    </table>
+              </div></td>
+            </tr>
+            <tr>
+              <td colspan="2" align="right"><img src="<%=ilsSession.getCurrentCompany().getCompanyLogoURL()%>" alt="Company Logo" width="250" height="70" /></td>
+            </tr>
+            <tr>
+              <td colspan="2" align="right" bgcolor="#283C7A">&nbsp;</td>
+            </tr>
+        </table></td>
+      </tr>
+    </table></td>
+  </tr>
+</table>
+</body>
+</html>

Added: trunk/styles/FarmersMonthly/header.jsp
===================================================================
--- trunk/styles/FarmersMonthly/header.jsp	                        (rev 0)
+++ trunk/styles/FarmersMonthly/header.jsp	2016-05-17 00:20:24 UTC (rev 1461)
@@ -0,0 +1,46 @@
+<%@ taglib uri="/META-INF/crosswire-i18n.tld" prefix="t" %>
+
+<t:pagestart />
+
+<%
+    response.setHeader("Cache-Control","no-cache"); 
+    response.setHeader("Pragma","no-cache"); 
+    response.setDateHeader ("Expires", 0);
+%>
+
+<script type="text/javascript">
+<!--
+function logoff() {
+     if (confirm("Are you sure you want to logoff?")) {
+          window.location = "login.jsp?action=logoff";
+     }
+     return 0;
+}
+// -->
+</script>
+
+<div id="pageHeaderContainer">
+
+ <div id="pageHeaderLogo">
+	 <img src="<%=ilsSession.getCurrentCompany().getCompanyLogoURL()%>" width="250" height="70" alt=""/>
+ </div>
+ <div id="pageHeaderBtns">
+<% if (user.getUserProfileAccessLevel() > UserProfile.ACCESS_ANONYMOUS) { %>
+	<a href="#" onclick="logoff();"><img src="images/logoff_btn.gif" alt="logoff" style="border:0;margin:0;padding:0;"/></a>
+<% } %>
+	<a href="employee.jsp"><img src="images/home_btn.jpg" alt="Home" width="24" height="24" style="border:0;"/></a>
+	<a href="#" onclick="ps('Need Help?  Contact <%=ilsSession.getCurrentCompany().getCompanyAdminContactName()%> at <%=ilsSession.getCurrentCompany().getCompanyAdminContactPhone()%> or &lt;a href=mailto:<%=ilsSession.getCurrentCompany().getCompanyAdminContactEMail()%>&gt;<%=ilsSession.getCurrentCompany().getCompanyAdminContactEMail()%>&lt;a/&gt;','1');">
+		<img style="border:0;" src="images/contact_btn.jpg" width="24" height="24" alt="Contact"/>
+	</a>
+	<a href="#" onclick="window.open('help/help_<%= (user.getUserProfileAccessLevel() > UserProfile.ACCESS_MANAGER) ? "admin.jsp" : (user.getUserProfileAccessLevel() == UserProfile.ACCESS_MANAGER) ? "manager.jsp" : "user.jsp" %>','Help','width=800,height=500');return false;">
+		<img src="images/help_btn.jpg" style="border:0;" alt="Help" width="24" height="24" />
+	</a>
+ </div>			  
+<div id="pageHeaderText">
+<% if (user.getUserProfileAccessLevel() > UserProfile.ACCESS_ANONYMOUS) { %>
+ Welcome <%=user.getUserProfileFirstName()%> <%=user.getUserProfileLastName()%> <br />
+ <%= user.getUserProfileEmployeeTitleName() + ((user.getUserProfileCity()!=null)?((user.getUserProfileEmployeeTitleName().length() > 0 ?", ":"") + user.getUserProfileCity()):"")%><br/><span class="loggedinTop">Logged in as:<%=user.getUserProfileNum()%></span>
+<% } %>
+</div>				  				
+</div>
+  

Added: trunk/styles/FarmersMonthly/login.jsp
===================================================================
--- trunk/styles/FarmersMonthly/login.jsp	                        (rev 0)
+++ trunk/styles/FarmersMonthly/login.jsp	2016-05-17 00:20:24 UTC (rev 1461)
@@ -0,0 +1,242 @@
+<%@ page
+    language="java"
+    contentType="text/html;charset=utf-8"
+%>
+<%@ page import="com.resolutions.ils.*" %>
+<%@ page import="com.resolutions.ils.data.*" %>
+<%@ page import="java.net.Authenticator"%>
+<%@ page import="java.net.PasswordAuthentication"%>
+<%@ page import="java.net.URL"%>
+<%@ page import="java.net.URLConnection"%>
+<%@ page import="java.net.URLEncoder"%>
+<%@ page import="java.io.DataOutputStream"%>
+<%@ page import="java.io.BufferedReader"%>
+<%@ page import="java.io.InputStreamReader"%>
+<%@ page import="java.util.Properties"%>
+<%@ page import="org.apache.log4j.Logger" %>
+
+<%
+    String requestURL = request.getRequestURL().toString() + "?" + request.getQueryString();
+    String co = com.resolutions.ils.Utils.getCompanyFromConfig(session, requestURL);
+//out.print(requestURL + co+"<br/>");
+    if (co != null) {
+        session.setAttribute("initURL", requestURL);
+    }
+    String initURL = (String) session.getAttribute("initURL");
+//out.print(initURL +"<br/>");
+    if (co == null) co = com.resolutions.ils.Utils.getSysConfig(session).getProperty("Company", null);
+//out.print("sysConfig " + co+"<br/>");
+    if (co == null) co = request.getParameter("co");
+//out.print("?co=" + co+"<br/>");
+    if (co != null) session.setAttribute("co", co);
+    co = (String) session.getAttribute("co");
+    Company company = Company.getCompany((co != null) ? Integer.parseInt(co):1);
+//out.print(co);
+
+    Properties sysConfig = Utils.getSysConfig(session.getServletContext(), company.getCompanyID());
+System.out.println(sysConfig);
+    boolean emailNotice = "on".equals(sysConfig.getProperty("EmailEnableRecoverPassUser", "off"));
+    boolean selfReg = "on".equals(sysConfig.getProperty("SREnable", "off"));
+
+    String action = request.getParameter("action");
+    if ("logoff".equals(action)) {
+        session.invalidate();
+        response.sendRedirect(((initURL == null)?(request.getRequestURI() + "?co="+company.getCompanyID()):initURL));
+        return;
+    }
+    String errorMsg = request.getParameter("m");
+    if (errorMsg == null) errorMsg = "";
+    if ("retrievePW".equals(action)) {
+	    if (emailNotice) {
+	        String email = request.getParameter("retrievePWEmail");
+	        UserProfile.retrievePassword(session, company, email);
+	        errorMsg = "If the email you provided is registered, credentials have been sent.";
+	    }
+    }
+	ILSSession ilsSession = null;
+	String userID = request.getParameter("userID");
+	String remoteAddr = request.getRemoteAddr();
+	Logger eventsLogger = Logger.getLogger("EVENTS");
+    if (userID != null) {
+        String userPw = request.getParameter("userPw");
+        if ("admin".equals(userID) || !"on".equals(Utils.getSysConfig(session.getServletContext(), company.getCompanyID()).getProperty("AlternativeLoginValidationEnable", "off"))) {
+	        // internal validation
+	        ilsSession = ILSSession.login(company.getCompanyName(), userID, userPw);
+        }
+        else {
+        	ilsSession = performAltValidation(company.getCompanyName(), userID, userPw, Utils.getSysConfig(session.getServletContext(), company.getCompanyID()));
+        }
+        if (ilsSession == null) {
+        	errorMsg = "Your sign in information is not valid. Please try again.";
+		eventsLogger.info("Failed Primary Login Attempt, User: " + userID + "; from: " + remoteAddr);
+        }
+        else if (!ilsSession.getCurrentUserProfile().isSecondaryValidationOverride() && !"admin".equals(userID) && "on".equals(Utils.getSysConfig(session.getServletContext(), company.getCompanyID()).getProperty("SecondaryLoginValidationEnable", "off"))) {
+                String ipExceptions = Utils.getSysConfig(session).getProperty("SecondaryLoginValidationIPExceptions", "");
+                boolean match = false;
+                for (String p : ipExceptions.split("\n")) {
+                        p = p.trim();
+                        if (p.length() < 1) continue;
+                                match = (p.endsWith("*"))
+                                        ? remoteAddr.startsWith((p.substring(0,p.length()-1)))
+                                        : remoteAddr.equals(p);
+                        if (match) break;
+                }
+                if (!match) {
+                        session.setAttribute("preliminaryILSSession", ilsSession);
+                        String redirectURL = Utils.getSysConfig(session.getServletContext(), company.getCompanyID()).getProperty("SecondaryLoginValidationURL", "");
+                        out.print("<html><head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL="+redirectURL+"\"></head></html>");
+                        return;
+                }
+        }
+        session.setAttribute("ilsSession", ilsSession);
+        if (ilsSession != null) eventsLogger.info("Successful Login, User: " + ilsSession.getCurrentUserProfile().getUserProfileNum() + "; from: " + remoteAddr);
+    }
+    ilsSession = (ILSSession)session.getAttribute("ilsSession");
+    if (ilsSession != null) {
+        out.print("<html><head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=employee.jsp\"></head></html>");
+        return;
+    }
+%>
+
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title><%= company.getCompanyName() %> eLearning Portal</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<link href="lms_style.css" rel="stylesheet" type="text/css">
+<script type="text/javascript" src="crosswire.js"></script>
+<script type="text/javascript">
+
+function retrievePW() {
+	<% if (emailNotice) { %>
+	inputBox("To recover your login credentials, contact <br/><%=company.getCompanyAdminContactName()%> at <%=company.getCompanyAdminContactPhone()%> <br/>or <a href=mailto:<%=company.getCompanyAdminContactEMail()%>><%=company.getCompanyAdminContactEMail()%></a> <br/>or please provide your registered email address<br/>", 3, 80, 1, 'retrievePWComplete');
+	<% } else { %>
+	ps('Forgot your password?  Contact <%=company.getCompanyAdminContactName()%> at <%=company.getCompanyAdminContactPhone()%> or <a href=mailto:<%=company.getCompanyAdminContactEMail()%>><%=company.getCompanyAdminContactEMail()%></a>','1');
+	<% } %>
+}
+
+function retrievePWComplete(resultObject) {
+	email = resultObject.value;
+	document.getElementById('retrievePWEmail').value=email;
+	if (email.length > 0) {
+		document.retrievePWForm.submit();
+	}
+}
+
+</script>
+</head>
+
+<body style="margin-top:75px; text-align:left;" onLoad="init();">
+<div style="width:527px; margin-left:30%;">
+<div id="loginHeader">
+<img src="<%= company.getCompanyLogoURL() %>" width="250" height="70" alt="Company logo"></div>
+
+<div id="loginContainer">
+  <form  name="login" method="post" action="<%= (initURL == null)?"login.jsp":initURL %>">
+                <table cellpadding="0" cellspacing="0" id="tableFormLogin">
+                <tr><th>Login</th></tr>
+        <tr>
+          <td valign="top">
+        
+            <table  id="tableLogData">
+              <tr>
+                <td class="formHeadings">User ID:</td>
+                <td><input class="coursetxt" id="userID" name="userID" type="text" value="" size="30"/></td>
+              </tr>
+              <tr>
+                <td class="formHeadings">Password:</td>
+                <td><input class="coursetxt" id="userPW" name="userPw" type="password" value="" size="30"/></td>
+              </tr>
+              <tr>
+                <td>&nbsp;</td>
+                <td style="white-space: nowrap;">
+<%
+if (selfReg) {
+%>
+                <span><a href="selfregistration.jsp" class="formButtons">Create Account</a></span>
+<%
+}
+%>
+                <span style="float:right; margin: 0px 5px 0px 0px;"><a href="#" class="formButtons" onClick="retrievePW();">Forgot Password</a></span>
+                </td>
+              </tr>
+              <tr>
+                <td>&nbsp;</td>
+                <td><input name="GO2" value="GO" type="image" src="images/login_btn.gif" width="66" height="24">
+                    <input name="clear2" value="clear" type="image" src="images/cancel_btn.gif" /></td>
+              </tr>
+              <tr>
+                <td colspan="2"><span class="instructiontxt"><%= errorMsg %></span></td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+      </table>
+    </form>
+<div id="copyright" style="width:100%;">
+<%= company.getCompanyCopyright() %>
+</div>
+</div>
+
+<div style="visibility:hidden; display:none">
+<form name="retrievePWForm" method="post" action="<%= (initURL == null)?"login.jsp":initURL %>">
+		<input type="hidden" name="action" value="retrievePW"/>
+		<input type="hidden" id="retrievePWEmail" name="retrievePWEmail" value=""/>
+</form>
+</div>
+<script type="text/javascript">
+
+function init() {
+	document.getElementById('userID').select();
+	document.getElementById('userID').focus();
+}
+</script>
+
+</body>
+</html>
+<%!
+private ILSSession performAltValidation(String companyName, String userID, String userPw, java.util.Properties sysConfig) {
+		try {
+	    	URL url = new URL(sysConfig.getProperty("AlternativeLoginValidationURL"));
+	
+	    	URLConnection urlConn = url.openConnection();
+	    	urlConn.setDoInput(true);
+	    	urlConn.setDoOutput(true);
+	    	urlConn.setUseCaches(false);
+	    	urlConn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+	    	DataOutputStream outStream = new DataOutputStream(urlConn.getOutputStream());
+	
+	    	StringBuffer content = new StringBuffer();
+	
+	    	content.append("ID=").append(URLEncoder.encode(userID, "UTF-8"));
+	    	content.append("&PW=").append(URLEncoder.encode(userPw, "UTF-8"));
+	
+	    	outStream.writeBytes(content.toString());
+	    	outStream.flush();
+	    	outStream.close();
+	
+	    	BufferedReader rd = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
+	
+	    	StringBuffer responseBuffer = new StringBuffer();
+	    	String line;
+	    	while ((line = rd.readLine()) != null) {
+	    		responseBuffer.append(line + "\n");
+	    	}
+	    	String response = responseBuffer.toString().trim();
+	    	outStream.close();
+	    	rd.close();
+	    	int id = -1; try { id = Integer.parseInt(response); } catch (Exception e) {}
+	    	if (id > -1) {
+		    	String idPrefix = sysConfig.getProperty("AlternativeLoginIDPrefix");
+		    	String altLocalPassword = sysConfig.getProperty("AlternativeLoginLocalPassword");
+	        	return ILSSession.login(companyName, idPrefix+Integer.toString(id), altLocalPassword);
+	    	}
+	    	System.out.println(response);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	
+	return null;
+}
+%>




More information about the Ils-source mailing list