修复版本库

This commit is contained in:
Administrator 2013-08-15 10:29:15 +08:00
parent 8b9793cace
commit f08ab23492
9 changed files with 43 additions and 28 deletions

View File

@ -127,8 +127,9 @@ class AccountController < ApplicationController
@user.password, @user.password_confirmation = user_params[:password], user_params[:password_confirmation]
system "htpasswd -mb "+@root_path+"user.passwd "+params[:user][:login]+" "+user_params[:password]
system "echo -e '\n"+params[:user][:login]+"-write:"+
" "+user_params[:password]+"' >> "+@root_path+"group.passwd"
system "mkdir"+@root_path+"htdocs/"+params[:user][:login]
" "+params[:user][:login]+"' >> "+@root_path+"group.passwd"
system "mkdir "+@root_path+"htdocs/"+params[:user][:login]
system "echo -e 'Allow from all \n Order Deny,Allow \n "+
"<Limit PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> \n"+
"Require group "+params[:user][:login]+"-write \n "+

View File

@ -64,13 +64,13 @@ class IssuesController < ApplicationController
if @query.valid?
case params[:format]
when 'csv', 'pdf'
@limit = Setting.issues_export_limit.to_i
@limit = 10#Setting.issues_export_limit.to_i
when 'atom'
@limit = Setting.feeds_limit.to_i
@limit = 10#Setting.feeds_limit.to_i
when 'xml', 'json'
@offset, @limit = api_offset_and_limit
@offset, @limit = api_offset_and_limit({:limit => 10})
else
@limit = per_page_option
@limit = 10#per_page_option
end
@issue_count = @query.issue_count

View File

@ -112,6 +112,14 @@ class MyController < ApplicationController
if request.post?
if @user.check_password?(params[:password])
@user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation]
system "echo -e '\n"+@user.login.to_s+"-write:"+
" "+@user.login.to_s+"' >> "+@root_path+"group.passwd"
system "mkdir "+@root_path+"htdocs/"+@user.login.to_s
system "echo -e 'Allow from all \n Order Deny,Allow \n "+
"<Limit PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> \n"+
"Require group "+@user.login.to_s+"-write \n "+
"</Limit> \n ' >>"+
@root_path+"htdocs/"+@user.login.to_s+"/.htaccess"
if @user.save
flash[:notice] = l(:notice_account_password_updated)
redirect_to my_account_path

View File

@ -96,12 +96,15 @@ class RepositoriesController < ApplicationController
@repository.project = @project
if request.post? && @repository.save
if(!@repository_tag &&params[:repository_scm]=="Git")
if(params[:repository_scm]=="Git")
system "git init --bare "+@project_path
system "mv "+@project_path+"/hooks/post-update{.sample,}"
system "chmod a+x"+@project_path+"/hooks/post-update"
system "cd "+@project_path+"/"
system "git update-server-info"
system "chmod a+x "+@project_path+"/hooks/post-update"
puts "before ======================================================================"
puts system "cd "+@project_path+" ;git update-server-info"
flag = system "cd "+@project_path+" ;git update-server-info"
puts "after flag:#{flag} ======================================================================"
@repository.update_attributes(:login => User.current.login.to_s)
end
redirect_to settings_project_path(@project, :tab => 'repositories')
@ -165,7 +168,10 @@ class RepositoriesController < ApplicationController
@repository.destroy if request.delete?
redirect_to settings_project_path(@project, :tab => 'repositories')
if(@repository.type=="Repository::Git")
system "rm -r "+@repository_name
puts "before destroy system cmd ======================================="
puts "rm -r "+@root_path+@repository_name
flag = system "rm -r "+@root_path+"htdocs/"+@repository_name
puts "after destroy system cmd :#{flag} ======================================="
end
end

View File

@ -141,9 +141,9 @@ class UsersController < ApplicationController
case params[:format]
when 'xml', 'json'
@offset, @limit = api_offset_and_limit
@offset, @limit = api_offset_and_limit({:limit => 15})
else
@limit = per_page_option
@limit = 15#per_page_option
end
@status = params[:status] || 1

View File

@ -59,7 +59,7 @@ class Changeset < ActiveRecord::Base
before_create :before_create_cs
# fq
after_create :act_as_activity
# after_create :act_as_activity
# end
def revision=(r)

View File

@ -26,22 +26,24 @@
<td><%=h repository.url %></td>
<% end %>
<td class="buttons">
<td class="buttons" style="text-align:left">
<% if repository.scm_name=="Subversion"%>
<%if User.current.allowed_to?(:manage_repository, @project) %>
<%= link_to(l(:button_edit), edit_repository_path(repository),
:class => 'icon icon-edit') %>
<%= link_to(l(:label_user_plural), committers_repository_path(repository),
:class => 'icon icon-user') %>
<%= delete_link repository_path(repository) %>
<%= link_to(l(:label_user_plural), committers_repository_path(repository),
:class => 'icon icon-user') %>
<%= link_to(l(:button_edit), edit_repository_path(repository),
:class => 'icon icon-edit') %>
<%= delete_link repository_path(repository) %>
<% end %>
<% elsif repository.scm_name=="Git"%>
<%if User.current.allowed_to?(:manage_repository, @project) %>
<!-- <%= link_to(l(:button_edit), edit_repository_path(repository),
:class => 'icon icon-edit') %> -->
<%= link_to(l(:label_user_plural), committers_repository_path(repository),
<%= link_to(l(:label_user_plural), committers_repository_path(repository),
:class => 'icon icon-user') %>
<%= delete_link repository_path(repository) %>
<% if repository.login.to_s==User.current.login.to_s %>
<%= delete_link repository_path(repository) %>
<% end %>
<% end %>
<% end %>
</td>

View File

@ -431,7 +431,7 @@ RedmineApp::Application.routes.draw do
match 'bids/:id/show_project', :controller => 'bids', :action => 'show_project', :as => 'project_for_bid'
match 'bids/:id/add', :controller => 'bids', :action => 'add'
## 测试用
match 'test/index', :controller => 'test', :action => 'index'
# match 'test/index', :controller => 'test', :action => 'index'
# added by young
match 'bids', :controller => 'bids', :action => 'index'

View File

@ -20,7 +20,7 @@
# Settings can be defined through the application in Admin -> Settings
app_title:
default: Redmine
default: Trustie2
app_subtitle:
default: Project management
welcome_text:
@ -56,7 +56,7 @@ activity_days_default:
per_page_options:
default: '25,50,100'
mail_from:
default: redmine@example.net
default: trustie2@163.com
bcc_recipients:
default: 1
plain_text_mail:
@ -68,7 +68,7 @@ cache_formatted_text:
wiki_compression:
default: ""
default_language:
default: en
default: zh
host_name:
default: localhost:3000
protocol:
@ -230,8 +230,6 @@ non_working_week_days:
default:
- '6'
- '7'
#### added by liuping
show_tags_length:
format: int