@@ -1,282 +1,282 | |||||
1 | # Redmine - project management software |
|
1 | # Redmine - project management software | |
2 | # Copyright (C) 2006-2012 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006-2012 Jean-Philippe Lang | |
3 | # |
|
3 | # | |
4 | # This program is free software; you can redistribute it and/or |
|
4 | # This program is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU General Public License |
|
5 | # modify it under the terms of the GNU General Public License | |
6 | # as published by the Free Software Foundation; either version 2 |
|
6 | # as published by the Free Software Foundation; either version 2 | |
7 | # of the License, or (at your option) any later version. |
|
7 | # of the License, or (at your option) any later version. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | class AccountController < ApplicationController |
|
18 | class AccountController < ApplicationController | |
19 | helper :custom_fields |
|
19 | helper :custom_fields | |
20 | include CustomFieldsHelper |
|
20 | include CustomFieldsHelper | |
21 |
|
21 | |||
22 | # prevents login action to be filtered by check_if_login_required application scope filter |
|
22 | # prevents login action to be filtered by check_if_login_required application scope filter | |
23 | skip_before_filter :check_if_login_required |
|
23 | skip_before_filter :check_if_login_required | |
24 |
|
24 | |||
25 | # Login request and validation |
|
25 | # Login request and validation | |
26 | def login |
|
26 | def login | |
27 | if request.get? |
|
27 | if request.get? | |
28 | logout_user |
|
28 | logout_user | |
29 | else |
|
29 | else | |
30 | authenticate_user |
|
30 | authenticate_user | |
31 | end |
|
31 | end | |
32 | rescue AuthSourceException => e |
|
32 | rescue AuthSourceException => e | |
33 | logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" |
|
33 | logger.error "An error occured when authenticating #{params[:username]}: #{e.message}" | |
34 | render_error :message => e.message |
|
34 | render_error :message => e.message | |
35 | end |
|
35 | end | |
36 |
|
36 | |||
37 | # Log out current user and redirect to welcome page |
|
37 | # Log out current user and redirect to welcome page | |
38 | def logout |
|
38 | def logout | |
39 | logout_user |
|
39 | logout_user | |
40 | redirect_to home_url |
|
40 | redirect_to home_url | |
41 | end |
|
41 | end | |
42 |
|
42 | |||
43 | # Enable user to choose a new password |
|
43 | # Enable user to choose a new password | |
44 | def lost_password |
|
44 | def lost_password | |
45 | redirect_to(home_url) && return unless Setting.lost_password? |
|
45 | redirect_to(home_url) && return unless Setting.lost_password? | |
46 | if params[:token] |
|
46 | if params[:token] | |
47 | @token = Token.find_by_action_and_value("recovery", params[:token]) |
|
47 | @token = Token.find_by_action_and_value("recovery", params[:token]) | |
48 | redirect_to(home_url) && return unless @token and !@token.expired? |
|
48 | redirect_to(home_url) && return unless @token and !@token.expired? | |
49 | @user = @token.user |
|
49 | @user = @token.user | |
50 | if request.post? |
|
50 | if request.post? | |
51 | @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] |
|
51 | @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] | |
52 | if @user.save |
|
52 | if @user.save | |
53 | @token.destroy |
|
53 | @token.destroy | |
54 | flash[:notice] = l(:notice_account_password_updated) |
|
54 | flash[:notice] = l(:notice_account_password_updated) | |
55 | redirect_to :action => 'login' |
|
55 | redirect_to :action => 'login' | |
56 | return |
|
56 | return | |
57 | end |
|
57 | end | |
58 | end |
|
58 | end | |
59 | render :template => "account/password_recovery" |
|
59 | render :template => "account/password_recovery" | |
60 | return |
|
60 | return | |
61 | else |
|
61 | else | |
62 | if request.post? |
|
62 | if request.post? | |
63 | user = User.find_by_mail(params[:mail]) |
|
63 | user = User.find_by_mail(params[:mail]) | |
64 | # user not found in db |
|
64 | # user not found in db | |
65 | (flash.now[:error] = l(:notice_account_unknown_email); return) unless user |
|
65 | (flash.now[:error] = l(:notice_account_unknown_email); return) unless user | |
66 | # user uses an external authentification |
|
66 | # user uses an external authentification | |
67 | (flash.now[:error] = l(:notice_can_t_change_password); return) if user.auth_source_id |
|
67 | (flash.now[:error] = l(:notice_can_t_change_password); return) if user.auth_source_id | |
68 | # create a new token for password recovery |
|
68 | # create a new token for password recovery | |
69 | token = Token.new(:user => user, :action => "recovery") |
|
69 | token = Token.new(:user => user, :action => "recovery") | |
70 | if token.save |
|
70 | if token.save | |
71 | Mailer.lost_password(token).deliver |
|
71 | Mailer.lost_password(token).deliver | |
72 | flash[:notice] = l(:notice_account_lost_email_sent) |
|
72 | flash[:notice] = l(:notice_account_lost_email_sent) | |
73 |
redirect_to |
|
73 | redirect_to signin_path | |
74 | return |
|
74 | return | |
75 | end |
|
75 | end | |
76 | end |
|
76 | end | |
77 | end |
|
77 | end | |
78 | end |
|
78 | end | |
79 |
|
79 | |||
80 | # User self-registration |
|
80 | # User self-registration | |
81 | def register |
|
81 | def register | |
82 | redirect_to(home_url) && return unless Setting.self_registration? || session[:auth_source_registration] |
|
82 | redirect_to(home_url) && return unless Setting.self_registration? || session[:auth_source_registration] | |
83 | if request.get? |
|
83 | if request.get? | |
84 | session[:auth_source_registration] = nil |
|
84 | session[:auth_source_registration] = nil | |
85 | @user = User.new(:language => Setting.default_language) |
|
85 | @user = User.new(:language => Setting.default_language) | |
86 | else |
|
86 | else | |
87 | user_params = params[:user] || {} |
|
87 | user_params = params[:user] || {} | |
88 | @user = User.new |
|
88 | @user = User.new | |
89 | @user.safe_attributes = user_params |
|
89 | @user.safe_attributes = user_params | |
90 | @user.admin = false |
|
90 | @user.admin = false | |
91 | @user.register |
|
91 | @user.register | |
92 | if session[:auth_source_registration] |
|
92 | if session[:auth_source_registration] | |
93 | @user.activate |
|
93 | @user.activate | |
94 | @user.login = session[:auth_source_registration][:login] |
|
94 | @user.login = session[:auth_source_registration][:login] | |
95 | @user.auth_source_id = session[:auth_source_registration][:auth_source_id] |
|
95 | @user.auth_source_id = session[:auth_source_registration][:auth_source_id] | |
96 | if @user.save |
|
96 | if @user.save | |
97 | session[:auth_source_registration] = nil |
|
97 | session[:auth_source_registration] = nil | |
98 | self.logged_user = @user |
|
98 | self.logged_user = @user | |
99 | flash[:notice] = l(:notice_account_activated) |
|
99 | flash[:notice] = l(:notice_account_activated) | |
100 | redirect_to :controller => 'my', :action => 'account' |
|
100 | redirect_to :controller => 'my', :action => 'account' | |
101 | end |
|
101 | end | |
102 | else |
|
102 | else | |
103 | @user.login = params[:user][:login] |
|
103 | @user.login = params[:user][:login] | |
104 | unless user_params[:identity_url].present? && user_params[:password].blank? && user_params[:password_confirmation].blank? |
|
104 | unless user_params[:identity_url].present? && user_params[:password].blank? && user_params[:password_confirmation].blank? | |
105 | @user.password, @user.password_confirmation = user_params[:password], user_params[:password_confirmation] |
|
105 | @user.password, @user.password_confirmation = user_params[:password], user_params[:password_confirmation] | |
106 | end |
|
106 | end | |
107 |
|
107 | |||
108 | case Setting.self_registration |
|
108 | case Setting.self_registration | |
109 | when '1' |
|
109 | when '1' | |
110 | register_by_email_activation(@user) |
|
110 | register_by_email_activation(@user) | |
111 | when '3' |
|
111 | when '3' | |
112 | register_automatically(@user) |
|
112 | register_automatically(@user) | |
113 | else |
|
113 | else | |
114 | register_manually_by_administrator(@user) |
|
114 | register_manually_by_administrator(@user) | |
115 | end |
|
115 | end | |
116 | end |
|
116 | end | |
117 | end |
|
117 | end | |
118 | end |
|
118 | end | |
119 |
|
119 | |||
120 | # Token based account activation |
|
120 | # Token based account activation | |
121 | def activate |
|
121 | def activate | |
122 | redirect_to(home_url) && return unless Setting.self_registration? && params[:token] |
|
122 | redirect_to(home_url) && return unless Setting.self_registration? && params[:token] | |
123 | token = Token.find_by_action_and_value('register', params[:token]) |
|
123 | token = Token.find_by_action_and_value('register', params[:token]) | |
124 | redirect_to(home_url) && return unless token and !token.expired? |
|
124 | redirect_to(home_url) && return unless token and !token.expired? | |
125 | user = token.user |
|
125 | user = token.user | |
126 | redirect_to(home_url) && return unless user.registered? |
|
126 | redirect_to(home_url) && return unless user.registered? | |
127 | user.activate |
|
127 | user.activate | |
128 | if user.save |
|
128 | if user.save | |
129 | token.destroy |
|
129 | token.destroy | |
130 | flash[:notice] = l(:notice_account_activated) |
|
130 | flash[:notice] = l(:notice_account_activated) | |
131 | end |
|
131 | end | |
132 |
redirect_to |
|
132 | redirect_to signin_path | |
133 | end |
|
133 | end | |
134 |
|
134 | |||
135 | private |
|
135 | private | |
136 |
|
136 | |||
137 | def authenticate_user |
|
137 | def authenticate_user | |
138 | if Setting.openid? && using_open_id? |
|
138 | if Setting.openid? && using_open_id? | |
139 | open_id_authenticate(params[:openid_url]) |
|
139 | open_id_authenticate(params[:openid_url]) | |
140 | else |
|
140 | else | |
141 | password_authentication |
|
141 | password_authentication | |
142 | end |
|
142 | end | |
143 | end |
|
143 | end | |
144 |
|
144 | |||
145 | def password_authentication |
|
145 | def password_authentication | |
146 | user = User.try_to_login(params[:username], params[:password]) |
|
146 | user = User.try_to_login(params[:username], params[:password]) | |
147 |
|
147 | |||
148 | if user.nil? |
|
148 | if user.nil? | |
149 | invalid_credentials |
|
149 | invalid_credentials | |
150 | elsif user.new_record? |
|
150 | elsif user.new_record? | |
151 | onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id }) |
|
151 | onthefly_creation_failed(user, {:login => user.login, :auth_source_id => user.auth_source_id }) | |
152 | else |
|
152 | else | |
153 | # Valid user |
|
153 | # Valid user | |
154 | successful_authentication(user) |
|
154 | successful_authentication(user) | |
155 | end |
|
155 | end | |
156 | end |
|
156 | end | |
157 |
|
157 | |||
158 | def open_id_authenticate(openid_url) |
|
158 | def open_id_authenticate(openid_url) | |
159 | authenticate_with_open_id(openid_url, :required => [:nickname, :fullname, :email], :return_to => signin_url, :method => :post) do |result, identity_url, registration| |
|
159 | authenticate_with_open_id(openid_url, :required => [:nickname, :fullname, :email], :return_to => signin_url, :method => :post) do |result, identity_url, registration| | |
160 | if result.successful? |
|
160 | if result.successful? | |
161 | user = User.find_or_initialize_by_identity_url(identity_url) |
|
161 | user = User.find_or_initialize_by_identity_url(identity_url) | |
162 | if user.new_record? |
|
162 | if user.new_record? | |
163 | # Self-registration off |
|
163 | # Self-registration off | |
164 | redirect_to(home_url) && return unless Setting.self_registration? |
|
164 | redirect_to(home_url) && return unless Setting.self_registration? | |
165 |
|
165 | |||
166 | # Create on the fly |
|
166 | # Create on the fly | |
167 | user.login = registration['nickname'] unless registration['nickname'].nil? |
|
167 | user.login = registration['nickname'] unless registration['nickname'].nil? | |
168 | user.mail = registration['email'] unless registration['email'].nil? |
|
168 | user.mail = registration['email'] unless registration['email'].nil? | |
169 | user.firstname, user.lastname = registration['fullname'].split(' ') unless registration['fullname'].nil? |
|
169 | user.firstname, user.lastname = registration['fullname'].split(' ') unless registration['fullname'].nil? | |
170 | user.random_password |
|
170 | user.random_password | |
171 | user.register |
|
171 | user.register | |
172 |
|
172 | |||
173 | case Setting.self_registration |
|
173 | case Setting.self_registration | |
174 | when '1' |
|
174 | when '1' | |
175 | register_by_email_activation(user) do |
|
175 | register_by_email_activation(user) do | |
176 | onthefly_creation_failed(user) |
|
176 | onthefly_creation_failed(user) | |
177 | end |
|
177 | end | |
178 | when '3' |
|
178 | when '3' | |
179 | register_automatically(user) do |
|
179 | register_automatically(user) do | |
180 | onthefly_creation_failed(user) |
|
180 | onthefly_creation_failed(user) | |
181 | end |
|
181 | end | |
182 | else |
|
182 | else | |
183 | register_manually_by_administrator(user) do |
|
183 | register_manually_by_administrator(user) do | |
184 | onthefly_creation_failed(user) |
|
184 | onthefly_creation_failed(user) | |
185 | end |
|
185 | end | |
186 | end |
|
186 | end | |
187 | else |
|
187 | else | |
188 | # Existing record |
|
188 | # Existing record | |
189 | if user.active? |
|
189 | if user.active? | |
190 | successful_authentication(user) |
|
190 | successful_authentication(user) | |
191 | else |
|
191 | else | |
192 | account_pending |
|
192 | account_pending | |
193 | end |
|
193 | end | |
194 | end |
|
194 | end | |
195 | end |
|
195 | end | |
196 | end |
|
196 | end | |
197 | end |
|
197 | end | |
198 |
|
198 | |||
199 | def successful_authentication(user) |
|
199 | def successful_authentication(user) | |
200 | # Valid user |
|
200 | # Valid user | |
201 | self.logged_user = user |
|
201 | self.logged_user = user | |
202 | # generate a key and set cookie if autologin |
|
202 | # generate a key and set cookie if autologin | |
203 | if params[:autologin] && Setting.autologin? |
|
203 | if params[:autologin] && Setting.autologin? | |
204 | set_autologin_cookie(user) |
|
204 | set_autologin_cookie(user) | |
205 | end |
|
205 | end | |
206 | call_hook(:controller_account_success_authentication_after, {:user => user }) |
|
206 | call_hook(:controller_account_success_authentication_after, {:user => user }) | |
207 | redirect_back_or_default :controller => 'my', :action => 'page' |
|
207 | redirect_back_or_default :controller => 'my', :action => 'page' | |
208 | end |
|
208 | end | |
209 |
|
209 | |||
210 | def set_autologin_cookie(user) |
|
210 | def set_autologin_cookie(user) | |
211 | token = Token.create(:user => user, :action => 'autologin') |
|
211 | token = Token.create(:user => user, :action => 'autologin') | |
212 | cookie_name = Redmine::Configuration['autologin_cookie_name'] || 'autologin' |
|
212 | cookie_name = Redmine::Configuration['autologin_cookie_name'] || 'autologin' | |
213 | cookie_options = { |
|
213 | cookie_options = { | |
214 | :value => token.value, |
|
214 | :value => token.value, | |
215 | :expires => 1.year.from_now, |
|
215 | :expires => 1.year.from_now, | |
216 | :path => (Redmine::Configuration['autologin_cookie_path'] || '/'), |
|
216 | :path => (Redmine::Configuration['autologin_cookie_path'] || '/'), | |
217 | :secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false), |
|
217 | :secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false), | |
218 | :httponly => true |
|
218 | :httponly => true | |
219 | } |
|
219 | } | |
220 | cookies[cookie_name] = cookie_options |
|
220 | cookies[cookie_name] = cookie_options | |
221 | end |
|
221 | end | |
222 |
|
222 | |||
223 | # Onthefly creation failed, display the registration form to fill/fix attributes |
|
223 | # Onthefly creation failed, display the registration form to fill/fix attributes | |
224 | def onthefly_creation_failed(user, auth_source_options = { }) |
|
224 | def onthefly_creation_failed(user, auth_source_options = { }) | |
225 | @user = user |
|
225 | @user = user | |
226 | session[:auth_source_registration] = auth_source_options unless auth_source_options.empty? |
|
226 | session[:auth_source_registration] = auth_source_options unless auth_source_options.empty? | |
227 |
render |
|
227 | render register_path | |
228 | end |
|
228 | end | |
229 |
|
229 | |||
230 | def invalid_credentials |
|
230 | def invalid_credentials | |
231 | logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}" |
|
231 | logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}" | |
232 | flash.now[:error] = l(:notice_account_invalid_creditentials) |
|
232 | flash.now[:error] = l(:notice_account_invalid_creditentials) | |
233 | end |
|
233 | end | |
234 |
|
234 | |||
235 | # Register a user for email activation. |
|
235 | # Register a user for email activation. | |
236 | # |
|
236 | # | |
237 | # Pass a block for behavior when a user fails to save |
|
237 | # Pass a block for behavior when a user fails to save | |
238 | def register_by_email_activation(user, &block) |
|
238 | def register_by_email_activation(user, &block) | |
239 | token = Token.new(:user => user, :action => "register") |
|
239 | token = Token.new(:user => user, :action => "register") | |
240 | if user.save and token.save |
|
240 | if user.save and token.save | |
241 | Mailer.register(token).deliver |
|
241 | Mailer.register(token).deliver | |
242 | flash[:notice] = l(:notice_account_register_done) |
|
242 | flash[:notice] = l(:notice_account_register_done) | |
243 |
redirect_to |
|
243 | redirect_to signin_path | |
244 | else |
|
244 | else | |
245 | yield if block_given? |
|
245 | yield if block_given? | |
246 | end |
|
246 | end | |
247 | end |
|
247 | end | |
248 |
|
248 | |||
249 | # Automatically register a user |
|
249 | # Automatically register a user | |
250 | # |
|
250 | # | |
251 | # Pass a block for behavior when a user fails to save |
|
251 | # Pass a block for behavior when a user fails to save | |
252 | def register_automatically(user, &block) |
|
252 | def register_automatically(user, &block) | |
253 | # Automatic activation |
|
253 | # Automatic activation | |
254 | user.activate |
|
254 | user.activate | |
255 | user.last_login_on = Time.now |
|
255 | user.last_login_on = Time.now | |
256 | if user.save |
|
256 | if user.save | |
257 | self.logged_user = user |
|
257 | self.logged_user = user | |
258 | flash[:notice] = l(:notice_account_activated) |
|
258 | flash[:notice] = l(:notice_account_activated) | |
259 | redirect_to :controller => 'my', :action => 'account' |
|
259 | redirect_to :controller => 'my', :action => 'account' | |
260 | else |
|
260 | else | |
261 | yield if block_given? |
|
261 | yield if block_given? | |
262 | end |
|
262 | end | |
263 | end |
|
263 | end | |
264 |
|
264 | |||
265 | # Manual activation by the administrator |
|
265 | # Manual activation by the administrator | |
266 | # |
|
266 | # | |
267 | # Pass a block for behavior when a user fails to save |
|
267 | # Pass a block for behavior when a user fails to save | |
268 | def register_manually_by_administrator(user, &block) |
|
268 | def register_manually_by_administrator(user, &block) | |
269 | if user.save |
|
269 | if user.save | |
270 | # Sends an email to the administrators |
|
270 | # Sends an email to the administrators | |
271 | Mailer.account_activation_request(user).deliver |
|
271 | Mailer.account_activation_request(user).deliver | |
272 | account_pending |
|
272 | account_pending | |
273 | else |
|
273 | else | |
274 | yield if block_given? |
|
274 | yield if block_given? | |
275 | end |
|
275 | end | |
276 | end |
|
276 | end | |
277 |
|
277 | |||
278 | def account_pending |
|
278 | def account_pending | |
279 | flash[:notice] = l(:notice_account_pending) |
|
279 | flash[:notice] = l(:notice_account_pending) | |
280 |
redirect_to |
|
280 | redirect_to signin_path | |
281 | end |
|
281 | end | |
282 | end |
|
282 | end |
@@ -1,42 +1,42 | |||||
1 | <%= call_hook :view_account_login_top %> |
|
1 | <%= call_hook :view_account_login_top %> | |
2 | <div id="login-form"> |
|
2 | <div id="login-form"> | |
3 |
<%= form_tag( |
|
3 | <%= form_tag(signin_path) do %> | |
4 | <%= back_url_hidden_field_tag %> |
|
4 | <%= back_url_hidden_field_tag %> | |
5 | <table> |
|
5 | <table> | |
6 | <tr> |
|
6 | <tr> | |
7 | <td align="right"><label for="username"><%=l(:field_login)%>:</label></td> |
|
7 | <td align="right"><label for="username"><%=l(:field_login)%>:</label></td> | |
8 | <td align="left"><%= text_field_tag 'username', nil, :tabindex => '1' %></td> |
|
8 | <td align="left"><%= text_field_tag 'username', nil, :tabindex => '1' %></td> | |
9 | </tr> |
|
9 | </tr> | |
10 | <tr> |
|
10 | <tr> | |
11 | <td align="right"><label for="password"><%=l(:field_password)%>:</label></td> |
|
11 | <td align="right"><label for="password"><%=l(:field_password)%>:</label></td> | |
12 | <td align="left"><%= password_field_tag 'password', nil, :tabindex => '2' %></td> |
|
12 | <td align="left"><%= password_field_tag 'password', nil, :tabindex => '2' %></td> | |
13 | </tr> |
|
13 | </tr> | |
14 | <% if Setting.openid? %> |
|
14 | <% if Setting.openid? %> | |
15 | <tr> |
|
15 | <tr> | |
16 | <td align="right"><label for="openid_url"><%=l(:field_identity_url)%></label></td> |
|
16 | <td align="right"><label for="openid_url"><%=l(:field_identity_url)%></label></td> | |
17 | <td align="left"><%= text_field_tag "openid_url", nil, :tabindex => '3' %></td> |
|
17 | <td align="left"><%= text_field_tag "openid_url", nil, :tabindex => '3' %></td> | |
18 | </tr> |
|
18 | </tr> | |
19 | <% end %> |
|
19 | <% end %> | |
20 | <tr> |
|
20 | <tr> | |
21 | <td></td> |
|
21 | <td></td> | |
22 | <td align="left"> |
|
22 | <td align="left"> | |
23 | <% if Setting.autologin? %> |
|
23 | <% if Setting.autologin? %> | |
24 | <label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label> |
|
24 | <label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label> | |
25 | <% end %> |
|
25 | <% end %> | |
26 | </td> |
|
26 | </td> | |
27 | </tr> |
|
27 | </tr> | |
28 | <tr> |
|
28 | <tr> | |
29 | <td align="left"> |
|
29 | <td align="left"> | |
30 | <% if Setting.lost_password? %> |
|
30 | <% if Setting.lost_password? %> | |
31 |
<%= link_to l(:label_password_lost), |
|
31 | <%= link_to l(:label_password_lost), lost_password_path %> | |
32 | <% end %> |
|
32 | <% end %> | |
33 | </td> |
|
33 | </td> | |
34 | <td align="right"> |
|
34 | <td align="right"> | |
35 | <input type="submit" name="login" value="<%=l(:button_login)%> »" tabindex="5"/> |
|
35 | <input type="submit" name="login" value="<%=l(:button_login)%> »" tabindex="5"/> | |
36 | </td> |
|
36 | </td> | |
37 | </tr> |
|
37 | </tr> | |
38 | </table> |
|
38 | </table> | |
39 | <%= javascript_tag "Form.Element.focus('username');" %> |
|
39 | <%= javascript_tag "Form.Element.focus('username');" %> | |
40 | <% end %> |
|
40 | <% end %> | |
41 | </div> |
|
41 | </div> | |
42 | <%= call_hook :view_account_login_bottom %> |
|
42 | <%= call_hook :view_account_login_bottom %> |
@@ -1,11 +1,11 | |||||
1 | <h2><%=l(:label_password_lost)%></h2> |
|
1 | <h2><%=l(:label_password_lost)%></h2> | |
2 |
|
2 | |||
3 | <div class="box"> |
|
3 | <%= form_tag(lost_password_path) do %> | |
4 | <%= form_tag({:action=> "lost_password"}, :class => "tabular") do %> |
|
4 | <div class="box tabular"> | |
5 |
|
5 | <p> | ||
6 |
|
|
6 | <label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label> | |
7 | <%= text_field_tag 'mail', nil, :size => 40 %> |
|
7 | <%= text_field_tag 'mail', nil, :size => 40 %> | |
8 |
<%= submit_tag l(:button_submit) %> |
|
8 | <%= submit_tag l(:button_submit) %> | |
9 |
|
9 | </p> | ||
10 | <% end %> |
|
|||
11 | </div> |
|
10 | </div> | |
|
11 | <% end %> |
@@ -1,31 +1,31 | |||||
1 | <h2><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h2> |
|
1 | <h2><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h2> | |
2 |
|
2 | |||
3 |
<%= labelled_form_for @user, :url => |
|
3 | <%= labelled_form_for @user, :url => register_path do |f| %> | |
4 | <%= error_messages_for 'user' %> |
|
4 | <%= error_messages_for 'user' %> | |
5 |
|
5 | |||
6 | <div class="box tabular"> |
|
6 | <div class="box tabular"> | |
7 | <% if @user.auth_source_id.nil? %> |
|
7 | <% if @user.auth_source_id.nil? %> | |
8 | <p><%= f.text_field :login, :size => 25, :required => true %></p> |
|
8 | <p><%= f.text_field :login, :size => 25, :required => true %></p> | |
9 |
|
9 | |||
10 | <p><%= f.password_field :password, :size => 25, :required => true %> |
|
10 | <p><%= f.password_field :password, :size => 25, :required => true %> | |
11 | <em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p> |
|
11 | <em class="info"><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p> | |
12 |
|
12 | |||
13 | <p><%= f.password_field :password_confirmation, :size => 25, :required => true %></p> |
|
13 | <p><%= f.password_field :password_confirmation, :size => 25, :required => true %></p> | |
14 | <% end %> |
|
14 | <% end %> | |
15 |
|
15 | |||
16 | <p><%= f.text_field :firstname, :required => true %></p> |
|
16 | <p><%= f.text_field :firstname, :required => true %></p> | |
17 | <p><%= f.text_field :lastname, :required => true %></p> |
|
17 | <p><%= f.text_field :lastname, :required => true %></p> | |
18 | <p><%= f.text_field :mail, :required => true %></p> |
|
18 | <p><%= f.text_field :mail, :required => true %></p> | |
19 | <p><%= f.select :language, lang_options_for_select %></p> |
|
19 | <p><%= f.select :language, lang_options_for_select %></p> | |
20 |
|
20 | |||
21 | <% if Setting.openid? %> |
|
21 | <% if Setting.openid? %> | |
22 | <p><%= f.text_field :identity_url %></p> |
|
22 | <p><%= f.text_field :identity_url %></p> | |
23 | <% end %> |
|
23 | <% end %> | |
24 |
|
24 | |||
25 | <% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %> |
|
25 | <% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %> | |
26 | <p><%= custom_field_tag_with_label :user, value %></p> |
|
26 | <p><%= custom_field_tag_with_label :user, value %></p> | |
27 | <% end %> |
|
27 | <% end %> | |
28 | </div> |
|
28 | </div> | |
29 |
|
29 | |||
30 | <%= submit_tag l(:button_submit) %> |
|
30 | <%= submit_tag l(:button_submit) %> | |
31 | <% end %> |
|
31 | <% end %> |
@@ -1,339 +1,339 | |||||
1 | # Redmine - project management software |
|
1 | # Redmine - project management software | |
2 | # Copyright (C) 2006-2012 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006-2012 Jean-Philippe Lang | |
3 | # |
|
3 | # | |
4 | # This program is free software; you can redistribute it and/or |
|
4 | # This program is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU General Public License |
|
5 | # modify it under the terms of the GNU General Public License | |
6 | # as published by the Free Software Foundation; either version 2 |
|
6 | # as published by the Free Software Foundation; either version 2 | |
7 | # of the License, or (at your option) any later version. |
|
7 | # of the License, or (at your option) any later version. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | RedmineApp::Application.routes.draw do |
|
18 | RedmineApp::Application.routes.draw do | |
19 | root :to => 'welcome#index', :as => 'home' |
|
19 | root :to => 'welcome#index', :as => 'home' | |
20 |
|
20 | |||
21 | match 'login', :to => 'account#login', :as => 'signin' |
|
21 | match 'login', :to => 'account#login', :as => 'signin' | |
22 | match 'logout', :to => 'account#logout', :as => 'signout' |
|
22 | match 'logout', :to => 'account#logout', :as => 'signout' | |
23 | match 'account/register', :to => 'account#register', :via => [:get, :post] |
|
23 | match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register' | |
24 | match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post] |
|
24 | match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password' | |
25 | match 'account/activate', :to => 'account#activate', :via => :get |
|
25 | match 'account/activate', :to => 'account#activate', :via => :get | |
26 |
|
26 | |||
27 | match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news' |
|
27 | match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news' | |
28 | match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue' |
|
28 | match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue' | |
29 | match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue' |
|
29 | match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue' | |
30 | match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue' |
|
30 | match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue' | |
31 |
|
31 | |||
32 | match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post |
|
32 | match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post | |
33 | match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post] |
|
33 | match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post] | |
34 |
|
34 | |||
35 | match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post] |
|
35 | match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post] | |
36 | get 'boards/:board_id/topics/:id', :to => 'messages#show' |
|
36 | get 'boards/:board_id/topics/:id', :to => 'messages#show' | |
37 | match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post] |
|
37 | match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post] | |
38 | get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' |
|
38 | get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' | |
39 |
|
39 | |||
40 | post 'boards/:board_id/topics/preview', :to => 'messages#preview' |
|
40 | post 'boards/:board_id/topics/preview', :to => 'messages#preview' | |
41 | post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply' |
|
41 | post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply' | |
42 | post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' |
|
42 | post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit' | |
43 | post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy' |
|
43 | post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy' | |
44 |
|
44 | |||
45 | # Misc issue routes. TODO: move into resources |
|
45 | # Misc issue routes. TODO: move into resources | |
46 | match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues' |
|
46 | match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues' | |
47 | match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu' |
|
47 | match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu' | |
48 | match '/issues/changes', :to => 'journals#index', :as => 'issue_changes' |
|
48 | match '/issues/changes', :to => 'journals#index', :as => 'issue_changes' | |
49 | match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue' |
|
49 | match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue' | |
50 |
|
50 | |||
51 | match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get |
|
51 | match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get | |
52 | match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post] |
|
52 | match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post] | |
53 |
|
53 | |||
54 | match '/projects/:project_id/issues/gantt', :to => 'gantts#show' |
|
54 | match '/projects/:project_id/issues/gantt', :to => 'gantts#show' | |
55 | match '/issues/gantt', :to => 'gantts#show' |
|
55 | match '/issues/gantt', :to => 'gantts#show' | |
56 |
|
56 | |||
57 | match '/projects/:project_id/issues/calendar', :to => 'calendars#show' |
|
57 | match '/projects/:project_id/issues/calendar', :to => 'calendars#show' | |
58 | match '/issues/calendar', :to => 'calendars#show' |
|
58 | match '/issues/calendar', :to => 'calendars#show' | |
59 |
|
59 | |||
60 | match 'projects/:id/issues/report', :to => 'reports#issue_report', :via => :get |
|
60 | match 'projects/:id/issues/report', :to => 'reports#issue_report', :via => :get | |
61 | match 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :via => :get |
|
61 | match 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :via => :get | |
62 |
|
62 | |||
63 | match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post] |
|
63 | match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post] | |
64 | match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post] |
|
64 | match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post] | |
65 | match 'my/page', :controller => 'my', :action => 'page', :via => :get |
|
65 | match 'my/page', :controller => 'my', :action => 'page', :via => :get | |
66 | match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page |
|
66 | match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page | |
67 | match 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :via => :post |
|
67 | match 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :via => :post | |
68 | match 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :via => :post |
|
68 | match 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :via => :post | |
69 | match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post] |
|
69 | match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post] | |
70 | match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get |
|
70 | match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get | |
71 | match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post |
|
71 | match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post | |
72 | match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post |
|
72 | match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post | |
73 | match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post |
|
73 | match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post | |
74 |
|
74 | |||
75 | resources :users |
|
75 | resources :users | |
76 | match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership' |
|
76 | match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership' | |
77 | match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete |
|
77 | match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete | |
78 | match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships' |
|
78 | match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships' | |
79 |
|
79 | |||
80 | match 'watchers/new', :controller=> 'watchers', :action => 'new', :via => :get |
|
80 | match 'watchers/new', :controller=> 'watchers', :action => 'new', :via => :get | |
81 | match 'watchers', :controller=> 'watchers', :action => 'create', :via => :post |
|
81 | match 'watchers', :controller=> 'watchers', :action => 'create', :via => :post | |
82 | match 'watchers/append', :controller=> 'watchers', :action => 'append', :via => :post |
|
82 | match 'watchers/append', :controller=> 'watchers', :action => 'append', :via => :post | |
83 | match 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', :via => :post |
|
83 | match 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', :via => :post | |
84 | match 'watchers/watch', :controller=> 'watchers', :action => 'watch', :via => :post |
|
84 | match 'watchers/watch', :controller=> 'watchers', :action => 'watch', :via => :post | |
85 | match 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', :via => :post |
|
85 | match 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', :via => :post | |
86 | match 'watchers/autocomplete_for_user', :controller=> 'watchers', :action => 'autocomplete_for_user', :via => :get |
|
86 | match 'watchers/autocomplete_for_user', :controller=> 'watchers', :action => 'autocomplete_for_user', :via => :get | |
87 |
|
87 | |||
88 | match 'projects/:id/settings/:tab', :to => "projects#settings" |
|
88 | match 'projects/:id/settings/:tab', :to => "projects#settings" | |
89 |
|
89 | |||
90 | resources :projects do |
|
90 | resources :projects do | |
91 | member do |
|
91 | member do | |
92 | get 'settings' |
|
92 | get 'settings' | |
93 | post 'modules' |
|
93 | post 'modules' | |
94 | post 'archive' |
|
94 | post 'archive' | |
95 | post 'unarchive' |
|
95 | post 'unarchive' | |
96 | post 'close' |
|
96 | post 'close' | |
97 | post 'reopen' |
|
97 | post 'reopen' | |
98 | match 'copy', :via => [:get, :post] |
|
98 | match 'copy', :via => [:get, :post] | |
99 | end |
|
99 | end | |
100 |
|
100 | |||
101 | resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :create, :update, :destroy] do |
|
101 | resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :create, :update, :destroy] do | |
102 | collection do |
|
102 | collection do | |
103 | get 'autocomplete' |
|
103 | get 'autocomplete' | |
104 | end |
|
104 | end | |
105 | end |
|
105 | end | |
106 |
|
106 | |||
107 | resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy] |
|
107 | resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy] | |
108 |
|
108 | |||
109 | match 'issues/:copy_from/copy', :to => 'issues#new' |
|
109 | match 'issues/:copy_from/copy', :to => 'issues#new' | |
110 | resources :issues, :only => [:index, :new, :create] do |
|
110 | resources :issues, :only => [:index, :new, :create] do | |
111 | resources :time_entries, :controller => 'timelog' do |
|
111 | resources :time_entries, :controller => 'timelog' do | |
112 | collection do |
|
112 | collection do | |
113 | get 'report' |
|
113 | get 'report' | |
114 | end |
|
114 | end | |
115 | end |
|
115 | end | |
116 | end |
|
116 | end | |
117 | # issue form update |
|
117 | # issue form update | |
118 | match 'issues/new', :controller => 'issues', :action => 'new', :via => [:put, :post], :as => 'issue_form' |
|
118 | match 'issues/new', :controller => 'issues', :action => 'new', :via => [:put, :post], :as => 'issue_form' | |
119 |
|
119 | |||
120 | resources :files, :only => [:index, :new, :create] |
|
120 | resources :files, :only => [:index, :new, :create] | |
121 |
|
121 | |||
122 | resources :versions, :except => [:index, :show, :edit, :update, :destroy] do |
|
122 | resources :versions, :except => [:index, :show, :edit, :update, :destroy] do | |
123 | collection do |
|
123 | collection do | |
124 | put 'close_completed' |
|
124 | put 'close_completed' | |
125 | end |
|
125 | end | |
126 | end |
|
126 | end | |
127 | match 'versions.:format', :to => 'versions#index' |
|
127 | match 'versions.:format', :to => 'versions#index' | |
128 | match 'roadmap', :to => 'versions#index', :format => false |
|
128 | match 'roadmap', :to => 'versions#index', :format => false | |
129 | match 'versions', :to => 'versions#index' |
|
129 | match 'versions', :to => 'versions#index' | |
130 |
|
130 | |||
131 | resources :news, :except => [:show, :edit, :update, :destroy] |
|
131 | resources :news, :except => [:show, :edit, :update, :destroy] | |
132 | resources :time_entries, :controller => 'timelog' do |
|
132 | resources :time_entries, :controller => 'timelog' do | |
133 | get 'report', :on => :collection |
|
133 | get 'report', :on => :collection | |
134 | end |
|
134 | end | |
135 | resources :queries, :only => [:new, :create] |
|
135 | resources :queries, :only => [:new, :create] | |
136 | resources :issue_categories, :shallow => true |
|
136 | resources :issue_categories, :shallow => true | |
137 | resources :documents, :except => [:show, :edit, :update, :destroy] |
|
137 | resources :documents, :except => [:show, :edit, :update, :destroy] | |
138 | resources :boards |
|
138 | resources :boards | |
139 | resources :repositories, :shallow => true, :except => [:index, :show] do |
|
139 | resources :repositories, :shallow => true, :except => [:index, :show] do | |
140 | member do |
|
140 | member do | |
141 | match 'committers', :via => [:get, :post] |
|
141 | match 'committers', :via => [:get, :post] | |
142 | end |
|
142 | end | |
143 | end |
|
143 | end | |
144 |
|
144 | |||
145 | match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get |
|
145 | match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get | |
146 | match 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff' |
|
146 | match 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff' | |
147 | match 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff' |
|
147 | match 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff' | |
148 | resources :wiki, :except => [:index, :new, :create] do |
|
148 | resources :wiki, :except => [:index, :new, :create] do | |
149 | member do |
|
149 | member do | |
150 | get 'rename' |
|
150 | get 'rename' | |
151 | post 'rename' |
|
151 | post 'rename' | |
152 | get 'history' |
|
152 | get 'history' | |
153 | get 'diff' |
|
153 | get 'diff' | |
154 | match 'preview', :via => [:post, :put] |
|
154 | match 'preview', :via => [:post, :put] | |
155 | post 'protect' |
|
155 | post 'protect' | |
156 | post 'add_attachment' |
|
156 | post 'add_attachment' | |
157 | end |
|
157 | end | |
158 | collection do |
|
158 | collection do | |
159 | get 'export' |
|
159 | get 'export' | |
160 | get 'date_index' |
|
160 | get 'date_index' | |
161 | end |
|
161 | end | |
162 | end |
|
162 | end | |
163 | match 'wiki', :controller => 'wiki', :action => 'show', :via => :get |
|
163 | match 'wiki', :controller => 'wiki', :action => 'show', :via => :get | |
164 | match 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate' |
|
164 | match 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate' | |
165 | end |
|
165 | end | |
166 |
|
166 | |||
167 | resources :issues do |
|
167 | resources :issues do | |
168 | collection do |
|
168 | collection do | |
169 | match 'bulk_edit', :via => [:get, :post] |
|
169 | match 'bulk_edit', :via => [:get, :post] | |
170 | post 'bulk_update' |
|
170 | post 'bulk_update' | |
171 | end |
|
171 | end | |
172 | resources :time_entries, :controller => 'timelog' do |
|
172 | resources :time_entries, :controller => 'timelog' do | |
173 | collection do |
|
173 | collection do | |
174 | get 'report' |
|
174 | get 'report' | |
175 | end |
|
175 | end | |
176 | end |
|
176 | end | |
177 | resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy] |
|
177 | resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy] | |
178 | end |
|
178 | end | |
179 | match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete |
|
179 | match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete | |
180 |
|
180 | |||
181 | resources :queries, :except => [:show] |
|
181 | resources :queries, :except => [:show] | |
182 |
|
182 | |||
183 | resources :news, :only => [:index, :show, :edit, :update, :destroy] |
|
183 | resources :news, :only => [:index, :show, :edit, :update, :destroy] | |
184 | match '/news/:id/comments', :to => 'comments#create', :via => :post |
|
184 | match '/news/:id/comments', :to => 'comments#create', :via => :post | |
185 | match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete |
|
185 | match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete | |
186 |
|
186 | |||
187 | resources :versions, :only => [:show, :edit, :update, :destroy] do |
|
187 | resources :versions, :only => [:show, :edit, :update, :destroy] do | |
188 | post 'status_by', :on => :member |
|
188 | post 'status_by', :on => :member | |
189 | end |
|
189 | end | |
190 |
|
190 | |||
191 | resources :documents, :only => [:show, :edit, :update, :destroy] do |
|
191 | resources :documents, :only => [:show, :edit, :update, :destroy] do | |
192 | post 'add_attachment', :on => :member |
|
192 | post 'add_attachment', :on => :member | |
193 | end |
|
193 | end | |
194 |
|
194 | |||
195 | match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu |
|
195 | match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu | |
196 |
|
196 | |||
197 | resources :time_entries, :controller => 'timelog', :except => :destroy do |
|
197 | resources :time_entries, :controller => 'timelog', :except => :destroy do | |
198 | collection do |
|
198 | collection do | |
199 | get 'report' |
|
199 | get 'report' | |
200 | get 'bulk_edit' |
|
200 | get 'bulk_edit' | |
201 | post 'bulk_update' |
|
201 | post 'bulk_update' | |
202 | end |
|
202 | end | |
203 | end |
|
203 | end | |
204 | match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/ |
|
204 | match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/ | |
205 | # TODO: delete /time_entries for bulk deletion |
|
205 | # TODO: delete /time_entries for bulk deletion | |
206 | match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete |
|
206 | match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete | |
207 |
|
207 | |||
208 | # TODO: port to be part of the resources route(s) |
|
208 | # TODO: port to be part of the resources route(s) | |
209 | match 'projects/:id/settings/:tab', :to => 'projects#settings', :via => :get |
|
209 | match 'projects/:id/settings/:tab', :to => 'projects#settings', :via => :get | |
210 |
|
210 | |||
211 | get 'projects/:id/activity', :to => 'activities#index' |
|
211 | get 'projects/:id/activity', :to => 'activities#index' | |
212 | get 'projects/:id/activity.:format', :to => 'activities#index' |
|
212 | get 'projects/:id/activity.:format', :to => 'activities#index' | |
213 | get 'activity', :to => 'activities#index' |
|
213 | get 'activity', :to => 'activities#index' | |
214 |
|
214 | |||
215 | # repositories routes |
|
215 | # repositories routes | |
216 | get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats' |
|
216 | get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats' | |
217 | get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph' |
|
217 | get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph' | |
218 |
|
218 | |||
219 | get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))', |
|
219 | get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))', | |
220 | :to => 'repositories#changes' |
|
220 | :to => 'repositories#changes' | |
221 |
|
221 | |||
222 | get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision' |
|
222 | get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision' | |
223 | get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision' |
|
223 | get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision' | |
224 | post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue' |
|
224 | post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue' | |
225 | delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' |
|
225 | delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' | |
226 | get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions' |
|
226 | get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions' | |
227 | get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', |
|
227 | get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))', | |
228 | :controller => 'repositories', |
|
228 | :controller => 'repositories', | |
229 | :format => false, |
|
229 | :format => false, | |
230 | :constraints => { |
|
230 | :constraints => { | |
231 | :action => /(browse|show|entry|raw|annotate|diff)/, |
|
231 | :action => /(browse|show|entry|raw|annotate|diff)/, | |
232 | :rev => /[a-z0-9\.\-_]+/ |
|
232 | :rev => /[a-z0-9\.\-_]+/ | |
233 | } |
|
233 | } | |
234 |
|
234 | |||
235 | get 'projects/:id/repository/statistics', :to => 'repositories#stats' |
|
235 | get 'projects/:id/repository/statistics', :to => 'repositories#stats' | |
236 | get 'projects/:id/repository/graph', :to => 'repositories#graph' |
|
236 | get 'projects/:id/repository/graph', :to => 'repositories#graph' | |
237 |
|
237 | |||
238 | get 'projects/:id/repository/changes(/*path(.:ext))', |
|
238 | get 'projects/:id/repository/changes(/*path(.:ext))', | |
239 | :to => 'repositories#changes' |
|
239 | :to => 'repositories#changes' | |
240 |
|
240 | |||
241 | get 'projects/:id/repository/revisions', :to => 'repositories#revisions' |
|
241 | get 'projects/:id/repository/revisions', :to => 'repositories#revisions' | |
242 | get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision' |
|
242 | get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision' | |
243 | get 'projects/:id/repository/revision', :to => 'repositories#revision' |
|
243 | get 'projects/:id/repository/revision', :to => 'repositories#revision' | |
244 | post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue' |
|
244 | post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue' | |
245 | delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' |
|
245 | delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' | |
246 | get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', |
|
246 | get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', | |
247 | :controller => 'repositories', |
|
247 | :controller => 'repositories', | |
248 | :format => false, |
|
248 | :format => false, | |
249 | :constraints => { |
|
249 | :constraints => { | |
250 | :action => /(browse|show|entry|raw|annotate|diff)/, |
|
250 | :action => /(browse|show|entry|raw|annotate|diff)/, | |
251 | :rev => /[a-z0-9\.\-_]+/ |
|
251 | :rev => /[a-z0-9\.\-_]+/ | |
252 | } |
|
252 | } | |
253 | get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))', |
|
253 | get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))', | |
254 | :controller => 'repositories', |
|
254 | :controller => 'repositories', | |
255 | :action => /(browse|show|entry|raw|changes|annotate|diff)/ |
|
255 | :action => /(browse|show|entry|raw|changes|annotate|diff)/ | |
256 | get 'projects/:id/repository/:action(/*path(.:ext))', |
|
256 | get 'projects/:id/repository/:action(/*path(.:ext))', | |
257 | :controller => 'repositories', |
|
257 | :controller => 'repositories', | |
258 | :action => /(browse|show|entry|raw|changes|annotate|diff)/ |
|
258 | :action => /(browse|show|entry|raw|changes|annotate|diff)/ | |
259 |
|
259 | |||
260 | get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil |
|
260 | get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil | |
261 | get 'projects/:id/repository', :to => 'repositories#show', :path => nil |
|
261 | get 'projects/:id/repository', :to => 'repositories#show', :path => nil | |
262 |
|
262 | |||
263 | # additional routes for having the file name at the end of url |
|
263 | # additional routes for having the file name at the end of url | |
264 | match 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/, :via => :get |
|
264 | match 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/, :via => :get | |
265 | match 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/, :via => :get |
|
265 | match 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/, :via => :get | |
266 | match 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/, :via => :get |
|
266 | match 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/, :via => :get | |
267 | match 'attachments/thumbnail/:id', :controller => 'attachments', :action => 'thumbnail', :id => /\d+/, :via => :get |
|
267 | match 'attachments/thumbnail/:id', :controller => 'attachments', :action => 'thumbnail', :id => /\d+/, :via => :get | |
268 | resources :attachments, :only => [:show, :destroy] |
|
268 | resources :attachments, :only => [:show, :destroy] | |
269 |
|
269 | |||
270 | resources :groups do |
|
270 | resources :groups do | |
271 | member do |
|
271 | member do | |
272 | get 'autocomplete_for_user' |
|
272 | get 'autocomplete_for_user' | |
273 | end |
|
273 | end | |
274 | end |
|
274 | end | |
275 |
|
275 | |||
276 | match 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :via => :post, :as => 'group_users' |
|
276 | match 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :via => :post, :as => 'group_users' | |
277 | match 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :via => :delete, :as => 'group_user' |
|
277 | match 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :via => :delete, :as => 'group_user' | |
278 | match 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :via => :post |
|
278 | match 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :via => :post | |
279 | match 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :via => :post |
|
279 | match 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :via => :post | |
280 |
|
280 | |||
281 | resources :trackers, :except => :show |
|
281 | resources :trackers, :except => :show | |
282 | resources :issue_statuses, :except => :show do |
|
282 | resources :issue_statuses, :except => :show do | |
283 | collection do |
|
283 | collection do | |
284 | post 'update_issue_done_ratio' |
|
284 | post 'update_issue_done_ratio' | |
285 | end |
|
285 | end | |
286 | end |
|
286 | end | |
287 | resources :custom_fields, :except => :show |
|
287 | resources :custom_fields, :except => :show | |
288 | resources :roles, :except => :show do |
|
288 | resources :roles, :except => :show do | |
289 | collection do |
|
289 | collection do | |
290 | match 'permissions', :via => [:get, :post] |
|
290 | match 'permissions', :via => [:get, :post] | |
291 | end |
|
291 | end | |
292 | end |
|
292 | end | |
293 | resources :enumerations, :except => :show |
|
293 | resources :enumerations, :except => :show | |
294 |
|
294 | |||
295 | get 'projects/:id/search', :controller => 'search', :action => 'index' |
|
295 | get 'projects/:id/search', :controller => 'search', :action => 'index' | |
296 | get 'search', :controller => 'search', :action => 'index' |
|
296 | get 'search', :controller => 'search', :action => 'index' | |
297 |
|
297 | |||
298 | match 'mail_handler', :controller => 'mail_handler', :action => 'index', :via => :post |
|
298 | match 'mail_handler', :controller => 'mail_handler', :action => 'index', :via => :post | |
299 |
|
299 | |||
300 | match 'admin', :controller => 'admin', :action => 'index', :via => :get |
|
300 | match 'admin', :controller => 'admin', :action => 'index', :via => :get | |
301 | match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get |
|
301 | match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get | |
302 | match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get |
|
302 | match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get | |
303 | match 'admin/info', :controller => 'admin', :action => 'info', :via => :get |
|
303 | match 'admin/info', :controller => 'admin', :action => 'info', :via => :get | |
304 | match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get |
|
304 | match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get | |
305 | match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post |
|
305 | match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post | |
306 |
|
306 | |||
307 | resources :auth_sources do |
|
307 | resources :auth_sources do | |
308 | member do |
|
308 | member do | |
309 | get 'test_connection' |
|
309 | get 'test_connection' | |
310 | end |
|
310 | end | |
311 | end |
|
311 | end | |
312 |
|
312 | |||
313 | match 'workflows', :controller => 'workflows', :action => 'index', :via => :get |
|
313 | match 'workflows', :controller => 'workflows', :action => 'index', :via => :get | |
314 | match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post] |
|
314 | match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post] | |
315 | match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post] |
|
315 | match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post] | |
316 | match 'settings', :controller => 'settings', :action => 'index', :via => :get |
|
316 | match 'settings', :controller => 'settings', :action => 'index', :via => :get | |
317 | match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post] |
|
317 | match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post] | |
318 | match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post] |
|
318 | match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post] | |
319 |
|
319 | |||
320 | match 'sys/projects', :to => 'sys#projects', :via => :get |
|
320 | match 'sys/projects', :to => 'sys#projects', :via => :get | |
321 | match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post |
|
321 | match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post | |
322 | match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => :get |
|
322 | match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => :get | |
323 |
|
323 | |||
324 | match 'uploads', :to => 'attachments#upload', :via => :post |
|
324 | match 'uploads', :to => 'attachments#upload', :via => :post | |
325 |
|
325 | |||
326 | get 'robots.txt', :to => 'welcome#robots' |
|
326 | get 'robots.txt', :to => 'welcome#robots' | |
327 |
|
327 | |||
328 | Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir| |
|
328 | Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir| | |
329 | file = File.join(plugin_dir, "config/routes.rb") |
|
329 | file = File.join(plugin_dir, "config/routes.rb") | |
330 | if File.exists?(file) |
|
330 | if File.exists?(file) | |
331 | begin |
|
331 | begin | |
332 | instance_eval File.read(file) |
|
332 | instance_eval File.read(file) | |
333 | rescue Exception => e |
|
333 | rescue Exception => e | |
334 | puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}." |
|
334 | puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}." | |
335 | exit 1 |
|
335 | exit 1 | |
336 | end |
|
336 | end | |
337 | end |
|
337 | end | |
338 | end |
|
338 | end | |
339 | end |
|
339 | end |
@@ -1,240 +1,240 | |||||
1 | require 'redmine/access_control' |
|
1 | require 'redmine/access_control' | |
2 | require 'redmine/menu_manager' |
|
2 | require 'redmine/menu_manager' | |
3 | require 'redmine/activity' |
|
3 | require 'redmine/activity' | |
4 | require 'redmine/search' |
|
4 | require 'redmine/search' | |
5 | require 'redmine/custom_field_format' |
|
5 | require 'redmine/custom_field_format' | |
6 | require 'redmine/mime_type' |
|
6 | require 'redmine/mime_type' | |
7 | require 'redmine/core_ext' |
|
7 | require 'redmine/core_ext' | |
8 | require 'redmine/themes' |
|
8 | require 'redmine/themes' | |
9 | require 'redmine/hook' |
|
9 | require 'redmine/hook' | |
10 | require 'redmine/plugin' |
|
10 | require 'redmine/plugin' | |
11 | require 'redmine/notifiable' |
|
11 | require 'redmine/notifiable' | |
12 | require 'redmine/wiki_formatting' |
|
12 | require 'redmine/wiki_formatting' | |
13 | require 'redmine/scm/base' |
|
13 | require 'redmine/scm/base' | |
14 |
|
14 | |||
15 | begin |
|
15 | begin | |
16 | require 'RMagick' unless Object.const_defined?(:Magick) |
|
16 | require 'RMagick' unless Object.const_defined?(:Magick) | |
17 | rescue LoadError |
|
17 | rescue LoadError | |
18 | # RMagick is not available |
|
18 | # RMagick is not available | |
19 | end |
|
19 | end | |
20 |
|
20 | |||
21 | if RUBY_VERSION < '1.9' |
|
21 | if RUBY_VERSION < '1.9' | |
22 | require 'fastercsv' |
|
22 | require 'fastercsv' | |
23 | else |
|
23 | else | |
24 | require 'csv' |
|
24 | require 'csv' | |
25 | FCSV = CSV |
|
25 | FCSV = CSV | |
26 | end |
|
26 | end | |
27 |
|
27 | |||
28 | Redmine::Scm::Base.add "Subversion" |
|
28 | Redmine::Scm::Base.add "Subversion" | |
29 | Redmine::Scm::Base.add "Darcs" |
|
29 | Redmine::Scm::Base.add "Darcs" | |
30 | Redmine::Scm::Base.add "Mercurial" |
|
30 | Redmine::Scm::Base.add "Mercurial" | |
31 | Redmine::Scm::Base.add "Cvs" |
|
31 | Redmine::Scm::Base.add "Cvs" | |
32 | Redmine::Scm::Base.add "Bazaar" |
|
32 | Redmine::Scm::Base.add "Bazaar" | |
33 | Redmine::Scm::Base.add "Git" |
|
33 | Redmine::Scm::Base.add "Git" | |
34 | Redmine::Scm::Base.add "Filesystem" |
|
34 | Redmine::Scm::Base.add "Filesystem" | |
35 |
|
35 | |||
36 | Redmine::CustomFieldFormat.map do |fields| |
|
36 | Redmine::CustomFieldFormat.map do |fields| | |
37 | fields.register 'string' |
|
37 | fields.register 'string' | |
38 | fields.register 'text' |
|
38 | fields.register 'text' | |
39 | fields.register 'int', :label => :label_integer |
|
39 | fields.register 'int', :label => :label_integer | |
40 | fields.register 'float' |
|
40 | fields.register 'float' | |
41 | fields.register 'list' |
|
41 | fields.register 'list' | |
42 | fields.register 'date' |
|
42 | fields.register 'date' | |
43 | fields.register 'bool', :label => :label_boolean |
|
43 | fields.register 'bool', :label => :label_boolean | |
44 | fields.register 'user', :only => %w(Issue TimeEntry Version Project), :edit_as => 'list' |
|
44 | fields.register 'user', :only => %w(Issue TimeEntry Version Project), :edit_as => 'list' | |
45 | fields.register 'version', :only => %w(Issue TimeEntry Version Project), :edit_as => 'list' |
|
45 | fields.register 'version', :only => %w(Issue TimeEntry Version Project), :edit_as => 'list' | |
46 | end |
|
46 | end | |
47 |
|
47 | |||
48 | # Permissions |
|
48 | # Permissions | |
49 | Redmine::AccessControl.map do |map| |
|
49 | Redmine::AccessControl.map do |map| | |
50 | map.permission :view_project, {:projects => [:show], :activities => [:index]}, :public => true, :read => true |
|
50 | map.permission :view_project, {:projects => [:show], :activities => [:index]}, :public => true, :read => true | |
51 | map.permission :search_project, {:search => :index}, :public => true, :read => true |
|
51 | map.permission :search_project, {:search => :index}, :public => true, :read => true | |
52 | map.permission :add_project, {:projects => [:new, :create]}, :require => :loggedin |
|
52 | map.permission :add_project, {:projects => [:new, :create]}, :require => :loggedin | |
53 | map.permission :edit_project, {:projects => [:settings, :edit, :update]}, :require => :member |
|
53 | map.permission :edit_project, {:projects => [:settings, :edit, :update]}, :require => :member | |
54 | map.permission :close_project, {:projects => [:close, :reopen]}, :require => :member, :read => true |
|
54 | map.permission :close_project, {:projects => [:close, :reopen]}, :require => :member, :read => true | |
55 | map.permission :select_project_modules, {:projects => :modules}, :require => :member |
|
55 | map.permission :select_project_modules, {:projects => :modules}, :require => :member | |
56 | map.permission :manage_members, {:projects => :settings, :members => [:index, :show, :create, :update, :destroy, :autocomplete]}, :require => :member |
|
56 | map.permission :manage_members, {:projects => :settings, :members => [:index, :show, :create, :update, :destroy, :autocomplete]}, :require => :member | |
57 | map.permission :manage_versions, {:projects => :settings, :versions => [:new, :create, :edit, :update, :close_completed, :destroy]}, :require => :member |
|
57 | map.permission :manage_versions, {:projects => :settings, :versions => [:new, :create, :edit, :update, :close_completed, :destroy]}, :require => :member | |
58 | map.permission :add_subprojects, {:projects => [:new, :create]}, :require => :member |
|
58 | map.permission :add_subprojects, {:projects => [:new, :create]}, :require => :member | |
59 |
|
59 | |||
60 | map.project_module :issue_tracking do |map| |
|
60 | map.project_module :issue_tracking do |map| | |
61 | # Issue categories |
|
61 | # Issue categories | |
62 | map.permission :manage_categories, {:projects => :settings, :issue_categories => [:index, :show, :new, :create, :edit, :update, :destroy]}, :require => :member |
|
62 | map.permission :manage_categories, {:projects => :settings, :issue_categories => [:index, :show, :new, :create, :edit, :update, :destroy]}, :require => :member | |
63 | # Issues |
|
63 | # Issues | |
64 | map.permission :view_issues, {:issues => [:index, :show], |
|
64 | map.permission :view_issues, {:issues => [:index, :show], | |
65 | :auto_complete => [:issues], |
|
65 | :auto_complete => [:issues], | |
66 | :context_menus => [:issues], |
|
66 | :context_menus => [:issues], | |
67 | :versions => [:index, :show, :status_by], |
|
67 | :versions => [:index, :show, :status_by], | |
68 | :journals => [:index, :diff], |
|
68 | :journals => [:index, :diff], | |
69 | :queries => :index, |
|
69 | :queries => :index, | |
70 | :reports => [:issue_report, :issue_report_details]}, |
|
70 | :reports => [:issue_report, :issue_report_details]}, | |
71 | :read => true |
|
71 | :read => true | |
72 | map.permission :add_issues, {:issues => [:new, :create, :update_form], :attachments => :upload} |
|
72 | map.permission :add_issues, {:issues => [:new, :create, :update_form], :attachments => :upload} | |
73 | map.permission :edit_issues, {:issues => [:edit, :update, :bulk_edit, :bulk_update, :update_form], :journals => [:new], :attachments => :upload} |
|
73 | map.permission :edit_issues, {:issues => [:edit, :update, :bulk_edit, :bulk_update, :update_form], :journals => [:new], :attachments => :upload} | |
74 | map.permission :manage_issue_relations, {:issue_relations => [:index, :show, :create, :destroy]} |
|
74 | map.permission :manage_issue_relations, {:issue_relations => [:index, :show, :create, :destroy]} | |
75 | map.permission :manage_subtasks, {} |
|
75 | map.permission :manage_subtasks, {} | |
76 | map.permission :set_issues_private, {} |
|
76 | map.permission :set_issues_private, {} | |
77 | map.permission :set_own_issues_private, {}, :require => :loggedin |
|
77 | map.permission :set_own_issues_private, {}, :require => :loggedin | |
78 | map.permission :add_issue_notes, {:issues => [:edit, :update], :journals => [:new], :attachments => :upload} |
|
78 | map.permission :add_issue_notes, {:issues => [:edit, :update], :journals => [:new], :attachments => :upload} | |
79 | map.permission :edit_issue_notes, {:journals => :edit}, :require => :loggedin |
|
79 | map.permission :edit_issue_notes, {:journals => :edit}, :require => :loggedin | |
80 | map.permission :edit_own_issue_notes, {:journals => :edit}, :require => :loggedin |
|
80 | map.permission :edit_own_issue_notes, {:journals => :edit}, :require => :loggedin | |
81 | map.permission :move_issues, {:issues => [:bulk_edit, :bulk_update]}, :require => :loggedin |
|
81 | map.permission :move_issues, {:issues => [:bulk_edit, :bulk_update]}, :require => :loggedin | |
82 | map.permission :delete_issues, {:issues => :destroy}, :require => :member |
|
82 | map.permission :delete_issues, {:issues => :destroy}, :require => :member | |
83 | # Queries |
|
83 | # Queries | |
84 | map.permission :manage_public_queries, {:queries => [:new, :create, :edit, :update, :destroy]}, :require => :member |
|
84 | map.permission :manage_public_queries, {:queries => [:new, :create, :edit, :update, :destroy]}, :require => :member | |
85 | map.permission :save_queries, {:queries => [:new, :create, :edit, :update, :destroy]}, :require => :loggedin |
|
85 | map.permission :save_queries, {:queries => [:new, :create, :edit, :update, :destroy]}, :require => :loggedin | |
86 | # Watchers |
|
86 | # Watchers | |
87 | map.permission :view_issue_watchers, {}, :read => true |
|
87 | map.permission :view_issue_watchers, {}, :read => true | |
88 | map.permission :add_issue_watchers, {:watchers => :new} |
|
88 | map.permission :add_issue_watchers, {:watchers => :new} | |
89 | map.permission :delete_issue_watchers, {:watchers => :destroy} |
|
89 | map.permission :delete_issue_watchers, {:watchers => :destroy} | |
90 | end |
|
90 | end | |
91 |
|
91 | |||
92 | map.project_module :time_tracking do |map| |
|
92 | map.project_module :time_tracking do |map| | |
93 | map.permission :log_time, {:timelog => [:new, :create]}, :require => :loggedin |
|
93 | map.permission :log_time, {:timelog => [:new, :create]}, :require => :loggedin | |
94 | map.permission :view_time_entries, {:timelog => [:index, :report, :show]}, :read => true |
|
94 | map.permission :view_time_entries, {:timelog => [:index, :report, :show]}, :read => true | |
95 | map.permission :edit_time_entries, {:timelog => [:edit, :update, :destroy, :bulk_edit, :bulk_update]}, :require => :member |
|
95 | map.permission :edit_time_entries, {:timelog => [:edit, :update, :destroy, :bulk_edit, :bulk_update]}, :require => :member | |
96 | map.permission :edit_own_time_entries, {:timelog => [:edit, :update, :destroy,:bulk_edit, :bulk_update]}, :require => :loggedin |
|
96 | map.permission :edit_own_time_entries, {:timelog => [:edit, :update, :destroy,:bulk_edit, :bulk_update]}, :require => :loggedin | |
97 | map.permission :manage_project_activities, {:project_enumerations => [:update, :destroy]}, :require => :member |
|
97 | map.permission :manage_project_activities, {:project_enumerations => [:update, :destroy]}, :require => :member | |
98 | end |
|
98 | end | |
99 |
|
99 | |||
100 | map.project_module :news do |map| |
|
100 | map.project_module :news do |map| | |
101 | map.permission :manage_news, {:news => [:new, :create, :edit, :update, :destroy], :comments => [:destroy]}, :require => :member |
|
101 | map.permission :manage_news, {:news => [:new, :create, :edit, :update, :destroy], :comments => [:destroy]}, :require => :member | |
102 | map.permission :view_news, {:news => [:index, :show]}, :public => true, :read => true |
|
102 | map.permission :view_news, {:news => [:index, :show]}, :public => true, :read => true | |
103 | map.permission :comment_news, {:comments => :create} |
|
103 | map.permission :comment_news, {:comments => :create} | |
104 | end |
|
104 | end | |
105 |
|
105 | |||
106 | map.project_module :documents do |map| |
|
106 | map.project_module :documents do |map| | |
107 | map.permission :manage_documents, {:documents => [:new, :create, :edit, :update, :destroy, :add_attachment]}, :require => :loggedin |
|
107 | map.permission :manage_documents, {:documents => [:new, :create, :edit, :update, :destroy, :add_attachment]}, :require => :loggedin | |
108 | map.permission :view_documents, {:documents => [:index, :show, :download]}, :read => true |
|
108 | map.permission :view_documents, {:documents => [:index, :show, :download]}, :read => true | |
109 | end |
|
109 | end | |
110 |
|
110 | |||
111 | map.project_module :files do |map| |
|
111 | map.project_module :files do |map| | |
112 | map.permission :manage_files, {:files => [:new, :create]}, :require => :loggedin |
|
112 | map.permission :manage_files, {:files => [:new, :create]}, :require => :loggedin | |
113 | map.permission :view_files, {:files => :index, :versions => :download}, :read => true |
|
113 | map.permission :view_files, {:files => :index, :versions => :download}, :read => true | |
114 | end |
|
114 | end | |
115 |
|
115 | |||
116 | map.project_module :wiki do |map| |
|
116 | map.project_module :wiki do |map| | |
117 | map.permission :manage_wiki, {:wikis => [:edit, :destroy]}, :require => :member |
|
117 | map.permission :manage_wiki, {:wikis => [:edit, :destroy]}, :require => :member | |
118 | map.permission :rename_wiki_pages, {:wiki => :rename}, :require => :member |
|
118 | map.permission :rename_wiki_pages, {:wiki => :rename}, :require => :member | |
119 | map.permission :delete_wiki_pages, {:wiki => :destroy}, :require => :member |
|
119 | map.permission :delete_wiki_pages, {:wiki => :destroy}, :require => :member | |
120 | map.permission :view_wiki_pages, {:wiki => [:index, :show, :special, :date_index]}, :read => true |
|
120 | map.permission :view_wiki_pages, {:wiki => [:index, :show, :special, :date_index]}, :read => true | |
121 | map.permission :export_wiki_pages, {:wiki => [:export]}, :read => true |
|
121 | map.permission :export_wiki_pages, {:wiki => [:export]}, :read => true | |
122 | map.permission :view_wiki_edits, {:wiki => [:history, :diff, :annotate]}, :read => true |
|
122 | map.permission :view_wiki_edits, {:wiki => [:history, :diff, :annotate]}, :read => true | |
123 | map.permission :edit_wiki_pages, :wiki => [:edit, :update, :preview, :add_attachment] |
|
123 | map.permission :edit_wiki_pages, :wiki => [:edit, :update, :preview, :add_attachment] | |
124 | map.permission :delete_wiki_pages_attachments, {} |
|
124 | map.permission :delete_wiki_pages_attachments, {} | |
125 | map.permission :protect_wiki_pages, {:wiki => :protect}, :require => :member |
|
125 | map.permission :protect_wiki_pages, {:wiki => :protect}, :require => :member | |
126 | end |
|
126 | end | |
127 |
|
127 | |||
128 | map.project_module :repository do |map| |
|
128 | map.project_module :repository do |map| | |
129 | map.permission :manage_repository, {:repositories => [:new, :create, :edit, :update, :committers, :destroy]}, :require => :member |
|
129 | map.permission :manage_repository, {:repositories => [:new, :create, :edit, :update, :committers, :destroy]}, :require => :member | |
130 | map.permission :browse_repository, {:repositories => [:show, :browse, :entry, :raw, :annotate, :changes, :diff, :stats, :graph]}, :read => true |
|
130 | map.permission :browse_repository, {:repositories => [:show, :browse, :entry, :raw, :annotate, :changes, :diff, :stats, :graph]}, :read => true | |
131 | map.permission :view_changesets, {:repositories => [:show, :revisions, :revision]}, :read => true |
|
131 | map.permission :view_changesets, {:repositories => [:show, :revisions, :revision]}, :read => true | |
132 | map.permission :commit_access, {} |
|
132 | map.permission :commit_access, {} | |
133 | map.permission :manage_related_issues, {:repositories => [:add_related_issue, :remove_related_issue]} |
|
133 | map.permission :manage_related_issues, {:repositories => [:add_related_issue, :remove_related_issue]} | |
134 | end |
|
134 | end | |
135 |
|
135 | |||
136 | map.project_module :boards do |map| |
|
136 | map.project_module :boards do |map| | |
137 | map.permission :manage_boards, {:boards => [:new, :create, :edit, :update, :destroy]}, :require => :member |
|
137 | map.permission :manage_boards, {:boards => [:new, :create, :edit, :update, :destroy]}, :require => :member | |
138 | map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :public => true, :read => true |
|
138 | map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :public => true, :read => true | |
139 | map.permission :add_messages, {:messages => [:new, :reply, :quote]} |
|
139 | map.permission :add_messages, {:messages => [:new, :reply, :quote]} | |
140 | map.permission :edit_messages, {:messages => :edit}, :require => :member |
|
140 | map.permission :edit_messages, {:messages => :edit}, :require => :member | |
141 | map.permission :edit_own_messages, {:messages => :edit}, :require => :loggedin |
|
141 | map.permission :edit_own_messages, {:messages => :edit}, :require => :loggedin | |
142 | map.permission :delete_messages, {:messages => :destroy}, :require => :member |
|
142 | map.permission :delete_messages, {:messages => :destroy}, :require => :member | |
143 | map.permission :delete_own_messages, {:messages => :destroy}, :require => :loggedin |
|
143 | map.permission :delete_own_messages, {:messages => :destroy}, :require => :loggedin | |
144 | end |
|
144 | end | |
145 |
|
145 | |||
146 | map.project_module :calendar do |map| |
|
146 | map.project_module :calendar do |map| | |
147 | map.permission :view_calendar, {:calendars => [:show, :update]}, :read => true |
|
147 | map.permission :view_calendar, {:calendars => [:show, :update]}, :read => true | |
148 | end |
|
148 | end | |
149 |
|
149 | |||
150 | map.project_module :gantt do |map| |
|
150 | map.project_module :gantt do |map| | |
151 | map.permission :view_gantt, {:gantts => [:show, :update]}, :read => true |
|
151 | map.permission :view_gantt, {:gantts => [:show, :update]}, :read => true | |
152 | end |
|
152 | end | |
153 | end |
|
153 | end | |
154 |
|
154 | |||
155 | Redmine::MenuManager.map :top_menu do |menu| |
|
155 | Redmine::MenuManager.map :top_menu do |menu| | |
156 | menu.push :home, :home_path |
|
156 | menu.push :home, :home_path | |
157 | menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? } |
|
157 | menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? } | |
158 | menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural |
|
158 | menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural | |
159 | menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true |
|
159 | menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true | |
160 | menu.push :help, Redmine::Info.help_url, :last => true |
|
160 | menu.push :help, Redmine::Info.help_url, :last => true | |
161 | end |
|
161 | end | |
162 |
|
162 | |||
163 | Redmine::MenuManager.map :account_menu do |menu| |
|
163 | Redmine::MenuManager.map :account_menu do |menu| | |
164 | menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? } |
|
164 | menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? } | |
165 |
menu.push :register, |
|
165 | menu.push :register, :register_path, :if => Proc.new { !User.current.logged? && Setting.self_registration? } | |
166 | menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? } |
|
166 | menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? } | |
167 | menu.push :logout, :signout_path, :if => Proc.new { User.current.logged? } |
|
167 | menu.push :logout, :signout_path, :if => Proc.new { User.current.logged? } | |
168 | end |
|
168 | end | |
169 |
|
169 | |||
170 | Redmine::MenuManager.map :application_menu do |menu| |
|
170 | Redmine::MenuManager.map :application_menu do |menu| | |
171 | # Empty |
|
171 | # Empty | |
172 | end |
|
172 | end | |
173 |
|
173 | |||
174 | Redmine::MenuManager.map :admin_menu do |menu| |
|
174 | Redmine::MenuManager.map :admin_menu do |menu| | |
175 | menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural |
|
175 | menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural | |
176 | menu.push :users, {:controller => 'users'}, :caption => :label_user_plural |
|
176 | menu.push :users, {:controller => 'users'}, :caption => :label_user_plural | |
177 | menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural |
|
177 | menu.push :groups, {:controller => 'groups'}, :caption => :label_group_plural | |
178 | menu.push :roles, {:controller => 'roles'}, :caption => :label_role_and_permissions |
|
178 | menu.push :roles, {:controller => 'roles'}, :caption => :label_role_and_permissions | |
179 | menu.push :trackers, {:controller => 'trackers'}, :caption => :label_tracker_plural |
|
179 | menu.push :trackers, {:controller => 'trackers'}, :caption => :label_tracker_plural | |
180 | menu.push :issue_statuses, {:controller => 'issue_statuses'}, :caption => :label_issue_status_plural, |
|
180 | menu.push :issue_statuses, {:controller => 'issue_statuses'}, :caption => :label_issue_status_plural, | |
181 | :html => {:class => 'issue_statuses'} |
|
181 | :html => {:class => 'issue_statuses'} | |
182 | menu.push :workflows, {:controller => 'workflows', :action => 'edit'}, :caption => :label_workflow |
|
182 | menu.push :workflows, {:controller => 'workflows', :action => 'edit'}, :caption => :label_workflow | |
183 | menu.push :custom_fields, {:controller => 'custom_fields'}, :caption => :label_custom_field_plural, |
|
183 | menu.push :custom_fields, {:controller => 'custom_fields'}, :caption => :label_custom_field_plural, | |
184 | :html => {:class => 'custom_fields'} |
|
184 | :html => {:class => 'custom_fields'} | |
185 | menu.push :enumerations, {:controller => 'enumerations'} |
|
185 | menu.push :enumerations, {:controller => 'enumerations'} | |
186 | menu.push :settings, {:controller => 'settings'} |
|
186 | menu.push :settings, {:controller => 'settings'} | |
187 | menu.push :ldap_authentication, {:controller => 'auth_sources', :action => 'index'}, |
|
187 | menu.push :ldap_authentication, {:controller => 'auth_sources', :action => 'index'}, | |
188 | :html => {:class => 'server_authentication'} |
|
188 | :html => {:class => 'server_authentication'} | |
189 | menu.push :plugins, {:controller => 'admin', :action => 'plugins'}, :last => true |
|
189 | menu.push :plugins, {:controller => 'admin', :action => 'plugins'}, :last => true | |
190 | menu.push :info, {:controller => 'admin', :action => 'info'}, :caption => :label_information_plural, :last => true |
|
190 | menu.push :info, {:controller => 'admin', :action => 'info'}, :caption => :label_information_plural, :last => true | |
191 | end |
|
191 | end | |
192 |
|
192 | |||
193 | Redmine::MenuManager.map :project_menu do |menu| |
|
193 | Redmine::MenuManager.map :project_menu do |menu| | |
194 | menu.push :overview, { :controller => 'projects', :action => 'show' } |
|
194 | menu.push :overview, { :controller => 'projects', :action => 'show' } | |
195 | menu.push :activity, { :controller => 'activities', :action => 'index' } |
|
195 | menu.push :activity, { :controller => 'activities', :action => 'index' } | |
196 | menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id, |
|
196 | menu.push :roadmap, { :controller => 'versions', :action => 'index' }, :param => :project_id, | |
197 | :if => Proc.new { |p| p.shared_versions.any? } |
|
197 | :if => Proc.new { |p| p.shared_versions.any? } | |
198 | menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural |
|
198 | menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural | |
199 | menu.push :new_issue, { :controller => 'issues', :action => 'new' }, :param => :project_id, :caption => :label_issue_new, |
|
199 | menu.push :new_issue, { :controller => 'issues', :action => 'new' }, :param => :project_id, :caption => :label_issue_new, | |
200 | :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } |
|
200 | :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } | |
201 | menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt |
|
201 | menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt | |
202 | menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar |
|
202 | menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar | |
203 | menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural |
|
203 | menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural | |
204 | menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural |
|
204 | menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural | |
205 | menu.push :wiki, { :controller => 'wiki', :action => 'show', :id => nil }, :param => :project_id, |
|
205 | menu.push :wiki, { :controller => 'wiki', :action => 'show', :id => nil }, :param => :project_id, | |
206 | :if => Proc.new { |p| p.wiki && !p.wiki.new_record? } |
|
206 | :if => Proc.new { |p| p.wiki && !p.wiki.new_record? } | |
207 | menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id, |
|
207 | menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id, | |
208 | :if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural |
|
208 | :if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural | |
209 | menu.push :files, { :controller => 'files', :action => 'index' }, :caption => :label_file_plural, :param => :project_id |
|
209 | menu.push :files, { :controller => 'files', :action => 'index' }, :caption => :label_file_plural, :param => :project_id | |
210 | menu.push :repository, { :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil }, |
|
210 | menu.push :repository, { :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil }, | |
211 | :if => Proc.new { |p| p.repository && !p.repository.new_record? } |
|
211 | :if => Proc.new { |p| p.repository && !p.repository.new_record? } | |
212 | menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true |
|
212 | menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true | |
213 | end |
|
213 | end | |
214 |
|
214 | |||
215 | Redmine::Activity.map do |activity| |
|
215 | Redmine::Activity.map do |activity| | |
216 | activity.register :issues, :class_name => %w(Issue Journal) |
|
216 | activity.register :issues, :class_name => %w(Issue Journal) | |
217 | activity.register :changesets |
|
217 | activity.register :changesets | |
218 | activity.register :news |
|
218 | activity.register :news | |
219 | activity.register :documents, :class_name => %w(Document Attachment) |
|
219 | activity.register :documents, :class_name => %w(Document Attachment) | |
220 | activity.register :files, :class_name => 'Attachment' |
|
220 | activity.register :files, :class_name => 'Attachment' | |
221 | activity.register :wiki_edits, :class_name => 'WikiContent::Version', :default => false |
|
221 | activity.register :wiki_edits, :class_name => 'WikiContent::Version', :default => false | |
222 | activity.register :messages, :default => false |
|
222 | activity.register :messages, :default => false | |
223 | activity.register :time_entries, :default => false |
|
223 | activity.register :time_entries, :default => false | |
224 | end |
|
224 | end | |
225 |
|
225 | |||
226 | Redmine::Search.map do |search| |
|
226 | Redmine::Search.map do |search| | |
227 | search.register :issues |
|
227 | search.register :issues | |
228 | search.register :news |
|
228 | search.register :news | |
229 | search.register :documents |
|
229 | search.register :documents | |
230 | search.register :changesets |
|
230 | search.register :changesets | |
231 | search.register :wiki_pages |
|
231 | search.register :wiki_pages | |
232 | search.register :messages |
|
232 | search.register :messages | |
233 | search.register :projects |
|
233 | search.register :projects | |
234 | end |
|
234 | end | |
235 |
|
235 | |||
236 | Redmine::WikiFormatting.map do |format| |
|
236 | Redmine::WikiFormatting.map do |format| | |
237 | format.register :textile, Redmine::WikiFormatting::Textile::Formatter, Redmine::WikiFormatting::Textile::Helper |
|
237 | format.register :textile, Redmine::WikiFormatting::Textile::Formatter, Redmine::WikiFormatting::Textile::Helper | |
238 | end |
|
238 | end | |
239 |
|
239 | |||
240 | ActionView::Template.register_template_handler :rsb, Redmine::Views::ApiTemplateHandler |
|
240 | ActionView::Template.register_template_handler :rsb, Redmine::Views::ApiTemplateHandler |
General Comments 0
You need to be logged in to leave comments.
Login now