]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6226 Id provider info are set when users signup
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 2 Feb 2016 16:41:39 +0000 (17:41 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 4 Feb 2016 09:09:53 +0000 (10:09 +0100)
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/users_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/models/user.rb

index ac643f9c0d4b744d77e720c9b6ab3722055f4ec4..7a0729b623a3c7a9f94a86952087dddafc646995 100644 (file)
@@ -66,6 +66,8 @@ class UsersController < ApplicationController
 
   def prepare_user
     user = User.new(params[:user])
+    user.external_identity = user.login
+    user.external_identity_provider = 'sonarqube'
     default_group_name=java_facade.getSettings().getString('sonar.defaultGroup')
     default_group=Group.find_by_name(default_group_name)
     user.groups<<default_group if default_group
index a22804d9a33d9a1f265ee9965f65c661c55a13cb..a619978a3058a222c5410617e650652f68ff9552 100644 (file)
@@ -85,6 +85,14 @@ class User < ActiveRecord::Base
     write_attribute :email, (value && value.downcase)
   end
 
+  def external_identity=(value)
+    write_attribute :external_identity, value
+  end
+
+  def external_identity_provider=(value)
+    write_attribute :external_identity_provider, value
+  end
+
   # SCM accounts should also contain login and email
   def full_scm_accounts
     new_scm_accounts = self.scm_accounts.split(/\r?\n/).reject { |c| c.empty? } if self.scm_accounts