<%-- // // This file is part of the OpenNMS(R) Application. // // OpenNMS(R) is Copyright (C) 2002-2003 The OpenNMS Group, Inc. All rights reserved. // OpenNMS(R) is a derivative work, containing both original code, included code and modified // code that was published under the GNU General Public License. Copyrights for modified // and included code are below. // // OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc. // // Modifications: // // 2003 Feb 07: Fixed URLEncoder issues. // 2002 Nov 26: Fixed breadcrumbs issue. // // Original code base Copyright (C) 1999-2001 Oculan Corp. All rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // 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. // // For more information contact: // OpenNMS Licensing // http://www.opennms.org/ // http://www.opennms.com/ // --%> <%@page language="java" contentType="text/html" session="true" %> <%@page import="java.util.*"%> <%@page import="java.text.*"%> <%@page import="org.opennms.netmgt.config.*"%> <%@page import="org.opennms.netmgt.config.users.*"%> <% HttpSession userSession = request.getSession(false); User user = null; String userid = ""; UserManager userFactory; try { UserFactory.init(); userFactory = UserFactory.getInstance(); } catch (Exception e) { throw new ServletException("UserFactory:modify() " + e); } if (userSession != null) { user = (User) userSession.getAttribute("user.modifyUser.jsp"); userid = user.getUserId(); } %>

Modify User: <%=userid%>

<% String email = null; String pagerEmail = null; String xmppAddress = null; String numericPage = null; String numericPin = null; String textPage = null; String textPin = null; String fullName = null; String comments = null; Boolean isReadOnly = false; try { User usertemp = userFactory.getUser(userid); if (usertemp != null) { email = userFactory.getEmail(userid); pagerEmail = userFactory.getPagerEmail(userid); xmppAddress = userFactory.getXMPPAddress(userid); numericPage = userFactory.getNumericPage(userid); numericPin = userFactory.getNumericPin(userid); textPage = userFactory.getTextPage(userid); textPin = userFactory.getTextPin(userid); }else { Contact[] contact = user.getContact(); for (int i = 0; i < contact.length; i++) { Contact tempContact = contact[i]; if (contact[i].getType().equals((String)"email")) { email = contact[i].getInfo(); }else if (contact[i].getType().equals((String)"pagerEmail")) { pagerEmail = contact[i].getInfo(); }else if (contact[i].getType().equals((String)"xmppAddress")) { xmppAddress = contact[i].getInfo(); }else if (contact[i].getType().equals((String)"numericPage")) { numericPage = contact[i].getInfo(); }else if (contact[i].getType().equals((String)"textPage")) { textPage = contact[i].getInfo(); } } } fullName = user.getFullName(); comments = user.getUserComments(); isReadOnly = user.isReadOnly(); } catch (org.exolab.castor.xml.MarshalException e) { throw new ServletException("An Error occurred reading the users file", e); } catch (org.exolab.castor.xml.ValidationException e) { throw new ServletException("An Error occurred reading the users file", e); } %>

User Information

/>
" />
 

Notification Information

This panel allows you to modify information for each user, including their name, notification information, and duty schedules.

Notification Information provides the ability for you to configure contact information for each user, including any of email address, pager email (in the case that the pager can be reached as an email destination), XMPP address (for instant messages using the Jabber XMPP protocol), numeric service (for pagers that cannot display text messages), and text service (for alphanumeric pagers).

Duty Schedules allow you to flexibility to determine when users should receive notifications. A duty schedule consists of a list of days for which the time will apply and a time range, presented in military time with no punctuation. Using this standard, days run from 0000 to 2359.

If your duty schedules span midnight, or if your users work multiple, non-contiguous time periods, you will need to configure multiple duty schedules. To do so, select the number of duty schedules to add from the drop-down box next to [Add This Many Schedules], and click the button. Then, using the duty schedule fields you've just added, create a duty schedule from the start time to 2359 on one day, and enter a second duty schedule which begins at 0000 and ends at the end of that users coverage.

To remove configured duty schedules, put a check in the Delete column and click [Remove Checked Schedules].

To save your configuration, click on [Finish].

Duty Schedules

<% Collection dutySchedules = user.getDutyScheduleCollection(); %> <% int i = 0; Iterator iter = dutySchedules.iterator(); while (iter.hasNext()) { DutySchedule tmp = new DutySchedule((String) iter.next()); Vector curSched = tmp.getAsVector(); %> <%ChoiceFormat days = new ChoiceFormat("0#Mo|1#Tu|2#We|3#Th|4#Fr|5#Sa|6#Su"); for (int j = 0; j < 7; j++) { Boolean curDay = (Boolean) curSched.get(j); %> <%} %> <%i++; } %>
  Delete Mo Tu We Th Fr Sa Su Begin Time End Time
<%=(i + 1)%> />