hotspotlogin 1.0.1 → 1.0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -90,3 +90,4 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
90
90
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
91
91
  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
92
92
 
93
+
@@ -1,7 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'sinatra/base'
3
3
  require 'erb'
4
- require 'pp'
5
4
 
6
5
  require 'hotspotlogin/constants'
7
6
  require 'hotspotlogin/config'
@@ -19,8 +18,6 @@ module HotSpotLogin
19
18
 
20
19
  #set :run, false
21
20
 
22
- include ERB::Util # for html_escape...
23
-
24
21
  result, titel, headline, bodytext = '', '', '', ''
25
22
 
26
23
  before do
@@ -197,6 +194,7 @@ module HotSpotLogin
197
194
  :custom_footer => HotSpotLogin.config['custom-footer'],
198
195
  :logoext => logoext,
199
196
  :result => result,
197
+ :reply => params['reply'] # Reply-Message
200
198
  }
201
199
  )
202
200
 
@@ -1,6 +1,6 @@
1
1
  module HotSpotLogin
2
2
 
3
- VERSION = '1.0.1'
3
+ VERSION = '1.0.2.1'
4
4
 
5
5
  DEFAULT_CONFIG = {
6
6
  'listen-address' => '0.0.0.0',
@@ -12,6 +12,7 @@ h1 {
12
12
  h2 {
13
13
  font-size: 135%;
14
14
  margin-top: 0.1ex;
15
+ margin-bottom: 0.5ex;
15
16
  font-style: italic;
16
17
  }
17
18
  #powered-by {
@@ -24,7 +25,12 @@ h2 {
24
25
  }
25
26
  #logo-container {
26
27
  text-align: center;
27
- margin: 0 0;
28
+ margin: 0.75em 0;
29
+ }
30
+ #Reply-Message {
31
+ margin: 1em;
32
+ font-family: monospace;
33
+ text-align: center;
28
34
  }
29
35
  #form-container {
30
36
  text-align: center;
@@ -143,10 +143,26 @@ function showUserStatus(h) {
143
143
  }
144
144
  }
145
145
 
146
+ function updateReplyMessage(clientState) {
147
+ var e = document.getElementById('Reply-Message');
148
+ if (e) {
149
+ switch(clientState) {
150
+ case chilliController.stateCodes.NOT_AUTH:
151
+ e.style.visibility = 'hidden';
152
+ break;
153
+ case chilliController.stateCodes.AUTH:
154
+ e.style.visibility = 'visible';
155
+ break;
156
+ }
157
+ }
158
+ }
159
+
146
160
  // when the reply is ready, this handler function is called
147
161
  function updateUI( cmd ) {
148
- updateHeadings( chilliController.clientState);
149
- updateLinks( chilliController.clientState);
162
+ updateHeadings( chilliController.clientState);
163
+ updateLinks( chilliController.clientState);
164
+ updateReplyMessage( chilliController.clientState);
165
+
150
166
  var userName_e = document.getElementById('userName');
151
167
  var clientState_e = document.getElementById('clientState');
152
168
  var sessionTime_e = document.getElementById('sessionTime');
@@ -2,6 +2,11 @@
2
2
  require 'hotspotlogin/app/helpers'
3
3
  %>
4
4
 
5
+ <!--
6
+ Some element IDs reflect JS method names, other reflect RADIUS
7
+ attributes: this explains the apparent naming inconsistency
8
+ -->
9
+
5
10
  <% if custom_headline %>
6
11
  <h1><%= custom_headline %></h1>
7
12
  <% end %>
@@ -10,6 +15,11 @@
10
15
  <% end %>
11
16
 
12
17
  <h2 id="headline"><%= titel %></h2>
18
+ <div id="Reply-Message">
19
+ <% if params['reply'] %>
20
+ <%= Rack::Utils::escape_html params['reply'] %>
21
+ <% end %>
22
+ </div>
13
23
 
14
24
  <% if custom_text and File.file? custom_text %>
15
25
  <div id="custom-text"><%= File.read custom_text %></div>
@@ -38,9 +48,6 @@
38
48
  <p>Login must be performed through ChilliSpot daemon!</p>
39
49
  <% end %>
40
50
 
41
- <% if params['reply'] %>
42
- <div style="text-align: center;"><%= params['reply'] %></div>
43
- <% end %>
44
51
 
45
52
  <% if status_window?(result) %>
46
53
  <div id="status-container">
data/views/layout.erb CHANGED
@@ -1,4 +1,6 @@
1
- <%
1
+ <%
2
+ require 'rack/utils'
3
+
2
4
  require 'hotspotlogin/constants'
3
5
 
4
6
  loginpath = request.path_info
@@ -57,14 +59,6 @@
57
59
  }
58
60
  }
59
61
 
60
- function doOnBlur(result) {
61
- if ((result == 12) && (self.name == "chillispot_popup")) {
62
- if (blur == 0) {
63
- blur = 1;
64
- self.focus();
65
- }
66
- }
67
- }
68
62
  </script>
69
63
 
70
64
  <link rel="stylesheet" href="/hotspotlogin/css/default.css"/>
@@ -72,7 +66,7 @@
72
66
 
73
67
  </head>
74
68
 
75
- <body onLoad="javascript:doOnLoad(<%= result %>, '<%= request.path_info %>?res=popup2&uamip=<%= uamip %>&uamport=<%= uamport %>&userurl=<%= userurl %>&redirurl=<%= redirurl %>&timeleft=<%= timeleft %>','<%= userurl %>', '<%= redirurl %>', '<%= timeleft %>')" onBlur="javascript:doOnBlur(<%= result %>)">
69
+ <body onLoad="javascript:doOnLoad(<%= result %>, '<%= request.path_info %>?res=popup2&uamip=<%= uamip %>&uamport=<%= uamport %>&userurl=<%= userurl %>&redirurl=<%= redirurl %>&reply=<%= Rack::Utils::escape reply %>','<%= userurl %>', '<%= redirurl %>', '<%= timeleft %>')">
76
70
  <div id="powered-by">
77
71
  Powered by <a href="http://rubygems.org/gems/hotspotlogin">hotspotlogin.rb</a>
78
72
  </div>
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotspotlogin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 85
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
+ - 2
9
10
  - 1
10
- version: 1.0.1
11
+ version: 1.0.2.1
11
12
  platform: ruby
12
13
  authors:
13
14
  - Guido De Rosa
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-11-17 00:00:00 +00:00
19
+ date: 2010-12-08 00:00:00 +01:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
@@ -32,7 +33,21 @@ dependencies:
32
33
  version: "0"
33
34
  type: :runtime
34
35
  version_requirements: *id001
35
- description: Traditionally, a PHP or Perl/CGI web page has been used to login unauthenticated users to a Network Access Controller like ChilliSpot; this hotspotlogin implementation is based on Ruby and Sinatra (the classy web framework).
36
+ - !ruby/object:Gem::Dependency
37
+ name: rack
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 0
47
+ version: "0"
48
+ type: :runtime
49
+ version_requirements: *id002
50
+ description: Traditionally, a PHP or Perl/CGI web page has been used to login unauthenticated users to a Network Access Controller like ChilliSpot; this hotspotlogin implementation is based on Sinatra instead, and relies heavily on the CoovaChilli JSON interface.
36
51
  email: guido.derosa@vemarsas.it
37
52
  executables:
38
53
  - hotspotlogin
@@ -59,7 +74,7 @@ files:
59
74
  - views/404.erb
60
75
  - views/_login_form.erb
61
76
  has_rdoc: true
62
- homepage: http://github.com/gderosa/hotspotlogin.rb
77
+ homepage: http://dev.vemarsas.it/projects/hospotlogin/wiki
63
78
  licenses: []
64
79
 
65
80
  post_install_message:
@@ -92,6 +107,6 @@ rubyforge_project:
92
107
  rubygems_version: 1.3.7
93
108
  signing_key:
94
109
  specification_version: 3
95
- summary: Ruby/Sinatra implementation of the login page used with ChilliSpot and friends.
110
+ summary: Login page/Captive portal based on Sinatra and the CoovaChilli JSON API
96
111
  test_files: []
97
112