|
From: Michael K. <ko...@us...> - 2005-01-19 15:56:51
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4033 Modified Files: UserManagerImpl.java Log Message: Index: UserManagerImpl.java =================================================================== RCS file: /cvsroot/cobricks/cobricks2/src/org/cobricks/user/UserManagerImpl.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- UserManagerImpl.java 17 Dec 2004 14:26:22 -0000 1.39 +++ UserManagerImpl.java 19 Jan 2005 15:56:27 -0000 1.40 @@ -315,10 +315,36 @@ User user = getUser(userid); if (user == null) return null; // handle rules ... currently we just check the aname+".acc" attribute - // for a substring "web" String acc = user.getAttribute(aname+".acc"); if (acc == null) return user.getAttribute(aname); - if (acc.indexOf("web")>-1) return user.getAttribute(aname); + if (acc.equals("1")) return user.getAttribute(aname); + return null; + } + + /** + * Return the value of a user attribute for a display destination. + * The rule for determining the result is to check the user attribute + * aname+".acc."+destinationid - if it is "1" or not defined + * then return the value, otherwise (other value) return null. + * + * @param userid The id of the user. + * @param aname The name of the attribute. + * @param requserid The id of the requesting user. + * @param destinationid The id of the destination, e.g. "mm" for + * the meeting mirror + * @return The value of the user attribute. + */ + public Object getUserAttr(int userid, String aname, int requserid, + String destinationid) + { + User user = getUser(userid); + if (user == null) return null; + String anameacc = aname+".acc"; + if (destinationid!=null && destinationid.length()>0) + anameacc = anameacc + "." + destinationid.trim(); + String acc = user.getAttribute(anameacc); + if (acc == null) return user.getAttribute(aname); + if (acc.equals("1")) return user.getAttribute(aname); return null; } |