- String username = authentication.getName();
- if (username.equals(KernelHeader.USERNAME_ANONYMOUS)) {
- username = null;
- anonymousUi();
+ public UserMenu(Control source, boolean autoclose) {
+ shell = new Shell(source.getDisplay(), SWT.NO_TRIM | SWT.BORDER
+ | SWT.ON_TOP);
+ shell.setData(RWT.CUSTOM_VARIANT, CMS_USER_MENU);
+ // cmsView = (CmsView) shell.getDisplay().getData(CmsView.KEY);
+ cmsView = CmsUtils.getCmsView();
+
+ if (cmsView != null) {
+ String username = CurrentUser.getUsername(CmsUtils.getCmsView()
+ .getSubject());
+ if (username == null
+ || username.equalsIgnoreCase(AuthConstants.ROLE_ANONYMOUS)) {
+ username = null;
+ anonymousUi(shell);
+ } else {
+ userUi(shell);
+ }