mailr/app/controllers/prefs_controller.rb
Wojciech Todryk fdd3019f55 devel
2011-09-03 13:07:40 +02:00

48 lines
920 B
Ruby
Executable file

class PrefsController < ApplicationController
before_filter :check_current_user,:selected_folder
before_filter :get_current_folders
before_filter :get_prefs, :only => [:look,:update_look]
theme :theme_resolver
def update_look
if params[:prefs]
@prefs.update_attributes(params[:prefs])
end
redirect_to :action => 'look'
end
def update_servers
redirect_to :action => 'servers'
end
def update_identity
if params[:user]
@current_user.update_attributes(params[:user])
end
redirect_to :action => 'identity'
end
def look
end
def identity
@identity = @curent_user
end
def servers
@servers = @current_user.servers
end
############################# protected section ##################################
def get_prefs
@prefs = @current_user.prefs
end
end