-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsimple_password_extension.rb
35 lines (28 loc) · 1.13 KB
/
simple_password_extension.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require_dependency 'application_controller'
require_dependency 'site_controller_ext'
require_dependency 'app/models/simple_password_page'
class SimplePasswordExtension < Radiant::Extension
version "0.1"
description %{
A "Simple Password Page" page protects contents with HTTP Basic
Authentication. The user name, password, and realm are set up in
the "config" page part with the following YAML format:
user: foo
password: secret
realm: kingdom
You will need to quote strings with ambiguous meaning in YAML including
(not limited) to: "!abc", "foo:bar", "null", "true", "false", "yes",
"no", "on", "off" (see http://yaml.org/spec/1.2/#id2588633 and
http://en.wikipedia.org/wiki/YAML#Pitfalls_and_implementation_defects)
SimplePasswordExtension depends on the authenticate_with_http_basic and
request_http_basic_authentication methods, introduced with Rails 2, and
Radiant > 0.6.5.
}
url "git://github.com/yoon/radiant-simple-password-extension.git"
def activate
SiteController.send :include, SimplePassword::SiteControllerExt
SimplePasswordPage
end
def deactivate
end
end