Commit ee1191e8 authored by Valery Sizov's avatar Valery Sizov

Merge branch 'redirect_back_safari' into 'master'

HTTP_REFERER not properly set in Safari

https://gitlab.com/gitlab-org/gitlab-ee/issues/100

See merge request !71
parents 8feb2731 a7087cb9
......@@ -38,7 +38,7 @@ class Groups::HooksController < Groups::ApplicationController
flash[:alert] = 'Hook execution failed. Ensure the group has a project with commits.'
end
redirect_to :back
redirect_back_or_default(default: { action: 'index' })
end
def destroy
......
......@@ -14,16 +14,19 @@ class Groups::LdapGroupLinksController < Groups::ApplicationController
if request.referer && request.referer.include?('admin')
redirect_to [:admin, @group], notice: 'New LDAP link saved'
else
redirect_to :back, notice: 'New LDAP link saved'
redirect_back_or_default(default: { action: 'index' }, options: { notice: 'New LDAP link saved' })
end
else
redirect_to :back, alert: "Could not create new LDAP link: #{ldap_group_link.errors.full_messages * ', '}"
redirect_back_or_default(
default: { action: 'index' },
options: { alert: "Could not create new LDAP link: #{ldap_group_link.errors.full_messages * ', '}" }
)
end
end
def destroy
@group.ldap_group_links.where(id: params[:id]).destroy_all
redirect_to :back, notice: 'LDAP link removed'
redirect_back_or_default(default: { action: 'index' }, options: { notice: 'LDAP link removed' })
end
private
......
......@@ -9,6 +9,6 @@ class Projects::ApproversController < ApplicationController
project.approvers.find(params[:id]).destroy
end
redirect_to :back
redirect_back_or_default(default: { action: 'index' })
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment