Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

Commit 8a579b7

Browse files
authored
Migrate core.Logins and operations away from email address (#668)
1 parent 771bd5c commit 8a579b7

4 files changed

Lines changed: 6 additions & 41 deletions

File tree

src/org/labkey/cds/CDSController.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,41 +1070,6 @@ public void setAntigenQuery(String antigenQuery)
10701070
}
10711071
}
10721072

1073-
@RequiresSiteAdmin
1074-
public static class MailMergeAction extends SimpleViewAction<Object>
1075-
{
1076-
@Override
1077-
public ModelAndView getView(Object o, BindException errors) throws SQLException, IOException
1078-
{
1079-
if ("GET".equals(getViewContext().getRequest().getMethod()))
1080-
{
1081-
String csrf = new CsrfInput(getViewContext()).toString();
1082-
return new HtmlView("<form method=POST><input type=submit value=submit>" + csrf + "</form>");
1083-
}
1084-
else if ("POST".equals(getViewContext().getRequest().getMethod()))
1085-
{
1086-
String sql = "SELECT L.email, U.lastlogin, L.verification, U.displayname, U.firstname, U.lastname FROM core.logins L INNER JOIN core.principals P ON L.email = P.name INNER JOIN core.usersdata U ON P.userid = U.userid";
1087-
try (StashingResultsFactory factory = new StashingResultsFactory(()->new ResultsImpl(new SqlSelector(CoreSchema.getInstance().getScope(), sql).getResultSet())))
1088-
{
1089-
Results results = factory.get();
1090-
List<DisplayColumn> list = new ArrayList<>();
1091-
for (String s : Arrays.asList("email", "displayname", "firstname", "lastname", "lastlogin", "verification"))
1092-
list.add(new DataColumn(new BaseColumnInfo(s, JdbcType.valueOf(results.getMetaData().getColumnType(results.findColumn(s))))));
1093-
ExcelWriter xl = new ExcelWriter(factory, list);
1094-
xl.setFilenamePrefix("mailmerge");
1095-
xl.setAutoSize(true);
1096-
xl.renderWorkbook(getViewContext().getResponse());
1097-
}
1098-
}
1099-
return null;
1100-
}
1101-
1102-
@Override
1103-
public void addNavTrail(NavTree root)
1104-
{
1105-
}
1106-
}
1107-
11081073
@RequiresPermission(ReadPermission.class)
11091074
@MethodsAllowed({Method.POST, Method.DELETE})
11101075
public class UserPropertyAction extends MutatingApiAction<SimpleApiJsonForm>

test/src/org/labkey/test/tests/cds/CDSLoginTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ public void testPasswordStrength()
106106
DbLoginUtils.PasswordExpiration.Never);
107107

108108
log("Creating a user with password strength as Good");
109-
_userHelper.createUser(CDS_LOGIN_TESTUSER);
110-
SetPasswordForm.goToInitialPasswordForUser(this, CDS_LOGIN_TESTUSER)
109+
int userId = _userHelper.createUser(CDS_LOGIN_TESTUSER).getUserId();
110+
SetPasswordForm.goToInitialPasswordForUser(this, userId)
111111
.setNewPassword(goodPwd)
112112
.clickSubmit();
113113
log("Make the user as folder admin for CDS");

webapp/Connector/src/controller/Router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Ext.define('Connector.controller.Router', {
4040
this.BAD_AUTH = false;
4141
var me = this;
4242

43-
/* If the user recieves an unauthorized, return them to login screen */
43+
/* If the user receives an unauthorized, return them to login screen */
4444
this.application.on('httpunauthorized', function(status, text) {
4545
me.BAD_AUTH = true;
4646
Ext.Ajax.abortAll();

webapp/frontPage/js/modal.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ define(['jquery', 'magnific', 'util'], function($, magnific, util) {
298298
var newLocation = LABKEY.ActionURL.buildURL('cds', 'app.view', null, {
299299
'change_password': true,
300300
'message': params.message,
301-
'email': $sign_in_email.val()
301+
'userId': params.userId
302302
});
303303
window.location = newLocation;
304304
return;
@@ -429,7 +429,7 @@ define(['jquery', 'magnific', 'util'], function($, magnific, util) {
429429
return false;
430430
}
431431

432-
var emailVal = LABKEY.ActionURL.getParameter('email');
432+
var userIdVal = LABKEY.ActionURL.getParameter('userId');
433433
var prevPassword = document.getElementById('prevPassword');
434434
$.ajax({
435435
url: LABKEY.ActionURL.buildURL("login", "changePasswordAPI.api"),
@@ -438,7 +438,7 @@ define(['jquery', 'magnific', 'util'], function($, magnific, util) {
438438
oldPassword: prevPassword.value,
439439
password: pw1.value,
440440
password2: pw2.value,
441-
email: emailVal,
441+
userId: userIdVal,
442442
'X-LABKEY-CSRF': LABKEY.CSRF
443443
},
444444
success: function() {

0 commit comments

Comments
 (0)