before_filter :bf
def bf
- if Admin.count.to_i == 0
+ if Admin.count.to_i == 0 or License.count.to_i == 0
if params[:controller] == 'system' and params[:action] == 'start'
else
redirect_to :controller => '/system', :action => 'start'
end
end
+=begin
+ rescue_from ActiveRecord::RecordNotFound, :with => :render_404\r
+\r
+ private\r
+ def render_404(exception = nil)\r
+ if exception\r
+ logger.info "Rendering 404: #{exception.message}"\r
+ end\r
+ respond_to do |format|
+ format.html { \r
+ render :file => "#{Rails.root}/public/404.html", :status => 404, :layout => false\r
+}
+ format.json {
+ render :text => "404 found", :status => 404\r
+}
+ end\r
+ end\r
+=end \r
end