app/controllers/anoubis/core/application_controller.rb
##
# Sets default parameters for application controller.
Sets default parameters for application controller.
Sets default parameters for application controller .
def anubis_core_initialization
    self.version = 0
    if defined? params
      self.etc = Anoubis::Etc::Base.new({ params: params })
    else
      self.etc = Anoubis::Etc::Base.new
    end
    self.output = nil
    self.exports = nil
    self.writer = false
    self.current_user = nil
    self.locale = params[:locale] if params.has_key? :locale
    self.locale = 'ru' unless self.locale
    self.locale = 'ru' if self.locale == ''
    begin
      I18n.locale = self.locale
    rescue
      I18n.locale = 'ru'
    end
    return if request.method == 'OPTIONS'
    if !params.has_key? :version
      self.error_exit({ error: I18n.t('errors.no_api_version') })
      return
    end
    if self.access_allowed?
      self.set_access_control_headers
    else
      self.error_exit({ error: I18n.t('errors.access_not_allowed') })
    end
    self.version = params[:version]
    if self.authenticate?
      if self.authentication
        if self.check_menu_access?
          return if !self.menu_access params[:controller]
        end
      end
    end
    Time.zone = self.current_user.timezone if self.current_user
    self.after_initialization
  end
def anubis_core_initialization self . version = 0 if defined? params self . etc = Anoubis :: Etc :: Base . new ( { params : params } ) else self . etc = Anoubis :: Etc :: Base . new end self . output = nil self . exports = nil self . writer = false self . current_user = nil self . locale = params [ :locale ] if params . has_key? :locale self . locale = 'ru' unless self . locale self . locale = 'ru' if self . locale == '' begin I18n . locale = self . locale rescue I18n . locale = 'ru' end return if request . method == 'OPTIONS' if ! params . has_key? :version self . error_exit ( { error : I18n . t ( 'errors.no_api_version' ) } ) return end if self . access_allowed? self . set_access_control_headers else self . error_exit ( { error : I18n . t ( 'errors.access_not_allowed' ) } ) end self . version = params [ :version ] if self . authenticate? if self . authentication if self . check_menu_access? return if ! self . menu_access params [ :controller ] end end end Time . zone = self . current_user . timezone if self . current_user self . after_initialization end
Sets default parameters for application controller.
Sets default parameters for application controller .
#self.user_time_zone if self.current_user