webs 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  require 'rake'
4
4
  require 'echoe'
5
5
 
6
- Echoe.new('webs', '0.1.2') do |p|
6
+ Echoe.new('webs', '0.1.3') do |p|
7
7
  p.description = "Reusable webs stuff."
8
8
  p.url = "https://colczak@github.com/websdev/websgem.git"
9
9
  p.author = "Chuck Olczak"
@@ -29,10 +29,19 @@ module Webs
29
29
  Digest::MD5.hexdigest(webs_auth_string + secret)
30
30
  end
31
31
 
32
- def require_valid_user
32
+ # FILTERS
33
+ def validate_webs_session
33
34
  render :text => "Access Denied: Webs::SECRET not defined." and return(false) unless defined?( Webs::SECRET )
34
35
  render :text => "Access Denied" and return(false) unless fw_sig == webs_auth( Webs::SECRET )
35
36
  end
37
+
38
+ def require_webs_user
39
+ render( :text => "<fw:require-login />" ) unless !fw_sig_user.blank? && fw_sig_user.to_i > 0
40
+ end
41
+
42
+ def require_webs_admin
43
+ render(:text => "You are not authorized.") unless webs_admin?
44
+ end
36
45
  end
37
46
  end
38
47
  end
data/lib/helper/params.rb CHANGED
@@ -45,6 +45,10 @@ module Webs
45
45
  params[:fw_sig]
46
46
  end
47
47
 
48
+ def fw_sig_user
49
+ params[:fw_sig_user]
50
+ end
51
+
48
52
  def fw_sig_width
49
53
  params[:fw_sig_width]
50
54
  end
data/lib/webs.rb CHANGED
@@ -5,7 +5,7 @@ require dir + 'helper/params'
5
5
  require dir + 'helper/tags'
6
6
 
7
7
  module Webs
8
- VERSION = "0.1.2".freeze
8
+ VERSION = "0.1.3".freeze
9
9
 
10
10
  module Permission
11
11
  ANYONE = 0
data/webs.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{webs}
5
- s.version = "0.1.2"
5
+ s.version = "0.1.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Chuck Olczak"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webs
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chuck Olczak