summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorFlorian Unglaub <florian.unglaub@nix-wie-weg.de>2012-08-24 15:25:52 +0200
committerFlorian Unglaub <florian.unglaub@nix-wie-weg.de>2012-08-24 15:25:52 +0200
commit48443d20ca9aa10323c1b81835e519680b10debc (patch)
tree7488eeab446a1a01f90450e50028bfcbdc0ad1d0 /app/controllers
parentc5ae1549a1d09599734ccaab27e90a8752f1ede6 (diff)
parent6d4ae75f544d9819954865c105414a722344336a (diff)
downloadgitlab-ce-48443d20ca9aa10323c1b81835e519680b10debc.tar.gz
Merge branch 'master' of git://github.com/gitlabhq/gitlabhq
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/labels_controller.rb25
-rw-r--r--app/controllers/omniauth_callbacks_controller.rb5
-rw-r--r--app/controllers/projects_controller.rb4
-rw-r--r--app/controllers/team_members_controller.rb1
4 files changed, 30 insertions, 5 deletions
diff --git a/app/controllers/labels_controller.rb b/app/controllers/labels_controller.rb
new file mode 100644
index 00000000000..f52fc2d8180
--- /dev/null
+++ b/app/controllers/labels_controller.rb
@@ -0,0 +1,25 @@
+class LabelsController < ApplicationController
+ before_filter :authenticate_user!
+ before_filter :project
+ before_filter :module_enabled
+
+ layout "project"
+
+ # Authorize
+ before_filter :add_project_abilities
+
+ # Allow read any issue
+ before_filter :authorize_read_issue!
+
+ respond_to :js, :html
+
+ def index
+ @labels = Issue.tag_counts_on(:labels)
+ end
+
+ protected
+
+ def module_enabled
+ return render_404 unless @project.issues_enabled
+ end
+end
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb
index 84e578a3865..9b40e5640d0 100644
--- a/app/controllers/omniauth_callbacks_controller.rb
+++ b/app/controllers/omniauth_callbacks_controller.rb
@@ -12,8 +12,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def ldap
# We only find ourselves here if the authentication to LDAP was successful.
- info = request.env["omniauth.auth"]["info"]
- @user = User.find_for_ldap_auth(info)
+ @user = User.find_for_ldap_auth(request.env["omniauth.auth"], current_user)
if @user.persisted?
@user.remember_me = true
end
@@ -39,7 +38,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
current_user.save
redirect_to profile_path
else
- @user = User.find_by_provider_and_uid(provider, uid)
+ @user = User.find_by_provider_and_extern_uid(provider, uid)
if @user
sign_in_and_redirect @user
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index b596a5a6f8e..bd7f811e59f 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -1,4 +1,4 @@
-require File.join(Rails.root, 'lib', 'graph_commit')
+require Rails.root.join('lib', 'gitlab', 'graph_commit')
class ProjectsController < ApplicationController
before_filter :project, except: [:index, :new, :create]
@@ -78,7 +78,7 @@ class ProjectsController < ApplicationController
end
def graph
- @days_json, @commits_json = GraphCommit.to_graph(project)
+ @days_json, @commits_json = Gitlab::GraphCommit.to_graph(project)
end
def destroy
diff --git a/app/controllers/team_members_controller.rb b/app/controllers/team_members_controller.rb
index 0cc58c3ec16..0846f096554 100644
--- a/app/controllers/team_members_controller.rb
+++ b/app/controllers/team_members_controller.rb
@@ -9,6 +9,7 @@ class TeamMembersController < ApplicationController
def show
@team_member = project.users_projects.find(params[:id])
+ @events = @team_member.user.recent_events.where(:project_id => @project.id).limit(7)
end
def new