Class: Phcscriptcdnpro::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Phcscriptcdnpro::ApplicationController
- Defined in:
- app/controllers/phcscriptcdnpro/application_controller.rb
Direct Known Subclasses
Script::AuthorsController, Script::ExtensionsController, Script::LicencesController, Script::ListingsController, Script::UrlsController, Script::VersionsController
Instance Method Summary collapse
- #current_user ⇒ Object
-
#get_member_profile_info ⇒ Object
Grab Member Information.
- #membership_info ⇒ Object
- #new_login_url ⇒ Object
-
#phcpress_recent_posts ⇒ Object
PHCPress Widget Helpers.
-
#require_user ⇒ Object
AuthRocket User Helpers.
Instance Method Details
#current_user ⇒ Object
24 25 26 |
# File 'app/controllers/phcscriptcdnpro/application_controller.rb', line 24 def current_user @_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user) end |
#get_member_profile_info ⇒ Object
Grab Member Information
11 12 13 |
# File 'app/controllers/phcscriptcdnpro/application_controller.rb', line 11 def get_member_profile_info @members_profile_info = Member::Profile.find(params[:profile_id]) end |
#membership_info ⇒ Object
34 35 36 |
# File 'app/controllers/phcscriptcdnpro/application_controller.rb', line 34 def membership_info AuthRocket::Membership.all(user_id: current_user.id).first end |
#new_login_url ⇒ Object
29 30 31 |
# File 'app/controllers/phcscriptcdnpro/application_controller.rb', line 29 def new_login_url ENV['AUTHROCKET_LOGIN_URL'] end |
#phcpress_recent_posts ⇒ Object
PHCPress Widget Helpers
44 45 46 |
# File 'app/controllers/phcscriptcdnpro/application_controller.rb', line 44 def phcpress_recent_posts @recent_posts = Phcpresspro::Articles::Post.all end |
#require_user ⇒ Object
AuthRocket User Helpers
16 17 18 19 20 21 22 |
# File 'app/controllers/phcscriptcdnpro/application_controller.rb', line 16 def require_user unless current_user params.permit! session[:last_url] = request.get? ? url_for(params) : url_for redirect_to new_login_url end end |