Index: lams_admin/conf/xdoclet/struts-actions.xml =================================================================== diff -u -rded00a8f72f9f5318fb39ee9e9c6bd15d3ddf8c4 -r44f9636e4923ab01e51ff46d67b190caf4c93012 --- lams_admin/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision ded00a8f72f9f5318fb39ee9e9c6bd15d3ddf8c4) +++ lams_admin/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 44f9636e4923ab01e51ff46d67b190caf4c93012) @@ -1,4 +1 @@ - \ No newline at end of file Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/ToolContentListAction.java =================================================================== diff -u -r95219dd1bf9fbe3081733f637800fd8519b202d7 -r44f9636e4923ab01e51ff46d67b190caf4c93012 --- lams_admin/src/java/org/lamsfoundation/lams/admin/web/ToolContentListAction.java (.../ToolContentListAction.java) (revision 95219dd1bf9fbe3081733f637800fd8519b202d7) +++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/ToolContentListAction.java (.../ToolContentListAction.java) (revision 44f9636e4923ab01e51ff46d67b190caf4c93012) @@ -63,7 +63,7 @@ HttpServletResponse response) throws Exception { // check permission - if(!request.isUserInRole(Role.SYSADMIN)){ + if(!(request.isUserInRole(Role.SYSADMIN) || request.isUserInRole(Role.AUTHOR_ADMIN))){ request.setAttribute("errorName","ToolContentListAction"); request.setAttribute("errorMessage",AdminServiceProxy.getMessageService(getServlet().getServletContext()) .getMessage("error.authorisation")); Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/SysAdminStartAction.java =================================================================== diff -u --- lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/SysAdminStartAction.java (revision 0) +++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/action/SysAdminStartAction.java (revision 44f9636e4923ab01e51ff46d67b190caf4c93012) @@ -0,0 +1,87 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.admin.web.action; + +import java.util.ArrayList; + +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.lamsfoundation.lams.admin.service.AdminServiceProxy; +import org.lamsfoundation.lams.admin.web.dto.LinkBean; +import org.lamsfoundation.lams.usermanagement.Role; + +/** + * @author jliew + * + * @struts.action path="/sysadminstart" validate="false" + * @struts.action-forward name="sysadmin" path=".sysadmin" + */ +public class SysAdminStartAction extends Action { + + public ActionForward execute(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + + ArrayList links = new ArrayList(); + if (request.isUserInRole(Role.SYSADMIN)) { + LinkBean linkBean = new LinkBean("cache.do", "cache.title"); + links.add(linkBean); + linkBean = new LinkBean("config.do", "sysadmin.config.settings.edit"); + links.add(linkBean); + linkBean = new LinkBean("toolcontentlist.do", "sysadmin.edit.default.tool.content"); + links.add(linkBean); + linkBean = new LinkBean("usersearch.do", "admin.user.find"); + links.add(linkBean); + linkBean = new LinkBean("importexcel.do", "admin.user.import"); + links.add(linkBean); + linkBean = new LinkBean("disabledmanage.do", "admin.list.disabled.users"); + links.add(linkBean); + linkBean = new LinkBean("loginmaintain.do", "sysadmin.maintain.loginpage"); + links.add(linkBean); + linkBean = new LinkBean("serverlist.do", "sysadmin.maintain.external.servers"); + links.add(linkBean); + linkBean = new LinkBean("register.do", "sysadmin.register.server"); + links.add(linkBean); + } else if (request.isUserInRole(Role.AUTHOR_ADMIN)) { + LinkBean linkBean = new LinkBean("toolcontentlist.do", "sysadmin.edit.default.tool.content"); + links.add(linkBean); + } else { + request.setAttribute("errorName", "SysAdminStartAction"); + request.setAttribute("errorMessage", AdminServiceProxy + .getMessageService(getServlet().getServletContext()) + .getMessage("error.authorisation")); + return mapping.findForward("error"); + } + + request.setAttribute("links", links); + return mapping.findForward("sysadmin"); + } + +} Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/dto/LinkBean.java =================================================================== diff -u --- lams_admin/src/java/org/lamsfoundation/lams/admin/web/dto/LinkBean.java (revision 0) +++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/dto/LinkBean.java (revision 44f9636e4923ab01e51ff46d67b190caf4c93012) @@ -0,0 +1,51 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.admin.web.dto; + +public class LinkBean { + + private String link; + private String name; + + public LinkBean(String link, String name) { + this.link = link; + this.name = name; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} Index: lams_admin/web/sysadmin.jsp =================================================================== diff -u -r95219dd1bf9fbe3081733f637800fd8519b202d7 -r44f9636e4923ab01e51ff46d67b190caf4c93012 --- lams_admin/web/sysadmin.jsp (.../sysadmin.jsp) (revision 95219dd1bf9fbe3081733f637800fd8519b202d7) +++ lams_admin/web/sysadmin.jsp (.../sysadmin.jsp) (revision 44f9636e4923ab01e51ff46d67b190caf4c93012) @@ -2,23 +2,13 @@


-

-

+ +

+ "> + + +

+
-

-

- -

- -

- -

- -

- -

- -

-