Merge branch 'master' of https://github.com/Rulingcom/orbit into ldap
Conflicts: Gemfile Gemfile.lock app/views/admin/attributes/_app_selector.html.erb app/views/admin/module_apps/_app_selector.html.erb app/views/admin/pages/_app_selector.html.erb config/application.rb vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb vendor/built_in_modules/new_blog/app/controllers/panel/new_blog/widget/posts_controller.rb vendor/built_in_modules/page_content/app/controllers/panel/page_content/front_end/page_contexts_controller.rb vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/front_end/web_links_controller.rb vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/widget/web_links_controller.rb
This commit is contained in:
commit
f55b3a4374
279 files changed
+6029
-5296
No files matched your search
@@ -1,5 +1,5 @@
|
||||
class Admin::AdBannersController < ApplicationController
|
||||
layout "admin"
|
||||
layout "new_admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
|
||||
@@ -10,11 +10,14 @@ class Admin::AdBannersController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
@ad_banner = AdBanner.find(params[:id])
|
||||
@ad_banners = AdBanner.all
|
||||
@active = AdBanner.find(params[:id])
|
||||
render :action => 'index'
|
||||
end
|
||||
|
||||
def new
|
||||
@ad_banner = AdBanner.new
|
||||
@ad_banners = AdBanner.all
|
||||
render :action => 'index',:params => 'new'
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -36,8 +39,13 @@ class Admin::AdBannersController < ApplicationController
|
||||
redirect_to admin_ad_banners_url
|
||||
end
|
||||
|
||||
def destroy_ad_image
|
||||
|
||||
end
|
||||
|
||||
def index
|
||||
@ad_banners = AdBanner.all
|
||||
@active = @ad_banners.first
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,47 @@
|
||||
class Admin::AdImagesController < ApplicationController
|
||||
layout 'new_admin'
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
|
||||
def edit
|
||||
@ad_banner = AdBanner.find params[:ad_banner_id]
|
||||
@ad_image = @ad_banner.ad_images.find params[:id]
|
||||
end
|
||||
|
||||
def update
|
||||
@ad_banner = AdBanner.find params[:ad_banner_id]
|
||||
@ad_image = AdImage.find params[:id]
|
||||
@ad_image.update_attributes(params[:ad_image])
|
||||
@ad_image.to_save = true
|
||||
@ad_image.save!
|
||||
redirect_to admin_ad_banner_path @ad_banner
|
||||
end
|
||||
|
||||
def new
|
||||
@ad_image =AdImage.new
|
||||
#render :action => 'new',:url=> {:ad_banner_id => params.has_key?(:ad_banner_id)? params[:ad_banner_id],nil}
|
||||
end
|
||||
|
||||
def create
|
||||
@ad_banner = AdBanner.find params[:ad_banner][:id]
|
||||
ad_image = AdImage.new params[:ad_image]
|
||||
ad_image.to_save = true
|
||||
@ad_banner.ad_images << ad_image
|
||||
|
||||
if @ad_banner.save!
|
||||
redirect_to admin_ad_banner_path @ad_banner
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def destroy
|
||||
@ad_banner = AdBanner.find params[:ad_banner_id]
|
||||
@ad_image = @ad_banner.ad_images.find params[:id]
|
||||
if @ad_image.destroy
|
||||
flash[:notice] = t('admin.success_destroy_ad_image')
|
||||
redirect_to admin_ad_banner_path @ad_banner
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -1,8 +1,7 @@
|
||||
class Admin::ObjectAuthsController < ApplicationController
|
||||
include OrbitCoreLib::PermissionUnility
|
||||
layout "admin"
|
||||
before_filter :authenticate_user!
|
||||
before_filter :check_if_user_can_do_object_auth
|
||||
before_filter :force_order
|
||||
# before_filter :is_admin? ,:only => :index
|
||||
|
||||
|
||||
@@ -84,6 +83,12 @@ class Admin::ObjectAuthsController < ApplicationController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def force_order
|
||||
authenticate_user!
|
||||
check_if_user_can_do_object_auth
|
||||
end
|
||||
|
||||
def check_if_user_can_do_object_auth
|
||||
unless check_permission(:manager)
|
||||
render :nothing => true, :status => 403
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
class SessionsController < Devise::SessionsController
|
||||
|
||||
def create
|
||||
super
|
||||
reset_session
|
||||
end
|
||||
|
||||
end
|
||||
@@ -47,7 +47,7 @@ class ApplicationController < ActionController::Base
|
||||
# Render the page
|
||||
def render_page(id = nil)
|
||||
if @item
|
||||
render :text => parse_page(@item, id)
|
||||
render :text => process_page(@item, id), :layout => 'page_layout'
|
||||
else
|
||||
render :text => '404 Not Found'
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ require 'mongo'
|
||||
class GridfsController < ActionController::Metal
|
||||
|
||||
def serve
|
||||
gridfs_path = env["PATH_INFO"].gsub("/gridfs/", "")
|
||||
gridfs_path = env["PATH_INFO"].gsub("/gridfs/", "").force_encoding("UTF-8")
|
||||
begin
|
||||
gridfs_file = Mongo::GridFileSystem.new(Mongoid.database).open(gridfs_path, 'r')
|
||||
self.response_body = gridfs_file.read
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
class OrbitBackendController< ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
before_filter :force_order,:except => [:public]
|
||||
before_filter :setup_vars
|
||||
# before_filter {|c| c.front_end_available(@app_title)}
|
||||
before_filter :check_user_can_use,:except => [:public]
|
||||
# before_filter :check_user_can_use
|
||||
include OrbitCoreLib::PermissionUnility
|
||||
include AdminHelper
|
||||
|
||||
layout 'admin'
|
||||
layout 'new_admin'
|
||||
|
||||
def setup_vars
|
||||
@app_title = request.fullpath.split('/')[2]
|
||||
@@ -14,6 +15,11 @@ class OrbitBackendController< ApplicationController
|
||||
|
||||
private
|
||||
|
||||
def force_order
|
||||
authenticate_user!
|
||||
check_user_can_use
|
||||
end
|
||||
|
||||
def check_user_can_use
|
||||
unless check_permission
|
||||
redirect_to polymorphic_path(['panel',@app_title,'back_end','public'])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class OrbitFrontendComponentController< ApplicationController
|
||||
before_filter :setup_vars
|
||||
before_filter {|c| c.front_end_available(@app_title)}
|
||||
layout 'module_widget'
|
||||
layout :false
|
||||
|
||||
def setup_vars
|
||||
@app_title = request.fullpath.split('/')[2]
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
class PagesController < ApplicationController
|
||||
|
||||
include ApplicationHelper
|
||||
|
||||
before_filter :get_item, :only => [:index_from_link, :show_from_link]
|
||||
|
||||
def index
|
||||
@@ -30,7 +32,11 @@ class PagesController < ApplicationController
|
||||
end
|
||||
|
||||
def index_from_link
|
||||
redirect_to "/#{@item.full_name}"
|
||||
if params[:page]
|
||||
redirect_to "/#{@item.full_name}?page=#{params[:page]}"
|
||||
else
|
||||
redirect_to "/#{@item.full_name}"
|
||||
end
|
||||
end
|
||||
|
||||
def show_from_link
|
||||
|
||||
Reference in new issue
Block a user