import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.LanguageCallback;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.LanguageCallback;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.argeo.cms.CmsMsg;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.argeo.cms.CmsMsg;
import org.argeo.cms.auth.CurrentUser;
import org.argeo.cms.auth.HttpRequestCallback;
import org.argeo.cms.i18n.LocaleUtils;
import org.argeo.cms.auth.CurrentUser;
import org.argeo.cms.auth.HttpRequestCallback;
import org.argeo.cms.i18n.LocaleUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
specificUserUi(credentialsBlock);
Label l = new Label(credentialsBlock, SWT.NONE);
specificUserUi(credentialsBlock);
Label l = new Label(credentialsBlock, SWT.NONE);
// new Label(this, SWT.NONE).setText(CmsMsg.username.lead());
usernameT = new Text(credentialsBlock, SWT.BORDER);
usernameT.setMessage(username.lead(locale));
// new Label(this, SWT.NONE).setText(CmsMsg.username.lead());
usernameT = new Text(credentialsBlock, SWT.BORDER);
usernameT.setMessage(username.lead(locale));
GridData gd = CmsUtils.fillWidth();
gd.widthHint = textWidth;
usernameT.setLayoutData(gd);
GridData gd = CmsUtils.fillWidth();
gd.widthHint = textWidth;
usernameT.setLayoutData(gd);
// new Label(this, SWT.NONE).setText(CmsMsg.password.lead());
passwordT = new Text(credentialsBlock, SWT.BORDER | SWT.PASSWORD);
passwordT.setMessage(password.lead(locale));
// new Label(this, SWT.NONE).setText(CmsMsg.password.lead());
passwordT = new Text(credentialsBlock, SWT.BORDER | SWT.PASSWORD);
passwordT.setMessage(password.lead(locale));
gd = CmsUtils.fillWidth();
gd.widthHint = textWidth;
passwordT.setLayoutData(gd);
gd = CmsUtils.fillWidth();
gd.widthHint = textWidth;
passwordT.setLayoutData(gd);
- new LoginContext(LOGIN_CONTEXT_ANONYMOUS, subject).logout();
- loginContext = new LoginContext(LOGIN_CONTEXT_USER, subject, this);
+ loginContext.logout();
+ loginContext = new LoginContext(NodeConstants.LOGIN_CONTEXT_USER, this);
@Override
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (Callback callback : callbacks) {
@Override
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (Callback callback : callbacks) {
((PasswordCallback) callback).setPassword(passwordT.getTextChars());
else if (callback instanceof HttpRequestCallback)
((PasswordCallback) callback).setPassword(passwordT.getTextChars());
else if (callback instanceof HttpRequestCallback)
else if (callback instanceof LanguageCallback && localeChoice != null)
((LanguageCallback) callback).setLocale(localeChoice.getSelectedLocale());
}
else if (callback instanceof LanguageCallback && localeChoice != null)
((LanguageCallback) callback).setLocale(localeChoice.getSelectedLocale());
}