Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/LoginMaintainAction.java =================================================================== diff -u --- lams_admin/src/java/org/lamsfoundation/lams/admin/web/LoginMaintainAction.java (revision 0) +++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/LoginMaintainAction.java (revision a6c0af353325aa608566b347d055d7ba0c78f2d7) @@ -0,0 +1,92 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +package org.lamsfoundation.lams.admin.web; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.DynaActionForm; +import org.lamsfoundation.lams.util.Configuration; +import org.lamsfoundation.lams.util.ConfigurationKeys; + +/** + *
+ * View Source + *
+ * + * @author Fei Yang + */ + +/** + * struts doclets + * + * @struts:action path="/loginmaintain" + * name = "LoginMaintainForm" + * scope = "request" + * validate="false" + * + * @struts:action-forward name="loginmaintain" path=".loginmaintain" + * + */ +public class LoginMaintainAction extends Action { + + + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) + throws Exception { + + DynaActionForm loginMaintainForm = (DynaActionForm) form; + loginMaintainForm.set("news",loadNews()); + return mapping.findForward("loginmaintain"); + } + + private String loadNews() throws IOException { + String filePath = Configuration.get(ConfigurationKeys.LAMS_EAR_DIR) + + File.separatorChar + "lams-www.war" + File.separatorChar + "news.html"; + BufferedReader bReader = null; + try{ + bReader = new BufferedReader(new FileReader(filePath)); + StringBuilder news = new StringBuilder(); + String line = bReader.readLine(); + while (line != null) { + news.append(line).append('\n'); + line = bReader.readLine(); + } + return news.toString(); + }finally{ + if(bReader!=null){ + bReader.close(); + } + } + } + +} Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/LoginSaveAction.java =================================================================== diff -u --- lams_admin/src/java/org/lamsfoundation/lams/admin/web/LoginSaveAction.java (revision 0) +++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/LoginSaveAction.java (revision a6c0af353325aa608566b347d055d7ba0c78f2d7) @@ -0,0 +1,191 @@ +/**************************************************************** + * Copyright (C) 2006 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.admin.web; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.UnsupportedEncodingException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.apache.struts.action.DynaActionForm; +import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.util.Configuration; +import org.lamsfoundation.lams.util.ConfigurationKeys; +import org.lamsfoundation.lams.web.action.LamsDispatchAction; + +/** + *+ * View Source + *
+ * + * @author Fei Yang + */ + +/** + * struts doclet + * + * @struts.action path = "/loginsave" + * name = "LoginMaintainForm" + * parameter = "method" + * scope = "request" + * input = ".loginmaintian" + * validate = "false" + * + * @struts.action-forward name="sysadmin" path=".sysadmin" + * @struts.action-forward name="loginmaintain" path=".loginmaintain" + */ +public class LoginSaveAction extends LamsDispatchAction { + + private static final String LOGO_TAG = "
+