1/*2 * Copyright 2000-2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.om.security.ldap;
1819import java.io.ByteArrayOutputStream;
20import java.io.PrintWriter;
21import java.util.Date;
22import java.util.Enumeration;
23import java.util.Hashtable;
24import java.util.Vector;
25import javax.naming.directory.Attribute;
26import javax.naming.directory.Attributes;
27import javax.naming.directory.BasicAttribute;
28import javax.naming.directory.BasicAttributes;
29import javax.servlet.http.HttpSessionBindingEvent;
30import javax.servlet.http.HttpSessionBindingListener;
3132import org.apache.jetspeed.om.security.JetspeedUser;
33import org.apache.jetspeed.services.JetspeedAuthentication;
34import org.apache.jetspeed.services.JetspeedLDAP;
35import org.apache.jetspeed.services.JetspeedUserManagement;
36import org.apache.jetspeed.services.ldap.LDAPURL;
37import org.apache.jetspeed.services.logging.JetspeedLogFactoryService;
38import org.apache.jetspeed.services.logging.JetspeedLogger;
39import org.apache.jetspeed.services.resources.JetspeedResources;
40import org.apache.jetspeed.services.security.JetspeedSecurityException;
41import org.apache.jetspeed.services.security.UserException;
4243import org.apache.turbine.om.security.User;
44import org.apache.turbine.util.ObjectUtils;
4546/***47 *48 * @author <a href="mailto:ender@kilicoglu.nom.tr">Ender KILICOGLU</a>49 * @author <a href="mailto:sami.leino@netorek.fi">Sami Leino</a>50 * 51 * @version $Id: LDAPUser.java,v 1.7 2004/02/23 03:12:13 jford Exp $ 52 * 53 */54publicclassLDAPUserextendsBaseLDAPObject implements JetspeedUser, HttpSessionBindingListener
55 {
5657/***58 * Static initialization of the logger for this class59 */60privatestaticfinalJetspeedLogger logger = JetspeedLogFactoryService.getLogger(LDAPUser.class.getName());
6162// ---------------------------- Constants ----------------------------6364protectedstaticfinal String OBJECT_CLASS = "jetspeeduser";
65protectedstaticfinal String ORGANIZATIONAL_UNIT = "ou=users";
6667protectedstaticfinal String ATTR_UID = "uid";
68protectedstaticfinal String ATTR_UID_NUMBER = "uidNumber";
69protectedstaticfinal String ATTR_USER_PASSWORD = "userPassword";
70protectedstaticfinal String ATTR_NAME = "name";
71protectedstaticfinal String ATTR_GIVEN_NAME = "givenName";
72protectedstaticfinal String ATTR_SN = "sn";
73protectedstaticfinal String ATTR_MAIL = "mail";
74protectedstaticfinal String ATTR_OBJECT_DATA = "objectdata";
75protectedstaticfinal String ATTR_OBJECT_CLASS = "objectClass";
76protectedstaticfinal String ATTR_USER_GROUP_ROLE = "usergrouprole";
77protectedstaticfinal String ATTR_LAST_LOGIN_DATE = "lastlogindate";
78protectedstaticfinal String ATTR_LAST_MODIFIED_DATE = "lastmodifieddate";
79protectedstaticfinal String ATTR_CREATION_DATE = "creationdate";
80protectedstaticfinal String ATTR_CONFIRMED = "confirm";
81protectedstaticfinal String ATTR_DISABLED = "disabled";
8283// ------------------------- Member variables ------------------------8485/*** The date on which the user account was created. */86private Date createDate = null;
8788/*** The date on which the user last accessed the application. */89private Date lastAccessDate = null;
9091/*** The date on which the user last changed his password. */92private Date passwordChanged = null;
9394/*** This is data that will survive a servlet engine restart. */95private Hashtable permStorage = null;
9697/*** This is data that will not survive a servlet engine restart. */98private Hashtable tempStorage = null;
99100/*** Name of the user */101protected String name = "";
102103/*** Is this object "new" or does it already exist in the datastore? */104protectedboolean isNew = false;
105106/*** User's roles. */107protected Vector groupRoles = null;
108109// --------------------------- Constructors --------------------------110111publicLDAPUser()
112 {
113this("TempUser", true);
114 }
115116/***117 * Constructor.118 * Create a new User and set the createDate.119 */120publicLDAPUser(String username, boolean isNew)
121 {
122super.ldapurl = JetspeedLDAP.buildURL(ATTR_UID + "=" + username + "," + ORGANIZATIONAL_UNIT);
123this.isNew = isNew;
124125 createDate = new Date();
126 lastAccessDate = createDate;
127 tempStorage = new Hashtable(20);
128 permStorage = new Hashtable(50);
129 groupRoles = new Vector();
130 setHasLoggedIn(Boolean.FALSE);
131132if (isNew)
133 {
134 setDisabled(false);
135 setUserName(username);
136 String uidNumber = new Long(System.currentTimeMillis()).toString();
137 setUserId(uidNumber);
138 myAttrs = new BasicAttributes();
139 myAttrs.put(ATTR_UID, username);
140 myAttrs.put(ATTR_UID_NUMBER, uidNumber);
141 Attribute oc = new BasicAttribute(ATTR_OBJECT_CLASS);
142 oc.add("jetspeeduser");
143 myAttrs.put(oc);
144 }
145else146 {
147 myAttrs = JetspeedLDAP.read(ldapurl);
148 fillObject(myAttrs);
149 }
150 }
151152publicLDAPUser(LDAPURL ldapurl)
153 {
154 fillObject(JetspeedLDAP.read(ldapurl));
155 }
156157publicLDAPUser(Attributes attributes)
158 {
159 fillObject(attributes);
160 }
161162privatevoid fillObject(Attributes attributes)
163 {
164 tempStorage = new Hashtable(20);
165 permStorage = new Hashtable(50);
166 setHasLoggedIn(Boolean.FALSE);
167168 myAttrs = attributes;
169170try171 {
172 setPermStorage(deserializePerm(getutil(ATTR_OBJECT_DATA, attributes)));
173 }
174catch (Exception e)
175 {
176 logger.error("fillobject()" , e);
177 }
178179 setUserName(getutil(ATTR_UID, attributes));
180 setUserId(getutil(ATTR_UID_NUMBER, attributes));
181 setEmail(getutil(ATTR_MAIL, attributes));
182 setFirstName(getutil(ATTR_GIVEN_NAME, attributes));
183 setLastName(getutil(ATTR_SN, attributes));
184// setName(getutil(ATTR_NAME, attributes));185 setConfirmed(getutil(ATTR_CONFIRMED, attributes));
186187 setLastLogin(parseDate(getutil(ATTR_LAST_LOGIN_DATE, attributes)));
188 lastAccessDate = parseDate(getutil(ATTR_LAST_MODIFIED_DATE, attributes));
189 setCreateDate(parseDate(getutil(ATTR_CREATION_DATE, attributes)));
190 String temp = getutil(ATTR_DISABLED, attributes);
191if (temp != null && temp.equals("TRUE")) setDisabled(true);
192else setDisabled(false);
193194try195 {
196 setPassword(new String ((byte[]) attributes.get(ATTR_USER_PASSWORD).getAll().nextElement()));
197 }
198catch (Exception e)
199 {
200 logger.error("fillobject() could not set password" , e);
201 }
202203this.groupRoles = getutil( ATTR_USER_GROUP_ROLE, attributes, true );
204 ldapurl = JetspeedLDAP.buildURL(ATTR_UID + "=" + getUserName() + "," + ORGANIZATIONAL_UNIT);
205 }
206207// --------------------- Persistence operations ----------------------208209publicvoid update(boolean create)
210 throws JetspeedSecurityException211 {
212 removeutil("createTimeStamp", false);
213 removeutil("modifyTimeStamp", false);
214215 setutil(ATTR_USER_PASSWORD,(String)getPerm(User.PASSWORD) );
216 setutil(ATTR_MAIL,(String)getPerm(User.EMAIL));
217 setutil(ATTR_CONFIRMED,(String)getPerm(User.CONFIRM_VALUE));
218 setutil(ATTR_SN,(String)getPerm(User.LAST_NAME));
219 setutil(ATTR_GIVEN_NAME,(String)getPerm(User.FIRST_NAME));
220 setutil(ATTR_USER_GROUP_ROLE, this.getGroupRoles(), create);
221// setutilMulti(ATTR_USER_GROUP_ROLE, groupRoles);222 setutil(ATTR_LAST_LOGIN_DATE, formatDate(getLastLogin()));
223 setutil(ATTR_LAST_MODIFIED_DATE, formatDate(getLastAccessDate()));
224 setutil(ATTR_CREATION_DATE, formatDate(getCreateDate()));
225if (getDisabled() == true) setutil(ATTR_DISABLED, "TRUE");
226else setutil(ATTR_DISABLED, "FALSE");
227228try229 {
230 setutil(ATTR_OBJECT_DATA, serializePerm(permStorage));
231 }
232catch (Exception e)
233 {
234 logger.warn("Could not serialize object data!" , e);
235 }
236237if (create)
238 {
239 ldapurl = JetspeedLDAP.buildURL("uid=" + (String)getPerm(User.USERNAME) + ",ou=users");
240 setutil(ATTR_UID, (String)getPerm(User.USERNAME));
241if (JetspeedLDAP.addEntry(ldapurl, myAttrs) == false) thrownew UserException("Could not insert user data to LDAP!");
242 }
243elseif (JetspeedLDAP.exists(ldapurl))
244 {
245 JetspeedLDAP.deleteAttrs(ldapurl, rmAttrs);
246if (JetspeedLDAP.updateEntry(ldapurl, myAttrs) == false) thrownew UserException("Could not update user data to LDAP!");
247 }
248 }
249250// ------------------------ Accessor methods -------------------------251252public Vector getGroupRoles()
253 {
254returnthis.groupRoles;
255 }
256257publicvoid addGroupRole(String groupName, String roleName)
258 {
259 groupRoles.add(groupName + "," + roleName);
260 }
261262publicvoid removeGroup(String groupName)
263 {
264for (Enumeration enum = groupRoles.elements();enum.hasMoreElements();)
265 {
266 String groupRoleStr = (String)enum.nextElement();
267if (groupRoleStr.startsWith(groupName + ","))
268 {
269 groupRoles.remove(groupRoleStr);
270 }
271 }
272 }
273274publicvoid removeGroupRole(String groupName, String roleName)
275 {
276for (Enumeration enum = groupRoles.elements(); enum.hasMoreElements();)
277 {
278 String groupRoleStr = (String)enum.nextElement();
279if (groupRoleStr.equalsIgnoreCase(groupName + "," + roleName))
280 {
281 groupRoles.remove(groupRoleStr);
282 }
283 }
284 }
285286/***287 * Returns the primary principle for this User, the user id.288 *289290 * @return the user id.291 */292public String getUserId()
293 {
294 String tmp = null;
295296try297 {
298 tmp = (String) getPerm (JetspeedUser.USER_ID);
299if ( tmp.length() == 0 )
300 {
301 tmp = null;
302 }
303 }
304catch (Exception e)
305 {
306 logger.error("getUserId():" , e);
307 }
308return tmp;
309 }
310311publicvoid setUserId(String id)
312 {
313if (getUserId() == null)
314 {
315 setPerm(JetspeedUser.USER_ID, id);
316 }
317 }
318319/***320 * Gets the access counter for a user during a session.321 *322 * @return The access counter for the user for the session.323 */324publicint getAccessCounterForSession()
325 {
326try327 {
328return ((Integer) getTemp(User.SESSION_ACCESS_COUNTER)).intValue();
329 }
330catch (Exception e)
331 {
332 logger.error("getAccessCounterForSession():" , e);
333return 0;
334 }
335 }
336337/***338 * Gets the access counter for a user from perm storage.339 *340 * @return The access counter for the user.341 */342publicint getAccessCounter()
343 {
344try345 {
346return ((Integer) getPerm(User.ACCESS_COUNTER)).intValue();
347 }
348catch (Exception e)
349 {
350 logger.error("getAccessCounter():" , e);
351return 0;
352353 }
354 }
355356/***357 * Gets the create date for this User. This is the time at which358 * the user object was created.359 *360 * @return A Java Date with the date of creation for the user.361 */362public java.util.Date getCreateDate()
363 {
364return createDate;
365 }
366367/***368 * Gets the last access date for this User. This is the last time369 * that the user object was referenced.370 *371 * @return A Java Date with the last access date for the user.372 */373public java.util.Date getLastAccessDate()
374 {
375if (lastAccessDate == null)
376 {
377 setLastAccessDate();
378 }
379return lastAccessDate;
380 }
381382/***383384 * Get last login date/time for this user.385 *386 * @return A Java Date with the last login date for the user.387 */388public java.util.Date getLastLogin()
389 {
390return (java.util.Date) getPerm(User.LAST_LOGIN);
391 }
392393/***394 * Get password for this user.395 *396 * @return A String with the password for the user.397 */398public String getPassword()
399 {
400return (String) getPerm(User.PASSWORD);
401 }
402403/***404 * Get an object from permanent storage.405 *406 * @param name The object's name.407 * @return An Object with the given name.408 */409public Object getPerm(String name)
410 {
411return permStorage.get(name);
412 }
413414/***415 * Get an object from permanent storage; return default if value416 * is null.417 *418 * @param name The object's name.419 * @param def A default value to return.420 * @return An Object with the given name.421 */422public Object getPerm(String name, Object def)
423 {
424try425 {
426 Object val = permStorage.get (name);
427428return (val == null ? def : val);
429 }
430catch (Exception e)
431 {
432 logger.error("getPerm():" , e);
433return def;
434 }
435 }
436437/***438 * This should only be used in the case where we want to save the439 * data to the database.440 *441 * @return A Hashtable.442 */443public Hashtable getPermStorage()
444 {
445if (this.permStorage == null)
446 {
447this.permStorage = new Hashtable(50);
448 }
449returnthis.permStorage;
450 }
451452/***453 * Get an object from temporary storage.454 *455 * @param name The object's name.456 * @return An Object with the given name.457 */458public Object getTemp(String name)
459 {
460return tempStorage.get(name);
461 }
462463/***464 * Get an object from temporary storage; return default if value465 * is null.466 *467 * @param name The object's name.468 * @param def A default value to return.469 * @return An Object with the given name.470 */471public Object getTemp(String name, Object def)
472 {
473 Object val;
474try475 {
476 val = tempStorage.get(name);
477if (val == null)
478 {
479 val = def;
480 }
481 }
482catch (Exception e)
483 {
484 logger.error("getTemp():" , e);
485 val = def;
486 }
487return val;
488489 }
490491/***492 * Returns the username for this user. If this is defined, then493 * the user is considered logged in.494 *495 * @return A String with the username.496 */497public String getUserName()
498 {
499 String tmp = null;
500try501 {
502 tmp = (String) getPerm (User.USERNAME);
503if ( tmp.length() == 0 )
504 {
505 tmp = null;
506 }
507 }
508catch (Exception e)
509 {
510 logger.error("getUserName():" , e);
511 }
512513return tmp;
514 }
515516/***517 * Returns the first name for this user. If this is defined, then518 * the user is considered logged in.519 *520 * @return A String with the user's first name.521 */522public String getFirstName()
523 {
524 String tmp = null;
525526try527 {
528 tmp = (String) getPerm (User.FIRST_NAME);
529if (tmp.length() == 0)
530 {
531 tmp = null;
532 }
533 }
534catch (Exception e)
535 {
536 logger.error("getFirstName():" , e);
537 }
538return tmp;
539 }
540541/***542 * Returns the last name for this user. If this is defined, then543 * the user is considered logged in.544 *545 * @return A String with the user's last name.546 */547public String getLastName()
548 {
549 String tmp = null;
550551try552 {
553 tmp = (String) getPerm (User.LAST_NAME);
554if (tmp.length() == 0) tmp = null;
555 }
556catch (Exception e)
557 {
558 logger.error("getLastName():" , e);
559 }
560561return tmp;
562 }
563564/***565 * The user is considered logged in if they have not timed out.566567 *568 * @return Whether the user has logged in.569 */570publicboolean hasLoggedIn()
571 {
572573 Boolean loggedIn = getHasLoggedIn();
574return (loggedIn != null && loggedIn.booleanValue());
575 }
576577/***578 * Returns the email address for this user.579580 *581 * @return A String with the user's email address.582 */583public String getEmail()
584 {
585return (String)getPerm(User.EMAIL);
586 }
587588/***589 * Increments the permanent hit counter for the user.590 */591publicvoid incrementAccessCounter()
592 {
593 setAccessCounter(getAccessCounter() + 1);
594 }
595596/***597 * Increments the session hit counter for the user.598 */599publicvoid incrementAccessCounterForSession()
600 {
601 setAccessCounterForSession(getAccessCounterForSession() + 1);
602 }
603604/***605 * Remove an object from temporary storage and return the object.606 *607 * @param name The name of the object to remove.608 * @return An Object.609 */610public Object removeTemp(String name)
611 {
612return tempStorage.remove(name);
613 }
614615/***616 * Sets the access counter for a user, saved in perm storage.617 *618 * @param cnt The new count.619 */620publicvoid setAccessCounter(int cnt)
621 {
622 setPerm(User.ACCESS_COUNTER, new Integer(cnt));
623 }
624625/***626 * Sets the session access counter for a user, saved in temp627 * storage.628 *629 * @param cnt The new count.630 */631publicvoid setAccessCounterForSession(int cnt)
632 {
633 setTemp(User.SESSION_ACCESS_COUNTER, new Integer(cnt));
634 }
635636/***637 * Sets the last access date for this User. This is the last time638 * that the user object was referenced.639 */640publicvoid setLastAccessDate()
641 {
642 lastAccessDate = new java.util.Date();
643 }
644645/***646 * Sets the create date for this User. This is the time at which647 * the user object was created.648 *649 * @param date The create date.650 */651publicvoid setCreateDate(java.util.Date date)
652 {
653 createDate = date;
654 }
655656/***657 * Set last login date/time.658 *659 * @param date The last login date.660 */661publicvoid setLastLogin(java.util.Date date)
662 {
663 setPerm(User.LAST_LOGIN, date);
664 }
665666/***667 * Set password.668 *669 * @param password The new password.670 */671publicvoid setPassword(String password)
672 {
673 setPerm(User.PASSWORD, password);
674 }
675676/***677 * Put an object into permanent storage. If the value is null,678 * it will convert that to a "" because the underlying storage679 * mechanism within TurbineUser is currently a Hashtable and680 * null is not a valid value.681 *682 * @param name The object's name.683 * @param value The object.684 */685publicvoid setPerm(String name, Object value)
686 {
687 ObjectUtils.safeAddToHashtable(getPermStorage(), name, value);
688 }
689690/***691 * This should only be used in the case where we want to save the692 * data to the database.693 *694 * @param stuff A Hashtable.695 */696publicvoid setPermStorage(Hashtable stuff)
697 {
698this.permStorage = stuff;
699 }
700701/***702 * This should only be used in the case where we want to save the703 * data to the database.704 *705 * @return A Hashtable.706 */707public Hashtable getTempStorage()
708 {
709if (this.tempStorage == null)
710 {
711this.tempStorage = new Hashtable(20);
712 }
713returnthis.tempStorage;
714 }
715716/***717 * This should only be used in the case where we want to save the718 * data to the database.719 *720 * @param storage A Hashtable.721 */722publicvoid setTempStorage(Hashtable storage)
723 {
724this.tempStorage = storage;
725 }
726727/***728 * This gets whether or not someone has logged in. hasLoggedIn()729 * returns this value as a boolean. This is private because you730 * should use hasLoggedIn() instead.731 *732 * @return True if someone has logged in.733734 */735private Boolean getHasLoggedIn()
736 {
737return (Boolean) getTemp (User.HAS_LOGGED_IN);
738 }
739740/***741 * This sets whether or not someone has logged in. hasLoggedIn()742 * returns this value.743 *744 * @param value Whether someone has logged in or not.745 */746publicvoid setHasLoggedIn (Boolean value)
747 {
748 setTemp (User.HAS_LOGGED_IN, value);
749 }
750751/***752 * Put an object into temporary storage. If the value is null,753 * it will convert that to a "" because the underlying storage754 * mechanism within TurbineUser is currently a Hashtable and755 * null is not a valid value.756 *757 * @param name The object's name.758 * @param value The object.759 */760publicvoid setTemp(String name, Object value)
761 {
762 ObjectUtils.safeAddToHashtable(tempStorage, name, value);
763 }
764765/***766 * Sets the username for this user.767 *768 * @param username The user's username.769 */770publicvoid setUserName(String username)
771 {
772 setPerm (User.USERNAME, username);
773 }
774775/***776 * Sets the first name for this user.777 *778 * @param firstName User's first name.779 */780publicvoid setFirstName(String firstName)
781 {
782 setPerm(User.FIRST_NAME, firstName);
783 }
784785/***786 * Sets the last name for this user.787 *788 * @param lastName User's last name.789 */790publicvoid setLastName(String lastName)
791 {
792 setPerm(User.LAST_NAME, lastName);
793 }
794795/***796 * Sets the email address.797 *798 * @param address The email address.799 */800publicvoid setEmail(String address)
801 {
802 setPerm(User.EMAIL, address);
803 }
804805/***806 * This method reports whether or not the user has been confirmed807 * in the system by checking the User.CONFIRM_VALUE808 * column in the users record to see if it is equal to809 * User.CONFIRM_DATA.810 *811 * @return True if the user has been confirmed.812 */813publicboolean isConfirmed()
814 {
815 String value = getConfirmed();
816return (value != null && value.equals(User.CONFIRM_DATA));
817 }
818819/***820 * Sets the confirmation value. The value should821 * be either a random string or User.CONFIRM_DATA822 *823 * @param value The confirmation key value.824 */825publicvoid setConfirmed(String value)
826 {
827 String val = "";
828if (value != null)
829 {
830 val = value;
831 }
832 setPerm(User.CONFIRM_VALUE, val);
833 }
834835/***836 * Gets the confirmation value.837 *838 * @return status The confirmation value for this User839 */840public String getConfirmed()
841 {
842return (String)getPerm(User.CONFIRM_VALUE);
843 }
844845/***846 * Updates the last login date in the database.847 *848 * @exception Exception, a generic exception.849 */850publicvoid updateLastLogin()
851 throws Exception
852 {
853 setPerm( User.LAST_LOGIN, new java.util.Date() );
854 }
855856/***857 * Implement this method if you wish to be notified when the User858 * has been Bound to the session.859 *860 * @param hsbe The HttpSessionBindingEvent.861 */862publicvoid valueBound(HttpSessionBindingEvent hsbe)
863 {
864 }
865866/***867 * Implement this method if you wish to be notified when the User868 * has been Unbound from the session.869 *870 * @param hsbe The HttpSessionBindingEvent.871 */872publicvoid valueUnbound(HttpSessionBindingEvent hsbe)
873 {
874try875 {
876 java.util.Date now = new java.util.Date();
877878if (this.hasLoggedIn())
879 {
880if ( JetspeedResources.getBoolean("automatic.logout.save", false) )
881 {
882 JetspeedUserManagement.saveUser(this);
883 }
884885 JetspeedAuthentication.logout();
886 }
887 }
888catch ( Exception e )
889 {
890 logger.error("LDAPUser.valueUnbound(): " + e.getMessage(), e);
891892// To prevent messages being lost in case the logging system893// goes away before sessions get unbound on servlet container894// shutdown, print the stcktrace to the container's console.895 ByteArrayOutputStream ostr = new ByteArrayOutputStream();
896 e.printStackTrace(new PrintWriter(ostr,true));
897 String stackTrace = ostr.toString();
898 System.out.println(stackTrace);
899 }
900 }
901902/***903 * Saves this object to the data store.904 */905publicvoid save()
906 throws Exception
907 {
908if (this.isNew())
909 {
910 JetspeedUserManagement.saveUser(this);
911 }
912else913 {
914 JetspeedUserManagement.addUser(this);
915 }
916 }
917918/***919 * Returns the disabled status for the user920 *921 * @return True when the account is disabled922 */923publicboolean getDisabled()
924 {
925boolean disabled = false;
926927try928 {
929 String tmp = (String) getPerm (JetspeedUser.DISABLED);
930if ( tmp != null && tmp.length() > 0 )
931 {
932if (tmp.equalsIgnoreCase("T"))
933 disabled = true;
934 }
935 }
936catch (Exception e)
937 {
938 logger.error("getDisabled():" , e);
939 }
940941return disabled;
942 }
943944publicvoid setDisabled(boolean disabled)
945 {
946 setPerm(JetspeedUser.DISABLED, (disabled) ? "T" : "F");
947 }
948949public String getName()
950 {
951return name;
952 }
953954publicvoid setName(String name)
955 {
956this.name = name;
957 }
958959960publicboolean isNew()
961 {
962return isNew;
963 }
964965void setNew(boolean isNew)
966 {
967this.isNew = isNew;
968 }
969970/***971 * Returns the date of last password change972 *973 * @return date974975 */976public Date getPasswordChanged()
977 {
978returnthis.passwordChanged;
979 }
980981/***982 * Sets the date of last password change983 * 984 * @param value Date985 */986publicvoid setPasswordChanged(Date value)
987 {
988this.passwordChanged = value;
989 }
990991 }