[Ils-source] r1277 - trunk/webapp
scribe at crosswire.org
scribe at crosswire.org
Thu Dec 4 07:28:44 MST 2014
Author: scribe
Date: 2014-12-04 07:28:44 -0700 (Thu, 04 Dec 2014)
New Revision: 1277
Modified:
trunk/webapp/admin_systemmanagement.jsp
Log:
removed newlines
Modified: trunk/webapp/admin_systemmanagement.jsp
===================================================================
--- trunk/webapp/admin_systemmanagement.jsp 2014-12-04 14:24:44 UTC (rev 1276)
+++ trunk/webapp/admin_systemmanagement.jsp 2014-12-04 14:28:44 UTC (rev 1277)
@@ -1,1435 +1,1435 @@
-<?xml version="1.0" encoding="utf-8"?>
-<%@ page
- language="java"
- contentType="text/html;charset=utf-8"
-%>
-<%@ page trimDirectiveWhitespaces="true" %>
-<%@ page import="com.resolutions.ils.*" %>
-<%@ page import="com.resolutions.ils.data.*" %>
-<%@ page import="java.util.Vector" %>
-<%@ page import="java.util.Comparator" %>
-<%@ page import="java.util.Properties" %>
-<%@ page import="java.util.Date" %>
-<%@ page import="java.util.List" %>
-<%@ page import="java.io.File" %>
-<%@ page import="java.io.FileInputStream" %>
-<%@ page import="java.io.FileOutputStream" %>
-<%@ page import="java.net.URL" %>
-<%@ page import="java.text.SimpleDateFormat" %>
-<%@ page import="org.apache.commons.fileupload.*" %>
-<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>
-<%@ page import="org.apache.log4j.Logger" %>
-
-<%
- Logger logger = Logger.getLogger(this.getClass());
- Logger eventsLogger = Logger.getLogger("EVENTS");
-
- 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;
- }
-
- UserProfile user = ilsSession.getCurrentUserProfile();
- if ((user.getUserProfileAccessLevel() < UserProfile.ACCESS_ADMIN) && (!user.hasAccess(UserProfile.ACCESS_MODE_MENU_SYSTEM_MGMT))) {
- out.print("<html><body><h1>You do not have access to this feature</h1></body></html>");
- eventsLogger.info("Access denied to user ["+user.getUserProfileNum()+"]");
- return;
- }
-
- class EMailTemplate {
- String name;
-
- String defSubject;
- String currentEMailTemplateSubject;
- String emailTemplateSubject;
-
- String defBody;
- String currentEMailTemplateBody;
- String emailTemplateBody;
-
-
- EMailTemplate(String name, String defSubject, String defBody) { this.name = name; this.defSubject = defSubject; this.defBody = defBody; }
- }
-
- Vector<EMailTemplate> emailTemplates = new Vector<EMailTemplate>();
-
- // TODO: Changed these from using ordered number to instead letting us supply a 'properties file save' name
- // 0
- emailTemplates.add(new EMailTemplate("Recover Password/User Name", "Credentials",
- "Your credentials for your account at {CONAME}\n" +
- "User ID : {USERPRNUM}\n" +
- "Password: {USERPRPASSWD}\n\n"));
-
- // 1
- emailTemplates.add(new EMailTemplate("Change Password", "Password Changed",
- "Your password has just been changed at {SITEURL}.\n\n" +
- "Login Account: {USERPRNUM}\n\n" +
- "If you did not change this password, please contact your administrator "+
- "{ADMINCONTACTNAME} at {ADMINCONTACTPHONE}.\n\n"));
-
- // 2
- emailTemplates.add(new EMailTemplate("Student Pass/Fail", "Student {PASSEDFAILED}: {USERPRNUM}",
- "A student you manage {PASSEDFAILED} a course. Details:\n\n" +
- "Account: {USERPRNUM}\n" +
- "User : {USERPRFNAME} {USERPRLNAME}\n" +
- "Course : {COURSNAME}\n\n"));
-
- // 3
- emailTemplates.add(new EMailTemplate("Prior Due", "Pending Deadline",
- "You are assigned to take {COURSNAME} training which is due in less than {WARNDAYS}. " +
- "Please Log on to {SITEURL} to complete your training.\n\n" +
- "Login Account: {USERPRNUM}\n" +
- "Course Name : {COURSNAME}\n\n"));
-
- // 4
- emailTemplates.add(new EMailTemplate("Past Due", "Past Due",
- "You are assigned to take {COURSNAME} training which is more than {WARNDAYS} days past due. " +
- "Please Log on to {SITEURL} to complete your training.\n\n" +
- "Login Account: {USERPRNUM}\n" +
- "Course Name : {COURSNAME}\n\n"));
-
- // 5
- emailTemplates.add(new EMailTemplate("Assigned Retakes", "Assigned Retake Notice",
- "You have been reassigned to take {COURSNAME} training. " +
- "Please Log on to {SITEURL} to complete your training.\n\n" +
- "Login Account: {USERPRNUM}\n" +
- "Course Name : {COURSNAME}\n\n"));
-
- // 6
- emailTemplates.add(new EMailTemplate("Welcome Email", "Welcome to {CONAME}",
- "You have a new account at {CONAME}\n\n" +
- "Workgroup: {WORKGROUPNAME}\n" +
- "Role : {ROLENAME}\n\n" +
- "You can login to your account at {SITEURL} with the credentials: \n\n" +
- "User ID : {USERPRNUM}\n" +
- "Password: {USERPRPASSWD}\n\n"));
-
- Properties sysConfigProperties = Utils.getSysConfig(session);
- File sysConfigFile = new File(session.getServletContext().getRealPath("/WEB-INF/sysconfig."+ilsSession.getCompanyID()+".properties"));
- if (sysConfigProperties == null) {
- sysConfigProperties = new Properties();
- }
- if (!sysConfigFile.exists()) {
- sysConfigFile.createNewFile();
- }
-
- Properties loggerProperties = new Properties();
- loggerProperties.load(new FileInputStream(session.getServletContext().getRealPath("/WEB-INF/classes/log4j.properties")));
- String currentLogFileSize = loggerProperties.getProperty("log4j.appender.E.MaxFileSize");
- String currentLogFileName = loggerProperties.getProperty("log4j.appender.E.File");
- String currentSendMailServer = sysConfigProperties.getProperty("SendMailServer", "");
- String currentSendMailUser = sysConfigProperties.getProperty("SendMailUser", "");
- String currentSendMailPasswd = sysConfigProperties.getProperty("SendMailPasswd", "");
- String currentSendMailFrom = sysConfigProperties.getProperty("SendMailFrom", "");
- String currentSendMailSig = sysConfigProperties.getProperty("SendMailSig", "");
- String currentSiteURL = sysConfigProperties.getProperty("SiteURL", "");
- String currentEmailEnableWelcome = sysConfigProperties.getProperty("EmailEnableWelcome", "");
- String currentEmailEnableRecoverPassUser = sysConfigProperties.getProperty("EmailEnableRecoverPassUser", "");
- String currentEmailEnableAssignedRetakes = sysConfigProperties.getProperty("EmailEnableAssignedRetakes", "");
- String currentEmailEnableBeforeDue = sysConfigProperties.getProperty("EmailEnableBeforeDue", "");
- String currentEmailEnablePastDue = sysConfigProperties.getProperty("EmailEnablePastDue", "");
- String currentEmailBeforeDueDate1 = sysConfigProperties.getProperty("EmailBeforeDueDate1", "");
- String currentEmailBeforeDueDate2 = sysConfigProperties.getProperty("EmailBeforeDueDate2", "");
- String currentEmailPastDueDate1 = sysConfigProperties.getProperty("EmailPastDueDate1", "");
- String currentEmailPastDueDate2 = sysConfigProperties.getProperty("EmailPastDueDate2", "");
- String currentEmailEnableChangePassword = sysConfigProperties.getProperty("EmailEnableChangePassword", "");
- String currentEmailEnableStudentPassFail = sysConfigProperties.getProperty("EmailEnableStudentPassFail", "");
- String currentEmailEnableManagerSummaryReport = sysConfigProperties.getProperty("EmailEnableManagerSummaryReport", "");
- String currentEmailEnableUserEdit = sysConfigProperties.getProperty("EmailEnableUserEdit", "");
- String currentAPIEnable = sysConfigProperties.getProperty("APIEnable", "");
- String currentAPICallbackCourseComplete = sysConfigProperties.getProperty("APICallbackCourseComplete", "");
- String currentSREnable = sysConfigProperties.getProperty("SREnable", "");
- String currentIPEnable = sysConfigProperties.getProperty("IPEnable", "");
- String currentSecondaryLoginValidationEnable = sysConfigProperties.getProperty("SecondaryLoginValidationEnable", "");
- String currentSecondaryLoginValidationIPExceptions = sysConfigProperties.getProperty("SecondaryLoginValidationIPExceptions", "");
- String currentSRWGVal = sysConfigProperties.getProperty("SRWGVal", "");
- String currentIPPatVal = sysConfigProperties.getProperty("IPPatVal", "");
- String currentSRLengthVal = sysConfigProperties.getProperty("SRLengthVal", "");
- String currentAlternativeLoginValidationEnable = sysConfigProperties.getProperty("AlternativeLoginValidationEnable", "");
- String currentAlternativeLoginValidationURL = sysConfigProperties.getProperty("AlternativeLoginValidationURL", "");
- String currentAlternativeLoginIDPrefix = sysConfigProperties.getProperty("AlternativeLoginIDPrefix", "");
- String currentAlternativeLoginLocalPassword = sysConfigProperties.getProperty("AlternativeLoginLocalPassword", "");
- for (int i = 0; i < emailTemplates.size(); i++) {
- EMailTemplate t = emailTemplates.get(i);
- t.currentEMailTemplateSubject = sysConfigProperties.getProperty("EmailTemplate"+i+"Subject");
- t.currentEMailTemplateBody = sysConfigProperties.getProperty("EmailTemplate"+i+"Body");
- }
- try {
- int fStart = currentLogFileName.lastIndexOf('\\');
- if (fStart < 0) fStart = currentLogFileName.lastIndexOf('/');
- currentLogFileName = currentLogFileName.substring(0,fStart);
- }
- catch (Exception e) {}
- String currentLogFileKeep = loggerProperties.getProperty("log4j.appender.E.MaxBackupIndex");
- String currentLogFileLevel= loggerProperties.getProperty("log4j.rootLogger");
- if (currentLogFileLevel != null) currentLogFileLevel = currentLogFileLevel.substring(0, currentLogFileLevel.indexOf(','));
- if ((currentLogFileSize != null) && currentLogFileSize.toUpperCase().endsWith("KB")) currentLogFileSize = currentLogFileSize.substring(0, currentLogFileSize.length()-2);
-
- String statusMsg = "";
- String validError = "";
-
- Company current = null;
- SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
-
- try {
- current = Company.getCompany(ilsSession);
- }
- catch (Exception e) { logger.error(e, e); }
- String val = null;
-
- String action = request.getParameter("action");
- String name = request.getParameter("name");
- String copyright = request.getParameter("copyright");
- String adminname = request.getParameter("adminname");
- String adminemail = request.getParameter("adminemail");
- String adminphone = request.getParameter("adminphone");
- String logFileSize= request.getParameter("logFileSize");
- String logFileName= request.getParameter("logFileName");
- String logFileLevel= request.getParameter("logFileLevel");
- String logFileKeep = request.getParameter("logFileKeep");
- String sendMailServer = request.getParameter("sendMailServer");
- String sendMailUser = request.getParameter("sendMailUser");
- String sendMailPasswd = request.getParameter("sendMailPasswd");
- String sendMailFrom = request.getParameter("sendMailFrom");
- String sendMailSig = request.getParameter("sendMailSig");
- String siteURL = request.getParameter("siteURL");
- String emailEnableWelcome = request.getParameter("emailEnableWelcome");
- String emailEnableRecoverPassUser = request.getParameter("emailEnableRecoverPassUser");
- String emailEnableAssignedRetakes = request.getParameter("emailEnableAssignedRetakes");
- String emailEnableChangePassword = request.getParameter("emailEnableChangePassword");
- String emailEnableUserEdit = request.getParameter("emailEnableChangePassword");
- String emailEnableStudentPassFail = request.getParameter("emailEnableStudentPassFail");
- String emailEnableManagerSummaryReport = request.getParameter("emailEnableManagerSummaryReport");
- String emailEnableBeforeDue = request.getParameter("emailEnableBeforeDue");
- String emailEnablePastDue = request.getParameter("emailEnablePastDue");
- String emailBeforeDueDate1 = request.getParameter("emailBeforeDueDate1");
- String emailBeforeDueDate2 = request.getParameter("emailBeforeDueDate2");
- String emailPastDueDate1 = request.getParameter("emailPastDueDate1");
- String emailPastDueDate2 = request.getParameter("emailPastDueDate2");
- String apiEnable = request.getParameter("apiEnable");
- String apiCallbackCourseComplete = request.getParameter("apiCallbackCourseComplete");
- String srEnable = request.getParameter("srEnable");
- String srWGVal = request.getParameter("srWGVal");
- String srLengthVal = request.getParameter("srLengthVal");
- String secondaryLoginValidationEnable = request.getParameter("secondaryLoginValidationEnable");
- String secondaryLoginValidationIPExceptions = request.getParameter("secondaryLoginValidationIPExceptions");
- String ipEnable = request.getParameter("ipEnable");
- String ipPatVal = request.getParameter("ipPatVal");
- String alternativeLoginValidationEnable = request.getParameter("alternativeLoginValidationEnable");
- String alternativeLoginValidationURL = request.getParameter("alternativeLoginValidationURL");
- String alternativeLoginIDPrefix = request.getParameter("alternativeLoginIDPrefix");
- String alternativeLoginLocalPassword = request.getParameter("alternativeLoginLocalPassword");
- for (int i = 0; i < emailTemplates.size(); ++i) {
- EMailTemplate t = emailTemplates.get(i);
- t.emailTemplateSubject = request.getParameter("emailTemplate"+i+"Subject");
- t.emailTemplateBody = request.getParameter("emailTemplate"+i+"Body");
- }
-
- File upFile = null;
- try {
- DiskFileUpload fu = new DiskFileUpload();
- // maximum size before a FileUploadException will be thrown
- fu.setSizeMax(99000000);
- // maximum size that will be stored in memory
- fu.setSizeThreshold(4096);
- // the location for saving data that is larger than getSizeThreshold()
- fu.setRepositoryPath(session.getServletContext().getRealPath("tmp/"));
-
- List fileItems = fu.parseRequest(request);
- for (int i = 0; i < fileItems.size(); i++) {
- FileItem fi = (FileItem)fileItems.get(i);
- if (fi.isFormField()) {
- if ("action".equals(fi.getFieldName())) {
- action = fi.getString();
- }
- if ("name".equals(fi.getFieldName())) {
- name = fi.getString();
- }
- if ("copyright".equals(fi.getFieldName())) {
- copyright = fi.getString();
- }
- if ("adminname".equals(fi.getFieldName())) {
- adminname = fi.getString();
- }
- if ("adminemail".equals(fi.getFieldName())) {
- adminemail = fi.getString();
- }
- if ("adminphone".equals(fi.getFieldName())) {
- adminphone = fi.getString();
- }
- if ("logFileSize".equals(fi.getFieldName())) {
- logFileSize = fi.getString();
- }
- if ("logFileName".equals(fi.getFieldName())) {
- logFileName = fi.getString();
- }
- if ("logFileLevel".equals(fi.getFieldName())) {
- logFileLevel = fi.getString();
- }
- if ("logFileKeep".equals(fi.getFieldName())) {
- logFileKeep = fi.getString();
- }
- if ("sendMailServer".equals(fi.getFieldName())) {
- sendMailServer = fi.getString();
- }
- if ("sendMailUser".equals(fi.getFieldName())) {
- sendMailUser = fi.getString();
- }
- if ("sendMailPasswd".equals(fi.getFieldName())) {
- sendMailPasswd = fi.getString();
- }
- if ("sendMailFrom".equals(fi.getFieldName())) {
- sendMailFrom = fi.getString();
- }
- if ("sendMailSig".equals(fi.getFieldName())) {
- sendMailSig = fi.getString();
- }
- if ("siteURL".equals(fi.getFieldName())) {
- siteURL = fi.getString();
- }
- if ("emailEnableWelcome".equals(fi.getFieldName())) {
- emailEnableWelcome = fi.getString();
- }
- if ("emailEnableRecoverPassUser".equals(fi.getFieldName())) {
- emailEnableRecoverPassUser = fi.getString();
- }
- if ("emailEnableAssignedRetakes".equals(fi.getFieldName())) {
- emailEnableAssignedRetakes = fi.getString();
- }
- if ("emailEnableChangePassword".equals(fi.getFieldName())) {
- emailEnableChangePassword = fi.getString();
- }
- if ("emailEnableUserEdit".equals(fi.getFieldName())) {
- emailEnableUserEdit = fi.getString();
- }
- if ("emailEnableStudentPassFail".equals(fi.getFieldName())) {
- emailEnableStudentPassFail = fi.getString();
- }
- if ("emailEnableManagerSummaryReport".equals(fi.getFieldName())) {
- emailEnableManagerSummaryReport = fi.getString();
- }
- if ("emailEnableBeforeDue".equals(fi.getFieldName())) {
- emailEnableBeforeDue = fi.getString();
- }
- if ("emailEnablePastDue".equals(fi.getFieldName())) {
- emailEnablePastDue = fi.getString();
- }
- if ("emailBeforeDueDate1".equals(fi.getFieldName())) {
- emailBeforeDueDate1 = fi.getString();
- }
- if ("emailBeforeDueDate2".equals(fi.getFieldName())) {
- emailBeforeDueDate2 = fi.getString();
- }
- if ("emailPastDueDate1".equals(fi.getFieldName())) {
- emailPastDueDate1 = fi.getString();
- }
- if ("emailPastDueDate2".equals(fi.getFieldName())) {
- emailPastDueDate2 = fi.getString();
- }
- if ("apiEnable".equals(fi.getFieldName())) {
- apiEnable = fi.getString();
- }
- if ("apiCallbackCourseComplete".equals(fi.getFieldName())) {
- apiCallbackCourseComplete = fi.getString();
- }
- if ("srEnable".equals(fi.getFieldName())) {
- srEnable = fi.getString();
- }
- if ("secondaryLoginValidationIPExceptions".equals(fi.getFieldName())) {
- secondaryLoginValidationIPExceptions = fi.getString();
- }
- if ("secondaryLoginValidationEnable".equals(fi.getFieldName())) {
- secondaryLoginValidationEnable = fi.getString();
- }
- if ("ipEnable".equals(fi.getFieldName())) {
- ipEnable = fi.getString();
- }
- if ("ipPatVal".equals(fi.getFieldName())) {
- ipPatVal = fi.getString();
- }
- if ("srWGVal".equals(fi.getFieldName())) {
- srWGVal = fi.getString();
- }
- if ("srLengthVal".equals(fi.getFieldName())) {
- srLengthVal = fi.getString();
- }
- if ("alternativeLoginValidationEnable".equals(fi.getFieldName())) {
- alternativeLoginValidationEnable = fi.getString();
- }
- if ("alternativeLoginValidationURL".equals(fi.getFieldName())) {
- alternativeLoginValidationURL = fi.getString();
- }
- if ("alternativeLoginIDPrefix".equals(fi.getFieldName())) {
- alternativeLoginIDPrefix = fi.getString();
- }
- if ("alternativeLoginLocalPassword".equals(fi.getFieldName())) {
- alternativeLoginLocalPassword = fi.getString();
- }
- for (int j = 0; j < emailTemplates.size(); ++j) {
- if (("emailTemplate"+j+"Subject").equals(fi.getFieldName())) {
- emailTemplates.get(j).emailTemplateSubject = fi.getString();
- }
- if (("emailTemplate"+j+"Body").equals(fi.getFieldName())) {
- emailTemplates.get(j).emailTemplateBody = fi.getString();
- }
- }
- }
- else {
- // filename on the client
- String fileName = fi.getName();
- if ((fileName != null) && (fileName.length() > 1)) {
- int fStart = fileName.lastIndexOf('\\');
- if (fStart < 0) fStart = fileName.lastIndexOf('/');
- if (fStart > 0) fileName = fileName.substring(fStart+1);
- upFile = new File(session.getServletContext().getRealPath("images/companyLogo"+Integer.toString(current.getCompanyID())+fileName));
- fi.write(upFile);
- }
- }
- }
- }
- catch (Exception e) { } // ok, nothing to upload
-
- if ("Save".equals(action)) {
- boolean saveLog = false;
- boolean saveSysconfig = false;
- Company orig = (Company)current.clone();
- if (name != null) current.setCompanyName(name);
- if (copyright != null) current.setCompanyCopyright(copyright);
- if (adminname != null) current.setCompanyAdminContactName(adminname);
- if (adminemail != null) current.setCompanyAdminContactEMail(adminemail);
- if (adminphone != null) current.setCompanyAdminContactPhone(adminphone);
- if (logFileSize != null) {
- if (!logFileSize.equals(currentLogFileSize)) {
- saveLog = true;
- eventsLogger.info("Log Max File Size changed from " + currentLogFileSize + " to " + logFileSize + " by user: " + ilsSession.getCurrentUserProfile().getUserProfileNum());
- loggerProperties.setProperty("log4j.appender.E.MaxFileSize", logFileSize+"KB");
- loggerProperties.setProperty("log4j.appender.S.MaxFileSize", logFileSize+"KB");
- loggerProperties.setProperty("log4j.appender.A.MaxFileSize", logFileSize+"KB");
- currentLogFileSize = logFileSize;
- }
- }
- if (logFileName != null) {
- if (!logFileName.equals(currentLogFileName)) {
- File f = new File(logFileName);
- if (f.isDirectory()) {
- saveLog = true;
- eventsLogger.info("Log Folder changed from " + currentLogFileName + " to " + logFileName + " by user: " + ilsSession.getCurrentUserProfile().getUserProfileNum());
- File l = new File(f, "events.log");
- loggerProperties.setProperty("log4j.appender.E.File", l.getCanonicalPath());
- l = new File(f, "system.log");
- loggerProperties.setProperty("log4j.appender.S.File", l.getCanonicalPath());
- l = new File(f, "aicc.log");
- loggerProperties.setProperty("log4j.appender.A.File", l.getCanonicalPath());
- currentLogFileName = logFileName;
- }
- else {
- validError = "Log folder specified does not exist. Please supply a valid folder";
- }
- }
- }
- if (logFileKeep != null) {
- if (!logFileKeep.equals(currentLogFileKeep)) {
- saveLog = true;
- eventsLogger.info("Log Backups Kept changed from " + currentLogFileKeep + " to " + logFileKeep + " by user: " + ilsSession.getCurrentUserProfile().getUserProfileNum());
- loggerProperties.setProperty("log4j.appender.E.MaxBackupIndex", logFileKeep);
- loggerProperties.setProperty("log4j.appender.S.MaxBackupIndex", logFileKeep);
- loggerProperties.setProperty("log4j.appender.A.MaxBackupIndex", logFileKeep);
- currentLogFileKeep = logFileKeep;
- }
- }
- if (logFileLevel != null) {
- if (!logFileLevel.equals(currentLogFileLevel)) {
- saveLog = true;
- eventsLogger.info("Log Level changed from " + currentLogFileLevel + " to " + logFileLevel + " by user: " + ilsSession.getCurrentUserProfile().getUserProfileNum());
- loggerProperties.setProperty("log4j.rootLogger", logFileLevel+", stdout, S");
- currentLogFileLevel = logFileLevel;
- }
- }
- if (sendMailServer != null) {
- if (!sendMailServer.equals(currentSendMailServer)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("SendMailServer", sendMailServer);
- currentSendMailServer = sendMailServer;
- }
- }
- if (sendMailUser != null) {
- if (!sendMailUser.equals(currentSendMailUser)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("SendMailUser", sendMailUser);
- currentSendMailUser = sendMailUser;
- }
- }
- if (sendMailPasswd != null) {
- if (!sendMailPasswd.equals(currentSendMailPasswd)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("SendMailPasswd", sendMailPasswd);
- currentSendMailPasswd = sendMailPasswd;
- }
- }
- if (sendMailFrom != null) {
- if (!sendMailFrom.equals(currentSendMailFrom)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("SendMailFrom", sendMailFrom);
- currentSendMailFrom = sendMailFrom;
- }
- }
- if (sendMailSig != null) {
- if (!sendMailSig.equals(currentSendMailSig)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("SendMailSig", sendMailSig);
- currentSendMailSig = sendMailSig;
- }
- }
- if (siteURL != null) {
- if (!siteURL.equals(currentSiteURL)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("SiteURL", siteURL);
- currentSiteURL = siteURL;
- }
- }
- if (emailBeforeDueDate1 != null) {
- if (!emailBeforeDueDate1.equals(currentEmailBeforeDueDate1)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailBeforeDueDate1", emailBeforeDueDate1);
- currentEmailBeforeDueDate1 = emailBeforeDueDate1;
- }
- }
- if (emailBeforeDueDate2 != null) {
- if (!emailBeforeDueDate2.equals(currentEmailBeforeDueDate2)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailBeforeDueDate2", emailBeforeDueDate2);
- currentEmailBeforeDueDate2 = emailBeforeDueDate2;
- }
- }
- if (emailPastDueDate1 != null) {
- if (!emailPastDueDate1.equals(currentEmailPastDueDate1)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailPastDueDate1", emailPastDueDate1);
- currentEmailPastDueDate1 = emailPastDueDate1;
- }
- }
- if (emailPastDueDate2 != null) {
- if (!emailPastDueDate2.equals(currentEmailPastDueDate2)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailPastDueDate2", emailPastDueDate2);
- currentEmailPastDueDate2 = emailPastDueDate2;
- }
- }
- if (apiEnable == null) { apiEnable = "off"; }
- if (!apiEnable.equals(currentAPIEnable)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("APIEnable", apiEnable);
- currentAPIEnable = apiEnable;
- }
- if (apiCallbackCourseComplete != null) {
- if (!apiCallbackCourseComplete.equals(currentAPICallbackCourseComplete)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("APICallbackCourseComplete", apiCallbackCourseComplete);
- currentAPICallbackCourseComplete = apiCallbackCourseComplete;
- }
- }
- if (srEnable == null) { srEnable = "off"; }
- if (!srEnable.equals(currentSREnable)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("SREnable", srEnable);
- currentSREnable = srEnable;
- }
- if (ipEnable == null) { ipEnable = "off"; }
- if (!ipEnable.equals(currentIPEnable)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("IPEnable", ipEnable);
- currentIPEnable = ipEnable;
- }
- if (secondaryLoginValidationEnable == null) { secondaryLoginValidationEnable = "off"; }
- if (!secondaryLoginValidationEnable.equals(currentSecondaryLoginValidationEnable)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("SecondaryLoginValidationEnable", secondaryLoginValidationEnable);
- currentSecondaryLoginValidationEnable = secondaryLoginValidationEnable;
- }
- if (secondaryLoginValidationIPExceptions != null) {
- if (!secondaryLoginValidationIPExceptions.equals(currentSecondaryLoginValidationIPExceptions)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("SecondaryLoginValidationIPExceptions", secondaryLoginValidationIPExceptions);
- currentSecondaryLoginValidationIPExceptions = secondaryLoginValidationIPExceptions;
- }
- }
- if (ipPatVal != null) {
- if (!ipPatVal.equals(currentIPPatVal)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("IPPatVal", ipPatVal);
- currentIPPatVal = ipPatVal;
- }
- }
- if (srWGVal != null) {
- if (!srWGVal.equals(currentSRWGVal)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("SRWGVal", srWGVal);
- currentSRWGVal = srWGVal;
- }
- }
- if (srLengthVal != null) {
- if (!srLengthVal.equals(currentSRLengthVal)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("SRLengthVal", srLengthVal);
- currentSRLengthVal = srLengthVal;
- }
- }
- if (alternativeLoginValidationEnable == null) { alternativeLoginValidationEnable = "off"; }
- if (!alternativeLoginValidationEnable.equals(currentAlternativeLoginValidationEnable)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("AlternativeLoginValidationEnable", alternativeLoginValidationEnable);
- currentAlternativeLoginValidationEnable = alternativeLoginValidationEnable;
- }
- if (alternativeLoginValidationURL != null) {
- if (!alternativeLoginValidationURL.equals(currentAlternativeLoginValidationURL)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("AlternativeLoginValidationURL", alternativeLoginValidationURL);
- currentAlternativeLoginValidationURL = alternativeLoginValidationURL;
- }
- }
- if (alternativeLoginIDPrefix != null) {
- if (!alternativeLoginIDPrefix.equals(currentAlternativeLoginIDPrefix)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("AlternativeLoginIDPrefix", alternativeLoginIDPrefix);
- currentAlternativeLoginIDPrefix = alternativeLoginIDPrefix;
- }
- }
- if (alternativeLoginLocalPassword != null) {
- if (!alternativeLoginLocalPassword.equals(currentAlternativeLoginLocalPassword)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("AlternativeLoginLocalPassword", alternativeLoginLocalPassword);
- currentAlternativeLoginLocalPassword = alternativeLoginLocalPassword;
- }
- }
- for (int i = 0; i < emailTemplates.size(); i++) {
- EMailTemplate t = emailTemplates.get(i);
- if (t.emailTemplateSubject != null) {
- if (!t.emailTemplateSubject.equals(t.currentEMailTemplateSubject)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailTemplate"+i+"Subject", t.emailTemplateSubject);
- t.currentEMailTemplateSubject = t.emailTemplateSubject;
- }
- }
- if (t.emailTemplateBody != null) {
- if (!t.emailTemplateBody.equals(t.currentEMailTemplateBody)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailTemplate"+i+"Body", t.emailTemplateBody);
- t.currentEMailTemplateBody = t.emailTemplateBody;
- }
- }
- }
- if (emailEnableWelcome == null) { emailEnableWelcome = "off"; }
- if (!emailEnableWelcome.equals(currentEmailEnableWelcome)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailEnableWelcome", emailEnableWelcome);
- currentEmailEnableWelcome = emailEnableWelcome;
- }
- if (emailEnableRecoverPassUser == null) { emailEnableRecoverPassUser = "off"; }
- if (!emailEnableRecoverPassUser.equals(currentEmailEnableRecoverPassUser)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailEnableRecoverPassUser", emailEnableRecoverPassUser);
- currentEmailEnableRecoverPassUser = emailEnableRecoverPassUser;
- }
- if (emailEnablePastDue == null) { emailEnablePastDue = "off"; }
- if (!emailEnablePastDue.equals(currentEmailEnablePastDue)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailEnablePastDue", emailEnablePastDue);
- currentEmailEnablePastDue = emailEnablePastDue;
- }
- if (emailEnableBeforeDue == null) { emailEnableBeforeDue = "off"; }
- if (!emailEnableBeforeDue.equals(currentEmailEnableBeforeDue)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailEnableBeforeDue", emailEnableBeforeDue);
- currentEmailEnableBeforeDue = emailEnableBeforeDue;
- }
- if (emailEnableAssignedRetakes == null) { emailEnableAssignedRetakes = "off"; }
- if (!emailEnableAssignedRetakes.equals(currentEmailEnableAssignedRetakes)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailEnableAssignedRetakes", emailEnableAssignedRetakes);
- currentEmailEnableAssignedRetakes = emailEnableAssignedRetakes;
- }
- if (emailEnableChangePassword == null) { emailEnableChangePassword = "off"; }
- if (!emailEnableChangePassword.equals(currentEmailEnableChangePassword)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailEnableChangePassword", emailEnableChangePassword);
- currentEmailEnableChangePassword = emailEnableChangePassword;
- }
- if (emailEnableUserEdit == null) { emailEnableUserEdit = "off"; }
- if (!emailEnableUserEdit.equals(currentEmailEnableUserEdit)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailEnableUserEdit", emailEnableUserEdit);
- currentEmailEnableUserEdit = emailEnableUserEdit;
- }
- if (emailEnableStudentPassFail == null) { emailEnableStudentPassFail = "off"; }
- if (!emailEnableStudentPassFail.equals(currentEmailEnableStudentPassFail)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailEnableStudentPassFail", emailEnableStudentPassFail);
- currentEmailEnableStudentPassFail = emailEnableStudentPassFail;
- }
- if (emailEnableManagerSummaryReport == null) { emailEnableManagerSummaryReport = "off"; }
- if (!emailEnableManagerSummaryReport.equals(currentEmailEnableManagerSummaryReport)) {
- saveSysconfig = true;
- sysConfigProperties.setProperty("EmailEnableManagerSummaryReport", emailEnableManagerSummaryReport);
- currentEmailEnableManagerSummaryReport = emailEnableManagerSummaryReport;
- }
- int logSize = 0;
- int logKeep = 0;
- try { logSize = Integer.parseInt(currentLogFileSize); } catch (Exception e) {}
- try { logKeep = Integer.parseInt(currentLogFileKeep); } catch (Exception e) {}
-
- statusMsg = "Warning: Your changes have not been saved.";
- if ((current.getCompanyName() == null) || (current.getCompanyName().length() < 1))
- validError = "You must supply a Company Name";
- else if ((current.getCompanyCopyright() == null) || (current.getCompanyCopyright().length() < 1))
- validError = "You must supply a Company Copyright line.";
- else if ((current.getCompanyAdminContactName() == null) || (current.getCompanyAdminContactName().length() < 1))
- validError = "You must supply a Company Admin Contact Name.";
- else if ((current.getCompanyAdminContactEMail() == null) || (current.getCompanyAdminContactEMail().length() < 1))
- validError = "You must supply a Company Admin Contact EMail.";
- else if ((current.getCompanyAdminContactPhone() == null) || (current.getCompanyAdminContactPhone().length() < 1))
- validError = "You must supply a Company Admin Contact Phone.";
- else if (logSize < 100 || logSize > 50000)
- validError = "You must supply a Log File Maximum Size between 100 and 50000.";
- else if (logKeep < 1 || logKeep > 999)
- validError = "You must supply a Log File Maximum Backups between 1 and 999.";
- else {
-System.out.println("Should be saving to: " + sysConfigFile);
- if (upFile != null) {
- current.setCompanyLogoURL("images/"+upFile.getName());
- }
- current.save(orig);
- if (saveLog) loggerProperties.store(new FileOutputStream(session.getServletContext().getRealPath("/WEB-INF/classes/log4j.properties")), "Last updated by "+user.getUserProfileNum());
- if (saveSysconfig) {
-System.out.println("saving to: " + sysConfigFile);
- sysConfigProperties.store(new FileOutputStream(sysConfigFile), "Last updated by "+user.getUserProfileNum());
- session.setAttribute("sysconfig."+ilsSession.getCompanyID(), null);
- }
- statusMsg = "Your changes have been saved.";
- }
- }
- if ("Edit".equals(action)) {
- String aid = request.getParameter("aid");
- if (aid != null) {
- out.print("<html><head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=admin_announceedit.jsp?aid="+aid+"\"></head></html>");
- return;
- }
- String rid = request.getParameter("rid");
- if (rid != null) {
- out.print("<html><head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=admin_resourceedit.jsp?rid="+rid+"\"></head></html>");
- return;
- }
-
- }
-
- if ("Delete".equals(action)) {
- String []aids = request.getParameterValues("aid");
- if (aids != null) {
- for (int i = 0; i < aids.length; i++) {
- Announcement.deleteAnnouncement(ilsSession, Integer.parseInt(aids[i]));
- }
- statusMsg = "Your changes have been saved.";
- }
- String []rids = request.getParameterValues("rid");
- if (rids != null) {
- for (int i = 0; i < rids.length; i++) {
- Resource.deleteResource(ilsSession, Integer.parseInt(rids[i]));
- }
- statusMsg = "Your changes have been saved.";
- }
- }
-
-
- Vector announces = Announcement.getAllAnnouncements(ilsSession);
- Vector resources = Resource.getAllResources(ilsSession);
-
- final String sort = request.getParameter("sort");
-
- if (sort != null) {
- if (sort.startsWith("a") && announces != null) {
- java.util.Collections.sort(announces, new Comparator() {
- public int compare(Object o1, Object o2) {
- if ("aname".equals(sort)) {
- return ((Announcement)o1).getAnnounceTitle().compareTo(((Announcement)o2).getAnnounceTitle());
- }
- if ("asdate".equals(sort)) {
- Date d1 = ((Announcement)o1).getAnnouncePostDate();
- Date d2 = ((Announcement)o2).getAnnouncePostDate();
- long i1 = (d1 == null) ? 0 : d1.getTime();
- long i2 = (d2 == null) ? 0 : d2.getTime();
- return (i1 > i2) ? -1 : (i1 == i2) ? 0 : 1;
- }
- if ("aedate".equals(sort)) {
- Date d1 = ((Announcement)o1).getAnnounceExpiration();
- Date d2 = ((Announcement)o2).getAnnounceExpiration();
- long i1 = (d1 == null) ? 0 : d1.getTime();
- long i2 = (d2 == null) ? 0 : d2.getTime();
- return (i1 > i2) ? -1 : (i1 == i2) ? 0 : 1;
- }
- return 0;
- }
- });
- }
- else if (sort.startsWith("r") && resources != null) {
- String pp = session.getServletContext().getRealPath("x");
- final String prefixPath = pp.substring(0, pp.length());
- java.util.Collections.sort(resources, new Comparator() {
- public int compare(Object o1, Object o2) {
- if ("rfname".equals(sort)) {
- return ((Resource)o1).getResourceURL().compareTo(((Resource)o2).getResourceURL());
- }
- if ("rdesc".equals(sort)) {
- return ((Resource)o1).getResourceTitle().compareTo(((Resource)o2).getResourceTitle());
- }
- if ("rsize".equals(sort)) {
- String p1 = ((Resource)o1).getResourceURL();
- String p2 = ((Resource)o2).getResourceURL();
- File rf1 = new File(prefixPath+p1);
- File rf2 = new File(prefixPath+p2);
- return (rf1.length() > rf2.length()) ? -1 : (rf1.length() == rf2.length()) ? 0 : 1;
- }
- if ("rdate".equals(sort)) {
- Date d1 = ((Resource)o1).getResourcePostDate();
- Date d2 = ((Resource)o2).getResourcePostDate();
- long i1 = (d1 == null) ? 0 : d1.getTime();
- long i2 = (d2 == null) ? 0 : d2.getTime();
- return (i1 > i2) ? -1 : (i1 == i2) ? 0 : 1;
- }
- return 0;
- }
- });
- }
- }
-
-%>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
-<head>
-<title><%= ilsSession.getCurrentCompany().getCompanyName() %> eLearning Portal</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<style type="text/css">
-#navlist {
- border-bottom: 1px solid #ccc;
- margin: 0 0 0 0;
- padding-bottom: 19px;
- padding-left: 10px;
-}
-
-#navlist ul, #navlist li {
- display: inline;
- list-style-type: none;
- margin: 0;
- padding: 0;
-}
-
-#navlist span {
- background: #E8EBF0;
- border: 1px solid #ccc;
- color: #666;
- float: left;
- font-family: "Trebuchet MS", verdana, lucida, arial, helvetica, sans-serif;
- font-size: 1.0em;
- font-weight: normal;
- line-height: 1.4em;
- margin-right: 8px;
- padding: 1px 5px 0px 5px;
- text-decoration: none;
-}
-
-div.emailTemplate div.emailTemplateCurrent {
-}
-
-div.emailTemplateCurrent {
- display:inline;
-}
-
-div.emailTemplate{
- display:none;
- visibility:hidden;
-}
-#navlist span.current {
- background: #fff;
- border-bottom: 1px solid #fff;
- color: #000;
-}
-
-#navlist span:hover {
- color: #ff0000;
- background: #C5D6EA;
-}
-</style>
-
-<link href="lms_style.css" rel="stylesheet" type="text/css" />
-<script type="text/javascript" src="crosswire.js"></script>
-<script type="text/javascript">
-<!--
-function confirmSubmit(form, boxid) {
- box=document.getElementById(boxid);
- choice = box.options[box.selectedIndex].value;
- if (choice == 'Delete') {
- if (confirm("Are you sure?")) {
- form.submit();
- }
- }
- else {
- form.submit();
- }
-}
-
-function setTemplateVisible(n) {
- for (i = 0; i < <%= emailTemplates.size() %>; i++) {
- s = document.getElementById('emailTemplateMenu'+i);
- s.className = (i == n) ? "current" : "";
- d = document.getElementById('emailTemplate'+i);
- d.className = (i == n) ? "emailTemplateCurrent" : "emailTemplate";
- }
-}
-
-function initPage() {
- setTemplateVisible(0);
-}
-
-// -->
-</script>
-</head>
-
-<body onLoad="initPage()">
-<%@ include file="header.jsp" %>
- <div id="pageContainer">
-<%@ include file="menu.jsp" %>
-<div id="content">
-<div id="pageTitles">
-System Management<br/>
-<span class="instructiontxt"><%= statusMsg %></span><br/>
-<span class="instructiontxt"><%= validError %></span>
-</div>
-<form id="systemsave" method="post" action="admin_systemmanagement.jsp" enctype="multipart/form-data">
- <table cellpadding="0" id="tableForm" class="tableForm">
- <tr>
- <th>Edit System Settings</th>
- </tr>
- <tr>
- <td>
- <input type="hidden" name="action" value="Save"/>
- <table id="tableFormData" class="tableFormData">
- <tr>
- <td class="formHeadings">Version :</td>
- <td colspan="2"><%=Utils.getVersionString()%></td>
- </tr>
- <tr>
- <td class="formHeadings">Company ID :</td>
- <td colspan="2"><%=current.getCompanyID()%></td>
- </tr>
- <tr>
- <td class="formHeadings">Company Name : </td>
- <td colspan="2"><input name="name" type="text" value="<%=current.getCompanyName()%>" size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Upload Logo Image<br/>
- <span class="instructiontxt">(147 x 67 pixels)</span> :</td>
- <td><input name="file" type="file" size="40"/></td>
- <!--
- <td width="27%" class="coursetxtHDR"><table width="100%" border="0">
- <tr>
- <td width="12%"><img src="images/browse_btn.gif" width="20" height="20" alt=""/></td>
- <td width="88%"><span class="formbtn">Browse</span></td>
- </tr>
- </table></td>
- -->
- </tr>
- <tr>
- <td class="formHeadings">Logo Image:</td>
- <td colspan="2"><img src="<%=current.getCompanyLogoURL()%>" alt="Company Logo"/></td>
- </tr>
- <tr>
- <td class="formHeadings">Copyright Text:</td>
- <td colspan="2"><input name="copyright" type="text" value="<%=current.getCompanyCopyright()%>" size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">System Administrator Contact Name:</td>
- <td colspan="2"><input name="adminname" type="text" value="<%=current.getCompanyAdminContactName()%>" size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">System Administrator Contact EMail:</td>
- <td colspan="2"><input name="adminemail" type="text" value="<%=current.getCompanyAdminContactEMail()%>" size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">System Administrator Contact Phone: </td>
- <td colspan="2"><input name="adminphone" type="text" value="<%=current.getCompanyAdminContactPhone()%>" size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Log Level: </td>
- <td>
- <select id="logFileLevelSelectBox" name="logFileLevel">
- <option value="FATAL" <%="FATAL".equals(currentLogFileLevel)?"selected=\"selected\"":""%>>FATAL - show only app fatalities</option>
- <option value="ERROR" <%="ERROR".equals(currentLogFileLevel)?"selected=\"selected\"":""%>>ERROR - show only errors and worse</option>
- <option value="WARN" <%="WARN".equals(currentLogFileLevel)?"selected=\"selected\"":"" %>>WARN - show only warnings and worse</option>
- <option value="INFO" <%="INFO".equals(currentLogFileLevel)?"selected=\"selected\"":"" %>>INFO - PRODUCTION LOG LEVEL</option>
- <option value="DEBUG" <%="DEBUG".equals(currentLogFileLevel)?"selected=\"selected\"":""%>>DEBUG - show debug info</option>
- <option value="TRACE" <%="TRACE".equals(currentLogFileLevel)?"selected=\"selected\"":""%>>TRACE - show execution tracing</option>
- </select>
- <input type="button" value="Show Logs..." onClick="window.open('viewLog.jsp', 'Log', 'width=800,height=600,scrollbars=1');" />
- </td>
- </tr>
- <tr>
- <td class="formHeadings">Log Folder: </td>
- <td colspan="2">
- <input name="logFileName" type="text" value="<%=currentLogFileName%>" size="40"/>
- <input type="button" value="Default" onClick="<%= "logFileName.value='"+session.getServletContext().getRealPath("/log/").replace('\\', '/')+"'"%>;return false;" />
- </td>
- </tr>
- <tr>
- <td class="formHeadings">Log File Max Size (in KB): </td>
- <td colspan="2"><input name="logFileSize" type="text" value="<%=currentLogFileSize%>" size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Log File Max Backups: </td>
- <td colspan="2"><input name="logFileKeep" type="text" value="<%=currentLogFileKeep%>" size="40"/> </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
- </tr>
- </table> </td> </tr>
- </table>
-
-
- <table cellpadding="0" id="tableFormEmail" class="tableForm">
- <tr>
- <th>Edit Email Settings</th>
- </tr>
- <tr>
- <td>
- <table id="tableFormData2" class="tableFormData">
- <tr>
- <td class="formHeadings">Outgoing Mail Server: </td>
- <td colspan="2"><input name="sendMailServer" type="text" value="<%=currentSendMailServer%>" size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Outgoing Mail User: </td>
- <td colspan="2"><input name="sendMailUser" type="text" value="<%=currentSendMailUser%>" size="40" autocomplete="off"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Outgoing Mail Password: </td>
- <td colspan="2"><input name="sendMailPasswd" type="password" value="<%=currentSendMailPasswd%>" size="40" autocomplete="off"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Default "From" Email Address: </td>
- <td colspan="2"><input name="sendMailFrom" type="text" value="<%=currentSendMailFrom%>" size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Default EMail Signature: </td>
- <td colspan="2"><textarea name="sendMailSig" cols="40" rows="4"><%=currentSendMailSig%></textarea></td>
- </tr>
- <tr>
- <td class="formHeadings">Site URL: </td>
- <td colspan="2"><input name="siteURL" type="text" value="<%=currentSiteURL%>" size="40"/> </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td>Enable Automatic E-Mail Notification</td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td class="formHeadings"></td>
- <td colspan="2"><input name="emailEnableWelcome" type="checkbox" value="on" <%="on".equals(currentEmailEnableWelcome)?"checked=\"checked\"":""%> size="40"/>Welcome Email For New Users</td>
- </tr>
- <tr>
- <td class="formHeadings"></td>
- <td colspan="2"><input name="emailEnableRecoverPassUser" type="checkbox" value="on" <%="on".equals(currentEmailEnableRecoverPassUser)?"checked=\"checked\"":""%> size="40"/>Recover Password/User Name</td>
- </tr>
- <tr>
- <td class="formHeadings"></td>
- <td colspan="2"><input name="emailEnableChangePassword" type="checkbox" value="on" <%="on".equals(currentEmailEnableChangePassword)?"checked=\"checked\"":""%> size="40"/>Change Password</td>
- </tr>
- <tr>
- <td class="formHeadings"></td>
- <td colspan="2"><input name="emailEnableStudentPassFail" type="checkbox" value="on" <%="on".equals(currentEmailEnableStudentPassFail)?"checked=\"checked\"":""%> size="40"/>Student Pass/Fail</td>
- </tr>
- <tr>
- <td class="formHeadings"></td>
- <td colspan="2"><input name="emailEnableManagerSummaryReport" type="checkbox" value="on" <%="on".equals(currentEmailEnableManagerSummaryReport)?"checked=\"checked\"":""%> size="40"/><t:t>Manager</t:t> Summary Report</td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td>Enable Automatic Recurrent Training Reminders</td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td class="formHeadings"></td>
- <td colspan="2"><input name="emailEnableBeforeDue" type="checkbox" value="on" <%="on".equals(currentEmailEnableBeforeDue)?"checked=\"checked\"":""%> size="40"/>Due Date : <input type="text" name="emailBeforeDueDate1" size="4" value="<%= currentEmailBeforeDueDate1 %>" /> Days and <input type="text" name="emailBeforeDueDate2" size="4" value="<%= currentEmailBeforeDueDate2 %>" /> Days Prior to Due Date</td>
- </tr>
- <tr>
- <td class="formHeadings"></td>
- <td colspan="2"><input name="emailEnablePastDue" type="checkbox" value="on" <%="on".equals(currentEmailEnablePastDue)?"checked=\"checked\"":""%> size="40"/>Past Due : <input type="text" name="emailPastDueDate1" size="4" value="<%= currentEmailPastDueDate1 %>"/> Days and <input type="text" name="emailPastDueDate2" size="4" value="<%= currentEmailPastDueDate2 %>" /> Days After Due Date</td>
- </tr>
- <tr>
- <td class="formHeadings"></td>
- <td colspan="2"><input name="emailEnableAssignedRetakes" type="checkbox" value="on" <%="on".equals(currentEmailEnableAssignedRetakes)?"checked=\"checked\"":""%> size="40"/>Assigned Retakes</td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td>Allow Users To Edit Their Email Address</td>
- <td colspan="2"><input name="emailEnableUserEdit" type="checkbox" value="on" <%="on".equals(currentEmailEnableUserEdit)?"checked=\"checked\"":""%> size="40"/></td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
-
-
-
- <tr><td colspan="3">
- <div id="navlist">
- <ul>
- <%
- for (int i = 0; i < emailTemplates.size(); i++) {
- %>
- <li><span id="emailTemplateMenu<%= i %>" onClick="setTemplateVisible(<%= i %>)"><%= emailTemplates.get(i).name %></span></li>
- <%
- }
- %>
- </ul></div>
- <%
- for (int i = 0; i < emailTemplates.size(); i++) {
- EMailTemplate t = emailTemplates.get(i);
- %>
- <div class="emailTemplate" id="emailTemplate<%= i %>">
- <table>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td class="formHeadings"><%= t.name %></td><td></td><td>
- <input type="button" value="Default" onClick="emailTemplate<%= i %>Subject.value='<%= StringEscapeUtils.escapeJavaScript(t.defSubject) %>';emailTemplate<%= i %>Body.value='<%= StringEscapeUtils.escapeJavaScript(t.defBody) %>';return false;" />
- </td>
- </tr>
- <tr>
- <td class="formHeadings">Subject: </td>
- <td colspan="2"><input name="emailTemplate<%= i %>Subject" type="text" value="<%= (t.currentEMailTemplateSubject == null) ? t.defSubject : t.currentEMailTemplateSubject %>" size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Body: </td>
- <td colspan="2"><textarea style="width:100%;" name="emailTemplate<%= i %>Body" cols="40" rows="7"><%= (t.currentEMailTemplateBody == null) ? t.defBody : t.currentEMailTemplateBody %></textarea></td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- </table>
- </div>
- <%
- }
- %>
- </td></tr>
-
-
-
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
- </tr>
- </table> </td> </tr>
- </table>
-
- <table cellpadding="0" id="tableFormAPI" class="tableForm">
- <tr>
- <th>Web Service API Settings</th>
- </tr>
- <tr>
- <td>
- <table id="tableFormData2" class="tableFormData">
- <tr>
- <td class="formHeadings">Enable: </td>
- <td colspan="2"><input name="apiEnable" type="checkbox" value="on" <%="on".equals(currentAPIEnable)?"checked=\"checked\"":""%> size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Callback URL - Course Complete: </td>
- <td colspan="2"><input name="apiCallbackCourseComplete" type="text" value="<%=currentAPICallbackCourseComplete%>" size="40"/> </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
- </tr>
- </table> </td>
- </tr>
- </table>
-
- <table cellpadding="0" id="tableFormSR" class="tableForm">
- <tr>
- <th>Self Registration</th>
- </tr>
- <tr>
- <td>
- <table id="tableFormData2" class="tableFormData">
- <tr>
- <td class="formHeadings">Enable: </td>
- <td colspan="2"><input name="srEnable" type="checkbox" value="on" <%="on".equals(currentSREnable)?"checked=\"checked\"":""%> size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings"><t:t>Workgroup</t:t> Field Must Contain These Characters<br/>(One Validation String Per Line)</td>
- <td colspan="2"><textarea name="srWGVal" rows="3" cols="40"><%=currentSRWGVal%></textarea></td>
- </tr>
- <tr>
- <td class="formHeadings"><t:t>Workgroup</t:t> Field Must Contain Exactly</td>
- <td colspan="2"><input name="srLengthVal" type="text" value="<%=currentSRLengthVal%>" size="2"/> <span class="formHeadings">Characters (Maximum 75 Characters)</span></td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
- </tr>
- </table> </td>
- </tr>
- </table>
- <table cellpadding="0" class="tableForm">
- <tr>
- <th>ID Check Validation at Login</th>
- </tr>
- <tr>
- <td>
- <table class="tableFormData">
- <tr>
- <td class="formHeadings">Enable: </td>
- <td colspan="2"><input name="secondaryLoginValidationEnable" type="checkbox" value="on" <%="on".equals(currentSecondaryLoginValidationEnable)?"checked=\"checked\"":""%> size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Disable ID Check at Login for these<br/>IP Addresses</td>
- <td colspan="2"><textarea name="secondaryLoginValidationIPExceptions" rows="3" cols="40"><%=currentSecondaryLoginValidationIPExceptions %></textarea></td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2">Valid IP Address Patterns (e.g., 192.168.*)<br/>(One IP Address Pattern Per Line)</td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
- </tr>
- </table> </td>
- </tr>
- </table>
- <table cellpadding="0" id="tableFormSR" class="tableForm">
- <tr>
- <th>Course IP Address Restriction</th>
- </tr>
- <tr>
- <td>
- <table id="tableFormData2" class="tableFormData">
- <tr>
- <td class="formHeadings">Enable: </td>
- <td colspan="2"><input name="ipEnable" type="checkbox" value="on" <%="on".equals(currentIPEnable)?"checked=\"checked\"":""%> size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Valid IP Address Patterns (e.g., 192.168.*)<br/>(One IP Address Pattern Per Line)</td>
- <td colspan="2"><textarea name="ipPatVal" rows="3" cols="40"><%=currentIPPatVal%></textarea></td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
- </tr>
- </table> </td>
- </tr>
- </table>
-
- <table cellpadding="0" id="tableForm2" class="tableForm">
- <tr>
- <th>Alternative Login Validation Settings</th>
- </tr>
- <tr>
- <td>
- <table id="tableFormData2" class="tableFormData">
- <tr>
- <td class="formHeadings">Enable: </td>
- <td colspan="2"><input name="alternativeLoginValidationEnable" type="checkbox" value="on" <%="on".equals(currentAlternativeLoginValidationEnable)?"checked=\"checked\"":""%> size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">Validation Service URL: </td>
- <td colspan="2"><input name="alternativeLoginValidationURL" type="text" value="<%=currentAlternativeLoginValidationURL%>" size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">ILS Prefix to UserID: </td>
- <td colspan="2"><input name="alternativeLoginIDPrefix" type="text" value="<%=currentAlternativeLoginIDPrefix%>" size="40"/> </td>
- </tr>
- <tr>
- <td class="formHeadings">ILS User Local Password: </td>
- <td colspan="2"><input name="alternativeLoginLocalPassword" type="text" value="<%=currentAlternativeLoginLocalPassword%>" size="40"/> </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"> </td>
- </tr>
- <tr>
- <td> </td>
- <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
- </tr>
- </table> </td> </tr>
- </table>
-</form>
-<br/>
- <form id="announc" method="get" action="admin_systemmanagement.jsp">
- <table cellpadding="0" cellspacing="0" class="tableMain">
- <tr>
- <th>Announcements</th>
- </tr>
- <tr>
- <td>
- <table class="tableBTN">
- <tr>
- <td class="tableBTN_td1">
- <table>
- <tr>
- <td><a href="admin_announceedit.jsp"><img style="border:0;" src="images/Add.gif" width="24" height="24" alt=""/></a></td>
- <td><a href="admin_announceedit.jsp" class="formButtons">Add Announcement</a></td>
- </tr>
- </table> </td>
- <td class="tableBTN_td1">
- <select id="action1" name="action">
- <option>Choose Action</option>
- <option value="Edit" <%="Edit".equals(action)?"selected=\"selected\"":""%>>Edit</option>
- <option value="Delete" <%="Delete".equals(action)?"selected=\"selected\"":""%>>Delete</option>
- </select> </td>
- <td>
- <table>
- <tr>
- <td><a href="#" onClick="confirmSubmit(document.getElementById('announc'), 'action1');"><img style="border:0;" src="images/performaction_btn.gif" width="24" height="24" alt=""/></a></td>
- <td><a href="#" class="formButtons" onClick="confirmSubmit(document.getElementById('announc'), 'action1');">Perform Action</a></td>
- </tr>
- </table> </td>
- </tr>
- </table> </td>
- </tr>
- <tr>
- <td>
- <table class="tableDataList">
- <tr>
- <th><input type="checkbox" name="cba1" onClick="checkAll('annck', this.checked);"/></th>
- <th><a href="admin_systemmanagement.jsp?sort=aname">Announcement</a></th>
- <th><a href="admin_systemmanagement.jsp?sort=asdate">Initiated</a></th>
- <th><a href="admin_systemmanagement.jsp?sort=aedate">Expires</a></th>
- </tr>
-<%
- for (int j = 0; j < announces.size(); j++) {
- Announcement r = (Announcement)announces.get(j);
- String sDate = (r.getAnnouncePostDate() != null) ? df.format(r.getAnnouncePostDate()) : "";
- String eDate = (r.getAnnounceExpiration() != null) ? df.format(r.getAnnounceExpiration()) : "";
-%>
- <tr>
- <td><input type="checkbox" id="annck<%=j%>" name="aid" value="<%=r.getAnnounceID()%>"></td>
- <td><%=r.getAnnounceTitle()%></td>
- <td><%=sDate%></td>
- <td><%=eDate%></td>
- </tr>
-<%
- }
-%>
- </table> </td>
- </tr>
- </table>
- </form>
- <br />
- <form id="resourc" method="get" action="admin_systemmanagement.jsp">
-
- <table cellpadding="0" cellspacing="0" class="tableMain">
- <tr>
- <th>Resources</th>
- </tr>
- <tr>
- <td>
- <table class="tableBTN">
- <tr>
- <td class="tableBTN_td1">
- <table >
- <tr>
- <td><a href="admin_resourceedit.jsp"><img style="border:0;" src="images/Add.gif" width="24" height="24" alt=""/></a></td>
- <td><a href="admin_resourceedit.jsp" class="formButtons">Add Resource</a></td>
- </tr>
- </table> </td>
- <td class="tableBTN_td1">
- <select id="action2" name="action">
- <option>Choose Action</option>
- <option value="Edit" <%="Edit".equals(action)?"selected=\"selected\"":""%>>Edit</option>
- <option value="Delete" <%="Delete".equals(action)?"selected=\"selected\"":""%>>Delete</option>
- </select> </td>
- <td>
- <table>
- <tr>
- <td><a href="#" onClick="confirmSubmit(document.getElementById('resourc'), 'action2');"><img style="border:0;" src="images/performaction_btn.gif" width="24" height="24" alt=""/></a></td>
- <td><a href="#" class="formButtons" onClick="confirmSubmit(document.getElementById('resourc'), 'action2');">Perform Action</a></td>
- </tr>
- </table> </td>
- </tr>
- </table> </td>
- </tr>
- <tr>
- <td>
- <table class="tableDataList">
- <tr>
- <th><input type="checkbox" name="cba2" onClick="checkAll('resck', this.checked);"/></th>
- <th><a href="admin_systemmanagement.jsp?sort=rfname">File Name</a></th>
- <th><a href="admin_systemmanagement.jsp?sort=rdesc">File Description</a></th>
- <th><a href="admin_systemmanagement.jsp?sort=rsize">Size</a></th>
- <th><a href="admin_systemmanagement.jsp?sort=rdate">Date</a></th>
- </tr>
-<%
- for (int i = 0; i < resources.size(); i++) {
- Resource r = (Resource)resources.get(i);
- String path = r.getResourceURL();
-// URL ru = new URL(request.getRequestURL().toString(), path);
- File rf = new File(session.getServletContext().getRealPath(path));
- String fName = rf.getName();
- String fSize = Integer.toString((int)rf.length() / 1000) + "kb";
-
-%>
- <tr class="reporttxt">
- <td><input type="checkbox" id="resck<%=i%>" name="rid" value="<%=r.getResourceID()%>"></td>
- <td><a class="coursetxt" href="<%=r.getResourceURL()%>"><%=fName%></a></td>
- <td><%=r.getResourceTitle()%></td>
- <td><%=fSize%></td>
- <td><%=df.format(r.getResourcePostDate()) %></td>
- </tr>
-<%
- }
-%>
- </table> </td>
- </tr>
- </table>
- </form>
-</div>
-<%@ include file="footer.jsp" %>
-</div>
-
-</body>
-</html>
+<?xml version="1.0" encoding="utf-8"?>
+<%@ page
+ language="java"
+ contentType="text/html;charset=utf-8"
+%>
+<%@ page trimDirectiveWhitespaces="true" %>
+<%@ page import="com.resolutions.ils.*" %>
+<%@ page import="com.resolutions.ils.data.*" %>
+<%@ page import="java.util.Vector" %>
+<%@ page import="java.util.Comparator" %>
+<%@ page import="java.util.Properties" %>
+<%@ page import="java.util.Date" %>
+<%@ page import="java.util.List" %>
+<%@ page import="java.io.File" %>
+<%@ page import="java.io.FileInputStream" %>
+<%@ page import="java.io.FileOutputStream" %>
+<%@ page import="java.net.URL" %>
+<%@ page import="java.text.SimpleDateFormat" %>
+<%@ page import="org.apache.commons.fileupload.*" %>
+<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>
+<%@ page import="org.apache.log4j.Logger" %>
+
+<%
+ Logger logger = Logger.getLogger(this.getClass());
+ Logger eventsLogger = Logger.getLogger("EVENTS");
+
+ 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;
+ }
+
+ UserProfile user = ilsSession.getCurrentUserProfile();
+ if ((user.getUserProfileAccessLevel() < UserProfile.ACCESS_ADMIN) && (!user.hasAccess(UserProfile.ACCESS_MODE_MENU_SYSTEM_MGMT))) {
+ out.print("<html><body><h1>You do not have access to this feature</h1></body></html>");
+ eventsLogger.info("Access denied to user ["+user.getUserProfileNum()+"]");
+ return;
+ }
+
+ class EMailTemplate {
+ String name;
+
+ String defSubject;
+ String currentEMailTemplateSubject;
+ String emailTemplateSubject;
+
+ String defBody;
+ String currentEMailTemplateBody;
+ String emailTemplateBody;
+
+
+ EMailTemplate(String name, String defSubject, String defBody) { this.name = name; this.defSubject = defSubject; this.defBody = defBody; }
+ }
+
+ Vector<EMailTemplate> emailTemplates = new Vector<EMailTemplate>();
+
+ // TODO: Changed these from using ordered number to instead letting us supply a 'properties file save' name
+ // 0
+ emailTemplates.add(new EMailTemplate("Recover Password/User Name", "Credentials",
+ "Your credentials for your account at {CONAME}\n" +
+ "User ID : {USERPRNUM}\n" +
+ "Password: {USERPRPASSWD}\n\n"));
+
+ // 1
+ emailTemplates.add(new EMailTemplate("Change Password", "Password Changed",
+ "Your password has just been changed at {SITEURL}.\n\n" +
+ "Login Account: {USERPRNUM}\n\n" +
+ "If you did not change this password, please contact your administrator "+
+ "{ADMINCONTACTNAME} at {ADMINCONTACTPHONE}.\n\n"));
+
+ // 2
+ emailTemplates.add(new EMailTemplate("Student Pass/Fail", "Student {PASSEDFAILED}: {USERPRNUM}",
+ "A student you manage {PASSEDFAILED} a course. Details:\n\n" +
+ "Account: {USERPRNUM}\n" +
+ "User : {USERPRFNAME} {USERPRLNAME}\n" +
+ "Course : {COURSNAME}\n\n"));
+
+ // 3
+ emailTemplates.add(new EMailTemplate("Prior Due", "Pending Deadline",
+ "You are assigned to take {COURSNAME} training which is due in less than {WARNDAYS}. " +
+ "Please Log on to {SITEURL} to complete your training.\n\n" +
+ "Login Account: {USERPRNUM}\n" +
+ "Course Name : {COURSNAME}\n\n"));
+
+ // 4
+ emailTemplates.add(new EMailTemplate("Past Due", "Past Due",
+ "You are assigned to take {COURSNAME} training which is more than {WARNDAYS} days past due. " +
+ "Please Log on to {SITEURL} to complete your training.\n\n" +
+ "Login Account: {USERPRNUM}\n" +
+ "Course Name : {COURSNAME}\n\n"));
+
+ // 5
+ emailTemplates.add(new EMailTemplate("Assigned Retakes", "Assigned Retake Notice",
+ "You have been reassigned to take {COURSNAME} training. " +
+ "Please Log on to {SITEURL} to complete your training.\n\n" +
+ "Login Account: {USERPRNUM}\n" +
+ "Course Name : {COURSNAME}\n\n"));
+
+ // 6
+ emailTemplates.add(new EMailTemplate("Welcome Email", "Welcome to {CONAME}",
+ "You have a new account at {CONAME}\n\n" +
+ "Workgroup: {WORKGROUPNAME}\n" +
+ "Role : {ROLENAME}\n\n" +
+ "You can login to your account at {SITEURL} with the credentials: \n\n" +
+ "User ID : {USERPRNUM}\n" +
+ "Password: {USERPRPASSWD}\n\n"));
+
+ Properties sysConfigProperties = Utils.getSysConfig(session);
+ File sysConfigFile = new File(session.getServletContext().getRealPath("/WEB-INF/sysconfig."+ilsSession.getCompanyID()+".properties"));
+ if (sysConfigProperties == null) {
+ sysConfigProperties = new Properties();
+ }
+ if (!sysConfigFile.exists()) {
+ sysConfigFile.createNewFile();
+ }
+
+ Properties loggerProperties = new Properties();
+ loggerProperties.load(new FileInputStream(session.getServletContext().getRealPath("/WEB-INF/classes/log4j.properties")));
+ String currentLogFileSize = loggerProperties.getProperty("log4j.appender.E.MaxFileSize");
+ String currentLogFileName = loggerProperties.getProperty("log4j.appender.E.File");
+ String currentSendMailServer = sysConfigProperties.getProperty("SendMailServer", "");
+ String currentSendMailUser = sysConfigProperties.getProperty("SendMailUser", "");
+ String currentSendMailPasswd = sysConfigProperties.getProperty("SendMailPasswd", "");
+ String currentSendMailFrom = sysConfigProperties.getProperty("SendMailFrom", "");
+ String currentSendMailSig = sysConfigProperties.getProperty("SendMailSig", "");
+ String currentSiteURL = sysConfigProperties.getProperty("SiteURL", "");
+ String currentEmailEnableWelcome = sysConfigProperties.getProperty("EmailEnableWelcome", "");
+ String currentEmailEnableRecoverPassUser = sysConfigProperties.getProperty("EmailEnableRecoverPassUser", "");
+ String currentEmailEnableAssignedRetakes = sysConfigProperties.getProperty("EmailEnableAssignedRetakes", "");
+ String currentEmailEnableBeforeDue = sysConfigProperties.getProperty("EmailEnableBeforeDue", "");
+ String currentEmailEnablePastDue = sysConfigProperties.getProperty("EmailEnablePastDue", "");
+ String currentEmailBeforeDueDate1 = sysConfigProperties.getProperty("EmailBeforeDueDate1", "");
+ String currentEmailBeforeDueDate2 = sysConfigProperties.getProperty("EmailBeforeDueDate2", "");
+ String currentEmailPastDueDate1 = sysConfigProperties.getProperty("EmailPastDueDate1", "");
+ String currentEmailPastDueDate2 = sysConfigProperties.getProperty("EmailPastDueDate2", "");
+ String currentEmailEnableChangePassword = sysConfigProperties.getProperty("EmailEnableChangePassword", "");
+ String currentEmailEnableStudentPassFail = sysConfigProperties.getProperty("EmailEnableStudentPassFail", "");
+ String currentEmailEnableManagerSummaryReport = sysConfigProperties.getProperty("EmailEnableManagerSummaryReport", "");
+ String currentEmailEnableUserEdit = sysConfigProperties.getProperty("EmailEnableUserEdit", "");
+ String currentAPIEnable = sysConfigProperties.getProperty("APIEnable", "");
+ String currentAPICallbackCourseComplete = sysConfigProperties.getProperty("APICallbackCourseComplete", "");
+ String currentSREnable = sysConfigProperties.getProperty("SREnable", "");
+ String currentIPEnable = sysConfigProperties.getProperty("IPEnable", "");
+ String currentSecondaryLoginValidationEnable = sysConfigProperties.getProperty("SecondaryLoginValidationEnable", "");
+ String currentSecondaryLoginValidationIPExceptions = sysConfigProperties.getProperty("SecondaryLoginValidationIPExceptions", "");
+ String currentSRWGVal = sysConfigProperties.getProperty("SRWGVal", "");
+ String currentIPPatVal = sysConfigProperties.getProperty("IPPatVal", "");
+ String currentSRLengthVal = sysConfigProperties.getProperty("SRLengthVal", "");
+ String currentAlternativeLoginValidationEnable = sysConfigProperties.getProperty("AlternativeLoginValidationEnable", "");
+ String currentAlternativeLoginValidationURL = sysConfigProperties.getProperty("AlternativeLoginValidationURL", "");
+ String currentAlternativeLoginIDPrefix = sysConfigProperties.getProperty("AlternativeLoginIDPrefix", "");
+ String currentAlternativeLoginLocalPassword = sysConfigProperties.getProperty("AlternativeLoginLocalPassword", "");
+ for (int i = 0; i < emailTemplates.size(); i++) {
+ EMailTemplate t = emailTemplates.get(i);
+ t.currentEMailTemplateSubject = sysConfigProperties.getProperty("EmailTemplate"+i+"Subject");
+ t.currentEMailTemplateBody = sysConfigProperties.getProperty("EmailTemplate"+i+"Body");
+ }
+ try {
+ int fStart = currentLogFileName.lastIndexOf('\\');
+ if (fStart < 0) fStart = currentLogFileName.lastIndexOf('/');
+ currentLogFileName = currentLogFileName.substring(0,fStart);
+ }
+ catch (Exception e) {}
+ String currentLogFileKeep = loggerProperties.getProperty("log4j.appender.E.MaxBackupIndex");
+ String currentLogFileLevel= loggerProperties.getProperty("log4j.rootLogger");
+ if (currentLogFileLevel != null) currentLogFileLevel = currentLogFileLevel.substring(0, currentLogFileLevel.indexOf(','));
+ if ((currentLogFileSize != null) && currentLogFileSize.toUpperCase().endsWith("KB")) currentLogFileSize = currentLogFileSize.substring(0, currentLogFileSize.length()-2);
+
+ String statusMsg = "";
+ String validError = "";
+
+ Company current = null;
+ SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
+
+ try {
+ current = Company.getCompany(ilsSession);
+ }
+ catch (Exception e) { logger.error(e, e); }
+ String val = null;
+
+ String action = request.getParameter("action");
+ String name = request.getParameter("name");
+ String copyright = request.getParameter("copyright");
+ String adminname = request.getParameter("adminname");
+ String adminemail = request.getParameter("adminemail");
+ String adminphone = request.getParameter("adminphone");
+ String logFileSize= request.getParameter("logFileSize");
+ String logFileName= request.getParameter("logFileName");
+ String logFileLevel= request.getParameter("logFileLevel");
+ String logFileKeep = request.getParameter("logFileKeep");
+ String sendMailServer = request.getParameter("sendMailServer");
+ String sendMailUser = request.getParameter("sendMailUser");
+ String sendMailPasswd = request.getParameter("sendMailPasswd");
+ String sendMailFrom = request.getParameter("sendMailFrom");
+ String sendMailSig = request.getParameter("sendMailSig");
+ String siteURL = request.getParameter("siteURL");
+ String emailEnableWelcome = request.getParameter("emailEnableWelcome");
+ String emailEnableRecoverPassUser = request.getParameter("emailEnableRecoverPassUser");
+ String emailEnableAssignedRetakes = request.getParameter("emailEnableAssignedRetakes");
+ String emailEnableChangePassword = request.getParameter("emailEnableChangePassword");
+ String emailEnableUserEdit = request.getParameter("emailEnableChangePassword");
+ String emailEnableStudentPassFail = request.getParameter("emailEnableStudentPassFail");
+ String emailEnableManagerSummaryReport = request.getParameter("emailEnableManagerSummaryReport");
+ String emailEnableBeforeDue = request.getParameter("emailEnableBeforeDue");
+ String emailEnablePastDue = request.getParameter("emailEnablePastDue");
+ String emailBeforeDueDate1 = request.getParameter("emailBeforeDueDate1");
+ String emailBeforeDueDate2 = request.getParameter("emailBeforeDueDate2");
+ String emailPastDueDate1 = request.getParameter("emailPastDueDate1");
+ String emailPastDueDate2 = request.getParameter("emailPastDueDate2");
+ String apiEnable = request.getParameter("apiEnable");
+ String apiCallbackCourseComplete = request.getParameter("apiCallbackCourseComplete");
+ String srEnable = request.getParameter("srEnable");
+ String srWGVal = request.getParameter("srWGVal");
+ String srLengthVal = request.getParameter("srLengthVal");
+ String secondaryLoginValidationEnable = request.getParameter("secondaryLoginValidationEnable");
+ String secondaryLoginValidationIPExceptions = request.getParameter("secondaryLoginValidationIPExceptions");
+ String ipEnable = request.getParameter("ipEnable");
+ String ipPatVal = request.getParameter("ipPatVal");
+ String alternativeLoginValidationEnable = request.getParameter("alternativeLoginValidationEnable");
+ String alternativeLoginValidationURL = request.getParameter("alternativeLoginValidationURL");
+ String alternativeLoginIDPrefix = request.getParameter("alternativeLoginIDPrefix");
+ String alternativeLoginLocalPassword = request.getParameter("alternativeLoginLocalPassword");
+ for (int i = 0; i < emailTemplates.size(); ++i) {
+ EMailTemplate t = emailTemplates.get(i);
+ t.emailTemplateSubject = request.getParameter("emailTemplate"+i+"Subject");
+ t.emailTemplateBody = request.getParameter("emailTemplate"+i+"Body");
+ }
+
+ File upFile = null;
+ try {
+ DiskFileUpload fu = new DiskFileUpload();
+ // maximum size before a FileUploadException will be thrown
+ fu.setSizeMax(99000000);
+ // maximum size that will be stored in memory
+ fu.setSizeThreshold(4096);
+ // the location for saving data that is larger than getSizeThreshold()
+ fu.setRepositoryPath(session.getServletContext().getRealPath("tmp/"));
+
+ List fileItems = fu.parseRequest(request);
+ for (int i = 0; i < fileItems.size(); i++) {
+ FileItem fi = (FileItem)fileItems.get(i);
+ if (fi.isFormField()) {
+ if ("action".equals(fi.getFieldName())) {
+ action = fi.getString();
+ }
+ if ("name".equals(fi.getFieldName())) {
+ name = fi.getString();
+ }
+ if ("copyright".equals(fi.getFieldName())) {
+ copyright = fi.getString();
+ }
+ if ("adminname".equals(fi.getFieldName())) {
+ adminname = fi.getString();
+ }
+ if ("adminemail".equals(fi.getFieldName())) {
+ adminemail = fi.getString();
+ }
+ if ("adminphone".equals(fi.getFieldName())) {
+ adminphone = fi.getString();
+ }
+ if ("logFileSize".equals(fi.getFieldName())) {
+ logFileSize = fi.getString();
+ }
+ if ("logFileName".equals(fi.getFieldName())) {
+ logFileName = fi.getString();
+ }
+ if ("logFileLevel".equals(fi.getFieldName())) {
+ logFileLevel = fi.getString();
+ }
+ if ("logFileKeep".equals(fi.getFieldName())) {
+ logFileKeep = fi.getString();
+ }
+ if ("sendMailServer".equals(fi.getFieldName())) {
+ sendMailServer = fi.getString();
+ }
+ if ("sendMailUser".equals(fi.getFieldName())) {
+ sendMailUser = fi.getString();
+ }
+ if ("sendMailPasswd".equals(fi.getFieldName())) {
+ sendMailPasswd = fi.getString();
+ }
+ if ("sendMailFrom".equals(fi.getFieldName())) {
+ sendMailFrom = fi.getString();
+ }
+ if ("sendMailSig".equals(fi.getFieldName())) {
+ sendMailSig = fi.getString();
+ }
+ if ("siteURL".equals(fi.getFieldName())) {
+ siteURL = fi.getString();
+ }
+ if ("emailEnableWelcome".equals(fi.getFieldName())) {
+ emailEnableWelcome = fi.getString();
+ }
+ if ("emailEnableRecoverPassUser".equals(fi.getFieldName())) {
+ emailEnableRecoverPassUser = fi.getString();
+ }
+ if ("emailEnableAssignedRetakes".equals(fi.getFieldName())) {
+ emailEnableAssignedRetakes = fi.getString();
+ }
+ if ("emailEnableChangePassword".equals(fi.getFieldName())) {
+ emailEnableChangePassword = fi.getString();
+ }
+ if ("emailEnableUserEdit".equals(fi.getFieldName())) {
+ emailEnableUserEdit = fi.getString();
+ }
+ if ("emailEnableStudentPassFail".equals(fi.getFieldName())) {
+ emailEnableStudentPassFail = fi.getString();
+ }
+ if ("emailEnableManagerSummaryReport".equals(fi.getFieldName())) {
+ emailEnableManagerSummaryReport = fi.getString();
+ }
+ if ("emailEnableBeforeDue".equals(fi.getFieldName())) {
+ emailEnableBeforeDue = fi.getString();
+ }
+ if ("emailEnablePastDue".equals(fi.getFieldName())) {
+ emailEnablePastDue = fi.getString();
+ }
+ if ("emailBeforeDueDate1".equals(fi.getFieldName())) {
+ emailBeforeDueDate1 = fi.getString();
+ }
+ if ("emailBeforeDueDate2".equals(fi.getFieldName())) {
+ emailBeforeDueDate2 = fi.getString();
+ }
+ if ("emailPastDueDate1".equals(fi.getFieldName())) {
+ emailPastDueDate1 = fi.getString();
+ }
+ if ("emailPastDueDate2".equals(fi.getFieldName())) {
+ emailPastDueDate2 = fi.getString();
+ }
+ if ("apiEnable".equals(fi.getFieldName())) {
+ apiEnable = fi.getString();
+ }
+ if ("apiCallbackCourseComplete".equals(fi.getFieldName())) {
+ apiCallbackCourseComplete = fi.getString();
+ }
+ if ("srEnable".equals(fi.getFieldName())) {
+ srEnable = fi.getString();
+ }
+ if ("secondaryLoginValidationIPExceptions".equals(fi.getFieldName())) {
+ secondaryLoginValidationIPExceptions = fi.getString();
+ }
+ if ("secondaryLoginValidationEnable".equals(fi.getFieldName())) {
+ secondaryLoginValidationEnable = fi.getString();
+ }
+ if ("ipEnable".equals(fi.getFieldName())) {
+ ipEnable = fi.getString();
+ }
+ if ("ipPatVal".equals(fi.getFieldName())) {
+ ipPatVal = fi.getString();
+ }
+ if ("srWGVal".equals(fi.getFieldName())) {
+ srWGVal = fi.getString();
+ }
+ if ("srLengthVal".equals(fi.getFieldName())) {
+ srLengthVal = fi.getString();
+ }
+ if ("alternativeLoginValidationEnable".equals(fi.getFieldName())) {
+ alternativeLoginValidationEnable = fi.getString();
+ }
+ if ("alternativeLoginValidationURL".equals(fi.getFieldName())) {
+ alternativeLoginValidationURL = fi.getString();
+ }
+ if ("alternativeLoginIDPrefix".equals(fi.getFieldName())) {
+ alternativeLoginIDPrefix = fi.getString();
+ }
+ if ("alternativeLoginLocalPassword".equals(fi.getFieldName())) {
+ alternativeLoginLocalPassword = fi.getString();
+ }
+ for (int j = 0; j < emailTemplates.size(); ++j) {
+ if (("emailTemplate"+j+"Subject").equals(fi.getFieldName())) {
+ emailTemplates.get(j).emailTemplateSubject = fi.getString();
+ }
+ if (("emailTemplate"+j+"Body").equals(fi.getFieldName())) {
+ emailTemplates.get(j).emailTemplateBody = fi.getString();
+ }
+ }
+ }
+ else {
+ // filename on the client
+ String fileName = fi.getName();
+ if ((fileName != null) && (fileName.length() > 1)) {
+ int fStart = fileName.lastIndexOf('\\');
+ if (fStart < 0) fStart = fileName.lastIndexOf('/');
+ if (fStart > 0) fileName = fileName.substring(fStart+1);
+ upFile = new File(session.getServletContext().getRealPath("images/companyLogo"+Integer.toString(current.getCompanyID())+fileName));
+ fi.write(upFile);
+ }
+ }
+ }
+ }
+ catch (Exception e) { } // ok, nothing to upload
+
+ if ("Save".equals(action)) {
+ boolean saveLog = false;
+ boolean saveSysconfig = false;
+ Company orig = (Company)current.clone();
+ if (name != null) current.setCompanyName(name);
+ if (copyright != null) current.setCompanyCopyright(copyright);
+ if (adminname != null) current.setCompanyAdminContactName(adminname);
+ if (adminemail != null) current.setCompanyAdminContactEMail(adminemail);
+ if (adminphone != null) current.setCompanyAdminContactPhone(adminphone);
+ if (logFileSize != null) {
+ if (!logFileSize.equals(currentLogFileSize)) {
+ saveLog = true;
+ eventsLogger.info("Log Max File Size changed from " + currentLogFileSize + " to " + logFileSize + " by user: " + ilsSession.getCurrentUserProfile().getUserProfileNum());
+ loggerProperties.setProperty("log4j.appender.E.MaxFileSize", logFileSize+"KB");
+ loggerProperties.setProperty("log4j.appender.S.MaxFileSize", logFileSize+"KB");
+ loggerProperties.setProperty("log4j.appender.A.MaxFileSize", logFileSize+"KB");
+ currentLogFileSize = logFileSize;
+ }
+ }
+ if (logFileName != null) {
+ if (!logFileName.equals(currentLogFileName)) {
+ File f = new File(logFileName);
+ if (f.isDirectory()) {
+ saveLog = true;
+ eventsLogger.info("Log Folder changed from " + currentLogFileName + " to " + logFileName + " by user: " + ilsSession.getCurrentUserProfile().getUserProfileNum());
+ File l = new File(f, "events.log");
+ loggerProperties.setProperty("log4j.appender.E.File", l.getCanonicalPath());
+ l = new File(f, "system.log");
+ loggerProperties.setProperty("log4j.appender.S.File", l.getCanonicalPath());
+ l = new File(f, "aicc.log");
+ loggerProperties.setProperty("log4j.appender.A.File", l.getCanonicalPath());
+ currentLogFileName = logFileName;
+ }
+ else {
+ validError = "Log folder specified does not exist. Please supply a valid folder";
+ }
+ }
+ }
+ if (logFileKeep != null) {
+ if (!logFileKeep.equals(currentLogFileKeep)) {
+ saveLog = true;
+ eventsLogger.info("Log Backups Kept changed from " + currentLogFileKeep + " to " + logFileKeep + " by user: " + ilsSession.getCurrentUserProfile().getUserProfileNum());
+ loggerProperties.setProperty("log4j.appender.E.MaxBackupIndex", logFileKeep);
+ loggerProperties.setProperty("log4j.appender.S.MaxBackupIndex", logFileKeep);
+ loggerProperties.setProperty("log4j.appender.A.MaxBackupIndex", logFileKeep);
+ currentLogFileKeep = logFileKeep;
+ }
+ }
+ if (logFileLevel != null) {
+ if (!logFileLevel.equals(currentLogFileLevel)) {
+ saveLog = true;
+ eventsLogger.info("Log Level changed from " + currentLogFileLevel + " to " + logFileLevel + " by user: " + ilsSession.getCurrentUserProfile().getUserProfileNum());
+ loggerProperties.setProperty("log4j.rootLogger", logFileLevel+", stdout, S");
+ currentLogFileLevel = logFileLevel;
+ }
+ }
+ if (sendMailServer != null) {
+ if (!sendMailServer.equals(currentSendMailServer)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("SendMailServer", sendMailServer);
+ currentSendMailServer = sendMailServer;
+ }
+ }
+ if (sendMailUser != null) {
+ if (!sendMailUser.equals(currentSendMailUser)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("SendMailUser", sendMailUser);
+ currentSendMailUser = sendMailUser;
+ }
+ }
+ if (sendMailPasswd != null) {
+ if (!sendMailPasswd.equals(currentSendMailPasswd)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("SendMailPasswd", sendMailPasswd);
+ currentSendMailPasswd = sendMailPasswd;
+ }
+ }
+ if (sendMailFrom != null) {
+ if (!sendMailFrom.equals(currentSendMailFrom)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("SendMailFrom", sendMailFrom);
+ currentSendMailFrom = sendMailFrom;
+ }
+ }
+ if (sendMailSig != null) {
+ if (!sendMailSig.equals(currentSendMailSig)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("SendMailSig", sendMailSig);
+ currentSendMailSig = sendMailSig;
+ }
+ }
+ if (siteURL != null) {
+ if (!siteURL.equals(currentSiteURL)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("SiteURL", siteURL);
+ currentSiteURL = siteURL;
+ }
+ }
+ if (emailBeforeDueDate1 != null) {
+ if (!emailBeforeDueDate1.equals(currentEmailBeforeDueDate1)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailBeforeDueDate1", emailBeforeDueDate1);
+ currentEmailBeforeDueDate1 = emailBeforeDueDate1;
+ }
+ }
+ if (emailBeforeDueDate2 != null) {
+ if (!emailBeforeDueDate2.equals(currentEmailBeforeDueDate2)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailBeforeDueDate2", emailBeforeDueDate2);
+ currentEmailBeforeDueDate2 = emailBeforeDueDate2;
+ }
+ }
+ if (emailPastDueDate1 != null) {
+ if (!emailPastDueDate1.equals(currentEmailPastDueDate1)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailPastDueDate1", emailPastDueDate1);
+ currentEmailPastDueDate1 = emailPastDueDate1;
+ }
+ }
+ if (emailPastDueDate2 != null) {
+ if (!emailPastDueDate2.equals(currentEmailPastDueDate2)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailPastDueDate2", emailPastDueDate2);
+ currentEmailPastDueDate2 = emailPastDueDate2;
+ }
+ }
+ if (apiEnable == null) { apiEnable = "off"; }
+ if (!apiEnable.equals(currentAPIEnable)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("APIEnable", apiEnable);
+ currentAPIEnable = apiEnable;
+ }
+ if (apiCallbackCourseComplete != null) {
+ if (!apiCallbackCourseComplete.equals(currentAPICallbackCourseComplete)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("APICallbackCourseComplete", apiCallbackCourseComplete);
+ currentAPICallbackCourseComplete = apiCallbackCourseComplete;
+ }
+ }
+ if (srEnable == null) { srEnable = "off"; }
+ if (!srEnable.equals(currentSREnable)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("SREnable", srEnable);
+ currentSREnable = srEnable;
+ }
+ if (ipEnable == null) { ipEnable = "off"; }
+ if (!ipEnable.equals(currentIPEnable)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("IPEnable", ipEnable);
+ currentIPEnable = ipEnable;
+ }
+ if (secondaryLoginValidationEnable == null) { secondaryLoginValidationEnable = "off"; }
+ if (!secondaryLoginValidationEnable.equals(currentSecondaryLoginValidationEnable)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("SecondaryLoginValidationEnable", secondaryLoginValidationEnable);
+ currentSecondaryLoginValidationEnable = secondaryLoginValidationEnable;
+ }
+ if (secondaryLoginValidationIPExceptions != null) {
+ if (!secondaryLoginValidationIPExceptions.equals(currentSecondaryLoginValidationIPExceptions)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("SecondaryLoginValidationIPExceptions", secondaryLoginValidationIPExceptions);
+ currentSecondaryLoginValidationIPExceptions = secondaryLoginValidationIPExceptions;
+ }
+ }
+ if (ipPatVal != null) {
+ if (!ipPatVal.equals(currentIPPatVal)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("IPPatVal", ipPatVal);
+ currentIPPatVal = ipPatVal;
+ }
+ }
+ if (srWGVal != null) {
+ if (!srWGVal.equals(currentSRWGVal)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("SRWGVal", srWGVal);
+ currentSRWGVal = srWGVal;
+ }
+ }
+ if (srLengthVal != null) {
+ if (!srLengthVal.equals(currentSRLengthVal)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("SRLengthVal", srLengthVal);
+ currentSRLengthVal = srLengthVal;
+ }
+ }
+ if (alternativeLoginValidationEnable == null) { alternativeLoginValidationEnable = "off"; }
+ if (!alternativeLoginValidationEnable.equals(currentAlternativeLoginValidationEnable)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("AlternativeLoginValidationEnable", alternativeLoginValidationEnable);
+ currentAlternativeLoginValidationEnable = alternativeLoginValidationEnable;
+ }
+ if (alternativeLoginValidationURL != null) {
+ if (!alternativeLoginValidationURL.equals(currentAlternativeLoginValidationURL)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("AlternativeLoginValidationURL", alternativeLoginValidationURL);
+ currentAlternativeLoginValidationURL = alternativeLoginValidationURL;
+ }
+ }
+ if (alternativeLoginIDPrefix != null) {
+ if (!alternativeLoginIDPrefix.equals(currentAlternativeLoginIDPrefix)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("AlternativeLoginIDPrefix", alternativeLoginIDPrefix);
+ currentAlternativeLoginIDPrefix = alternativeLoginIDPrefix;
+ }
+ }
+ if (alternativeLoginLocalPassword != null) {
+ if (!alternativeLoginLocalPassword.equals(currentAlternativeLoginLocalPassword)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("AlternativeLoginLocalPassword", alternativeLoginLocalPassword);
+ currentAlternativeLoginLocalPassword = alternativeLoginLocalPassword;
+ }
+ }
+ for (int i = 0; i < emailTemplates.size(); i++) {
+ EMailTemplate t = emailTemplates.get(i);
+ if (t.emailTemplateSubject != null) {
+ if (!t.emailTemplateSubject.equals(t.currentEMailTemplateSubject)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailTemplate"+i+"Subject", t.emailTemplateSubject);
+ t.currentEMailTemplateSubject = t.emailTemplateSubject;
+ }
+ }
+ if (t.emailTemplateBody != null) {
+ if (!t.emailTemplateBody.equals(t.currentEMailTemplateBody)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailTemplate"+i+"Body", t.emailTemplateBody);
+ t.currentEMailTemplateBody = t.emailTemplateBody;
+ }
+ }
+ }
+ if (emailEnableWelcome == null) { emailEnableWelcome = "off"; }
+ if (!emailEnableWelcome.equals(currentEmailEnableWelcome)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailEnableWelcome", emailEnableWelcome);
+ currentEmailEnableWelcome = emailEnableWelcome;
+ }
+ if (emailEnableRecoverPassUser == null) { emailEnableRecoverPassUser = "off"; }
+ if (!emailEnableRecoverPassUser.equals(currentEmailEnableRecoverPassUser)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailEnableRecoverPassUser", emailEnableRecoverPassUser);
+ currentEmailEnableRecoverPassUser = emailEnableRecoverPassUser;
+ }
+ if (emailEnablePastDue == null) { emailEnablePastDue = "off"; }
+ if (!emailEnablePastDue.equals(currentEmailEnablePastDue)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailEnablePastDue", emailEnablePastDue);
+ currentEmailEnablePastDue = emailEnablePastDue;
+ }
+ if (emailEnableBeforeDue == null) { emailEnableBeforeDue = "off"; }
+ if (!emailEnableBeforeDue.equals(currentEmailEnableBeforeDue)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailEnableBeforeDue", emailEnableBeforeDue);
+ currentEmailEnableBeforeDue = emailEnableBeforeDue;
+ }
+ if (emailEnableAssignedRetakes == null) { emailEnableAssignedRetakes = "off"; }
+ if (!emailEnableAssignedRetakes.equals(currentEmailEnableAssignedRetakes)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailEnableAssignedRetakes", emailEnableAssignedRetakes);
+ currentEmailEnableAssignedRetakes = emailEnableAssignedRetakes;
+ }
+ if (emailEnableChangePassword == null) { emailEnableChangePassword = "off"; }
+ if (!emailEnableChangePassword.equals(currentEmailEnableChangePassword)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailEnableChangePassword", emailEnableChangePassword);
+ currentEmailEnableChangePassword = emailEnableChangePassword;
+ }
+ if (emailEnableUserEdit == null) { emailEnableUserEdit = "off"; }
+ if (!emailEnableUserEdit.equals(currentEmailEnableUserEdit)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailEnableUserEdit", emailEnableUserEdit);
+ currentEmailEnableUserEdit = emailEnableUserEdit;
+ }
+ if (emailEnableStudentPassFail == null) { emailEnableStudentPassFail = "off"; }
+ if (!emailEnableStudentPassFail.equals(currentEmailEnableStudentPassFail)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailEnableStudentPassFail", emailEnableStudentPassFail);
+ currentEmailEnableStudentPassFail = emailEnableStudentPassFail;
+ }
+ if (emailEnableManagerSummaryReport == null) { emailEnableManagerSummaryReport = "off"; }
+ if (!emailEnableManagerSummaryReport.equals(currentEmailEnableManagerSummaryReport)) {
+ saveSysconfig = true;
+ sysConfigProperties.setProperty("EmailEnableManagerSummaryReport", emailEnableManagerSummaryReport);
+ currentEmailEnableManagerSummaryReport = emailEnableManagerSummaryReport;
+ }
+ int logSize = 0;
+ int logKeep = 0;
+ try { logSize = Integer.parseInt(currentLogFileSize); } catch (Exception e) {}
+ try { logKeep = Integer.parseInt(currentLogFileKeep); } catch (Exception e) {}
+
+ statusMsg = "Warning: Your changes have not been saved.";
+ if ((current.getCompanyName() == null) || (current.getCompanyName().length() < 1))
+ validError = "You must supply a Company Name";
+ else if ((current.getCompanyCopyright() == null) || (current.getCompanyCopyright().length() < 1))
+ validError = "You must supply a Company Copyright line.";
+ else if ((current.getCompanyAdminContactName() == null) || (current.getCompanyAdminContactName().length() < 1))
+ validError = "You must supply a Company Admin Contact Name.";
+ else if ((current.getCompanyAdminContactEMail() == null) || (current.getCompanyAdminContactEMail().length() < 1))
+ validError = "You must supply a Company Admin Contact EMail.";
+ else if ((current.getCompanyAdminContactPhone() == null) || (current.getCompanyAdminContactPhone().length() < 1))
+ validError = "You must supply a Company Admin Contact Phone.";
+ else if (logSize < 100 || logSize > 50000)
+ validError = "You must supply a Log File Maximum Size between 100 and 50000.";
+ else if (logKeep < 1 || logKeep > 999)
+ validError = "You must supply a Log File Maximum Backups between 1 and 999.";
+ else {
+System.out.println("Should be saving to: " + sysConfigFile);
+ if (upFile != null) {
+ current.setCompanyLogoURL("images/"+upFile.getName());
+ }
+ current.save(orig);
+ if (saveLog) loggerProperties.store(new FileOutputStream(session.getServletContext().getRealPath("/WEB-INF/classes/log4j.properties")), "Last updated by "+user.getUserProfileNum());
+ if (saveSysconfig) {
+System.out.println("saving to: " + sysConfigFile);
+ sysConfigProperties.store(new FileOutputStream(sysConfigFile), "Last updated by "+user.getUserProfileNum());
+ session.setAttribute("sysconfig."+ilsSession.getCompanyID(), null);
+ }
+ statusMsg = "Your changes have been saved.";
+ }
+ }
+ if ("Edit".equals(action)) {
+ String aid = request.getParameter("aid");
+ if (aid != null) {
+ out.print("<html><head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=admin_announceedit.jsp?aid="+aid+"\"></head></html>");
+ return;
+ }
+ String rid = request.getParameter("rid");
+ if (rid != null) {
+ out.print("<html><head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=admin_resourceedit.jsp?rid="+rid+"\"></head></html>");
+ return;
+ }
+
+ }
+
+ if ("Delete".equals(action)) {
+ String []aids = request.getParameterValues("aid");
+ if (aids != null) {
+ for (int i = 0; i < aids.length; i++) {
+ Announcement.deleteAnnouncement(ilsSession, Integer.parseInt(aids[i]));
+ }
+ statusMsg = "Your changes have been saved.";
+ }
+ String []rids = request.getParameterValues("rid");
+ if (rids != null) {
+ for (int i = 0; i < rids.length; i++) {
+ Resource.deleteResource(ilsSession, Integer.parseInt(rids[i]));
+ }
+ statusMsg = "Your changes have been saved.";
+ }
+ }
+
+
+ Vector announces = Announcement.getAllAnnouncements(ilsSession);
+ Vector resources = Resource.getAllResources(ilsSession);
+
+ final String sort = request.getParameter("sort");
+
+ if (sort != null) {
+ if (sort.startsWith("a") && announces != null) {
+ java.util.Collections.sort(announces, new Comparator() {
+ public int compare(Object o1, Object o2) {
+ if ("aname".equals(sort)) {
+ return ((Announcement)o1).getAnnounceTitle().compareTo(((Announcement)o2).getAnnounceTitle());
+ }
+ if ("asdate".equals(sort)) {
+ Date d1 = ((Announcement)o1).getAnnouncePostDate();
+ Date d2 = ((Announcement)o2).getAnnouncePostDate();
+ long i1 = (d1 == null) ? 0 : d1.getTime();
+ long i2 = (d2 == null) ? 0 : d2.getTime();
+ return (i1 > i2) ? -1 : (i1 == i2) ? 0 : 1;
+ }
+ if ("aedate".equals(sort)) {
+ Date d1 = ((Announcement)o1).getAnnounceExpiration();
+ Date d2 = ((Announcement)o2).getAnnounceExpiration();
+ long i1 = (d1 == null) ? 0 : d1.getTime();
+ long i2 = (d2 == null) ? 0 : d2.getTime();
+ return (i1 > i2) ? -1 : (i1 == i2) ? 0 : 1;
+ }
+ return 0;
+ }
+ });
+ }
+ else if (sort.startsWith("r") && resources != null) {
+ String pp = session.getServletContext().getRealPath("x");
+ final String prefixPath = pp.substring(0, pp.length());
+ java.util.Collections.sort(resources, new Comparator() {
+ public int compare(Object o1, Object o2) {
+ if ("rfname".equals(sort)) {
+ return ((Resource)o1).getResourceURL().compareTo(((Resource)o2).getResourceURL());
+ }
+ if ("rdesc".equals(sort)) {
+ return ((Resource)o1).getResourceTitle().compareTo(((Resource)o2).getResourceTitle());
+ }
+ if ("rsize".equals(sort)) {
+ String p1 = ((Resource)o1).getResourceURL();
+ String p2 = ((Resource)o2).getResourceURL();
+ File rf1 = new File(prefixPath+p1);
+ File rf2 = new File(prefixPath+p2);
+ return (rf1.length() > rf2.length()) ? -1 : (rf1.length() == rf2.length()) ? 0 : 1;
+ }
+ if ("rdate".equals(sort)) {
+ Date d1 = ((Resource)o1).getResourcePostDate();
+ Date d2 = ((Resource)o2).getResourcePostDate();
+ long i1 = (d1 == null) ? 0 : d1.getTime();
+ long i2 = (d2 == null) ? 0 : d2.getTime();
+ return (i1 > i2) ? -1 : (i1 == i2) ? 0 : 1;
+ }
+ return 0;
+ }
+ });
+ }
+ }
+
+%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
+<head>
+<title><%= ilsSession.getCurrentCompany().getCompanyName() %> eLearning Portal</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<style type="text/css">
+#navlist {
+ border-bottom: 1px solid #ccc;
+ margin: 0 0 0 0;
+ padding-bottom: 19px;
+ padding-left: 10px;
+}
+
+#navlist ul, #navlist li {
+ display: inline;
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+}
+
+#navlist span {
+ background: #E8EBF0;
+ border: 1px solid #ccc;
+ color: #666;
+ float: left;
+ font-family: "Trebuchet MS", verdana, lucida, arial, helvetica, sans-serif;
+ font-size: 1.0em;
+ font-weight: normal;
+ line-height: 1.4em;
+ margin-right: 8px;
+ padding: 1px 5px 0px 5px;
+ text-decoration: none;
+}
+
+div.emailTemplate div.emailTemplateCurrent {
+}
+
+div.emailTemplateCurrent {
+ display:inline;
+}
+
+div.emailTemplate{
+ display:none;
+ visibility:hidden;
+}
+#navlist span.current {
+ background: #fff;
+ border-bottom: 1px solid #fff;
+ color: #000;
+}
+
+#navlist span:hover {
+ color: #ff0000;
+ background: #C5D6EA;
+}
+</style>
+
+<link href="lms_style.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="crosswire.js"></script>
+<script type="text/javascript">
+<!--
+function confirmSubmit(form, boxid) {
+ box=document.getElementById(boxid);
+ choice = box.options[box.selectedIndex].value;
+ if (choice == 'Delete') {
+ if (confirm("Are you sure?")) {
+ form.submit();
+ }
+ }
+ else {
+ form.submit();
+ }
+}
+
+function setTemplateVisible(n) {
+ for (i = 0; i < <%= emailTemplates.size() %>; i++) {
+ s = document.getElementById('emailTemplateMenu'+i);
+ s.className = (i == n) ? "current" : "";
+ d = document.getElementById('emailTemplate'+i);
+ d.className = (i == n) ? "emailTemplateCurrent" : "emailTemplate";
+ }
+}
+
+function initPage() {
+ setTemplateVisible(0);
+}
+
+// -->
+</script>
+</head>
+
+<body onLoad="initPage()">
+<%@ include file="header.jsp" %>
+ <div id="pageContainer">
+<%@ include file="menu.jsp" %>
+<div id="content">
+<div id="pageTitles">
+System Management<br/>
+<span class="instructiontxt"><%= statusMsg %></span><br/>
+<span class="instructiontxt"><%= validError %></span>
+</div>
+<form id="systemsave" method="post" action="admin_systemmanagement.jsp" enctype="multipart/form-data">
+ <table cellpadding="0" id="tableForm" class="tableForm">
+ <tr>
+ <th>Edit System Settings</th>
+ </tr>
+ <tr>
+ <td>
+ <input type="hidden" name="action" value="Save"/>
+ <table id="tableFormData" class="tableFormData">
+ <tr>
+ <td class="formHeadings">Version :</td>
+ <td colspan="2"><%=Utils.getVersionString()%></td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Company ID :</td>
+ <td colspan="2"><%=current.getCompanyID()%></td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Company Name : </td>
+ <td colspan="2"><input name="name" type="text" value="<%=current.getCompanyName()%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Upload Logo Image<br/>
+ <span class="instructiontxt">(147 x 67 pixels)</span> :</td>
+ <td><input name="file" type="file" size="40"/></td>
+ <!--
+ <td width="27%" class="coursetxtHDR"><table width="100%" border="0">
+ <tr>
+ <td width="12%"><img src="images/browse_btn.gif" width="20" height="20" alt=""/></td>
+ <td width="88%"><span class="formbtn">Browse</span></td>
+ </tr>
+ </table></td>
+ -->
+ </tr>
+ <tr>
+ <td class="formHeadings">Logo Image:</td>
+ <td colspan="2"><img src="<%=current.getCompanyLogoURL()%>" alt="Company Logo"/></td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Copyright Text:</td>
+ <td colspan="2"><input name="copyright" type="text" value="<%=current.getCompanyCopyright()%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">System Administrator Contact Name:</td>
+ <td colspan="2"><input name="adminname" type="text" value="<%=current.getCompanyAdminContactName()%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">System Administrator Contact EMail:</td>
+ <td colspan="2"><input name="adminemail" type="text" value="<%=current.getCompanyAdminContactEMail()%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">System Administrator Contact Phone: </td>
+ <td colspan="2"><input name="adminphone" type="text" value="<%=current.getCompanyAdminContactPhone()%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Log Level: </td>
+ <td>
+ <select id="logFileLevelSelectBox" name="logFileLevel">
+ <option value="FATAL" <%="FATAL".equals(currentLogFileLevel)?"selected=\"selected\"":""%>>FATAL - show only app fatalities</option>
+ <option value="ERROR" <%="ERROR".equals(currentLogFileLevel)?"selected=\"selected\"":""%>>ERROR - show only errors and worse</option>
+ <option value="WARN" <%="WARN".equals(currentLogFileLevel)?"selected=\"selected\"":"" %>>WARN - show only warnings and worse</option>
+ <option value="INFO" <%="INFO".equals(currentLogFileLevel)?"selected=\"selected\"":"" %>>INFO - PRODUCTION LOG LEVEL</option>
+ <option value="DEBUG" <%="DEBUG".equals(currentLogFileLevel)?"selected=\"selected\"":""%>>DEBUG - show debug info</option>
+ <option value="TRACE" <%="TRACE".equals(currentLogFileLevel)?"selected=\"selected\"":""%>>TRACE - show execution tracing</option>
+ </select>
+ <input type="button" value="Show Logs..." onClick="window.open('viewLog.jsp', 'Log', 'width=800,height=600,scrollbars=1');" />
+ </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Log Folder: </td>
+ <td colspan="2">
+ <input name="logFileName" type="text" value="<%=currentLogFileName%>" size="40"/>
+ <input type="button" value="Default" onClick="<%= "logFileName.value='"+session.getServletContext().getRealPath("/log/").replace('\\', '/')+"'"%>;return false;" />
+ </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Log File Max Size (in KB): </td>
+ <td colspan="2"><input name="logFileSize" type="text" value="<%=currentLogFileSize%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Log File Max Backups: </td>
+ <td colspan="2"><input name="logFileKeep" type="text" value="<%=currentLogFileKeep%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
+ </tr>
+ </table> </td> </tr>
+ </table>
+
+
+ <table cellpadding="0" id="tableFormEmail" class="tableForm">
+ <tr>
+ <th>Edit Email Settings</th>
+ </tr>
+ <tr>
+ <td>
+ <table id="tableFormData2" class="tableFormData">
+ <tr>
+ <td class="formHeadings">Outgoing Mail Server: </td>
+ <td colspan="2"><input name="sendMailServer" type="text" value="<%=currentSendMailServer%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Outgoing Mail User: </td>
+ <td colspan="2"><input name="sendMailUser" type="text" value="<%=currentSendMailUser%>" size="40" autocomplete="off"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Outgoing Mail Password: </td>
+ <td colspan="2"><input name="sendMailPasswd" type="password" value="<%=currentSendMailPasswd%>" size="40" autocomplete="off"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Default "From" Email Address: </td>
+ <td colspan="2"><input name="sendMailFrom" type="text" value="<%=currentSendMailFrom%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Default EMail Signature: </td>
+ <td colspan="2"><textarea name="sendMailSig" cols="40" rows="4"><%=currentSendMailSig%></textarea></td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Site URL: </td>
+ <td colspan="2"><input name="siteURL" type="text" value="<%=currentSiteURL%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td>Enable Automatic E-Mail Notification</td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings"></td>
+ <td colspan="2"><input name="emailEnableWelcome" type="checkbox" value="on" <%="on".equals(currentEmailEnableWelcome)?"checked=\"checked\"":""%> size="40"/>Welcome Email For New Users</td>
+ </tr>
+ <tr>
+ <td class="formHeadings"></td>
+ <td colspan="2"><input name="emailEnableRecoverPassUser" type="checkbox" value="on" <%="on".equals(currentEmailEnableRecoverPassUser)?"checked=\"checked\"":""%> size="40"/>Recover Password/User Name</td>
+ </tr>
+ <tr>
+ <td class="formHeadings"></td>
+ <td colspan="2"><input name="emailEnableChangePassword" type="checkbox" value="on" <%="on".equals(currentEmailEnableChangePassword)?"checked=\"checked\"":""%> size="40"/>Change Password</td>
+ </tr>
+ <tr>
+ <td class="formHeadings"></td>
+ <td colspan="2"><input name="emailEnableStudentPassFail" type="checkbox" value="on" <%="on".equals(currentEmailEnableStudentPassFail)?"checked=\"checked\"":""%> size="40"/>Student Pass/Fail</td>
+ </tr>
+ <tr>
+ <td class="formHeadings"></td>
+ <td colspan="2"><input name="emailEnableManagerSummaryReport" type="checkbox" value="on" <%="on".equals(currentEmailEnableManagerSummaryReport)?"checked=\"checked\"":""%> size="40"/><t:t>Manager</t:t> Summary Report</td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td>Enable Automatic Recurrent Training Reminders</td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings"></td>
+ <td colspan="2"><input name="emailEnableBeforeDue" type="checkbox" value="on" <%="on".equals(currentEmailEnableBeforeDue)?"checked=\"checked\"":""%> size="40"/>Due Date : <input type="text" name="emailBeforeDueDate1" size="4" value="<%= currentEmailBeforeDueDate1 %>" /> Days and <input type="text" name="emailBeforeDueDate2" size="4" value="<%= currentEmailBeforeDueDate2 %>" /> Days Prior to Due Date</td>
+ </tr>
+ <tr>
+ <td class="formHeadings"></td>
+ <td colspan="2"><input name="emailEnablePastDue" type="checkbox" value="on" <%="on".equals(currentEmailEnablePastDue)?"checked=\"checked\"":""%> size="40"/>Past Due : <input type="text" name="emailPastDueDate1" size="4" value="<%= currentEmailPastDueDate1 %>"/> Days and <input type="text" name="emailPastDueDate2" size="4" value="<%= currentEmailPastDueDate2 %>" /> Days After Due Date</td>
+ </tr>
+ <tr>
+ <td class="formHeadings"></td>
+ <td colspan="2"><input name="emailEnableAssignedRetakes" type="checkbox" value="on" <%="on".equals(currentEmailEnableAssignedRetakes)?"checked=\"checked\"":""%> size="40"/>Assigned Retakes</td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td>Allow Users To Edit Their Email Address</td>
+ <td colspan="2"><input name="emailEnableUserEdit" type="checkbox" value="on" <%="on".equals(currentEmailEnableUserEdit)?"checked=\"checked\"":""%> size="40"/></td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+
+
+
+ <tr><td colspan="3">
+ <div id="navlist">
+ <ul>
+ <%
+ for (int i = 0; i < emailTemplates.size(); i++) {
+ %>
+ <li><span id="emailTemplateMenu<%= i %>" onClick="setTemplateVisible(<%= i %>)"><%= emailTemplates.get(i).name %></span></li>
+ <%
+ }
+ %>
+ </ul></div>
+ <%
+ for (int i = 0; i < emailTemplates.size(); i++) {
+ EMailTemplate t = emailTemplates.get(i);
+ %>
+ <div class="emailTemplate" id="emailTemplate<%= i %>">
+ <table>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings"><%= t.name %></td><td></td><td>
+ <input type="button" value="Default" onClick="emailTemplate<%= i %>Subject.value='<%= StringEscapeUtils.escapeJavaScript(t.defSubject) %>';emailTemplate<%= i %>Body.value='<%= StringEscapeUtils.escapeJavaScript(t.defBody) %>';return false;" />
+ </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Subject: </td>
+ <td colspan="2"><input name="emailTemplate<%= i %>Subject" type="text" value="<%= (t.currentEMailTemplateSubject == null) ? t.defSubject : t.currentEMailTemplateSubject %>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Body: </td>
+ <td colspan="2"><textarea style="width:100%;" name="emailTemplate<%= i %>Body" cols="40" rows="7"><%= (t.currentEMailTemplateBody == null) ? t.defBody : t.currentEMailTemplateBody %></textarea></td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ </table>
+ </div>
+ <%
+ }
+ %>
+ </td></tr>
+
+
+
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
+ </tr>
+ </table> </td> </tr>
+ </table>
+
+ <table cellpadding="0" id="tableFormAPI" class="tableForm">
+ <tr>
+ <th>Web Service API Settings</th>
+ </tr>
+ <tr>
+ <td>
+ <table id="tableFormData2" class="tableFormData">
+ <tr>
+ <td class="formHeadings">Enable: </td>
+ <td colspan="2"><input name="apiEnable" type="checkbox" value="on" <%="on".equals(currentAPIEnable)?"checked=\"checked\"":""%> size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Callback URL - Course Complete: </td>
+ <td colspan="2"><input name="apiCallbackCourseComplete" type="text" value="<%=currentAPICallbackCourseComplete%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
+ </tr>
+ </table> </td>
+ </tr>
+ </table>
+
+ <table cellpadding="0" id="tableFormSR" class="tableForm">
+ <tr>
+ <th>Self Registration</th>
+ </tr>
+ <tr>
+ <td>
+ <table id="tableFormData2" class="tableFormData">
+ <tr>
+ <td class="formHeadings">Enable: </td>
+ <td colspan="2"><input name="srEnable" type="checkbox" value="on" <%="on".equals(currentSREnable)?"checked=\"checked\"":""%> size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings"><t:t>Workgroup</t:t> Field Must Contain These Characters<br/>(One Validation String Per Line)</td>
+ <td colspan="2"><textarea name="srWGVal" rows="3" cols="40"><%=currentSRWGVal%></textarea></td>
+ </tr>
+ <tr>
+ <td class="formHeadings"><t:t>Workgroup</t:t> Field Must Contain Exactly</td>
+ <td colspan="2"><input name="srLengthVal" type="text" value="<%=currentSRLengthVal%>" size="2"/> <span class="formHeadings">Characters (Maximum 75 Characters)</span></td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
+ </tr>
+ </table> </td>
+ </tr>
+ </table>
+ <table cellpadding="0" class="tableForm">
+ <tr>
+ <th>ID Check Validation at Login</th>
+ </tr>
+ <tr>
+ <td>
+ <table class="tableFormData">
+ <tr>
+ <td class="formHeadings">Enable: </td>
+ <td colspan="2"><input name="secondaryLoginValidationEnable" type="checkbox" value="on" <%="on".equals(currentSecondaryLoginValidationEnable)?"checked=\"checked\"":""%> size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Disable ID Check at Login for these<br/>IP Addresses</td>
+ <td colspan="2"><textarea name="secondaryLoginValidationIPExceptions" rows="3" cols="40"><%=currentSecondaryLoginValidationIPExceptions %></textarea></td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2">Valid IP Address Patterns (e.g., 192.168.*)<br/>(One IP Address Pattern Per Line)</td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
+ </tr>
+ </table> </td>
+ </tr>
+ </table>
+ <table cellpadding="0" id="tableFormSR" class="tableForm">
+ <tr>
+ <th>Course IP Address Restriction</th>
+ </tr>
+ <tr>
+ <td>
+ <table id="tableFormData2" class="tableFormData">
+ <tr>
+ <td class="formHeadings">Enable: </td>
+ <td colspan="2"><input name="ipEnable" type="checkbox" value="on" <%="on".equals(currentIPEnable)?"checked=\"checked\"":""%> size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Valid IP Address Patterns (e.g., 192.168.*)<br/>(One IP Address Pattern Per Line)</td>
+ <td colspan="2"><textarea name="ipPatVal" rows="3" cols="40"><%=currentIPPatVal%></textarea></td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
+ </tr>
+ </table> </td>
+ </tr>
+ </table>
+
+ <table cellpadding="0" id="tableForm2" class="tableForm">
+ <tr>
+ <th>Alternative Login Validation Settings</th>
+ </tr>
+ <tr>
+ <td>
+ <table id="tableFormData2" class="tableFormData">
+ <tr>
+ <td class="formHeadings">Enable: </td>
+ <td colspan="2"><input name="alternativeLoginValidationEnable" type="checkbox" value="on" <%="on".equals(currentAlternativeLoginValidationEnable)?"checked=\"checked\"":""%> size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">Validation Service URL: </td>
+ <td colspan="2"><input name="alternativeLoginValidationURL" type="text" value="<%=currentAlternativeLoginValidationURL%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">ILS Prefix to UserID: </td>
+ <td colspan="2"><input name="alternativeLoginIDPrefix" type="text" value="<%=currentAlternativeLoginIDPrefix%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td class="formHeadings">ILS User Local Password: </td>
+ <td colspan="2"><input name="alternativeLoginLocalPassword" type="text" value="<%=currentAlternativeLoginLocalPassword%>" size="40"/> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"> </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td colspan="2"><a href="#" onClick="document.getElementById('systemsave').submit()"><img style="border:0;margin:0px 3px 0px 3px;" src="images/save_btn.gif" width="72" height="24" alt=""/></a> <a href="employee.jsp"><img style="border:0;" src="images/cancel_btn.gif" width="72" height="24" alt=""/></a></td>
+ </tr>
+ </table> </td> </tr>
+ </table>
+</form>
+<br/>
+ <form id="announc" method="get" action="admin_systemmanagement.jsp">
+ <table cellpadding="0" cellspacing="0" class="tableMain">
+ <tr>
+ <th>Announcements</th>
+ </tr>
+ <tr>
+ <td>
+ <table class="tableBTN">
+ <tr>
+ <td class="tableBTN_td1">
+ <table>
+ <tr>
+ <td><a href="admin_announceedit.jsp"><img style="border:0;" src="images/Add.gif" width="24" height="24" alt=""/></a></td>
+ <td><a href="admin_announceedit.jsp" class="formButtons">Add Announcement</a></td>
+ </tr>
+ </table> </td>
+ <td class="tableBTN_td1">
+ <select id="action1" name="action">
+ <option>Choose Action</option>
+ <option value="Edit" <%="Edit".equals(action)?"selected=\"selected\"":""%>>Edit</option>
+ <option value="Delete" <%="Delete".equals(action)?"selected=\"selected\"":""%>>Delete</option>
+ </select> </td>
+ <td>
+ <table>
+ <tr>
+ <td><a href="#" onClick="confirmSubmit(document.getElementById('announc'), 'action1');"><img style="border:0;" src="images/performaction_btn.gif" width="24" height="24" alt=""/></a></td>
+ <td><a href="#" class="formButtons" onClick="confirmSubmit(document.getElementById('announc'), 'action1');">Perform Action</a></td>
+ </tr>
+ </table> </td>
+ </tr>
+ </table> </td>
+ </tr>
+ <tr>
+ <td>
+ <table class="tableDataList">
+ <tr>
+ <th><input type="checkbox" name="cba1" onClick="checkAll('annck', this.checked);"/></th>
+ <th><a href="admin_systemmanagement.jsp?sort=aname">Announcement</a></th>
+ <th><a href="admin_systemmanagement.jsp?sort=asdate">Initiated</a></th>
+ <th><a href="admin_systemmanagement.jsp?sort=aedate">Expires</a></th>
+ </tr>
+<%
+ for (int j = 0; j < announces.size(); j++) {
+ Announcement r = (Announcement)announces.get(j);
+ String sDate = (r.getAnnouncePostDate() != null) ? df.format(r.getAnnouncePostDate()) : "";
+ String eDate = (r.getAnnounceExpiration() != null) ? df.format(r.getAnnounceExpiration()) : "";
+%>
+ <tr>
+ <td><input type="checkbox" id="annck<%=j%>" name="aid" value="<%=r.getAnnounceID()%>"></td>
+ <td><%=r.getAnnounceTitle()%></td>
+ <td><%=sDate%></td>
+ <td><%=eDate%></td>
+ </tr>
+<%
+ }
+%>
+ </table> </td>
+ </tr>
+ </table>
+ </form>
+ <br />
+ <form id="resourc" method="get" action="admin_systemmanagement.jsp">
+
+ <table cellpadding="0" cellspacing="0" class="tableMain">
+ <tr>
+ <th>Resources</th>
+ </tr>
+ <tr>
+ <td>
+ <table class="tableBTN">
+ <tr>
+ <td class="tableBTN_td1">
+ <table >
+ <tr>
+ <td><a href="admin_resourceedit.jsp"><img style="border:0;" src="images/Add.gif" width="24" height="24" alt=""/></a></td>
+ <td><a href="admin_resourceedit.jsp" class="formButtons">Add Resource</a></td>
+ </tr>
+ </table> </td>
+ <td class="tableBTN_td1">
+ <select id="action2" name="action">
+ <option>Choose Action</option>
+ <option value="Edit" <%="Edit".equals(action)?"selected=\"selected\"":""%>>Edit</option>
+ <option value="Delete" <%="Delete".equals(action)?"selected=\"selected\"":""%>>Delete</option>
+ </select> </td>
+ <td>
+ <table>
+ <tr>
+ <td><a href="#" onClick="confirmSubmit(document.getElementById('resourc'), 'action2');"><img style="border:0;" src="images/performaction_btn.gif" width="24" height="24" alt=""/></a></td>
+ <td><a href="#" class="formButtons" onClick="confirmSubmit(document.getElementById('resourc'), 'action2');">Perform Action</a></td>
+ </tr>
+ </table> </td>
+ </tr>
+ </table> </td>
+ </tr>
+ <tr>
+ <td>
+ <table class="tableDataList">
+ <tr>
+ <th><input type="checkbox" name="cba2" onClick="checkAll('resck', this.checked);"/></th>
+ <th><a href="admin_systemmanagement.jsp?sort=rfname">File Name</a></th>
+ <th><a href="admin_systemmanagement.jsp?sort=rdesc">File Description</a></th>
+ <th><a href="admin_systemmanagement.jsp?sort=rsize">Size</a></th>
+ <th><a href="admin_systemmanagement.jsp?sort=rdate">Date</a></th>
+ </tr>
+<%
+ for (int i = 0; i < resources.size(); i++) {
+ Resource r = (Resource)resources.get(i);
+ String path = r.getResourceURL();
+// URL ru = new URL(request.getRequestURL().toString(), path);
+ File rf = new File(session.getServletContext().getRealPath(path));
+ String fName = rf.getName();
+ String fSize = Integer.toString((int)rf.length() / 1000) + "kb";
+
+%>
+ <tr class="reporttxt">
+ <td><input type="checkbox" id="resck<%=i%>" name="rid" value="<%=r.getResourceID()%>"></td>
+ <td><a class="coursetxt" href="<%=r.getResourceURL()%>"><%=fName%></a></td>
+ <td><%=r.getResourceTitle()%></td>
+ <td><%=fSize%></td>
+ <td><%=df.format(r.getResourcePostDate()) %></td>
+ </tr>
+<%
+ }
+%>
+ </table> </td>
+ </tr>
+ </table>
+ </form>
+</div>
+<%@ include file="footer.jsp" %>
+</div>
+
+</body>
+</html>
More information about the Ils-source
mailing list