Move sshUserName from Account to AccountExternalId
We remove the secondary unique column sshUserName and store it in the AccountExternalId entity instead. This change is necessary to support databases which do not allow mulitiple key attributes for an entity. Change-Id: I20076a05f2ea083da6044a4f1ed2f0672e85739a Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -191,9 +191,9 @@ class GitWebServlet extends HttpServlet {
|
||||
}
|
||||
if (gerritConfig.getSshdAddress() != null) {
|
||||
String sshAddr = gerritConfig.getSshdAddress();
|
||||
p.print("if ($ENV{'GERRIT_SSH_USER_NAME'}) {\n");
|
||||
p.print("if ($ENV{'GERRIT_USER_NAME'}) {\n");
|
||||
p.print(" push @git_base_url_list, join('', 'ssh://'");
|
||||
p.print(", $ENV{'GERRIT_SSH_USER_NAME'}");
|
||||
p.print(", $ENV{'GERRIT_USER_NAME'}");
|
||||
p.print(", '@'");
|
||||
if (sshAddr.startsWith("*:") || "".equals(sshAddr)) {
|
||||
p.print(", $ENV{'SERVER_NAME'}");
|
||||
@@ -452,8 +452,8 @@ class GitWebServlet extends HttpServlet {
|
||||
String remoteUser = null;
|
||||
if (project.getCurrentUser() instanceof IdentifiedUser) {
|
||||
final IdentifiedUser u = (IdentifiedUser) project.getCurrentUser();
|
||||
final String user = u.getAccount().getSshUserName();
|
||||
env.set("GERRIT_SSH_USER_NAME", user);
|
||||
final String user = u.getUserName();
|
||||
env.set("GERRIT_USER_NAME", user);
|
||||
if (user != null && !user.isEmpty()) {
|
||||
remoteUser = user;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user