wmernagh-rubycas-server 0.6.99.336 → 0.7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +10 -3
- data/Manifest.txt +1 -3
- data/README.txt +1 -1
- data/bin/rubycas-server +3 -3
- data/bin/rubycas-server-ctl +3 -2
- data/config.example.yml +9 -9
- data/config/hoe.rb +7 -6
- data/lib/casserver.rb +13 -9
- data/lib/casserver/cas.rb +22 -15
- data/lib/casserver/controllers.rb +19 -16
- data/lib/casserver/environment.rb +16 -11
- data/lib/casserver/version.rb +2 -2
- data/lib/casserver/views.rb +7 -7
- data/lib/rubycas-server.rb +1 -1
- metadata +1 -1
data/History.txt
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
-
=== 0.7.
|
1
|
+
=== 0.7.1 :: 2008-11-10
|
2
2
|
|
3
|
-
*
|
4
|
-
|
3
|
+
* Fixed dependency loading problems introduced by upstream changes in RubyGems
|
4
|
+
1.3.1.
|
5
|
+
|
6
|
+
=== 0.7.0 :: 2008-11-04
|
7
|
+
|
8
|
+
* New functionality:
|
9
|
+
* Implemented single-sign-out functionality as specified in CAS 3.3. See
|
5
10
|
http://www.ja-sig.org/wiki/display/CASUM/Single+Sign+Out.
|
6
11
|
* It is now possible to configure Authenticators to return extra attributes
|
7
12
|
to CAS clients alongside the username. For an example of how to do this see
|
@@ -56,6 +61,8 @@
|
|
56
61
|
expected -- however currently this only works when the server is running
|
57
62
|
in the foregaround. When daemonized, USR2 will shut down the server without
|
58
63
|
restarting (see issue #58).
|
64
|
+
* Fixed activerecord/activesupport gem load problems, hopefully once and for all
|
65
|
+
(however picnic-0.7.0 is now required).
|
59
66
|
|
60
67
|
=== 0.6.0 :: 2008-03-28
|
61
68
|
|
data/Manifest.txt
CHANGED
@@ -7,9 +7,6 @@ README.txt
|
|
7
7
|
Rakefile
|
8
8
|
bin/rubycas-server
|
9
9
|
bin/rubycas-server-ctl
|
10
|
-
casserver.db
|
11
|
-
casserver.log
|
12
|
-
casserver_db.log
|
13
10
|
config.example.yml
|
14
11
|
config/hoe.rb
|
15
12
|
config/requirements.rb
|
@@ -18,6 +15,7 @@ lib/casserver.rb
|
|
18
15
|
lib/casserver/authenticators/active_directory_ldap.rb
|
19
16
|
lib/casserver/authenticators/base.rb
|
20
17
|
lib/casserver/authenticators/client_certificate.rb
|
18
|
+
lib/casserver/authenticators/google.rb
|
21
19
|
lib/casserver/authenticators/ldap.rb
|
22
20
|
lib/casserver/authenticators/ntlm.rb
|
23
21
|
lib/casserver/authenticators/open_id.rb
|
data/README.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
= RubyCAS-Server
|
2
2
|
|
3
3
|
*Copyright*:: 2008 Urbacon Ltd.
|
4
|
-
*Authors*::
|
4
|
+
*Authors*:: See http://github.com/gunark/rubycas-server/commits/
|
5
5
|
*Homepage*:: http://rubycas-server.googlecode.com
|
6
6
|
|
7
7
|
For info and installation instructions please see http://code.google.com/p/rubycas-server
|
data/bin/rubycas-server
CHANGED
@@ -8,10 +8,11 @@ else
|
|
8
8
|
require 'rubygems'
|
9
9
|
|
10
10
|
# make things backwards-compatible for rubygems < 0.9.0
|
11
|
-
|
11
|
+
if respond_to?(:require_gem)
|
12
|
+
puts "WARNING: aliasing gem to require_gem in #{__FILE__} -- you should update your RubyGems system!"
|
12
13
|
alias gem require_gem
|
13
14
|
end
|
14
|
-
|
15
|
+
|
15
16
|
gem 'picnic'
|
16
17
|
end
|
17
18
|
|
@@ -19,7 +20,6 @@ require 'picnic/cli'
|
|
19
20
|
|
20
21
|
cli = Picnic::Cli.new(
|
21
22
|
'rubycas-server',
|
22
|
-
:app_path => File.expand_path(File.dirname(File.expand_path(__FILE__))),
|
23
23
|
:app_module => 'CASServer'
|
24
24
|
)
|
25
25
|
|
data/bin/rubycas-server-ctl
CHANGED
@@ -8,10 +8,11 @@ else
|
|
8
8
|
require 'rubygems'
|
9
9
|
|
10
10
|
# make things backwards-compatible for rubygems < 0.9.0
|
11
|
-
|
11
|
+
if respond_to?(:require_gem)
|
12
|
+
puts "WARNING: aliasing gem to require_gem in #{__FILE__} -- you should update your RubyGems system!"
|
12
13
|
alias gem require_gem
|
13
14
|
end
|
14
|
-
|
15
|
+
|
15
16
|
gem 'picnic'
|
16
17
|
end
|
17
18
|
|
data/config.example.yml
CHANGED
@@ -132,7 +132,7 @@ database:
|
|
132
132
|
# database: some_database_with_users_table
|
133
133
|
# username: root
|
134
134
|
# password:
|
135
|
-
#
|
135
|
+
# host: localhost
|
136
136
|
# user_table: users
|
137
137
|
# username_column: username
|
138
138
|
# password_column: password
|
@@ -187,7 +187,7 @@ database:
|
|
187
187
|
# database: some_database_with_users_table
|
188
188
|
# user: root
|
189
189
|
# password:
|
190
|
-
#
|
190
|
+
# host: localhost
|
191
191
|
# user_table: user
|
192
192
|
# username_column: username
|
193
193
|
# password_column: password
|
@@ -212,7 +212,7 @@ database:
|
|
212
212
|
#authenticator:
|
213
213
|
# class: CASServer::Authenticators::ActiveDirectoryLDAP
|
214
214
|
# ldap:
|
215
|
-
#
|
215
|
+
# host: ad.example.net
|
216
216
|
# port: 389
|
217
217
|
# base: dc=example,dc=net
|
218
218
|
# filter: (objectClass=person)
|
@@ -226,7 +226,7 @@ database:
|
|
226
226
|
#authenticator:
|
227
227
|
# class: CASServer::Authenticators::ActiveDirectoryLDAP
|
228
228
|
# ldap:
|
229
|
-
#
|
229
|
+
# host: ad.example.net
|
230
230
|
# port: 636
|
231
231
|
# base: dc=example,dc=net
|
232
232
|
# filter: (objectClass=person) & !(msExchHideFromAddressLists=TRUE)
|
@@ -253,7 +253,7 @@ database:
|
|
253
253
|
#authenticator:
|
254
254
|
# class: CASServer::Authenticators::LDAP
|
255
255
|
# ldap:
|
256
|
-
#
|
256
|
+
# host: ldap.example.net
|
257
257
|
# port: 389
|
258
258
|
# base: dc=example,dc=net
|
259
259
|
# filter: (objectClass=person)
|
@@ -264,7 +264,7 @@ database:
|
|
264
264
|
#authenticator:
|
265
265
|
# class: CASServer::Authenticators::LDAP
|
266
266
|
# ldap:
|
267
|
-
#
|
267
|
+
# host: ldap.example.net
|
268
268
|
# port: 636
|
269
269
|
# base: dc=example,dc=net
|
270
270
|
# filter: (objectClass=person)
|
@@ -277,7 +277,7 @@ database:
|
|
277
277
|
#authenticator:
|
278
278
|
# class: CASServer::Authenticators::LDAP
|
279
279
|
# ldap:
|
280
|
-
#
|
280
|
+
# host: ldap.example.net
|
281
281
|
# port: 389
|
282
282
|
# base: dc=example,dc=net
|
283
283
|
# filter: (objectClass=person)
|
@@ -321,7 +321,7 @@ database:
|
|
321
321
|
# -
|
322
322
|
# class: CASServer::Authenticators::ActiveDirectoryLDAP
|
323
323
|
# ldap:
|
324
|
-
#
|
324
|
+
# host: ad.example.net
|
325
325
|
# port: 389
|
326
326
|
# base: dc=example,dc=net
|
327
327
|
# filter: (objectClass=person)
|
@@ -332,7 +332,7 @@ database:
|
|
332
332
|
# database: some_database_with_users_table
|
333
333
|
# user: root
|
334
334
|
# password:
|
335
|
-
#
|
335
|
+
# host: localhost
|
336
336
|
# user_table: user
|
337
337
|
# username_column: username
|
338
338
|
# password_column: password
|
data/config/hoe.rb
CHANGED
@@ -8,9 +8,10 @@ RUBYFORGE_PROJECT = 'rubycas-server' # The unix name for your project
|
|
8
8
|
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
9
9
|
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
10
10
|
EXTRA_DEPENDENCIES = [
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
'activesupport',
|
12
|
+
'activerecord',
|
13
|
+
'ruby-gettext',
|
14
|
+
['picnic', '>= 0.7.0']
|
14
15
|
] # An array of rubygem dependencies [name, version]
|
15
16
|
|
16
17
|
@config_file = "~/.rubyforge/user-config.yml"
|
@@ -34,9 +35,9 @@ end
|
|
34
35
|
|
35
36
|
ENV['NODOT'] = '1'
|
36
37
|
|
37
|
-
|
38
|
+
REV = nil
|
38
39
|
# UNCOMMENT IF REQUIRED:
|
39
|
-
REV = YAML.load(`svn info`)['Revision']
|
40
|
+
#REV = YAML.load(`svn info`)['Revision']
|
40
41
|
VERS = CASServer::VERSION::STRING + (REV ? ".#{REV}" : "")
|
41
42
|
RDOC_OPTS = ['--quiet', '--title', 'rubycas-server documentation',
|
42
43
|
"--opname", "index.html",
|
@@ -73,4 +74,4 @@ CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
|
73
74
|
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}"
|
74
75
|
$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
75
76
|
$hoe.rsync_args = '-av --delete --ignore-errors'
|
76
|
-
$hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
|
77
|
+
$hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
|
data/lib/casserver.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
unless $APP_PATH
|
2
|
+
$APP_PATH = File.dirname(File.expand_path(__FILE__))
|
3
|
+
$: << $APP_PATH
|
4
|
+
end
|
3
5
|
|
4
|
-
$APP_PATH
|
6
|
+
load "#{$APP_PATH}/lib/casserver/environment.rb"
|
5
7
|
|
6
8
|
# change to current directory when invoked on its own
|
7
9
|
Dir.chdir($APP_PATH) if __FILE__ == $0
|
8
10
|
|
9
|
-
$: << $APP_PATH + "
|
11
|
+
$: << $APP_PATH + "/vendor/isaac_0.9.1"
|
10
12
|
require 'crypt/ISAAC'
|
11
13
|
|
12
14
|
|
@@ -44,11 +46,12 @@ unless $CONF[:authenticator]
|
|
44
46
|
exit 1
|
45
47
|
end
|
46
48
|
|
47
|
-
require
|
48
|
-
require
|
49
|
-
require
|
50
|
-
require
|
51
|
-
require
|
49
|
+
require "casserver/utils.rb"
|
50
|
+
require "casserver/models.rb"
|
51
|
+
require "casserver/cas.rb"
|
52
|
+
require "casserver/views.rb"
|
53
|
+
require "casserver/controllers.rb"
|
54
|
+
require "casserver/localization.rb"
|
52
55
|
|
53
56
|
if $CONF[:authenticator].instance_of? Array
|
54
57
|
$CONF[:authenticator].each_index do |auth_index|
|
@@ -73,6 +76,7 @@ rescue NameError
|
|
73
76
|
else
|
74
77
|
# the authenticator class hasn't yet been loaded, so lets try to load it from the casserver/authenticators directory
|
75
78
|
auth_rb = authenticator[:class].underscore.gsub('cas_server/', '')
|
79
|
+
|
76
80
|
require 'casserver/'+auth_rb
|
77
81
|
end
|
78
82
|
$AUTH << authenticator[:class].constantize.new
|
data/lib/casserver/cas.rb
CHANGED
@@ -234,28 +234,31 @@ module CASServer::CAS
|
|
234
234
|
# See http://www.ja-sig.org/wiki/display/CASUM/Single+Sign+Out
|
235
235
|
def send_logout_notification_for_service_ticket(st)
|
236
236
|
uri = URI.parse(st.service)
|
237
|
-
http = Net::HTTP.new(uri.host,uri.port)
|
237
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
238
238
|
#http.use_ssl = true if uri.scheme = 'https'
|
239
239
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
240
|
+
time = Time.now
|
241
|
+
rand = CASServer::Utils.random_string
|
242
|
+
|
243
|
+
path = uri.path
|
244
|
+
path = '/' if path.empty?
|
245
|
+
|
246
|
+
req = Net::HTTP::Post.new(path)
|
247
|
+
req.set_form_data(
|
248
|
+
'logoutRequest' => %{<samlp:LogoutRequest ID="#{rand}" Version="2.0" IssueInstant="#{time.rfc2822}">
|
248
249
|
<saml:NameID></saml:NameID>
|
249
250
|
<samlp:SessionIndex>#{st.ticket}</samlp:SessionIndex>
|
250
251
|
</samlp:LogoutRequest>}
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
252
|
+
)
|
253
|
+
|
254
|
+
http.start do |conn|
|
255
|
+
response = conn.request(req)
|
256
|
+
|
257
|
+
if response.kind_of? Net::HTTPSuccess
|
255
258
|
$LOG.info "Logout notification successfully posted to #{st.service.inspect}."
|
256
259
|
return true
|
257
260
|
else
|
258
|
-
$LOG.error "Service #{st.service.inspect} responed to logout notification with code '#{response.code}'
|
261
|
+
$LOG.error "Service #{st.service.inspect} responed to logout notification with code '#{response.code}'!"
|
259
262
|
return false
|
260
263
|
end
|
261
264
|
end
|
@@ -283,7 +286,7 @@ module CASServer::CAS
|
|
283
286
|
end
|
284
287
|
|
285
288
|
# Strips CAS-related parameters from a service URL and normalizes it,
|
286
|
-
# removing trailing / and ?.
|
289
|
+
# removing trailing / and ?. Also converts any spaces to +.
|
287
290
|
#
|
288
291
|
# For example, "http://google.com?ticket=12345" will be returned as
|
289
292
|
# "http://google.com". Also, "http://google.com/" would be returned as
|
@@ -300,7 +303,11 @@ module CASServer::CAS
|
|
300
303
|
end
|
301
304
|
|
302
305
|
clean_service.gsub!(/[\/\?]$/, '')
|
306
|
+
clean_service.gsub!(' ', '+')
|
303
307
|
|
308
|
+
$LOG.debug("Cleaned dirty service URL #{dirty_service.inspect} to #{clean_service.inspect}") if
|
309
|
+
dirty_service != clean_service
|
310
|
+
|
304
311
|
return clean_service
|
305
312
|
end
|
306
313
|
module_function :clean_service_url
|
@@ -1,12 +1,14 @@
|
|
1
1
|
# The #.#.# comments (e.g. "2.1.3") refer to section numbers in the CAS protocol spec
|
2
2
|
# under http://www.ja-sig.org/products/cas/overview/protocol/index.html
|
3
3
|
|
4
|
+
require 'cas'
|
5
|
+
|
4
6
|
module CASServer::Controllers
|
5
7
|
|
6
8
|
# 2.1
|
7
9
|
class Login < R '/', '/login'
|
8
10
|
include CASServer::CAS
|
9
|
-
|
11
|
+
|
10
12
|
# 2.1.1
|
11
13
|
def get
|
12
14
|
CASServer::Utils::log_controller_action(self.class, @input)
|
@@ -27,12 +29,12 @@ module CASServer::Controllers
|
|
27
29
|
|
28
30
|
if tgt and !tgt_error
|
29
31
|
@message = {:type => 'notice',
|
30
|
-
:message =>
|
32
|
+
:message => _("You are currently logged in as '%s'. If this is not you, please log in below.") % tgt.username }
|
31
33
|
end
|
32
34
|
|
33
35
|
if @input['redirection_loop_intercepted']
|
34
36
|
@message = {:type => 'mistake',
|
35
|
-
:message =>
|
37
|
+
:message => _("The client and server are unable to negotiate authentication. Please try logging in again later.")}
|
36
38
|
end
|
37
39
|
|
38
40
|
begin
|
@@ -49,12 +51,12 @@ module CASServer::Controllers
|
|
49
51
|
elsif @gateway
|
50
52
|
$LOG.error("This is a gateway request but no service parameter was given!")
|
51
53
|
@message = {:type => 'mistake',
|
52
|
-
:message => "The server cannot fulfill this gateway request because no service parameter was given."}
|
54
|
+
:message => _("The server cannot fulfill this gateway request because no service parameter was given.")}
|
53
55
|
end
|
54
56
|
rescue URI::InvalidURIError
|
55
57
|
$LOG.error("The service '#{@service}' is not a valid URI!")
|
56
58
|
@message = {:type => 'mistake',
|
57
|
-
:message => "The target service your browser supplied appears to be invalid. Please contact your system administrator for help."}
|
59
|
+
:message => _("The target service your browser supplied appears to be invalid. Please contact your system administrator for help.")}
|
58
60
|
end
|
59
61
|
|
60
62
|
lt = generate_login_ticket
|
@@ -83,7 +85,7 @@ module CASServer::Controllers
|
|
83
85
|
render :login_form
|
84
86
|
else
|
85
87
|
@status = 500
|
86
|
-
"Could not guess the CAS login URI. Please supply a submitToURI parameter with your request."
|
88
|
+
_("Could not guess the CAS login URI. Please supply a submitToURI parameter with your request.")
|
87
89
|
end
|
88
90
|
else
|
89
91
|
render :login
|
@@ -179,7 +181,7 @@ module CASServer::Controllers
|
|
179
181
|
|
180
182
|
if @service.blank?
|
181
183
|
$LOG.info("Successfully authenticated user '#{@username}' at '#{tgt.client_hostname}'. No service param was given, so we will not redirect.")
|
182
|
-
@message = {:type => 'confirmation', :message => "You have successfully logged in."}
|
184
|
+
@message = {:type => 'confirmation', :message => _("You have successfully logged in.")}
|
183
185
|
else
|
184
186
|
@st = generate_service_ticket(@service, @username, tgt)
|
185
187
|
begin
|
@@ -189,12 +191,13 @@ module CASServer::Controllers
|
|
189
191
|
return redirect(service_with_ticket, :status => 303) # response code 303 means "See Other" (see Appendix B in CAS Protocol spec)
|
190
192
|
rescue URI::InvalidURIError
|
191
193
|
$LOG.error("The service '#{@service}' is not a valid URI!")
|
192
|
-
@message = {:type => 'mistake',
|
194
|
+
@message = {:type => 'mistake',
|
195
|
+
:message => _("The target service your browser supplied appears to be invalid. Please contact your system administrator for help.")}
|
193
196
|
end
|
194
197
|
end
|
195
198
|
else
|
196
199
|
$LOG.warn("Invalid credentials given for user '#{@username}'")
|
197
|
-
@message = {:type => 'mistake', :message => "Incorrect username or password."}
|
200
|
+
@message = {:type => 'mistake', :message => _("Incorrect username or password.")}
|
198
201
|
@status = 401
|
199
202
|
end
|
200
203
|
|
@@ -238,13 +241,13 @@ module CASServer::Controllers
|
|
238
241
|
tgt.service_tickets.each do |st|
|
239
242
|
send_logout_notification_for_service_ticket(st)
|
240
243
|
# TODO: Maybe we should do some special handling if send_logout_notification_for_service_ticket fails?
|
241
|
-
#
|
242
|
-
$LOG.debug "Deleting #{st.class} #{st.ticket.inspect}."
|
244
|
+
# (the above method returns false if the POST results in a non-200 HTTP response).
|
245
|
+
$LOG.debug "Deleting #{st.class.name.demodulize} #{st.ticket.inspect}."
|
243
246
|
st.destroy
|
244
247
|
end
|
245
248
|
end
|
246
249
|
|
247
|
-
$LOG.debug("Deleting
|
250
|
+
$LOG.debug("Deleting #{tgt.class.name.demodulize} '#{tgt}' for user '#{tgt.username}'")
|
248
251
|
tgt.destroy
|
249
252
|
end
|
250
253
|
|
@@ -253,10 +256,10 @@ module CASServer::Controllers
|
|
253
256
|
$LOG.warn("User tried to log out without a valid ticket-granting ticket.")
|
254
257
|
end
|
255
258
|
|
256
|
-
@message = {:type => 'confirmation', :message => "You have successfully logged out."}
|
259
|
+
@message = {:type => 'confirmation', :message => _("You have successfully logged out.")}
|
257
260
|
|
258
261
|
@message[:message] <<
|
259
|
-
" Please click on the following link to continue:" if @continue_url
|
262
|
+
_(" Please click on the following link to continue:") if @continue_url
|
260
263
|
|
261
264
|
@lt = generate_login_ticket
|
262
265
|
|
@@ -363,7 +366,7 @@ module CASServer::Controllers
|
|
363
366
|
|
364
367
|
@extra_attributes = t.ticket_granting_ticket.extra_attributes || {}
|
365
368
|
end
|
366
|
-
|
369
|
+
|
367
370
|
@status = response_status_from_error(@error) if @error
|
368
371
|
|
369
372
|
render :proxy_validate
|
@@ -406,7 +409,7 @@ module CASServer::Controllers
|
|
406
409
|
CASServer::Utils::log_controller_action(self.class, @input)
|
407
410
|
$LOG.error("Tried to use login ticket dispenser with get method!")
|
408
411
|
@status = 422
|
409
|
-
"To generate a login ticket, you must make a POST request."
|
412
|
+
_("To generate a login ticket, you must make a POST request.")
|
410
413
|
end
|
411
414
|
|
412
415
|
# Renders a page with a login ticket (and only the login ticket)
|
@@ -1,26 +1,31 @@
|
|
1
1
|
$: << File.dirname(File.expand_path(__FILE__))
|
2
2
|
|
3
3
|
# Try to load local version of Picnic if possible (for development purposes)
|
4
|
-
|
5
|
-
|
4
|
+
alt_picic_paths = []
|
5
|
+
alt_picic_paths << File.dirname(File.expand_path(__FILE__))+"/../../../picnic/lib"
|
6
|
+
alt_picic_paths << File.dirname(File.expand_path(__FILE__))+"/../../vendor/picnic/lib"
|
6
7
|
|
7
8
|
begin
|
9
|
+
require 'active_record'
|
10
|
+
rescue LoadError
|
11
|
+
require 'rubygems'
|
12
|
+
require 'active_record'
|
13
|
+
end
|
14
|
+
|
15
|
+
if alt_picic_paths.any?{|path| File.exists? "#{path}/picnic.rb" }
|
16
|
+
alt_picic_paths.each{|path| $: << path}
|
8
17
|
require 'picnic'
|
9
|
-
|
10
|
-
# make sure that the LoadError was about picnic and not something else
|
11
|
-
raise e unless e.to_s =~ /picnic/
|
12
|
-
|
18
|
+
else
|
13
19
|
require 'rubygems'
|
14
20
|
|
15
21
|
# make things backwards-compatible for rubygems < 0.9.0
|
16
|
-
|
22
|
+
if respond_to?(:require_gem)
|
23
|
+
puts "WARNING: aliasing gem to require_gem in #{__FILE__} -- you should update your RubyGems system!"
|
17
24
|
alias gem require_gem
|
18
25
|
end
|
19
|
-
|
20
|
-
gem 'picnic'
|
21
|
-
|
26
|
+
|
22
27
|
require 'picnic'
|
23
28
|
end
|
24
29
|
|
25
30
|
# used for serializing user extra_attributes (see #service_validate in views.rb)
|
26
|
-
require 'yaml'
|
31
|
+
require 'yaml'
|
data/lib/casserver/version.rb
CHANGED
data/lib/casserver/views.rb
CHANGED
@@ -14,7 +14,7 @@ module CASServer::Views
|
|
14
14
|
if @use_layout
|
15
15
|
xhtml_strict do
|
16
16
|
head do
|
17
|
-
title { "#{organization} Central Login" }
|
17
|
+
title { "#{organization} #{_(' Central Login')}" }
|
18
18
|
link(:rel => "stylesheet", :type => "text/css", :href => "/themes/cas.css")
|
19
19
|
link(:rel => "stylesheet", :type => "text/css", :href => "/themes/#{current_theme}/theme.css")
|
20
20
|
end
|
@@ -38,7 +38,7 @@ module CASServer::Views
|
|
38
38
|
td(:colspan => 2) do
|
39
39
|
div(:id => "headline-container") do
|
40
40
|
strong organization
|
41
|
-
text " Central Login"
|
41
|
+
text _(" Central Login")
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -64,11 +64,11 @@ module CASServer::Views
|
|
64
64
|
# Just the login form.
|
65
65
|
def login_form
|
66
66
|
form(:method => "post", :action => @form_action || '/login', :id => "login-form",
|
67
|
-
:onsubmit => "submitbutton = document.getElementById('login-submit'); submitbutton.value='Please wait...'; submitbutton.disabled=true; return true;") do
|
67
|
+
:onsubmit => "submitbutton = document.getElementById('login-submit'); submitbutton.value='#{ _("Please wait...") }'; submitbutton.disabled=true; return true;") do
|
68
68
|
table(:id => "form-layout") do
|
69
69
|
tr do
|
70
70
|
td(:id => "username-label-container") do
|
71
|
-
label(:id => "username-label", :for => "username") { "Username" }
|
71
|
+
label(:id => "username-label", :for => "username") { _( "Username" ) }
|
72
72
|
end
|
73
73
|
td(:id => "username-container") do
|
74
74
|
input(:type => "text", :id => "username", :name => "username",
|
@@ -77,7 +77,7 @@ module CASServer::Views
|
|
77
77
|
end
|
78
78
|
tr do
|
79
79
|
td(:id => "password-label-container") do
|
80
|
-
label(:id => "password-label", :for => "password") { "Password" }
|
80
|
+
label(:id => "password-label", :for => "password") { _( "Password" ) }
|
81
81
|
end
|
82
82
|
td(:id => "password-container") do
|
83
83
|
input(:type => "password", :id => "password", :name => "password",
|
@@ -89,7 +89,7 @@ module CASServer::Views
|
|
89
89
|
td(:id => "submit-container") do
|
90
90
|
input(:type => "hidden", :id => "lt", :name => "lt", :value => @lt)
|
91
91
|
input(:type => "hidden", :id => "service", :name => "service", :value => @service)
|
92
|
-
input(:type => "submit", :class => "button", :accesskey => "l", :value => "LOGIN", :tabindex => "4", :id => "login-submit")
|
92
|
+
input(:type => "submit", :class => "button", :accesskey => "l", :value => _("LOGIN"), :tabindex => "4", :id => "login-submit")
|
93
93
|
end
|
94
94
|
end
|
95
95
|
tr do
|
@@ -108,7 +108,7 @@ module CASServer::Views
|
|
108
108
|
td(:colspan => 2) do
|
109
109
|
div(:id => "headline-container") do
|
110
110
|
strong organization
|
111
|
-
text " Central Login"
|
111
|
+
text _(" Central Login")
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|
data/lib/rubycas-server.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require '
|
1
|
+
require 'casserver'
|