summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/redmine/files')
-rw-r--r--www-apps/redmine/files/no_ldap-2.2.2.patch11
-rw-r--r--www-apps/redmine/files/no_ldap-2.2.4.patch11
-rw-r--r--www-apps/redmine/files/no_ldap-2.3.0.patch11
-rw-r--r--www-apps/redmine/files/openid.patch270
-rw-r--r--www-apps/redmine/files/simple_captcha.patch77
5 files changed, 380 insertions, 0 deletions
diff --git a/www-apps/redmine/files/no_ldap-2.2.2.patch b/www-apps/redmine/files/no_ldap-2.2.2.patch
new file mode 100644
index 0000000..ad654be
--- /dev/null
+++ b/www-apps/redmine/files/no_ldap-2.2.2.patch
@@ -0,0 +1,11 @@
+--- lib/redmine.rb.old 2013-02-03 19:09:11.267220350 +0400
++++ lib/redmine.rb 2013-02-03 19:09:17.992220522 +0400
+@@ -186,8 +186,6 @@
+ :html => {:class => 'custom_fields'}
+ menu.push :enumerations, {:controller => 'enumerations'}
+ menu.push :settings, {:controller => 'settings'}
+- menu.push :ldap_authentication, {:controller => 'auth_sources', :action => 'index'},
+- :html => {:class => 'server_authentication'}
+ menu.push :plugins, {:controller => 'admin', :action => 'plugins'}, :last => true
+ menu.push :info, {:controller => 'admin', :action => 'info'}, :caption => :label_information_plural, :last => true
+ end
diff --git a/www-apps/redmine/files/no_ldap-2.2.4.patch b/www-apps/redmine/files/no_ldap-2.2.4.patch
new file mode 100644
index 0000000..ad654be
--- /dev/null
+++ b/www-apps/redmine/files/no_ldap-2.2.4.patch
@@ -0,0 +1,11 @@
+--- lib/redmine.rb.old 2013-02-03 19:09:11.267220350 +0400
++++ lib/redmine.rb 2013-02-03 19:09:17.992220522 +0400
+@@ -186,8 +186,6 @@
+ :html => {:class => 'custom_fields'}
+ menu.push :enumerations, {:controller => 'enumerations'}
+ menu.push :settings, {:controller => 'settings'}
+- menu.push :ldap_authentication, {:controller => 'auth_sources', :action => 'index'},
+- :html => {:class => 'server_authentication'}
+ menu.push :plugins, {:controller => 'admin', :action => 'plugins'}, :last => true
+ menu.push :info, {:controller => 'admin', :action => 'info'}, :caption => :label_information_plural, :last => true
+ end
diff --git a/www-apps/redmine/files/no_ldap-2.3.0.patch b/www-apps/redmine/files/no_ldap-2.3.0.patch
new file mode 100644
index 0000000..ad654be
--- /dev/null
+++ b/www-apps/redmine/files/no_ldap-2.3.0.patch
@@ -0,0 +1,11 @@
+--- lib/redmine.rb.old 2013-02-03 19:09:11.267220350 +0400
++++ lib/redmine.rb 2013-02-03 19:09:17.992220522 +0400
+@@ -186,8 +186,6 @@
+ :html => {:class => 'custom_fields'}
+ menu.push :enumerations, {:controller => 'enumerations'}
+ menu.push :settings, {:controller => 'settings'}
+- menu.push :ldap_authentication, {:controller => 'auth_sources', :action => 'index'},
+- :html => {:class => 'server_authentication'}
+ menu.push :plugins, {:controller => 'admin', :action => 'plugins'}, :last => true
+ menu.push :info, {:controller => 'admin', :action => 'info'}, :caption => :label_information_plural, :last => true
+ end
diff --git a/www-apps/redmine/files/openid.patch b/www-apps/redmine/files/openid.patch
new file mode 100644
index 0000000..2d2644c
--- /dev/null
+++ b/www-apps/redmine/files/openid.patch
@@ -0,0 +1,270 @@
+--- app/controllers/account_controller.rb
++++ app/controllers/account_controller.rb
+@@ -29,11 +29,34 @@ class AccountController < ApplicationController
+ self.logged_user = nil
+ else
+ # Authenticate user
+- if Setting.openid? && using_open_id?
+- open_id_authenticate(params[:openid_url])
+- else
+- password_authentication
++ password_authentication
++ end
++ end
++
++ def openid_login
++ if !Setting.openid?
++ render_404
++ end
++ if Setting.openid_only?
++ open_id_authenticate('iduser.net')
++ return
++ end
++ @server = '0'
++ if request.get?
++ # Logout user
++ self.logged_user = nil
++ elsif using_open_id?
++ # Authenticate user
++ if params[:server]
++ if params[:server] == '0'
++ params[:openid_url] = 'iduser.net'
++ elsif !simple_captcha_valid?
++ flash.now[:error] = l(:notice_account_invalid_captcha)
++ @server = params[:server]
++ return
++ end
+ end
++ open_id_authenticate(params[:openid_url])
+ end
+ end
+
+@@ -153,7 +176,7 @@ class AccountController < ApplicationController
+
+
+ def open_id_authenticate(openid_url)
+- authenticate_with_open_id(openid_url, :required => [:nickname, :fullname, :email], :return_to => signin_url) do |result, identity_url, registration|
++ authenticate_with_open_id(openid_url, :required => [:nickname, :fullname, :email], :return_to => url_for(:action => 'openid_login')) do |result, identity_url, registration|
+ if result.successful?
+ user = User.find_or_initialize_by_identity_url(identity_url)
+ if user.new_record?
+--- app/models/setting.rb
++++ app/models/setting.rb
+@@ -143,6 +143,10 @@ class Setting < ActiveRecord::Base
+ def self.openid?
+ Object.const_defined?(:OpenID) && self[:openid].to_i > 0
+ end
++
++ def self.openid_only?
++ Object.const_defined?(:OpenID) && self[:openid_only].to_i > 0
++ end
+
+ # Checks if settings have changed since the values were read
+ # and clears the cache hash if it's the case
+--- app/views/account/login.rhtml
++++ app/views/account/login.rhtml
+@@ -10,12 +10,6 @@
+ <td align="right"><label for="password"><%=l(:field_password)%>:</label></td>
+ <td align="left"><%= password_field_tag 'password', nil, :tabindex => '2' %></td>
+ </tr>
+-<% if Setting.openid? %>
+-<tr>
+- <td align="right"><label for="openid_url"><%=l(:field_identity_url)%></label></td>
+- <td align="left"><%= text_field_tag "openid_url", nil, :tabindex => '3' %></td>
+-</tr>
+-<% end %>
+ <tr>
+ <td></td>
+ <td align="left">
+--- app/views/settings/_authentication.rhtml
++++ app/views/settings/_authentication.rhtml
+@@ -29,6 +29,11 @@
+ <%= hidden_field_tag 'settings[openid]', 0 %>
+ <%= check_box_tag 'settings[openid]', 1, Setting.openid?, :disabled => !Object.const_defined?(:OpenID) %>
+ </p>
++
++<p><label><%= l(:setting_openid_only) %></label>
++<%= hidden_field_tag 'settings[openid_only]', 0 %>
++<%= check_box_tag 'settings[openid_only]', 1, Setting.openid_only?, :disabled => !Object.const_defined?(:OpenID) %>
++</p>
+ </div>
+
+ <div style="float:right;">
+--- config/locales/en.yml
++++ config/locales/en.yml
+@@ -125,6 +125,7 @@ en:
+
+ notice_account_updated: Account was successfully updated.
+ notice_account_invalid_creditentials: Invalid user or password
++ notice_account_invalid_captcha: You did not enter the correct code. Please try again.
+ notice_account_password_updated: Password was successfully updated.
+ notice_account_wrong_password: Wrong password
+ notice_account_register_done: Account was successfully created. To activate your account, click on the link that was emailed to you.
+@@ -265,6 +266,9 @@ en:
+ field_editable: Editable
+ field_watcher: Watcher
+ field_identity_url: OpenID URL
++ field_login_with: Sign In with a
++ field_other_openid: other OpenID
++ field_captcha_valid: Verification
+ field_content: Content
+ field_group_by: Group results by
+
+@@ -311,6 +315,7 @@ en:
+ setting_file_max_size_displayed: Max size of text files displayed inline
+ setting_repository_log_display_limit: Maximum number of revisions displayed on file log
+ setting_openid: Allow OpenID login and registration
++ setting_openid_only: Allow only OpenID
+ setting_password_min_length: Minimum password length
+ setting_new_project_user_role_id: Role given to a non-admin user who creates a project
+ setting_default_projects_modules: Default enabled modules for new projects
+@@ -425,6 +430,7 @@ en:
+ label_information_plural: Information
+ label_please_login: Please log in
+ label_register: Register
++ label_openid_register: Register OpenID
+ label_login_with_open_id_option: or login with OpenID
+ label_password_lost: Lost password
+ label_home: Home
+@@ -433,6 +438,7 @@ en:
+ label_my_projects: My projects
+ label_administration: Administration
+ label_login: Sign in
++ label_openid_login: Sign in with OpenID
+ label_logout: Sign out
+ label_help: Help
+ label_reported_issues: Reported issues
+--- config/locales/ru.yml
++++ config/locales/ru.yml
+@@ -315,6 +315,9 @@ ru:
+ field_hours: час(а,ов)
+ field_identifier: Уникальный идентификатор
+ field_identity_url: OpenID URL
++ field_login_with: Войти как
++ field_other_openid: другой OpenID
++ field_captcha_valid: Проверка
+ field_is_closed: Задача закрыта
+ field_is_default: Значение по умолчанию
+ field_is_filter: Используется в качестве фильтра
+@@ -543,6 +546,7 @@ ru:
+ label_loading: Загрузка...
+ label_logged_as: Вошел как
+ label_login: Войти
++ label_openid_login: Вход с помощью OpenID
+ label_login_with_open_id_option: или войти с помощью OpenID
+ label_logout: Выйти
+ label_max_size: Максимальный размер
+@@ -616,6 +620,7 @@ ru:
+ label_query_plural: Сохраненные запросы
+ label_read: Чтение...
+ label_register: Регистрация
++ label_openid_register: Регистрация OpenID
+ label_registered_on: Зарегистрирован(а)
+ label_registration_activation_by_email: активация учетных записей по email
+ label_registration_automatic_activation: автоматическая активация учетных записей
+@@ -736,6 +740,7 @@ ru:
+
+ notice_account_activated: Ваша учетная запись активирована. Вы можете войти.
+ notice_account_invalid_creditentials: Неправильное имя пользователя или пароль
++ notice_account_invalid_captcha: Вы ввели не верный код. Пожалуйста, попробуйте еще раз.
+ notice_account_lost_email_sent: Вам отправлено письмо с инструкциями по выбору нового пароля.
+ notice_account_password_updated: Пароль успешно обновлен.
+ notice_account_pending: "Ваша учетная запись уже создана и ожидает подтверждения администратора."
+@@ -846,6 +851,7 @@ ru:
+ setting_mail_handler_api_enabled: Включить веб-сервис для входящих сообщений
+ setting_mail_handler_api_key: API ключ
+ setting_openid: Разрешить OpenID для входа и регистрации
++ setting_openid_only: Разрешить только OpenID
+ setting_per_page_options: Количество строк на страницу
+ setting_plain_text_mail: Только простой текст (без HTML)
+ setting_protocol: Протокол
+--- config/settings.yml
++++ config/settings.yml
+@@ -168,5 +168,7 @@ gravatar_enabled:
+ default: 0
+ openid:
+ default: 0
++openid_only:
++ default: 0
+ gravatar_default:
+ default: ''
+--- lib/redmine.rb
++++ lib/redmine.rb
+@@ -124,8 +124,9 @@ Redmine::MenuManager.map :top_menu do |menu|
+ end
+
+ Redmine::MenuManager.map :account_menu do |menu|
+- menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? }
+- menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? }
++ menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? && !Setting.openid_only?}
++ menu.push :openid_login, { :controller => 'account', :action => 'openid_login' }, :if => Proc.new { !User.current.logged? && Setting.openid?}
++ menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? && !Setting.openid_only? }
+ menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? }
+ menu.push :logout, :signout_path, :if => Proc.new { User.current.logged? }
+ end
+--- vendor/plugins/open_id_authentication/lib/open_id_authentication.rb
++++ vendor/plugins/open_id_authentication/lib/open_id_authentication.rb
+@@ -118,7 +118,7 @@ module OpenIdAuthentication
+ # because that's what the specification dictates in order to get browser auto-complete working across sites
+ def using_open_id?(identity_url = nil) #:doc:
+ identity_url ||= params[:openid_identifier] || params[:openid_url]
+- !identity_url.blank? || params[:open_id_complete]
++ !identity_url.blank? || params[:server] || params[:open_id_complete]
+ end
+
+ def authenticate_with_open_id(identity_url = nil, options = {}, &block) #:doc:
+--- /dev/null
++++ app/views/account/openid_login.rhtml
+@@ -0,0 +1,52 @@
++<div id="login-form">
++<% form_tag({:action=> "openid_login"}) do %>
++<%= back_url_hidden_field_tag %>
++<table style="width: 400px">
++<tr>
++ <td align="right" style="width: 100px"><label for="server"><%=l(:field_login_with)%></label></td>
++ <td>
++<%= select_tag 'server',
++ options_for_select( [['iduser.net', "0"],
++ [l(:field_other_openid), "1"],
++ ], @server ) %>
++ <input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/>
++ </td>
++</tr>
++<tbody id="other_ident"<% if @server != '1' %> style="display:none"<% end %>>
++<tr>
++ <td align="right"><label for="openid_url"><%=l(:field_identity_url)%>:</label></td>
++ <td align="left"><input id="openid_url" name="openid_url" type="text" /></td>
++</tr>
++<tr>
++ <td align="right"><label for="captcha"><%=l(:field_captcha_valid)%>:</label></td>
++ <td align="left"><%= show_simple_captcha(:label => '') %></td>
++</tr>
++</tbody>
++<tr>
++ <td></td>
++ <td align="left">
++ <% if Setting.autologin? %>
++ <label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label>
++ <% end %>
++ </td>
++</tr>
++<tr>
++ <td align="left">
++ </td>
++ <td align="right">
++ <%= link_to l(:label_openid_register), 'http://iduser.net/register/' %>
++ </td>
++</tr>
++<script type="text/javascript">
++$('server').observe('change', function () {
++ var vl = this.value;
++ if (vl == 0) {
++ $('other_ident').hide();
++ } else if (vl == 1) {
++ $('other_ident').show();
++ }
++});
++</script>
++</table>
++</div>
++<% end %>
diff --git a/www-apps/redmine/files/simple_captcha.patch b/www-apps/redmine/files/simple_captcha.patch
new file mode 100644
index 0000000..7ab0de3
--- /dev/null
+++ b/www-apps/redmine/files/simple_captcha.patch
@@ -0,0 +1,77 @@
+--- app/controllers/application_controller.rb
++++ app/controllers/application_controller.rb
+@@ -19,6 +19,7 @@ require 'uri'
+ require 'cgi'
+
+ class ApplicationController < ActionController::Base
++ include SimpleCaptcha::ControllerHelpers
+ include Redmine::I18n
+
+ layout 'base'
+--- config/routes.rb
++++ config/routes.rb
+@@ -269,4 +269,6 @@ ActionController::Routing::Routes.draw do |map|
+ map.connect 'robots.txt', :controller => 'welcome', :action => 'robots'
+ # Used for OpenID
+ map.root :controller => 'account', :action => 'login'
++ # Captcha
++ map.simple_captcha '/simple_captcha/:action', :controller => 'simple_captcha'
+ end
+--- vendor/plugins/simple_captcha/lib/simple_captcha_config.rb
++++ vendor/plugins/simple_captcha/lib/simple_captcha_config.rb
+@@ -12,7 +12,7 @@ module SimpleCaptcha #:nodoc
+ end
+
+ def simple_captcha_key #:nodoc
+- session[:simple_captcha] ||= Digest::SHA1.hexdigest(Time.now.to_s + session.session_id.to_s)
++ session[:simple_captcha] ||= Digest::SHA1.hexdigest(Time.now.to_s)
+ end
+
+ def simple_captcha_value(key = simple_captcha_key) #:nodoc
+--- app/controllers/account_controller.rb
++++ app/controllers/account_controller.rb
+@@ -92,6 +92,7 @@ class AccountController < ApplicationController
+ @user = User.new(params[:user])
+ @user.admin = false
+ @user.status = User::STATUS_REGISTERED
++ captcha_valid = simple_captcha_valid?
+ if session[:auth_source_registration]
+ @user.status = User::STATUS_ACTIVE
+ @user.login = session[:auth_source_registration][:login]
+@@ -106,13 +107,18 @@ class AccountController < ApplicationController
+ @user.login = params[:user][:login]
+ @user.password, @user.password_confirmation = params[:password], params[:password_confirmation]
+
+- case Setting.self_registration
+- when '1'
+- register_by_email_activation(@user)
+- when '3'
+- register_automatically(@user)
++ if !captcha_valid
++ @user.valid?
++ @user.errors.add :base, l(:notice_account_invalid_captcha)
+ else
+- register_manually_by_administrator(@user)
++ case Setting.self_registration
++ when '1'
++ register_by_email_activation(@user)
++ when '3'
++ register_automatically(@user)
++ else
++ register_manually_by_administrator(@user)
++ end
+ end
+ end
+ end
+--- app/views/account/register.rhtml
++++ app/views/account/register.rhtml
+@@ -37,6 +37,9 @@
+ <% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %>
+ <p><%= custom_field_tag_with_label :user, value %></p>
+ <% end %>
++
++<p><span><label for="captcha"><%=l(:field_captcha_valid)%> <span class="required">*</span></label>
++<%= show_simple_captcha(:label => '') %></span></p>
+ <!--[eoform:user]-->
+ </div>
+