source: greenstone3/trunk/src/java/org/greenstone/gsdl3/service/Authentication.java@ 14295

Last change on this file since 14295 was 14295, checked in by qq6, 17 years ago

Authentication service

File size: 22.6 KB
Line 
1package org.greenstone.gsdl3.service;
2
3import org.greenstone.gsdl3.util.GSXML;
4import org.greenstone.gsdl3.util.GSPath;
5import org.greenstone.gsdl3.util.DerbyWrapper;
6import org.greenstone.gsdl3.util.UserQueryResult;
7import org.greenstone.gsdl3.util.UserTermInfo;
8
9import org.w3c.dom.Element;
10import org.w3c.dom.NodeList;
11
12import java.util.ArrayList;
13import java.util.Map;
14import java.util.Iterator;
15import java.util.Set;
16import java.util.HashMap;
17import java.util.Vector;
18import java.sql.SQLException;
19import org.apache.log4j.*;
20
21import org.greenstone.gsdl3.util.GSXML;
22import org.greenstone.gsdl3.util.GSPath;
23import org.greenstone.gsdl3.util.GlobalProperties;
24import org.greenstone.gsdl3.util.UserQueryResult;
25
26import java.net.InetAddress;
27import java.util.Properties;
28import java.util.Date;
29import java.util.regex.Pattern;
30import java.io.File;
31
32//import javax.mail.*;
33//import javax.mail.internet.*;
34
35import java.awt.event.ActionEvent;
36import java.awt.event.ActionListener;
37import javax.swing.Timer;
38
39import org.apache.log4j.*;
40
41import org.greenstone.gsdl3.util.DerbyWrapper;
42
43
44public class Authentication
45 extends ServiceRack {
46 //the services on offer
47 protected static final String AUTHENTICATION_SERVICE="Authentication";
48
49 /** constructor */
50 public Authentication()
51 { }
52
53 public boolean configure(Element info, Element extra_info)
54 {
55 logger.info("Configuring Authentication...");
56 this.config_info = info;
57
58 // set up Authentication service info - for now just has name and type
59 Element authentication_service= this.doc.createElement(GSXML.SERVICE_ELEM);
60 authentication_service.setAttribute(GSXML.TYPE_ATT, "authen");
61 authentication_service.setAttribute(GSXML.NAME_ATT, AUTHENTICATION_SERVICE);
62 this.short_service_info.appendChild(authentication_service);
63
64 return true;
65 }
66
67 protected Element getServiceDescription(String service_id, String lang, String subset)
68 {
69
70 Element authen_service=this.doc.createElement(GSXML.SERVICE_ELEM);
71
72 if (service_id.equals(AUTHENTICATION_SERVICE)) {
73 authen_service.setAttribute(GSXML.TYPE_ATT,"authen");
74 authen_service.setAttribute(GSXML.NAME_ATT, AUTHENTICATION_SERVICE);
75 } else {
76 return null;
77 }
78
79 if (subset==null || subset.equals(GSXML.DISPLAY_TEXT_ELEM+GSXML.LIST_MODIFIER)) {
80 authen_service.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_NAME, getServiceName(service_id, lang) ));
81 authen_service.appendChild(GSXML.createDisplayTextElement(this.doc, GSXML.DISPLAY_TEXT_DESCRIPTION, getServiceDescription(service_id, lang)));
82 }
83 return authen_service;
84 }
85
86 protected String getServiceName(String service_id, String lang) {
87 return getTextString(service_id+".name", lang);
88 }
89
90 protected String getServiceSubmit(String service_id, String lang) {
91 return getTextString(service_id+".submit", lang);
92 }
93
94 protected String getServiceDescription(String service_id, String lang) {
95 return getTextString(service_id+".description", lang);
96 }
97
98 protected void addCustomParams(String service, Element param_list, String lang) {
99 }
100
101 protected void createParameter(String name, Element param_list, String lang) {
102 }
103
104 protected Element processAuthentication(Element request) throws SQLException{
105
106 // Create a new (empty) result message
107 Element result = this.doc.createElement(GSXML.RESPONSE_ELEM);
108
109 result.setAttribute(GSXML.FROM_ATT, AUTHENTICATION_SERVICE);
110 result.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_PROCESS);
111
112 String lang = request.getAttribute(GSXML.LANG_ATT);
113 // Get the parameters of the request
114 Element param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER);
115
116 if (param_list == null) {
117 logger.error("AddUsers request had no paramList.");
118 return result; // Return the empty result
119 }
120
121 String aup=null; //Actions: ListUsers, AddUser, ModifyPassword, DeleteUser, Login
122 String un=""; //login user's name
123 String pw=""; //login user's password
124 String asn=""; //whether a user is authenticated
125 String uan=""; //whether a authentication for a particular action is needed
126 String cm=""; //whether the action is confirmed
127
128 String umun=""; //the new user name
129 String umpw=""; //user's new password
130 String umas=""; //user account status
131 String umgp=""; //user greoups
132 String umc=""; // comments for the user
133
134 String oumun=""; //the original user's name
135 String umpw1=""; //user's new password
136 String umpw2=""; //user's retyped new password
137
138 // get parameters from the request
139 NodeList params = param_list.getElementsByTagName(GSXML.PARAM_ELEM);
140 for (int i=0; i<params.getLength();i++) {
141 Element param = (Element)params.item(i);
142 String p_name = param.getAttribute(GSXML.NAME_ATT);
143 String p_value = GSXML.getValue(param);
144
145 if (p_name.equals("aup")){
146 aup = p_value;
147 }else if (p_name.equals("un")) {
148 un = p_value;
149 }else if(p_name.equals("pw")) {
150 pw = p_value;
151 }else if(p_name.equals("umun")) {
152 umun = p_value;
153 }else if(p_name.equals("umpw")) {
154 umpw = p_value;
155 }else if (p_name.equals("umas")){
156 umas=p_value;
157 }else if (p_name.equals("umgp")){
158 umgp=p_value;
159 }else if (p_name.equals("umc")){
160 umc=p_value;
161 }else if (p_name.equals("asn")){
162 asn=p_value;
163 }else if (p_name.equals("uan")){
164 uan=p_value;
165 }else if (p_name.equals("cm")){
166 cm=p_value;
167 }else if(p_name.equals("umpw1")) {
168 umpw1 = p_value;
169 }else if(p_name.equals("umpw2")) {
170 umpw2 = p_value;
171 }else if(p_name.equals("oumun")) {
172 oumun = p_value;
173 }
174
175 }
176
177 // create a Authentication node put into the result
178 Element authen_node = this.doc.createElement(GSXML.AUTHEN_NODE_ELEM);
179 result.appendChild(authen_node);
180 // create a service node added into the Authentication node
181 Element service_node = this.doc.createElement(GSXML.SERVICE_ELEM);
182 authen_node.appendChild(service_node);
183 // add the authentication procedure to the service node
184 service_node.setAttribute("aup",aup);
185 // the user recordes got from the users table
186 UserQueryResult userQueryResult=null;
187
188 // check the usersDb database, if it isn't existing, create one and add a "admin" user
189 String usersDB_dir = this.site_home + File.separatorChar + "etc" + File.separatorChar + "usersDB";
190 DerbyWrapper derbyWrapper=new DerbyWrapper();
191 File usersDB_file =new File(usersDB_dir);
192 if (!usersDB_file.exists()){
193 derbyWrapper.connectDatabase(usersDB_dir,true);
194 derbyWrapper.createDatabase();
195 }
196
197 // Action: login
198 if (aup.equals("Login")){
199 if (uan.equals("")){
200 service_node.setAttribute("info","Login");
201 return result;
202 }
203
204 // if the current procedure requires authentication(uan=1),but the user hasn't been authenticated(asn=0),will ask the user to login first
205 if ((uan.equals("1") && asn.equals("0"))) {
206 if ((un.length()==0) && (pw.length()==0)){
207 service_node.setAttribute("asn","0");
208 service_node.setAttribute("info","Login");
209 return result;
210 }
211 if ((un.length()==0) || (pw.length()==0)){
212 service_node.setAttribute("asn","0");
213 service_node.setAttribute("info","Login");
214 service_node.setAttribute("err","un-pw-err");
215 return result;
216 }else{
217 derbyWrapper.connectDatabase(usersDB_dir, false);
218 userQueryResult=derbyWrapper.findUser(un,pw);
219 derbyWrapper.closeDatabase();
220 service_node.setAttribute(GSXML.NAME_ATT,"Authentication");
221
222 service_node.setAttribute("un",un);
223 service_node.setAttribute("pw",pw);
224 // service_node.setAttribute("asn",asn);
225 if (userQueryResult!=null && userQueryResult.getSize()<=0){
226 asn="0";//the user isn't a vaild user
227 service_node.setAttribute("asn","0");// either unsername or password is wrong
228 service_node.setAttribute("err","un-pw-err");
229 service_node.setAttribute("info","Login");
230 return result;
231 }else{
232 // asn="1"; //the user is a member of the "administrator" group
233 Vector userInfo=userQueryResult.users_;
234 String groups=((UserTermInfo)userInfo.get(0)).groups_;
235 String accountstatus=((UserTermInfo)userInfo.get(0)).accountstatus_;
236 String[] groups_array=groups.split(",");
237 for (int i=0; i<groups_array.length;i++){
238 if ((groups_array[i].trim().toLowerCase()).equals("administrator")){
239 if (accountstatus.trim().equals("true")){
240 asn="1";
241 service_node.setAttribute("asn","1");
242 break;
243 }
244 }
245 }
246 if (!asn.equals("1")){
247 asn="2";
248 service_node.setAttribute("asn","2");//the user is authenticated
249 }
250 }
251 }
252 }
253 //asn=0 couldn't find the user
254 if (asn.equals("0")){
255 service_node.setAttribute("info","Login");
256 service_node.setAttribute("err","not-authen");
257 return result;
258 }
259 //asn!=0 This is a valid user
260 if (!asn.equals("0")){
261 service_node.setAttribute("info","Login");
262 service_node.setAttribute("un",un);
263 service_node.setAttribute("pw",pw);
264 service_node.setAttribute("asn",asn);
265 return result;
266 }
267 }
268
269 //Action: listuser
270 if (aup.equals("ListUsers")){
271 if (asn.equals("") && un.equals("")){
272 service_node.setAttribute("info","Login");
273 return result;
274 }
275
276 //valid users can't list all users because they aren't in the administrator group(asn=2)
277 if (asn.equals("2")){
278 service_node.setAttribute("info","Login");
279 service_node.setAttribute("err","no-permission");
280 service_node.setAttribute("un",un);
281 service_node.setAttribute("asn",asn);
282 return result;
283 }
284 //valid users are in the administrator group, they can list all users(asn=1)
285 if (asn.equals("1")){
286 derbyWrapper.connectDatabase(usersDB_dir, false);
287 userQueryResult=derbyWrapper.findUser(null,null);
288 derbyWrapper.closeDatabase();
289 service_node.setAttribute(GSXML.NAME_ATT,"Authentication");
290 service_node.setAttribute("un",un);
291 service_node.setAttribute("asn",asn);
292
293 if (userQueryResult!=null && userQueryResult.getSize()>0){
294 service_node.setAttribute("info","all-un"); // got a user list
295 Element user_node=getUserNode(userQueryResult);
296 service_node.appendChild(user_node);
297 return result;
298 }else {
299 service_node.setAttribute("err","no-un"); // no user returned
300 return result;
301 }
302 }
303 }
304
305 //Action : adduder
306 if (aup.equals("AddUser")){
307 if (asn.equals("") && un.equals("")){
308 service_node.setAttribute("info","Login");
309 return result;
310 }
311 //valid users can't add a new user because they aren't in the administrator group(asn=2)
312 if (asn.equals("2")){
313 service_node.setAttribute("info","Login");
314 service_node.setAttribute("err","no-permission");
315 service_node.setAttribute("un",un);
316 service_node.setAttribute("pw",pw);
317 service_node.setAttribute("asn",asn);
318 return result;
319 }
320 //valid users are in the administrator group, they can add a new user(asn=1)
321 if (asn.equals("1")){
322 service_node.setAttribute(GSXML.NAME_ATT,"Authentication");
323 service_node.setAttribute("un",un);
324 service_node.setAttribute("pw",pw);
325 service_node.setAttribute("asn",asn);
326
327 if (umun.length()==0 && umpw.length()==0 && umgp.length()==0 && umas.length()==0 && umc.length()==0){
328 service_node.setAttribute("info","adduser_interface");
329 return result;
330 }
331
332 //check the strings of username and password
333 if ((umun==null) || (umun.length()<2) || (umun.length()>30) || (!(Pattern.matches("[a-zA-Z0-9//_//.]+",umun)))){
334 service_node.setAttribute("err","un-err"); //the input username string is illegal
335 service_node.setAttribute("info","adduser_interface");
336 return result;
337 }
338
339 if ((umpw==null) || (umpw.length()<3) || (umpw.length()>8) || (!(Pattern.matches("[\\p{ASCII}]+",umpw)))){
340 service_node.setAttribute("err","pw-err"); //the input passwrod string is illegal
341 service_node.setAttribute("info","adduser_interface");
342 return result;
343 }
344
345 // add the new users into the users table
346 umgp=umgp.replaceAll(" ","");//get rid of the space of the groups string
347 derbyWrapper.connectDatabase(usersDB_dir, false);
348 String add_user=derbyWrapper.addUser(umun,umpw,umgp,umas,umc);
349 if (add_user.equals("succeed")){
350 userQueryResult=derbyWrapper.findUser(null,null);
351 derbyWrapper.closeDatabase();
352 service_node.setAttribute("info","all-un"); // return a list of all users if the user has been added
353 Element user_node=getUserNode(userQueryResult);
354 service_node.appendChild(user_node);
355 return result;
356 }else{
357 derbyWrapper.closeDatabase();
358 service_node.setAttribute("err",add_user);// return the error message if the user couldn't be added
359 return result;
360 }
361 }
362 }
363
364 //Action: edituser
365 if (aup.equals("EditUser")){
366 derbyWrapper.connectDatabase(usersDB_dir, false);
367 service_node.setAttribute(GSXML.NAME_ATT,"Authentication");
368 service_node.setAttribute("un",un);
369 service_node.setAttribute("pw",pw);
370 service_node.setAttribute("asn",asn);
371
372 //Get the user's info from the database
373 if (cm.length()==0){
374 service_node.setAttribute("info","edituser-interface");
375 userQueryResult=derbyWrapper.findUser(umun,null);
376 derbyWrapper.closeDatabase();
377 Vector userInfo=userQueryResult.users_;
378 String username=((UserTermInfo)userInfo.get(0)).username_;
379 String password=((UserTermInfo)userInfo.get(0)).password_;
380 String groups=((UserTermInfo)userInfo.get(0)).groups_;
381 String accountstatus=((UserTermInfo)userInfo.get(0)).accountstatus_;
382 String comment=((UserTermInfo)userInfo.get(0)).comment_;
383
384 service_node.setAttribute("oumun",oumun);
385 service_node.setAttribute("umun",username);
386 service_node.setAttribute("umpw",password);
387 service_node.setAttribute("umgp",groups);
388 service_node.setAttribute("umas",accountstatus);
389 service_node.setAttribute("umc",comment);
390 return result;
391 }
392
393 //Commit the modified user's info to the database
394 if (cm.toLowerCase().equals("submit")){
395 if (oumun.equals(umun)){// the user's name hasn't been changed, update the user's info
396 if (umpw.length()==0){
397 derbyWrapper.modifyUserInfo(umun,null,umgp,umas,umc);
398 userQueryResult=derbyWrapper.findUser(null,null);
399 derbyWrapper.closeDatabase();
400 service_node.setAttribute("info","all-un"); // the user's info has been updated, return a list of all users
401 Element user_node=getUserNode(userQueryResult);
402 service_node.appendChild(user_node);
403 return result;
404 }else{
405 if ((umpw.length()==0) || (umpw.length()<3) || (umpw.length()>8) || (!(Pattern.matches("[\\p{ASCII}]+",umpw)))){
406 service_node.setAttribute("err","umpw-err"); //the input passwrod string is illegal
407 service_node.setAttribute("info","edituser-interface");
408 service_node.setAttribute("umun",umun);
409 service_node.setAttribute("umpw",umpw);
410 service_node.setAttribute("umgp",umgp);
411 service_node.setAttribute("umas",umas);
412 service_node.setAttribute("umc",umc);
413 service_node.setAttribute("oumun",oumun);
414 return result;
415 }
416 umgp=umgp.replaceAll(" ","");// get rid of the space
417 derbyWrapper.modifyUserInfo(umun,umpw,umgp,umas,umc);
418 userQueryResult=derbyWrapper.findUser(null,null);
419 derbyWrapper.closeDatabase();
420 service_node.setAttribute("info","all-un"); // if the new user has been added successfully, return a list of all users
421 Element user_node=getUserNode(userQueryResult);
422 service_node.appendChild(user_node);
423 return result;
424 }
425 }
426 // The user's name has been changed, add a new user record to the database
427 else{
428 if ((umun.length()==0) || (umun.length()<2) || (umun.length()>30) || (!(Pattern.matches("[a-zA-Z0-9//_//.]+",umun)))){
429 service_node.setAttribute("err","umun-err"); //the input username string is illegal
430 service_node.setAttribute("umun",umun);
431 service_node.setAttribute("umpw",umpw);
432 service_node.setAttribute("umgp",umgp);
433 service_node.setAttribute("umas",umas);
434 service_node.setAttribute("umc",umc);
435 service_node.setAttribute("oumun",oumun);
436 service_node.setAttribute("info","edituser-interface");
437 return result;
438 }
439 if (umpw.length()==0){
440 service_node.setAttribute("err","ini-umpw-err"); //the input passwrod string is illegal
441 service_node.setAttribute("info","edituser-interface");
442 service_node.setAttribute("umun",umun);
443 service_node.setAttribute("umpw",umpw);
444 service_node.setAttribute("umgp",umgp);
445 service_node.setAttribute("umas",umas);
446 service_node.setAttribute("umc",umc);
447 service_node.setAttribute("oumun",oumun);
448 return result;
449 }
450 if ((umpw.length()<3) || (umpw.length()>8) || (!(Pattern.matches("[\\p{ASCII}]+",umpw)))){
451 service_node.setAttribute("err","umpw-err"); //the input passwrod string is illegal
452 service_node.setAttribute("info","edituser-interface");
453 service_node.setAttribute("umun",umun);
454 service_node.setAttribute("umpw",umpw);
455 service_node.setAttribute("umgp",umgp);
456 service_node.setAttribute("umas",umas);
457 service_node.setAttribute("umc",umc);
458 service_node.setAttribute("oumun",oumun);
459 return result;
460 }
461 umgp=umgp.replaceAll(" ","");// get rid of the space
462 derbyWrapper.addUser(umun,umpw,umgp,umas,umc);
463 userQueryResult=derbyWrapper.findUser(null,null);
464 derbyWrapper.closeDatabase();
465 service_node.setAttribute("info","all-un"); // if the new user has been added successfully, return a list of all users
466 Element user_node=getUserNode(userQueryResult);
467 service_node.appendChild(user_node);
468 return result;
469 }
470 }
471
472 if (cm.toLowerCase().equals("cancel")){
473 userQueryResult=derbyWrapper.findUser(null,null);
474 derbyWrapper.closeDatabase();
475 service_node.setAttribute("info","all-un"); // if the new user has been added successfully, return a list of all users
476 Element user_node=getUserNode(userQueryResult);
477 service_node.appendChild(user_node);
478 return result;
479 }
480 }
481
482 //Action: modifypassword
483 if (aup.equals("ModifyPassword")){
484 if (un.equals("")){
485 service_node.setAttribute("info","Login");
486 return result;
487 }
488
489 derbyWrapper.connectDatabase(usersDB_dir, false);
490 service_node.setAttribute(GSXML.NAME_ATT,"Authentication");
491 service_node.setAttribute("un",un);
492 service_node.setAttribute("asn",asn);
493
494 userQueryResult=derbyWrapper.findUser(un,null);
495 Vector userInfo=userQueryResult.users_;
496 pw=((UserTermInfo)userInfo.get(0)).password_;
497
498 if ((umpw1.length()==0) && (umpw2.length()==0) && (umpw.length()==0)){
499 service_node.setAttribute("info","modify_interface");// call the interface of the modifying password
500 derbyWrapper.closeDatabase();
501 return result;
502 }
503
504 if (!pw.equals(umpw) && umpw.length()>0){
505 service_node.setAttribute("info","modify_interface");
506 service_node.setAttribute("err","pw-umpw-nm-err");//if the original password is not match
507 derbyWrapper.closeDatabase();
508 return result;
509 }
510
511 if ((umpw1.length()==0) || (umpw2.length()==0)){
512 service_node.setAttribute("info","modify_interface");
513 service_node.setAttribute("err","umpw1-umpw2-null-err");//if one of the password strings is none,return the err info back
514 derbyWrapper.closeDatabase();
515 return result;
516 }
517
518 if(!umpw1.equals(umpw2)){
519 service_node.setAttribute("info","modify_interface");
520 service_node.setAttribute("err","umpw1-umpw2-nm-err");//if one of the password strings is none,return the err info back
521 derbyWrapper.closeDatabase();
522 return result;
523 }
524
525 if (umpw.length()==0){
526 service_node.setAttribute("info","modify_interface");
527 service_node.setAttribute("err","umpw-null-err");//if one of the password strings is none,return the err info back
528 derbyWrapper.closeDatabase();
529 return result;
530 }
531 //check the new password and the retyped password
532 if ((umpw1==null) || (umpw1.length()<3) || (umpw1.length()>8) || (!(Pattern.matches("[\\p{ASCII}]+",umpw1)))){
533 service_node.setAttribute("info","modify_interface");
534 service_node.setAttribute("err","umpw1-err");// the new password is illegal
535 derbyWrapper.closeDatabase();
536 return result;
537 }
538
539 if ((umpw2==null) || (umpw2.length()<3) || (umpw2.length()>8) || (!(Pattern.matches("[\\p{ASCII}]+",umpw2)))){
540 service_node.setAttribute("info","modify_interface");
541 service_node.setAttribute("err","umpw2-err"); // the retyped password is illegal
542 derbyWrapper.closeDatabase();
543 return result;
544 }
545 String modify_user_info=derbyWrapper.modifyUserInfo(un,umpw,null,null,null);
546 if (modify_user_info.equals("succeed")){
547 service_node.setAttribute("err","");// the passsword has been changed successfully
548 derbyWrapper.closeDatabase();
549 return result;
550 }else{
551 service_node.setAttribute("err",modify_user_info);// return the error message of the pasword couldn't be modified
552 derbyWrapper.closeDatabase();
553 return result;
554 }
555
556 }
557
558 //Action: deleteuser
559 if (aup.equals("DeleteUser")){
560 derbyWrapper.connectDatabase(usersDB_dir, false);
561 service_node.setAttribute("un",un);
562 service_node.setAttribute("pw",pw);
563 service_node.setAttribute("asn",asn);
564 service_node.setAttribute("umun",umun);
565 if (cm.equals("yes")){
566 String delete_user=derbyWrapper.deleteUser(umun);
567 if (delete_user.equals("succeed")){
568 service_node.setAttribute("err","");
569 userQueryResult=derbyWrapper.findUser(null,null);
570 service_node.setAttribute("info","all-un"); // return a list of all users
571 Element user_node=getUserNode(userQueryResult);
572 service_node.appendChild(user_node);
573 }else{
574 service_node.setAttribute("err",delete_user);//return the error message
575 derbyWrapper.closeDatabase();
576 return result;
577 }
578 }else if (cm.equals("no")){
579 service_node.setAttribute("err","");
580 userQueryResult=derbyWrapper.findUser(null,null);
581 service_node.setAttribute("info","all-un"); // return a list of all users
582 Element user_node=getUserNode(userQueryResult);
583 service_node.appendChild(user_node);
584 derbyWrapper.closeDatabase();
585 return result;
586 }else{
587 service_node.setAttribute("info","confirm");
588 derbyWrapper.closeDatabase();
589 return result;
590 }
591 }
592
593 return result;
594 }
595
596 private Element getUserNode(UserQueryResult userQueryResult){
597 Element user_list_node= this.doc.createElement(GSXML.USER_NODE_ELEM+"List");
598
599 Vector userInfo=userQueryResult.users_;
600
601 for (int i=0; i<userQueryResult.getSize(); i++){
602 Element user_node= this.doc.createElement(GSXML.USER_NODE_ELEM);
603 String username=((UserTermInfo)userInfo.get(i)).username_;
604 String password=((UserTermInfo)userInfo.get(i)).password_;
605 String groups=((UserTermInfo)userInfo.get(i)).groups_;
606 String accountstatus=((UserTermInfo)userInfo.get(i)).accountstatus_;
607 String comment=((UserTermInfo)userInfo.get(i)).comment_;
608 user_node.setAttribute("umun",username);
609 user_node.setAttribute("umpw",password);
610 user_node.setAttribute("umgp",groups);
611 user_node.setAttribute("umas",accountstatus);
612 user_node.setAttribute("umc",comment);
613
614 user_list_node.appendChild(user_node);
615 }
616 return user_list_node;
617 }
618
619}
620
Note: See TracBrowser for help on using the repository browser.