Class: CamaleonCms::CamaleonController

Inherits:
ApplicationController
  • Object
show all
Includes:
CamaleonHelper, CaptchaHelper, ContentHelper, EmailHelper, HooksHelper, HtmlHelper, PluginsHelper, SessionHelper, ShortCodeHelper, SiteHelper, ThemeHelper, UploaderHelper, UserRolesHelper, Mobu::DetectMobile
Defined in:
app/controllers/camaleon_cms/camaleon_controller.rb

Instance Method Summary collapse

Methods included from EmailHelper

#cama_send_email, #send_email, #send_password_reset_email, #send_user_confirm_email

Methods included from HooksHelper

#hook_run, #hook_skip, #hooks_run

Methods included from UploaderHelper

#cama_crop_image, #cama_file_path_to_url, #cama_resize_and_crop, #cama_resize_upload, #cama_tmp_upload, #cama_uploader, #cama_uploader_generate_thumbnail, #cama_url_to_file_path, #upload_file, #uploader_verify_name

Methods included from CaptchaHelper

#cama_captcha_build, #cama_captcha_increment_attack, #cama_captcha_reset_attack, #cama_captcha_tag, #cama_captcha_tags_if_under_attack, #cama_captcha_total_attacks, #cama_captcha_under_attack?, #cama_captcha_verified?, #captcha_verify_if_under_attack

Methods included from ContentHelper

#cama_content_after_draw, #cama_content_append, #cama_content_before_draw, #cama_content_init, #cama_content_prepend

Methods included from ThemeHelper

#self_theme_key, #theme_asset_file_path, #theme_asset_path, #theme_asset_url, #theme_init, #theme_layout, #theme_view

Methods included from PluginsHelper

#current_plugin, #plugin_asset_path, #plugin_asset_url, #plugin_destroy, #plugin_install, #plugin_layout, #plugin_load_helpers, #plugin_uninstall, #plugin_upgrade, #plugin_view, #plugins_initialize, #self_plugin_key

Methods included from ShortCodeHelper

#cama_strip_shortcodes, #do_shortcode, #render_shortcode, #shortcode_add, #shortcode_change_template, #shortcode_delete, #shortcodes_init

Methods included from UserRolesHelper

#cama_get_roles_values

Methods included from HtmlHelper

#append_asset_content, #append_asset_libraries, #append_pre_asset_content, #cama_assets_library_register, #cama_draw_custom_assets, #cama_draw_pre_asset_contents, #cama_get_options_html_from_items, #cama_html_helpers_init, #cama_html_tooltip, #cama_load_libraries

Methods included from SiteHelper

#cama_get_list_layouts_files, #cama_get_list_template_files, #current_locale, #current_site, #current_theme, #site_after_install, #site_install_theme, #site_uninstall_theme

Methods included from SessionHelper

#cama_authenticate, #cama_current_role, #cama_current_user, #cama_get_session_id, #cama_logout_user, #cama_on_heroku?, #cama_register_user, #cama_sign_in?, #login_user, #login_user_with_password, #session_back_to_parent, #session_switch_user

Methods included from CamaleonHelper

#cama_cache_fetch, #cama_draw_timer, #cama_edit_link, #cama_is_admin_request?, #cama_requestAction, #cama_sitemap_cats_generator, #ct

Instance Method Details

#captchaObject

generate captcha image



41
42
43
44
# File 'app/controllers/camaleon_cms/camaleon_controller.rb', line 41

def captcha
  image = cama_captcha_build(params[:len])
  send_data image.to_blob, :type => image.mime_type, :disposition => 'inline'
end

#render_error(status = 404, exception = nil, message = "") ⇒ Object

show page error



33
34
35
36
37
38
# File 'app/controllers/camaleon_cms/camaleon_controller.rb', line 33

def render_error(status = 404, exception = nil, message = "")
  Rails.logger.info "======url: #{request.original_url rescue nil}======message: #{exception.message if exception.present?}====#{params[:error_msg]}========#{caller.inspect}"
  @message = "#{message} #{params[:error_msg] || (exception.present? ? "#{exception.message}<br><br>#{caller.inspect}" : "")}"
  @message = "" if Rails.env == "production"
  render "camaleon_cms/#{status}", :status => status
end