From 9f61cfd857bbca6c7987d0a91b703fc62b78a5d9 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 15 Mar 2016 17:32:37 +0100 Subject: [PATCH] SONAR-7254 Update rails authentication to take into account user.local --- .../webapp/WEB-INF/app/controllers/users_controller.rb | 1 + .../sonar-web/src/main/webapp/WEB-INF/app/models/user.rb | 8 ++++++-- .../src/main/webapp/WEB-INF/lib/need_authentication.rb | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb index 7a0729b623a..40221c6465f 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb @@ -68,6 +68,7 @@ class UsersController < ApplicationController user = User.new(params[:user]) user.external_identity = user.login user.external_identity_provider = 'sonarqube' + user.user_local = true default_group_name=java_facade.getSettings().getString('sonar.defaultGroup') default_group=Group.find_by_name(default_group_name) user.groups< ['login=? and user_local=?', username, true]) + if countUserLocal > 0 local_auth(username, password) else auth(username, password, servlet_request) @@ -134,6 +134,7 @@ class PluginRealm user = User.new(:login => username, :name => username, :email => '', :created_at => now, :updated_at => now) user.external_identity = username user.external_identity_provider = 'sonarqube' + user.user_local = false if details user.name = details.getName() -- 2.39.5