Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
a9d224d3
Commit
a9d224d3
authored
Oct 15, 2011
by
gitlabhq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue #124
parent
4e063dea
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+4
-0
app/controllers/commits_controller.rb
app/controllers/commits_controller.rb
+1
-0
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+3
-1
No files found.
app/controllers/application_controller.rb
View file @
a9d224d3
...
...
@@ -61,4 +61,8 @@ class ApplicationController < ActionController::Base
def
render_404
render
:file
=>
File
.
join
(
Rails
.
root
,
"public"
,
"404"
),
:layout
=>
false
,
:status
=>
"404"
end
def
require_non_empty_project
redirect_to
@project
unless
@project
.
repo_exists?
end
end
app/controllers/commits_controller.rb
View file @
a9d224d3
...
...
@@ -6,6 +6,7 @@ class CommitsController < ApplicationController
# Authorize
before_filter
:add_project_abilities
before_filter
:authorize_read_project!
before_filter
:require_non_empty_project
def
index
load_refs
# load @branch, @tag & @ref
...
...
app/controllers/projects_controller.rb
View file @
a9d224d3
...
...
@@ -6,6 +6,8 @@ class ProjectsController < ApplicationController
before_filter
:authorize_read_project!
,
:except
=>
[
:index
,
:new
,
:create
]
before_filter
:authorize_admin_project!
,
:only
=>
[
:edit
,
:update
,
:destroy
]
before_filter
:require_non_empty_project
,
:only
=>
[
:blob
,
:tree
]
def
index
@projects
=
current_user
.
projects
.
all
end
...
...
@@ -48,7 +50,7 @@ class ProjectsController < ApplicationController
def
update
respond_to
do
|
format
|
if
project
.
update_attributes
(
params
[
:project
])
format
.
html
{
redirect_to
project
,
notice:
'Project was successfully updated.'
}
format
.
html
{
redirect_to
project
,
:notice
=>
'Project was successfully updated.'
}
format
.
js
else
format
.
html
{
render
action:
"edit"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment