hotspotlogin 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog CHANGED
@@ -1,44 +1,44 @@
1
- * 1.3.1 (2011-10.03)
2
- * "retry & delay" on logoff
1
+ * 1.4.0 (2013-03-01)
2
+ * Save credentials in cookies
3
3
 
4
4
  * 1.3.0 (2011-09-29)
5
- * Italian and English localization based on R18n
6
- * some mobile-friendliness (without special layouts or device detection)
7
- * improved JS code for user stats
5
+ * Italian and English localization based on R18n
6
+ * some mobile-friendliness (without special layouts or device detection)
7
+ * improved JS code for user stats
8
8
 
9
9
  * 1.2.2 (2011-08-08)
10
- * Fix logo link and links style
10
+ * Fix logo link and links style
11
11
 
12
12
  * 1.2.1 (2011-08-08)
13
- * Fix command line options
13
+ * Fix command line options
14
14
 
15
15
  * 1.2.0 (2011-08-08)
16
- * --logo-link
17
- * --my-url ("My Account" link w/ dynamic replacement of the actual username)
16
+ * --logo-link
17
+ * --my-url ("My Account" link w/ dynamic replacement of the actual username)
18
18
 
19
19
  * 1.1.0 (2011-08-03)
20
- * --signup-url
20
+ * --signup-url
21
21
 
22
22
  * 1.0.2 (2010-12-08)
23
- * Display Reply-Message properly
24
- * fix serious encoding issues
25
- * use Rack instead of ERB utils for escaping
23
+ * Display Reply-Message properly
24
+ * fix serious encoding issues
25
+ * use Rack instead of ERB utils for escaping
26
26
 
27
27
  * 1.0.1 (2010-11-17)
28
- * Urgent bugfix -- handle config['logo'] == nil (TypeError)
28
+ * Urgent bugfix -- handle config['logo'] == nil (TypeError)
29
29
 
30
30
  * 1.0.0 (2010-11-16)
31
- * Major rewrite based on CoovaChilli JSON API (coova.org/CoovaChilli/JSON).
32
- * tested with CoovaChilli 1.2.5, and IE7, FF3, Epiphany/WebKit
33
- * uses JavaScript and popups, your browser must support/allow them
34
- * periodic auto-refresh of accounting data to the end user, including
35
- downstream and upstream network traffic
36
- * supports Session and Idle Timeout, showing relevant info if applicable,
37
- and refreshing info when user is disconnected
38
- * view customization, with Your Org logo, custom text, etc.
39
- * some legacy code still around, sorry
31
+ * Major rewrite based on CoovaChilli JSON API (coova.org/CoovaChilli/JSON).
32
+ * tested with CoovaChilli 1.2.5, and IE7, FF3, Epiphany/WebKit
33
+ * uses JavaScript and popups, your browser must support/allow them
34
+ * periodic auto-refresh of accounting data to the end user, including
35
+ downstream and upstream network traffic
36
+ * supports Session and Idle Timeout, showing relevant info if applicable,
37
+ and refreshing info when user is disconnected
38
+ * view customization, with Your Org logo, custom text, etc.
39
+ * some legacy code still around, sorry
40
40
 
41
41
  * 0.1.2 (2010-11-08)
42
- * Become session leader when forking/daemonizing.
43
- * this is to avoid trapping terminal interrupts from a parent console
44
- process, etc.
42
+ * Become session leader when forking/daemonizing.
43
+ * this is to avoid trapping terminal interrupts from a parent console
44
+ process, etc.
@@ -28,4 +28,4 @@ status:
28
28
  download_traffic: download
29
29
  upload_traffic: upload
30
30
  auto_updated_every: auto updated every
31
-
31
+ remember_me: remember me
@@ -28,3 +28,4 @@ status:
28
28
  download_traffic: download
29
29
  upload_traffic: upload
30
30
  auto_updated_every: "aggiornato automaticam. ogni"
31
+ remember_me: ricordami
@@ -102,7 +102,11 @@ module HotSpotLogin
102
102
  erb :"js/UserStatus.js", :layout => false # localized strings...
103
103
  end
104
104
 
105
- get '/hotspotlogin/?' do
105
+ get '/hotspotlogin/' do # the trailing '/' causes issues apparently
106
+ redirect "/hotspotlogin?#{request.query_string}"
107
+ end
108
+
109
+ get '/hotspotlogin' do # the trailing '/' causes issues apparently
106
110
  if HotSpotLogin.config['uamsecret'] and
107
111
  HotSpotLogin.config['uamsecret'].length > 0
108
112
  uamsecret = HotSpotLogin.config['uamsecret']
@@ -112,9 +116,33 @@ module HotSpotLogin
112
116
  userpassword = HotSpotLogin.config['userpassword']
113
117
 
114
118
  # attempt to login
115
- if params['login'] # == 'login'
116
- # So you can put whichever text you want in submit button
117
- # as in <input type="submit" name="login" value="MyText"...
119
+ if params['login'] # or (
120
+ # params['res'] == 'notyet' and request.cookies['UserName'] =~ /\S/
121
+ # )
122
+
123
+ if params['login'] # submit form button
124
+ #if params['UserName'] =~ /\S/ # save empty credentials as a way to reset cookie content
125
+ if params['remember_me'] == 'on'
126
+ %w{UserName Password}.each do |k|
127
+ if params[k]
128
+ response.set_cookie(k,
129
+ :value => params[k],
130
+ :path => '/',
131
+ :expires => Time.now+180*24*60*60
132
+ )
133
+ end
134
+ end
135
+ else
136
+ %w{UserName Password}.each do |k|
137
+ response.delete_cookie k
138
+ end
139
+ end
140
+ #else # from cookies
141
+ # %w{chal uamip uamport UserName Password}.each do |k|
142
+ # params[k] = request.cookies[k] if request.cookies[k]
143
+ # end
144
+ end
145
+
118
146
  hexchal = Array[params['chal']].pack('H32')
119
147
  if uamsecret
120
148
  newchal =
@@ -1,6 +1,6 @@
1
1
  module HotSpotLogin
2
2
 
3
- VERSION = '1.3.1'
3
+ VERSION = '1.4.0'
4
4
 
5
5
  DEFAULT_CONFIG = {
6
6
  'listen-address' => '0.0.0.0',
@@ -79,8 +79,11 @@ h2#headline {
79
79
  text-align: left;
80
80
  }
81
81
  #submit-container button, #submit-container input[type="submit"] {
82
- width: 4.5em;
82
+ height: 1.7em;
83
+ width: 5em;
83
84
  margin-top: 0.3em;
85
+ background: #77f;
86
+ color: white;
84
87
  }
85
88
  #custom-text {
86
89
  font-size: 94%;
@@ -106,13 +109,14 @@ a#signup {
106
109
  border: none;
107
110
  color: white;
108
111
  background: #77f;
109
- padding: 0 0.2em 0.1em 0.2em;
112
+ padding: 0.2em 0.2em 0.1em 0.2em;
110
113
  font-style:normal;
111
114
  }
112
115
 
113
116
  a#signup {
114
117
  text-decoration: none;
115
118
  margin-left: 0.2em;
119
+ font-size: 130%;
116
120
  }
117
121
 
118
122
  a img {
@@ -7,22 +7,26 @@
7
7
  <tbody>
8
8
  <tr>
9
9
  <th scope="row"><%= t.username.short.capitalize %>:</td>
10
- <td><input type="text" name="UserName" size="16" maxlength="255"></td>
10
+ <td><input type="text" name="UserName" size="16" maxlength="255" value="<%= request.cookies['UserName'] %>"></td>
11
11
  </tr>
12
12
  <tr>
13
13
  <th scope="row">Password:</td>
14
- <td><input type="password" name="Password" size="16" maxlength="255"></td>
14
+ <td><input type="password" name="Password" size="16" maxlength="255" value="<%= request.cookies['Password'] %>"></td>
15
15
  </tr>
16
- <tr> <!-- yeah, it's horrible -->
17
- <td colspan="2" id="submit-container">
16
+ <tr>
17
+ <td id="submit-container">
18
18
  <input type="submit" name="login" value="<%= t.login.you!.capitalize %>">
19
19
  </td>
20
+ <td style="padding: none; text-align:right; font-style:italic; vertical-align:top; color:#444">
21
+ <%= t.remember_me.capitalize %> <input type="checkbox" checked name="remember_me" style="margin:none"/>
22
+ </td>
20
23
  </tr>
21
24
  </tbody>
22
25
  </table>
23
26
  </form>
27
+ <div style="height:1ex;"> <!-- separator --> </div>
24
28
  <% if signup_url =~ /\S/ %><span id="signup-container">
25
29
  <%= t.account.dont_have.you.capitalize %>?
26
- <a id="signup" href="<%= signup_url %>" target="_blank"><%= t.signup.you!.capitalize %>!</a>
30
+ <a id="signup" href="<%= signup_url %>" target="_blank"><%= t.signup.you!.capitalize %></a>
27
31
  </span><% end %>
28
32
 
metadata CHANGED
@@ -1,83 +1,90 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: hotspotlogin
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 3
8
- - 1
9
- version: 1.3.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.4.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Guido De Rosa
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-10-14 00:00:00 +02:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2013-03-01 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: facets
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
31
22
  type: :runtime
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: sinatra
35
23
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
37
25
  none: false
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
- version: "0"
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: sinatra
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
44
38
  type: :runtime
45
- version_requirements: *id002
46
- - !ruby/object:Gem::Dependency
47
- name: rack
48
39
  prerelease: false
49
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
50
41
  none: false
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- segments:
55
- - 0
56
- version: "0"
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rack
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
57
54
  type: :runtime
58
- version_requirements: *id003
59
- - !ruby/object:Gem::Dependency
60
- name: sinatra-r18n
61
55
  prerelease: false
62
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: sinatra-r18n
64
+ requirement: !ruby/object:Gem::Requirement
63
65
  none: false
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- segments:
68
- - 0
69
- version: "0"
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
70
  type: :runtime
71
- version_requirements: *id004
72
- 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.
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ description: Traditionally, a PHP or Perl/CGI web page has been used to login unauthenticated
79
+ users to a Network Access Controller like ChilliSpot; this hotspotlogin implementation
80
+ is based on Sinatra instead, and relies heavily on the CoovaChilli JSON interface.
73
81
  email: guido.derosa@vemarsas.it
74
- executables:
82
+ executables:
75
83
  - hotspotlogin
76
84
  extensions: []
77
-
78
- extra_rdoc_files:
85
+ extra_rdoc_files:
79
86
  - README.rdoc
80
- files:
87
+ files:
81
88
  - Changelog
82
89
  - README.rdoc
83
90
  - bin/hotspotlogin
@@ -98,38 +105,30 @@ files:
98
105
  - views/hotspotlogin.erb
99
106
  - views/404.erb
100
107
  - views/_login_form.erb
101
- has_rdoc: true
102
108
  homepage: http://dev.vemarsas.it/projects/hospotlogin/wiki
103
109
  licenses: []
104
-
105
110
  post_install_message:
106
- rdoc_options:
111
+ rdoc_options:
107
112
  - --main
108
113
  - README.rdoc
109
- require_paths:
114
+ require_paths:
110
115
  - lib
111
- required_ruby_version: !ruby/object:Gem::Requirement
116
+ required_ruby_version: !ruby/object:Gem::Requirement
112
117
  none: false
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- segments:
117
- - 0
118
- version: "0"
119
- required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ! '>='
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
120
123
  none: false
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- segments:
125
- - 0
126
- version: "0"
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
127
128
  requirements: []
128
-
129
129
  rubyforge_project:
130
- rubygems_version: 1.3.7
130
+ rubygems_version: 1.8.23
131
131
  signing_key:
132
132
  specification_version: 3
133
133
  summary: Login page/Captive portal based on Sinatra and the CoovaChilli JSON API
134
134
  test_files: []
135
-