modify
This commit is contained in:
parent
e53a9634a2
commit
36e0113f73
|
@ -18,7 +18,8 @@
|
||||||
class BoardsController < ApplicationController
|
class BoardsController < ApplicationController
|
||||||
layout 'base_projects'#by young
|
layout 'base_projects'#by young
|
||||||
default_search_scope :messages
|
default_search_scope :messages
|
||||||
before_filter :find_project_by_project_id, :find_board_if_available, :authorize
|
before_filter :find_project_by_project_id, :find_board_if_available
|
||||||
|
before_filter :authorize, :except => [:new, :show, :create]
|
||||||
accept_rss_auth :index, :show
|
accept_rss_auth :index, :show
|
||||||
|
|
||||||
helper :sort
|
helper :sort
|
||||||
|
|
|
@ -21,7 +21,7 @@ class MessagesController < ApplicationController
|
||||||
before_filter :find_board, :only => [:new, :preview]
|
before_filter :find_board, :only => [:new, :preview]
|
||||||
before_filter :find_attachments, :only => [:preview]
|
before_filter :find_attachments, :only => [:preview]
|
||||||
before_filter :find_message, :except => [:new, :preview]
|
before_filter :find_message, :except => [:new, :preview]
|
||||||
before_filter :authorize, :except => [:preview, :edit, :destroy]
|
before_filter :authorize, :except => [:preview, :edit, :destroy, :new]
|
||||||
|
|
||||||
helper :boards
|
helper :boards
|
||||||
helper :watchers
|
helper :watchers
|
||||||
|
|
|
@ -33,7 +33,7 @@ class RepositoriesController < ApplicationController
|
||||||
before_filter :find_repository, :only => [:edit, :update, :destroy, :committers]
|
before_filter :find_repository, :only => [:edit, :update, :destroy, :committers]
|
||||||
before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo]
|
before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo]
|
||||||
before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
|
before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
|
||||||
before_filter :authorize , :except => [:newrepo,:newcreate]
|
before_filter :authorize , :except => [:newrepo,:newcreate,:fork]
|
||||||
accept_rss_auth :revisions
|
accept_rss_auth :revisions
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,19 +55,24 @@ class RepositoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def fork
|
def fork
|
||||||
|
@repository_url = params[:repository_url]
|
||||||
|
|
||||||
|
# @repository.url
|
||||||
# system "htpasswd -mb "+@root_path+"user.passwd "+params[:repository][:identifier]+" "+@upasswd
|
# system "htpasswd -mb "+@root_path+"user.passwd "+params[:repository][:identifier]+" "+@upasswd
|
||||||
# system "echo -e '"+params[:project_id]+"-"+params[:repository][:identifier]+"-write:"+
|
# system "echo -e '"+params[:project_id]+"-"+params[:repository][:identifier]+"-write:"+
|
||||||
# " "+params[:repository][:identifier]+"' >> "+@root_path+"group.passwd"
|
# " "+params[:repository][:identifier]+"' >> "+@root_path+"group.passwd"
|
||||||
# system "git init --bare "+@project_path
|
system "git clone --bare "+@repository_url
|
||||||
# system "mv "+@project_path+"/hooks/post-update{.sample,}"
|
# system "mv "+@project_path+"/hooks/post-update{.sample,}"
|
||||||
# system "chmod a+x"+@project_path+"/hooks/post-update"
|
# system "chmod a+x "+@project_path+"/hooks/post-update"
|
||||||
# system "."+@project_path+"/hooks/post-update"
|
# system "."+@project_path+"/hooks/post-update"
|
||||||
# system "echo -e 'Allow from all \n Order Deny,Allow \n "+
|
# system "echo -e 'Allow from all \n Order Deny,Allow \n "+
|
||||||
# "<Limit PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> \n"+
|
# "<Limit PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> \n"+
|
||||||
# "Require group "+params[:project_id]+"-"+params[:repository][:identifier]+"-write \n "+
|
# "Require group "+params[:project_id]+"-"+params[:repository][:identifier]+"-write \n "+
|
||||||
# "</Limit> \n ' >>"+
|
# "</Limit> \n ' >>"+
|
||||||
# @project_path+"/.htaccess"
|
# @project_path+"/.htaccess"
|
||||||
render :action => "show"
|
flash[:notice] = l(:label_notice_fork_successed)
|
||||||
|
@repositories = @project.repositories
|
||||||
|
render :action => 'show', :layout => 'base_projects'
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
@ -76,8 +81,9 @@ class RepositoriesController < ApplicationController
|
||||||
@repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git"
|
@repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git"
|
||||||
@project_path=@root_path+"htdocs/"+@repository_name
|
@project_path=@root_path+"htdocs/"+@repository_name
|
||||||
@repository_tag=params[:repository][:upassword]
|
@repository_tag=params[:repository][:upassword]
|
||||||
@repo_name=User.current.login.to_s+"-"+params[:repository][:identifier]
|
@repo_name=User.current.login.to_s+"_"+params[:repository][:identifier]
|
||||||
@middle=User.current.login.to_s+"-"+params[:repository][:identifier]+"-write:"
|
logger.info "htpasswd -mb "+@root_path+"user.passwd "+@repo_name+": "+@repository_tag
|
||||||
|
logger.info "the value of create repository"+@root_path+": "+@repository_name+": "+@project_path+": "+@repo_name
|
||||||
attrs = pickup_extra_info
|
attrs = pickup_extra_info
|
||||||
if((@repository_tag!="")&¶ms[:repository_scm]=="Git")
|
if((@repository_tag!="")&¶ms[:repository_scm]=="Git")
|
||||||
params[:repository][:url]=@project_path
|
params[:repository][:url]=@project_path
|
||||||
|
@ -93,9 +99,8 @@ class RepositoriesController < ApplicationController
|
||||||
@repository.project = @project
|
@repository.project = @project
|
||||||
if request.post? && @repository.save
|
if request.post? && @repository.save
|
||||||
if(params[:repository_scm]=="Git")
|
if(params[:repository_scm]=="Git")
|
||||||
system "htpasswd -mb "+@root_path+" "+@repo_name+" "+@repository_tag
|
system "htpasswd -mb "+@root_path+"user.passwd "+@repo_name+" "+@repository_tag
|
||||||
logger.info "htpasswd -mb "+@root_path+" "+@repo_name+" "+@repository_tag+create_passwd
|
system "echo -e '"+@repo_name+"-write:"+
|
||||||
system "echo -e '\n"+@repo_name+"-write:"+
|
|
||||||
" "+@repo_name+"' >> "+@root_path+"group.passwd"
|
" "+@repo_name+"' >> "+@root_path+"group.passwd"
|
||||||
system "mkdir "+@root_path+"htdocs/"+User.current.login.to_s
|
system "mkdir "+@root_path+"htdocs/"+User.current.login.to_s
|
||||||
system "git init --bare "+@project_path
|
system "git init --bare "+@project_path
|
||||||
|
@ -172,10 +177,14 @@ class RepositoriesController < ApplicationController
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@root_path="/home/pdl/redmine-2.3.2-0/apache2/"
|
@root_path="/home/pdl/redmine-2.3.2-0/apache2/"
|
||||||
|
@repo_name=User.current.login.to_s+"_"+@repository.identifier.to_s
|
||||||
@repository_name=User.current.login.to_s+"/"+@repository.identifier.to_s+".git"
|
@repository_name=User.current.login.to_s+"/"+@repository.identifier.to_s+".git"
|
||||||
|
@middle=User.current.login.to_s+"_"+@repository.identifier.to_s+"-write:"
|
||||||
@repository.destroy if request.delete?
|
@repository.destroy if request.delete?
|
||||||
redirect_to settings_project_path(@project, :tab => 'repositories')
|
redirect_to settings_project_path(@project, :tab => 'repositories')
|
||||||
if(@repository.type=="Repository::Git")
|
if(@repository.type=="Repository::Git")
|
||||||
|
logger.info "destory the repository value"+"root path"+@root_path+"repo_name"+@repo_name+
|
||||||
|
"repository_name"+@repository_name+"user group"+@middle
|
||||||
system "sed -i /"+@repo_name+"/{d} "+@root_path+"user.passwd"
|
system "sed -i /"+@repo_name+"/{d} "+@root_path+"user.passwd"
|
||||||
system "sed -i /"+@middle+"/{d} "+@root_path+"group.passwd"
|
system "sed -i /"+@middle+"/{d} "+@root_path+"group.passwd"
|
||||||
system "rm -r "+@root_path+"htdocs/"+@repository_name
|
system "rm -r "+@root_path+"htdocs/"+@repository_name
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
<!--add by huang-->
|
<!--add by huang-->
|
||||||
<div style="padding-bottom: 10px">
|
<h3 style="padding-top:0px;"><%= l(:field_issue) %>
|
||||||
|
<div style="padding-bottom: 10px;float:right;font-size:11px;">
|
||||||
<%= link_to l(:label_issue_new), { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new,
|
<%= link_to l(:label_issue_new), { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new,
|
||||||
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %>
|
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %>
|
||||||
</div>
|
</div>
|
||||||
|
</h3>
|
||||||
<div class="contextual">
|
<div class="contextual">
|
||||||
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
||||||
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
|
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
|
||||||
|
@ -19,7 +20,7 @@
|
||||||
<div id="query_form_content" class="hide-when-print">
|
<div id="query_form_content" class="hide-when-print">
|
||||||
<fieldset id="filters" style="width:650px;" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
|
<fieldset id="filters" style="width:650px;" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
|
||||||
<legend onclick="toggleFieldset(this);">
|
<legend onclick="toggleFieldset(this);">
|
||||||
<%= l(:label_issue_query_condition) %>
|
<%= l(:label_filter_plural) %>
|
||||||
</legend>
|
</legend>
|
||||||
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
|
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
|
||||||
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
||||||
|
@ -53,13 +54,8 @@
|
||||||
</div>
|
</div>
|
||||||
<p class="buttons hide-when-print">
|
<p class="buttons hide-when-print">
|
||||||
|
|
||||||
<%= link_to_function l(:label_issue_query), 'submit_query_form("query_form")', :class => 'icon icon-checked' %>
|
<%= link_to_function l(:button_apply), 'submit_query_form("query_form")', :class => 'icon icon-checked' %>
|
||||||
<%= link_to l(:label_issue_cancel_query), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload' %>
|
<%= link_to l(:button_clear), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload' %>
|
||||||
<% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %>
|
|
||||||
<%= link_to_function l(:button_save),
|
|
||||||
"$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }'); submit_query_form('query_form')",
|
|
||||||
:class => 'icon icon-save' %>
|
|
||||||
<% end %>
|
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue