View Single Post
  #2 (permalink)  
Old 10-05-2009, 07:27 AM
scotty scotty is offline
Intermediate Member
 
Posts: 15
Default

Put something like this in your .jsp

Code:
  String name = null;
  Provisioning prov = Provisioning.getInstance();
  javax.servlet.http.Cookie[] cookies = request.getCookies();
  String authTokenString = "";
  Account acct = null;

  for (javax.servlet.http.Cookie cookie : cookies) {
     if (cookie.getName().equals("ZM_AUTH_TOKEN")) {
        authTokenString = cookie.getValue();
     }
  }

  if (!authTokenString.equals("")) {
     AuthToken authToken = AuthToken.getAuthToken(authTokenString);
     acct = prov.get(Provisioning.AccountBy.id, authToken.getAccountId());
  }

   if (acct != null) {
      name = acct.getName();
   }
Reply With Quote