SSOLogin can now be set in UserEditForms
git-svn-id: https://svn.libreccm.org/ccm/trunk@6198 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
cc70b41ada
commit
042e4006e2
|
|
@ -125,6 +125,8 @@ class UserAddForm extends UserForm
|
||||||
auth.setPasswordAnswer((String) m_answer.getValue(state));
|
auth.setPasswordAnswer((String) m_answer.getValue(state));
|
||||||
}
|
}
|
||||||
auth.save();
|
auth.save();
|
||||||
|
|
||||||
|
auth.setSSOlogin((String) m_ssoLogin.getValue(state));
|
||||||
|
|
||||||
// Switch to browse tab.
|
// Switch to browse tab.
|
||||||
m_adminPanel.setTab(USER_TAB_BROWSE_INDEX, state);
|
m_adminPanel.setTab(USER_TAB_BROWSE_INDEX, state);
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,8 @@ class UserCreateSection extends UserForm implements AdminConstants, Resettable {
|
||||||
// Save user authentication credentials.
|
// Save user authentication credentials.
|
||||||
final UserAuthentication auth = UserAuthentication.createForUser(user);
|
final UserAuthentication auth = UserAuthentication.createForUser(user);
|
||||||
|
|
||||||
|
auth.setSSOlogin((String) m_ssoLogin.getValue(state));
|
||||||
|
|
||||||
auth.setPassword((String) m_password.getValue(state));
|
auth.setPassword((String) m_password.getValue(state));
|
||||||
if (securityConfig.getEnableQuestion()) {
|
if (securityConfig.getEnableQuestion()) {
|
||||||
auth.setPasswordQuestion((String) m_question.getValue(state));
|
auth.setPasswordQuestion((String) m_question.getValue(state));
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.kernel.EmailAddress;
|
import com.arsdigita.kernel.EmailAddress;
|
||||||
import com.arsdigita.kernel.PersonName;
|
import com.arsdigita.kernel.PersonName;
|
||||||
|
import com.arsdigita.kernel.UserAuthentication;
|
||||||
import com.arsdigita.kernel.User;
|
import com.arsdigita.kernel.User;
|
||||||
import javax.mail.internet.InternetAddress;
|
import javax.mail.internet.InternetAddress;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
@ -81,6 +82,9 @@ class UserEditForm extends UserForm
|
||||||
}
|
}
|
||||||
|
|
||||||
m_screenName.setValue(state, user.getScreenName());
|
m_screenName.setValue(state, user.getScreenName());
|
||||||
|
|
||||||
|
final UserAuthentication auth = UserAuthentication.retrieveForUser(user);
|
||||||
|
m_ssoLogin.setValue(state, auth.getSSOlogin());
|
||||||
|
|
||||||
USER_FORM_LABEL_ADDITIONAL_EMAIL_LIST.setVisible(state, true);
|
USER_FORM_LABEL_ADDITIONAL_EMAIL_LIST.setVisible(state, true);
|
||||||
m_emailList.setVisible(state, true);
|
m_emailList.setVisible(state, true);
|
||||||
|
|
@ -139,6 +143,10 @@ class UserEditForm extends UserForm
|
||||||
|
|
||||||
user.save();
|
user.save();
|
||||||
|
|
||||||
|
final UserAuthentication auth = UserAuthentication.retrieveForUser(user);
|
||||||
|
auth.setSSOlogin((String) m_ssoLogin.getValue(state));
|
||||||
|
auth.save();
|
||||||
|
|
||||||
m_browsePane.displayUserInfoPanel(state);
|
m_browsePane.displayUserInfoPanel(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
protected TextField m_url;
|
protected TextField m_url;
|
||||||
protected TextField m_screenName;
|
protected TextField m_screenName;
|
||||||
protected EmailList m_emailList;
|
protected EmailList m_emailList;
|
||||||
|
protected TextField m_ssoLogin;
|
||||||
private final PasswordValidationListener m_pwListener;
|
private final PasswordValidationListener m_pwListener;
|
||||||
private final NotEmptyValidationListener m_notNullListener;
|
private final NotEmptyValidationListener m_notNullListener;
|
||||||
private final SecurityConfig securityConfig = SecurityConfig.getConfig();
|
private final SecurityConfig securityConfig = SecurityConfig.getConfig();
|
||||||
|
|
@ -77,31 +78,30 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
|
|
||||||
addValidationListener(this);
|
addValidationListener(this);
|
||||||
|
|
||||||
|
|
||||||
// Bug #163373 add length checking for first/last names. We
|
// Bug #163373 add length checking for first/last names. We
|
||||||
// do this with both maximum length parameters in the user/add
|
// do this with both maximum length parameters in the user/add
|
||||||
// form and with validation of the value that come in for
|
// form and with validation of the value that come in for
|
||||||
// processing.
|
// processing.
|
||||||
|
|
||||||
int max = 60;
|
int max = 60;
|
||||||
|
|
||||||
m_firstName = new TextField(
|
m_firstName = new TextField(
|
||||||
new StringParameter(USER_FORM_INPUT_FIRST_NAME));
|
new StringParameter(USER_FORM_INPUT_FIRST_NAME));
|
||||||
m_firstName.setMaxLength(max);
|
m_firstName.setMaxLength(max);
|
||||||
m_firstName.setSize(20);
|
m_firstName.setSize(20);
|
||||||
m_firstName.addValidationListener(new NotEmptyValidationListener());
|
m_firstName.addValidationListener(new NotEmptyValidationListener());
|
||||||
m_firstName.addValidationListener(
|
m_firstName.addValidationListener(
|
||||||
new StringLengthValidationListener(max));
|
new StringLengthValidationListener(max));
|
||||||
|
|
||||||
add(USER_FORM_LABEL_FIRST_NAME);
|
add(USER_FORM_LABEL_FIRST_NAME);
|
||||||
add(m_firstName);
|
add(m_firstName);
|
||||||
|
|
||||||
m_lastName = new TextField(
|
m_lastName = new TextField(
|
||||||
new StringParameter(USER_FORM_INPUT_LAST_NAME));
|
new StringParameter(USER_FORM_INPUT_LAST_NAME));
|
||||||
m_lastName.setMaxLength(max);
|
m_lastName.setMaxLength(max);
|
||||||
m_lastName.setSize(25);
|
m_lastName.setSize(25);
|
||||||
m_lastName.addValidationListener(new NotEmptyValidationListener());
|
m_lastName.addValidationListener(new NotEmptyValidationListener());
|
||||||
m_lastName.addValidationListener(new StringLengthValidationListener(max));
|
m_lastName
|
||||||
|
.addValidationListener(new StringLengthValidationListener(max));
|
||||||
|
|
||||||
add(USER_FORM_LABEL_LAST_NAME);
|
add(USER_FORM_LABEL_LAST_NAME);
|
||||||
add(m_lastName);
|
add(m_lastName);
|
||||||
|
|
@ -113,14 +113,14 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
|
|
||||||
// Password confirmation
|
// Password confirmation
|
||||||
m_confirmPassword = new Password(new StringParameter(
|
m_confirmPassword = new Password(new StringParameter(
|
||||||
USER_FORM_INPUT_PASSWORD_CONFIRMATION));
|
USER_FORM_INPUT_PASSWORD_CONFIRMATION));
|
||||||
|
|
||||||
add(USER_FORM_LABEL_PASSWORD_CONFIRMATION);
|
add(USER_FORM_LABEL_PASSWORD_CONFIRMATION);
|
||||||
add(m_confirmPassword);
|
add(m_confirmPassword);
|
||||||
|
|
||||||
// Password question
|
// Password question
|
||||||
m_question =
|
m_question
|
||||||
new TextField(new StringParameter(USER_FORM_INPUT_QUESTION));
|
= new TextField(new StringParameter(USER_FORM_INPUT_QUESTION));
|
||||||
m_question.setSize(50);
|
m_question.setSize(50);
|
||||||
|
|
||||||
if (securityConfig.getEnableQuestion()) {
|
if (securityConfig.getEnableQuestion()) {
|
||||||
|
|
@ -139,7 +139,7 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
|
|
||||||
// Primary email address
|
// Primary email address
|
||||||
m_primaryEmail = new TextField(new EmailParameter(
|
m_primaryEmail = new TextField(new EmailParameter(
|
||||||
USER_FORM_INPUT_PRIMARY_EMAIL));
|
USER_FORM_INPUT_PRIMARY_EMAIL));
|
||||||
m_primaryEmail.addValidationListener(new NotEmptyValidationListener());
|
m_primaryEmail.addValidationListener(new NotEmptyValidationListener());
|
||||||
m_primaryEmail.setSize(50);
|
m_primaryEmail.setSize(50);
|
||||||
add(USER_FORM_LABEL_PRIMARY_EMAIL);
|
add(USER_FORM_LABEL_PRIMARY_EMAIL);
|
||||||
|
|
@ -151,20 +151,25 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
add(m_emailList);
|
add(m_emailList);
|
||||||
|
|
||||||
m_additionalEmail = new TextField(new EmailParameter(
|
m_additionalEmail = new TextField(new EmailParameter(
|
||||||
USER_FORM_INPUT_ADDITIONAL_EMAIL));
|
USER_FORM_INPUT_ADDITIONAL_EMAIL));
|
||||||
m_additionalEmail.setSize(50);
|
m_additionalEmail.setSize(50);
|
||||||
add(USER_FORM_LABEL_ADDITIONAL_EMAIL);
|
add(USER_FORM_LABEL_ADDITIONAL_EMAIL);
|
||||||
add(m_additionalEmail);
|
add(m_additionalEmail);
|
||||||
|
|
||||||
// Screen name
|
// Screen name
|
||||||
m_screenName = new TextField(new StringParameter(
|
m_screenName = new TextField(new StringParameter(
|
||||||
USER_FORM_INPUT_SCREEN_NAME));
|
USER_FORM_INPUT_SCREEN_NAME));
|
||||||
if (Kernel.getConfig().screenNameIsPrimaryIdentifier()) {
|
if (Kernel.getConfig().screenNameIsPrimaryIdentifier()) {
|
||||||
m_screenName.addValidationListener(new NotEmptyValidationListener());
|
m_screenName.addValidationListener(new NotEmptyValidationListener());
|
||||||
}
|
}
|
||||||
add(USER_FORM_LABEL_SCREEN_NAME);
|
add(USER_FORM_LABEL_SCREEN_NAME);
|
||||||
add(m_screenName);
|
add(m_screenName);
|
||||||
|
|
||||||
|
m_ssoLogin = new TextField(new StringParameter(USER_FORM_INPUT_SSO));
|
||||||
|
m_ssoLogin.setSize(50);
|
||||||
|
add(USER_FORM_LABEL_SSO);
|
||||||
|
add(m_ssoLogin);
|
||||||
|
|
||||||
// URL
|
// URL
|
||||||
m_url = new TextField(new URLParameter(USER_FORM_INPUT_URL));
|
m_url = new TextField(new URLParameter(USER_FORM_INPUT_URL));
|
||||||
m_url.setSize(50);
|
m_url.setSize(50);
|
||||||
|
|
@ -179,14 +184,14 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate the form. Verifies that the password and
|
* Validate the form. Verifies that the password and password-confirm fields
|
||||||
* password-confirm fields match. If not it adds an error to the
|
* match. If not it adds an error to the password-confirm field. Also
|
||||||
* password-confirm field. Also verifies that primary email
|
* verifies that primary email address and screen name are unique amoung all
|
||||||
* address and screen name are unique amoung all users.
|
* users.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void validate(FormSectionEvent event)
|
public void validate(FormSectionEvent event)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
PageState ps = event.getPageState();
|
PageState ps = event.getPageState();
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
HttpServletRequest req = ps.getRequest();
|
HttpServletRequest req = ps.getRequest();
|
||||||
|
|
@ -200,22 +205,22 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
if (userID == null) {
|
if (userID == null) {
|
||||||
|
|
||||||
m_pwListener.validate(
|
m_pwListener.validate(
|
||||||
new ParameterEvent(event.getSource(),
|
new ParameterEvent(event.getSource(),
|
||||||
data.getParameter(
|
data.getParameter(
|
||||||
USER_FORM_INPUT_PASSWORD)));
|
USER_FORM_INPUT_PASSWORD)));
|
||||||
m_notNullListener.validate(
|
m_notNullListener.validate(
|
||||||
new ParameterEvent(event.getSource(),
|
new ParameterEvent(event.getSource(),
|
||||||
data.getParameter(
|
data.getParameter(
|
||||||
USER_FORM_INPUT_PASSWORD_CONFIRMATION)));
|
USER_FORM_INPUT_PASSWORD_CONFIRMATION)));
|
||||||
String password = (String) m_password.getValue(ps);
|
String password = (String) m_password.getValue(ps);
|
||||||
String confirm = (String) m_confirmPassword.getValue(ps);
|
String confirm = (String) m_confirmPassword.getValue(ps);
|
||||||
|
|
||||||
if (!StringUtils.emptyString(password) && !StringUtils.emptyString(
|
if (!StringUtils.emptyString(password) && !StringUtils.emptyString(
|
||||||
confirm)) {
|
confirm)) {
|
||||||
if (!password.equals(confirm)) {
|
if (!password.equals(confirm)) {
|
||||||
data.addError(USER_FORM_INPUT_PASSWORD_CONFIRMATION,
|
data.addError(USER_FORM_INPUT_PASSWORD_CONFIRMATION,
|
||||||
(String) USER_FORM_ERROR_PASSWORD_NOT_MATCH.
|
(String) USER_FORM_ERROR_PASSWORD_NOT_MATCH.
|
||||||
localize(req));
|
localize(req));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -229,16 +234,16 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
if (answer == null || answer.trim().length() == 0) {
|
if (answer == null || answer.trim().length() == 0) {
|
||||||
data.addError(USER_FORM_INPUT_ANSWER,
|
data.addError(USER_FORM_INPUT_ANSWER,
|
||||||
(String) USER_FORM_ERROR_ANSWER_NULL.localize(
|
(String) USER_FORM_ERROR_ANSWER_NULL.localize(
|
||||||
req));
|
req));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Check for edit form
|
// Check for edit form
|
||||||
if (answer != null && answer.length() > 0 && answer.trim().
|
if (answer != null && answer.length() > 0 && answer.trim().
|
||||||
length()
|
length()
|
||||||
== 0) {
|
== 0) {
|
||||||
data.addError(USER_FORM_INPUT_ANSWER,
|
data.addError(USER_FORM_INPUT_ANSWER,
|
||||||
(String) USER_FORM_ERROR_ANSWER_NULL.localize(
|
(String) USER_FORM_ERROR_ANSWER_NULL.localize(
|
||||||
req));
|
req));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -247,7 +252,7 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
* Verify that primary email and screen name are unique
|
* Verify that primary email and screen name are unique
|
||||||
*/
|
*/
|
||||||
DataQuery query = SessionManager.getSession().retrieveQuery(
|
DataQuery query = SessionManager.getSession().retrieveQuery(
|
||||||
"com.arsdigita.kernel.RetrieveUsers");
|
"com.arsdigita.kernel.RetrieveUsers");
|
||||||
query.setParameter("excludeGroupId", new BigDecimal(0));
|
query.setParameter("excludeGroupId", new BigDecimal(0));
|
||||||
|
|
||||||
String email = null;
|
String email = null;
|
||||||
|
|
@ -258,7 +263,7 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
String screenName = (String) m_screenName.getValue(ps);
|
String screenName = (String) m_screenName.getValue(ps);
|
||||||
|
|
||||||
Filter filter = query.addFilter(
|
Filter filter = query.addFilter(
|
||||||
"primaryEmail = :email or screenName = :sn");
|
"primaryEmail = :email or screenName = :sn");
|
||||||
filter.set("email", email);
|
filter.set("email", email);
|
||||||
filter.set("sn", screenName);
|
filter.set("sn", screenName);
|
||||||
|
|
||||||
|
|
@ -268,21 +273,21 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this query returns with any rows we have a duplicate
|
* If this query returns with any rows we have a duplicate screen name,
|
||||||
* screen name, email address, or both. Check the results and
|
* email address, or both. Check the results and produce appropriate
|
||||||
* produce appropriate error messages.
|
* error messages.
|
||||||
*/
|
*/
|
||||||
while (query.next()) {
|
while (query.next()) {
|
||||||
if (screenName != null && screenName.equals(query.get("screenName"))) {
|
if (screenName != null && screenName.equals(query.get("screenName"))) {
|
||||||
data.addError(USER_FORM_INPUT_SCREEN_NAME,
|
data.addError(USER_FORM_INPUT_SCREEN_NAME,
|
||||||
(String) USER_FORM_ERROR_SCREEN_NAME_NOT_UNIQUE.
|
(String) USER_FORM_ERROR_SCREEN_NAME_NOT_UNIQUE.
|
||||||
localize(req));
|
localize(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (email != null && email.equals(query.get("primaryEmail"))) {
|
if (email != null && email.equals(query.get("primaryEmail"))) {
|
||||||
data.addError(USER_FORM_INPUT_PRIMARY_EMAIL,
|
data.addError(USER_FORM_INPUT_PRIMARY_EMAIL,
|
||||||
(String) USER_FORM_ERROR_PRIMARY_EMAIL_NOT_UNIQUE.
|
(String) USER_FORM_ERROR_PRIMARY_EMAIL_NOT_UNIQUE.
|
||||||
localize(req));
|
localize(req));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -319,4 +324,5 @@ class UserForm extends Form implements FormValidationListener, AdminConstants {
|
||||||
m_answer.setVisible(state, isVisible);
|
m_answer.setVisible(state, isVisible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,40 +37,42 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.form.Hidden;
|
import com.arsdigita.bebop.form.Hidden;
|
||||||
import com.arsdigita.bebop.parameters.URLParameter;
|
import com.arsdigita.bebop.parameters.URLParameter;
|
||||||
import com.arsdigita.util.UncheckedWrapperException;
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
import com.arsdigita.kernel.UserAuthentication;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits a user. If returnURL is passed in to the form, then redirects to
|
* Edits a user. If returnURL is passed in to the form, then redirects to that
|
||||||
* that URL; otherwise redirects to the user workspace.
|
* URL; otherwise redirects to the user workspace.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @author Sameer Ajmani
|
* @author Sameer Ajmani
|
||||||
*
|
*
|
||||||
* @version $Id: UserEditForm.java 738 2005-09-01 12:36:52Z sskracic $
|
* @version $Id: UserEditForm.java 738 2005-09-01 12:36:52Z sskracic $
|
||||||
*
|
*
|
||||||
**/
|
*
|
||||||
|
*/
|
||||||
public class UserEditForm extends UserForm
|
public class UserEditForm extends UserForm
|
||||||
implements FormProcessListener
|
implements FormProcessListener {
|
||||||
{
|
|
||||||
|
|
||||||
private static final Logger s_log =
|
private static final Logger s_log = Logger.getLogger(UserEditForm.class);
|
||||||
Logger.getLogger(UserEditForm.class);
|
|
||||||
|
|
||||||
private UserAuthenticationListener m_listener =
|
private UserAuthenticationListener m_listener
|
||||||
new UserAuthenticationListener();
|
= new UserAuthenticationListener();
|
||||||
private Hidden m_returnURL;
|
private Hidden m_returnURL;
|
||||||
private RequestLocal m_user = new RequestLocal() {
|
private RequestLocal m_user = new RequestLocal() {
|
||||||
public Object initialValue(PageState ps) {
|
|
||||||
User result;
|
public Object initialValue(PageState ps) {
|
||||||
try {
|
User result;
|
||||||
result = User.retrieve(m_listener.getUser(ps).getOID());
|
try {
|
||||||
} catch (DataObjectNotFoundException e) {
|
result = User.retrieve(m_listener.getUser(ps).getOID());
|
||||||
result = null;
|
} catch (DataObjectNotFoundException e) {
|
||||||
}
|
result = null;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
};
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
public UserEditForm() {
|
public UserEditForm() {
|
||||||
super("user-edit", new ColumnPanel(2), false);
|
super("user-edit", new ColumnPanel(2), false);
|
||||||
|
|
@ -78,8 +80,8 @@ public class UserEditForm extends UserForm
|
||||||
addProcessListener(this);
|
addProcessListener(this);
|
||||||
|
|
||||||
// export return URL
|
// export return URL
|
||||||
m_returnURL = new Hidden(new URLParameter
|
m_returnURL = new Hidden(new URLParameter(
|
||||||
(LoginHelper.RETURN_URL_PARAM_NAME));
|
LoginHelper.RETURN_URL_PARAM_NAME));
|
||||||
m_returnURL.setPassIn(true);
|
m_returnURL.setPassIn(true);
|
||||||
add(m_returnURL);
|
add(m_returnURL);
|
||||||
}
|
}
|
||||||
|
|
@ -96,7 +98,7 @@ public class UserEditForm extends UserForm
|
||||||
|
|
||||||
public void process(FormSectionEvent event)
|
public void process(FormSectionEvent event)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
||||||
User user;
|
User user;
|
||||||
|
|
@ -120,15 +122,13 @@ public class UserEditForm extends UserForm
|
||||||
// user.addEmailAddress
|
// user.addEmailAddress
|
||||||
// (new EmailAddress(additional.getAddress()));
|
// (new EmailAddress(additional.getAddress()));
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// Bug #166274: Unexpected behavior when editing
|
// Bug #166274: Unexpected behavior when editing
|
||||||
// primary email.
|
// primary email.
|
||||||
//
|
//
|
||||||
// Check to see if the primary email address has
|
// Check to see if the primary email address has
|
||||||
// changed, and if so set it to the new value and
|
// changed, and if so set it to the new value and
|
||||||
// delete the association with the old. If it
|
// delete the association with the old. If it
|
||||||
// hasn't change don't do anything.
|
// hasn't change don't do anything.
|
||||||
|
|
||||||
EmailAddress oaddr = user.getPrimaryEmail();
|
EmailAddress oaddr = user.getPrimaryEmail();
|
||||||
EmailAddress naddr = new EmailAddress(data.get(FORM_EMAIL).toString());
|
EmailAddress naddr = new EmailAddress(data.get(FORM_EMAIL).toString());
|
||||||
if (!oaddr.equals(naddr)) {
|
if (!oaddr.equals(naddr)) {
|
||||||
|
|
@ -139,8 +139,11 @@ public class UserEditForm extends UserForm
|
||||||
|
|
||||||
user.save();
|
user.save();
|
||||||
|
|
||||||
// redirect to workspace or return URL, if specified
|
final UserAuthentication auth = UserAuthentication.retrieveForUser(user);
|
||||||
|
auth.setSSOlogin((String) m_ssoLogin.getValue(state));
|
||||||
|
auth.save();
|
||||||
|
|
||||||
|
// redirect to workspace or return URL, if specified
|
||||||
final HttpServletRequest req = state.getRequest();
|
final HttpServletRequest req = state.getRequest();
|
||||||
|
|
||||||
// final String path = LegacyInitializer.getFullURL
|
// final String path = LegacyInitializer.getFullURL
|
||||||
|
|
@ -151,4 +154,5 @@ public class UserEditForm extends UserForm
|
||||||
|
|
||||||
throw new ReturnSignal(req, fallback);
|
throw new ReturnSignal(req, fallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ public abstract class UserForm extends Form
|
||||||
protected TextField m_question;
|
protected TextField m_question;
|
||||||
protected TextField m_answer;
|
protected TextField m_answer;
|
||||||
protected TextField m_url;
|
protected TextField m_url;
|
||||||
|
protected TextField m_ssoLogin;
|
||||||
|
|
||||||
protected Label m_securitySectionHeader = new Label(LoginHelper
|
protected Label m_securitySectionHeader = new Label(LoginHelper
|
||||||
.getMessage("login.userNewForm.securitySectionHeader"), false);
|
.getMessage("login.userNewForm.securitySectionHeader"), false);
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,7 @@ public class UserNewForm extends UserForm
|
||||||
final String answer = (String)m_answer.getValue(state);
|
final String answer = (String)m_answer.getValue(state);
|
||||||
final String firstName = (String)m_firstName.getValue(state);
|
final String firstName = (String)m_firstName.getValue(state);
|
||||||
final String lastName = (String)m_lastName.getValue(state);
|
final String lastName = (String)m_lastName.getValue(state);
|
||||||
|
final String ssoLogin = (String) m_ssoLogin.getValue(state);
|
||||||
String sn = null;
|
String sn = null;
|
||||||
if (!Kernel.getConfig().emailIsPrimaryIdentifier()) {
|
if (!Kernel.getConfig().emailIsPrimaryIdentifier()) {
|
||||||
sn = (String)m_screenName.getValue(state);
|
sn = (String)m_screenName.getValue(state);
|
||||||
|
|
@ -183,6 +184,7 @@ public class UserNewForm extends UserForm
|
||||||
auth.setPassword(password);
|
auth.setPassword(password);
|
||||||
auth.setPasswordQuestion(question);
|
auth.setPasswordQuestion(question);
|
||||||
auth.setPasswordAnswer(answer);
|
auth.setPasswordAnswer(answer);
|
||||||
|
auth.setSSOlogin(ssoLogin);
|
||||||
auth.save();
|
auth.save();
|
||||||
} catch (PersistenceException e) {
|
} catch (PersistenceException e) {
|
||||||
// problem with creating new User or retrieving
|
// problem with creating new User or retrieving
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue