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 +26 -26
- data/i18n/en.yml +1 -1
- data/i18n/it.yml +1 -0
- data/lib/hotspotlogin/app.rb +32 -4
- data/lib/hotspotlogin/constants.rb +1 -1
- data/public/hotspotlogin/css/default.css +6 -2
- data/views/_login_form.erb +9 -5
- metadata +78 -79
data/Changelog
CHANGED
@@ -1,44 +1,44 @@
|
|
1
|
-
* 1.
|
2
|
-
|
1
|
+
* 1.4.0 (2013-03-01)
|
2
|
+
* Save credentials in cookies
|
3
3
|
|
4
4
|
* 1.3.0 (2011-09-29)
|
5
|
-
|
6
|
-
|
7
|
-
|
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
|
-
|
10
|
+
* Fix logo link and links style
|
11
11
|
|
12
12
|
* 1.2.1 (2011-08-08)
|
13
|
-
|
13
|
+
* Fix command line options
|
14
14
|
|
15
15
|
* 1.2.0 (2011-08-08)
|
16
|
-
|
17
|
-
|
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
|
-
|
20
|
+
* --signup-url
|
21
21
|
|
22
22
|
* 1.0.2 (2010-12-08)
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
28
|
+
* Urgent bugfix -- handle config['logo'] == nil (TypeError)
|
29
29
|
|
30
30
|
* 1.0.0 (2010-11-16)
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
-
|
43
|
-
|
44
|
-
|
42
|
+
* Become session leader when forking/daemonizing.
|
43
|
+
* this is to avoid trapping terminal interrupts from a parent console
|
44
|
+
process, etc.
|
data/i18n/en.yml
CHANGED
data/i18n/it.yml
CHANGED
data/lib/hotspotlogin/app.rb
CHANGED
@@ -102,7 +102,11 @@ module HotSpotLogin
|
|
102
102
|
erb :"js/UserStatus.js", :layout => false # localized strings...
|
103
103
|
end
|
104
104
|
|
105
|
-
get '/hotspotlogin
|
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']
|
116
|
-
|
117
|
-
|
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 =
|
@@ -79,8 +79,11 @@ h2#headline {
|
|
79
79
|
text-align: left;
|
80
80
|
}
|
81
81
|
#submit-container button, #submit-container input[type="submit"] {
|
82
|
-
|
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 {
|
data/views/_login_form.erb
CHANGED
@@ -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>
|
17
|
-
<td
|
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
|
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
|
-
|
5
|
-
|
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
|
-
|
18
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
25
|
none: false
|
38
|
-
requirements:
|
39
|
-
- -
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
41
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
55
|
-
|
56
|
-
|
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
|
-
|
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
|
-
|
68
|
-
- 0
|
69
|
-
version: "0"
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
70
|
type: :runtime
|
71
|
-
|
72
|
-
|
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
|
-
|
117
|
-
|
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
|
-
|
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.
|
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
|
-
|