Changeset 30123
- Timestamp:
- 02/13/08 01:20:08 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/auth/NuxeoAuthenticationFilter.java
r30112 r30123 239 239 HttpServletRequest httpRequest = (HttpServletRequest) request; 240 240 241 String deputy _login = (String) httpRequest.getAttribute(NXAuthContants.SWITCH_USER_KEY);242 243 if (deputy_login==null)241 String deputyLogin = (String) httpRequest.getAttribute(NXAuthContants.SWITCH_USER_KEY); 242 243 if (deputyLogin == null) { 244 244 return false; 245 } 245 246 246 247 CachableUserIdentificationInfo cachableUserIdent = retrieveIdentityFromCache(httpRequest); … … 301 302 } 302 303 303 304 304 public void doFilter(ServletRequest request, ServletResponse response, 305 305 FilterChain chain) throws IOException, ServletException { 306 306 307 String tokenPage = getRequestedPage(request);308 if (tokenPage.equals(NXAuthContants.SWITCH_USER_PAGE))309 {310 Boolean result = switchUser(request, response, chain);311 if (result)312 return;313 }307 String tokenPage = getRequestedPage(request); 308 if (tokenPage.equals(NXAuthContants.SWITCH_USER_PAGE)) { 309 Boolean result = switchUser(request, response, chain); 310 if (result) { 311 return; 312 } 313 } 314 314 315 315 if (request instanceof NuxeoSecuredRequestWrapper) { … … 336 336 HttpServletResponse httpResponse = (HttpServletResponse) response; 337 337 Principal principal = httpRequest.getUserPrincipal(); 338 339 log.debug(httpRequest.getRequestURL().toString());340 338 341 339 if (principal == null) { … … 543 541 } 544 542 } 545 // FIXME: this can't work: NuxeoAuthenticationPluginLogoutExtension546 // is not a subclass of NuxeoAuthenticationPlugin547 543 return false; 548 544 } … … 570 566 NuxeoAuthenticationPluginLogoutExtension logoutPlugin = null; 571 567 572 // FIXME: this can't work: NuxeoAuthenticationPluginLogoutExtension573 // is not a subclass of NuxeoAuthenticationPlugin574 568 if (authPlugin instanceof NuxeoAuthenticationPluginLogoutExtension) { 575 569 logoutPlugin = (NuxeoAuthenticationPluginLogoutExtension) authPlugin; … … 644 638 } 645 639 } 646 647 640 return false; 648 641 } … … 652 645 HttpServletRequest httpRequest = (HttpServletRequest) request; 653 646 return getRequestedPage(httpRequest); 654 } 655 else 647 } else { 656 648 return null; 649 } 657 650 } 658 651 … … 685 678 log.error("No auth plugin can be found to do the Login Prompt"); 686 679 return false; 687 }688 689 protected Boolean needSessionSaving(UserIdentificationInfo userInfo) {690 String pluginName = userInfo.getAuthPluginName();691 692 AuthenticationPluginDescriptor desc = service.getDescriptor(pluginName);693 694 if (desc.getStatefull()) {695 return true;696 } else {697 if (desc.getNeedStartingURLSaving()) {698 return true;699 } else {700 return false;701 }702 }703 680 } 704 681 … … 759 736 } 760 737 738 protected Boolean needSessionSaving(UserIdentificationInfo userInfo) { 739 String pluginName = userInfo.getAuthPluginName(); 740 741 AuthenticationPluginDescriptor desc = service.getDescriptor(pluginName); 742 743 if (desc.getStatefull()) { 744 return true; 745 } else { 746 return desc.getNeedStartingURLSaving(); 747 } 748 } 749 761 750 }
