MS DC; admins are now always redirected to new profile

This commit is contained in:
Dennis Collinson 2012-04-24 17:18:05 -07:00
parent 87fb922804
commit 340411f17c
3 changed files with 26 additions and 9 deletions

1
.powenv Normal file
View file

@ -0,0 +1 @@
export NEW_HOTNESS=yessir

View file

@ -81,15 +81,12 @@ class PeopleController < ApplicationController
def show def show
@person = Person.find_from_guid_or_username(params) @person = Person.find_from_guid_or_username(params)
flag = FeatureFlagger.new(current_user)
if remote_profile_with_no_user_session? raise(ActiveRecord::RecordNotFound) if remote_profile_with_no_user_session?
raise ActiveRecord::RecordNotFound return redirect_to :back, :notice => t("people.show.closed_account") if @person.closed_account?
end return redirect_to person_path(@person) if params[:ex] && !flag.new_profile?
return redirect_to person_path(@person, :ex => true) if !params[:ex] && flag.new_profile? && flag.new_hotness?
if @person.closed_account?
redirect_to :back, :notice => t("people.show.closed_account")
return
end
@post_type = :all @post_type = :all
@aspect = :profile @aspect = :profile

View file

@ -4,6 +4,25 @@ class FeatureFlagger
end end
def new_publisher? def new_publisher?
@current_user.admin? || !(Rails.env.production? || Rails.env.staging?) admin? || developer?
end end
def new_profile?
admin?
end
def new_hotness?
ENV["NEW_HOTNESS"]
end
protected
def developer?
!(Rails.env.production? || Rails.env.staging?) #includes test, cucumber, or developer
end
def admin?
@current_user.try(:admin?)
end
end end