diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 88c4f5ccf..47c65c052 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -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 "+ " \n"+ "Require group "+params[:user][:login]+"-write \n "+ diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index b7b2cdeed..605d78b26 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -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 diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 6541ed2ca..a4924ba98 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -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 "+ + " \n"+ + "Require group "+@user.login.to_s+"-write \n "+ + " \n ' >>"+ + @root_path+"htdocs/"+@user.login.to_s+"/.htaccess" if @user.save flash[:notice] = l(:notice_account_password_updated) redirect_to my_account_path diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index d781d6fe0..413e36af1 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -96,12 +96,15 @@ class RepositoriesController < ApplicationController @repository.project = @project if request.post? && @repository.save - if(!@repository_tag &¶ms[: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 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f45a05612..5487ae38c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 diff --git a/app/models/changeset.rb b/app/models/changeset.rb index 8d98afa3d..b46f7a312 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -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) diff --git a/app/views/projects/settings/_repositories.html.erb b/app/views/projects/settings/_repositories.html.erb index 6610300b7..1d8b778e6 100644 --- a/app/views/projects/settings/_repositories.html.erb +++ b/app/views/projects/settings/_repositories.html.erb @@ -26,22 +26,24 @@ <%=h repository.url %> <% end %> - + <% 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(: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 %> diff --git a/config/routes.rb b/config/routes.rb index c7d85549b..1f82dc520 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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' diff --git a/config/settings.yml b/config/settings.yml index ca2f5416a..ee78271d7 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -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