author | Dan |
Tue, 17 Mar 2009 00:25:50 -0400 | |
changeset 11 | 794e7b1a97e7 |
parent 10 | 748fa1b80031 |
child 13 | cfc9c33fc880 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/**!info** |
|
3 |
{ |
|
4 |
"Plugin Name" : "Yubikey authentication", |
|
5 |
"Plugin URI" : "http://enanocms.org/plugin/yubikey", |
|
6 |
"Description" : "Allows authentication to Enano via Yubico's Yubikey, a one-time password device.", |
|
7 |
"Author" : "Dan Fuhry", |
|
8 |
"Version" : "1.1.6", |
|
9 |
"Author URI" : "http://enanocms.org/" |
|
10 |
} |
|
11 |
**!*/ |
|
12 |
||
13 |
// Include files |
|
14 |
require( ENANO_ROOT . '/plugins/yubikey/corelib.php' ); |
|
15 |
require( ENANO_ROOT . '/plugins/yubikey/admincp.php' ); |
|
16 |
||
17 |
if ( getConfig('yubikey_enable', '1') == '1' ) |
|
18 |
{ |
|
19 |
require( ENANO_ROOT . '/plugins/yubikey/auth.php' ); |
|
20 |
require( ENANO_ROOT . '/plugins/yubikey/usercp.php' ); |
|
21 |
} |
|
22 |
||
23 |
// Install schema: MySQL |
|
24 |
/**!install dbms="mysql"; ** |
|
25 |
CREATE TABLE {{TABLE_PREFIX}}yubikey( |
|
26 |
yubi_id int(12) NOT NULL auto_increment, |
|
27 |
user_id mediumint(8) NOT NULL DEFAULT 1, |
|
28 |
yubi_uid char(12) NOT NULL DEFAULT '____________', |
|
29 |
PRIMARY KEY ( yubi_id ) |
|
30 |
) ENGINE `MyISAM` CHARACTER SET `utf8` COLLATE `utf8_bin`; |
|
31 |
||
32 |
ALTER TABLE {{TABLE_PREFIX}}users ADD COLUMN user_yubikey_flags smallint(3) NOT NULL DEFAULT 0; |
|
33 |
**!*/ |
|
34 |
||
35 |
// Install schema: PostgreSQL |
|
36 |
/**!install dbms="postgresql"; ** |
|
37 |
CREATE TABLE {{TABLE_PREFIX}}yubikey( |
|
38 |
yubi_id SERIAL, |
|
39 |
user_id int NOT NULL DEFAULT 1, |
|
40 |
yubi_uid char(12) NOT NULL DEFAULT '____________', |
|
41 |
PRIMARY KEY ( yubi_id ) |
|
42 |
); |
|
43 |
||
44 |
ALTER TABLE {{TABLE_PREFIX}}users ADD COLUMN user_yubikey_flags smallint NOT NULL DEFAULT 0; |
|
45 |
**!*/ |
|
46 |
||
47 |
// Uninstall schema |
|
48 |
/**!uninstall** |
|
49 |
DROP TABLE {{TABLE_PREFIX}}yubikey; |
|
1
86d41fd204a0
Typo! STOP -> DROP. See Spot run. Spot runs to the house. Spot licks Dick. Dick pets Spot.
Dan
parents:
0
diff
changeset
|
50 |
ALTER TABLE {{TABLE_PREFIX}}users DROP user_yubikey_flags; |
0 | 51 |
**!*/ |
52 |
||
53 |
/**!language** |
|
54 |
||
55 |
The following text up to the closing comment tag is JSON language data. |
|
56 |
It is not PHP code but your editor or IDE may highlight it as such. This |
|
57 |
data is imported when the plugin is loaded for the first time; it provides |
|
58 |
the strings displayed by this plugin's interface. |
|
59 |
||
60 |
You should copy and paste this block when you create your own plugins so |
|
61 |
that these comments and the basic structure of the language data is |
|
62 |
preserved. All language data is in the same format as the Enano core |
|
63 |
language files in the /language/* directories. See the Enano Localization |
|
64 |
Guide and Enano API Documentation for further information on the format of |
|
65 |
language files. |
|
66 |
||
67 |
The exception in plugin language file format is that multiple languages |
|
68 |
may be specified in the language block. This should be done by way of making |
|
69 |
the top-level elements each a JSON language object, with elements named |
|
70 |
according to the ISO-639-1 language they are representing. The path should be: |
|
71 |
||
72 |
root => language ID => categories array, ( strings object => category \ |
|
73 |
objects => strings ) |
|
74 |
||
75 |
All text leading up to first curly brace is stripped by the parser; using |
|
76 |
a code tag makes jEdit and other editors do automatic indentation and |
|
77 |
syntax highlighting on the language data. The use of the code tag is not |
|
78 |
necessary; it is only included as a tool for development. |
|
79 |
||
80 |
<code> |
|
81 |
{ |
|
82 |
// english |
|
83 |
eng: { |
|
84 |
categories: [ 'meta', 'yubiauth', 'yubiucp', 'yubiacp' ], |
|
85 |
strings: { |
|
86 |
meta: { |
|
87 |
yubiauth: 'Yubikey authentication messages', |
|
88 |
yubiucp: 'Yubikey user CP', |
|
89 |
yubiacp: 'Yubikey admin CP', |
|
90 |
}, |
|
91 |
yubiauth: { |
|
92 |
msg_please_touch_key: 'Please touch your Yubikey', |
|
93 |
msg_close_instructions: 'Press <tt>Esc</tt> to cancel', |
|
94 |
msg_invalid_chars: 'OTP contains invalid characters', |
|
8
032ca892b9a2
Added option to enroll Yubikey during registration + option in admin CP to require enrollment
Dan
parents:
5
diff
changeset
|
95 |
msg_too_long: 'OTP is too long', |
0 | 96 |
msg_validating_otp: 'Validating OTP...', |
97 |
msg_otp_valid: 'OTP validated', |
|
98 |
btn_enter_otp: 'Enter a Yubikey OTP', |
|
99 |
lbl_otp_field: 'Yubikey OTP:', |
|
100 |
||
101 |
ctl_btn_change_key: 'Change key', |
|
102 |
ctl_btn_clear: 'Clear', |
|
103 |
ctl_btn_enroll: 'Enroll', |
|
104 |
ctl_status_enrolled_pending: 'Enrolled (pending)', |
|
105 |
ctl_status_empty: 'Not enrolled', |
|
106 |
ctl_status_remove_pending: 'Removed (pending)', |
|
107 |
ctl_status_enrolled: 'Enrolled', |
|
108 |
||
109 |
err_invalid_otp: 'Your login was rejected because the Yubikey OTP you entered contains invalid characters.', |
|
110 |
err_invalid_auth_url: 'Login with Yubikey was rejected because the URL to the authentication server is not valid.', |
|
111 |
err_nothing_provided: 'You did not provide a Yubikey OTP or a username. One of these is required for login to work.', |
|
112 |
err_must_have_otp: 'Please provide a Yubikey OTP to log in to this account.', |
|
113 |
err_must_have_username: 'Please provide your username.', |
|
5 | 114 |
err_must_have_password: 'Please enter your password in addition to your username and Yubikey.', |
0 | 115 |
err_key_not_authorized: 'This Yubikey is not authorized on this site.', |
116 |
err_otp_invalid_chars: '%this.yubiauth_err_invalid_otp%', |
|
117 |
err_missing_api_key: 'Your OTP could not be validated because no Yubico API key is registered on this site.', |
|
118 |
err_http_response_error: 'Your OTP could not be validated because the Yubico authentication server reported an error.', |
|
119 |
err_malformed_response: 'Your OTP could not be validated because the Yubico authentication server returned an unexpected response.', |
|
10 | 120 |
err_timestamp_check_failed: 'Your OTP could not be validated because the timestamp of the response from the Yubico authentication server was out of bounds.', |
0 | 121 |
err_response_missing_sig: 'Your OTP could not be validated because the Yubico authentication server did not sign its response.', |
122 |
err_response_invalid_sig: 'Your OTP could not be validated because the signature of the authentication response was invalid.', |
|
123 |
err_response_missing_status: '%this.yubiauth_err_malformed_response%', |
|
124 |
err_response_ok: 'OTP is OK', |
|
125 |
err_response_bad_otp: 'Authentication failed because the Yubikey OTP is invalid.', |
|
126 |
err_response_replayed_otp: 'Authentication failed because the Yubikey OTP you entered has been used before.', |
|
127 |
err_response_bad_signature: 'Authentication failed because the Yubico authentication server reported an invalid signature.', |
|
128 |
err_response_missing_parameter: 'Authentication failed because of a Dan Fuhry error.', |
|
129 |
err_response_no_such_client: 'Authentication failed because the Yubikey you used is not registered with Yubico.', |
|
130 |
err_response_operation_not_allowed: 'Authentication failed because the Enano server was denied the request to validate the OTP.', |
|
131 |
err_response_backend_error: 'Authentication failed because an unexpected problem happened with the Yubico server.', |
|
132 |
err_response_security_error: 'Authentication failed because the Yubico authentication server reported an unknown security error.', |
|
133 |
||
134 |
specialpage_yubikey: 'Yubikey API' |
|
135 |
}, |
|
136 |
yubiucp: { |
|
137 |
panel_title: 'Yubikey settings', |
|
138 |
||
139 |
field_enable_title: 'Enable Yubikey support on my account:', |
|
140 |
field_enable_hint: 'Disabling support will remove any keys that are enrolled for your account.', |
|
141 |
field_enable: 'Enabled', |
|
142 |
field_keys_title: 'Enrolled Yubikeys:', |
|
143 |
field_keys_hint: 'Enroll a Yubikey to allow it to log into your account.', |
|
144 |
field_keys_maximum: 'You can enroll up to %max% Yubikeys.', |
|
145 |
field_normal_flags: 'When logging in:', |
|
146 |
field_elev_flags: 'When performing sensitive operations:', |
|
147 |
field_flags_keyonly: 'Only require my Yubikey', |
|
148 |
field_flags_username: 'Require a username', |
|
149 |
field_flags_userandpw: 'Require a username and password', |
|
150 |
field_allow_plain_login: 'Allow me to log in without my Yubikey', |
|
151 |
field_allow_plain_login_hint: 'If this option is turned off, you will be unable to access your account if all of your enrolled Yubikeys become lost or broken. However, turning this option off provides greater security.', |
|
152 |
err_double_enrollment: 'One of the Yubikeys you tried to enroll is already enrolled on another account on this website. A single Yubikey can only be associated with one account at a time.', |
|
8
032ca892b9a2
Added option to enroll Yubikey during registration + option in admin CP to require enrollment
Dan
parents:
5
diff
changeset
|
153 |
err_double_enrollment_single: 'The Yubikey you tried to enroll is already enrolled on another account on this website. A single Yubikey can only be associated with one account at a time.', |
032ca892b9a2
Added option to enroll Yubikey during registration + option in admin CP to require enrollment
Dan
parents:
5
diff
changeset
|
154 |
|
032ca892b9a2
Added option to enroll Yubikey during registration + option in admin CP to require enrollment
Dan
parents:
5
diff
changeset
|
155 |
reg_field_otp: 'Enroll a <a href="http://www.yubico.com/products/yubikey" onclick="window.open(this.href); return false;">Yubikey</a>:', |
032ca892b9a2
Added option to enroll Yubikey during registration + option in admin CP to require enrollment
Dan
parents:
5
diff
changeset
|
156 |
reg_field_otp_hint_optional: 'If you have a Yubikey, you can authorize it for use in your new account here.', |
032ca892b9a2
Added option to enroll Yubikey during registration + option in admin CP to require enrollment
Dan
parents:
5
diff
changeset
|
157 |
reg_field_otp_hint_required: 'Please enroll a Yubikey here to create an account. This is a required step.', |
032ca892b9a2
Added option to enroll Yubikey during registration + option in admin CP to require enrollment
Dan
parents:
5
diff
changeset
|
158 |
reg_err_otp_required: 'Please enroll a Yubikey to register on this site.', |
032ca892b9a2
Added option to enroll Yubikey during registration + option in admin CP to require enrollment
Dan
parents:
5
diff
changeset
|
159 |
reg_err_otp_invalid: 'Your Yubikey OTP failed to validate.' |
0 | 160 |
}, |
161 |
yubiacp: { |
|
162 |
th: 'Yubikey authentication', |
|
163 |
field_enable_title: 'Yubikey support:', |
|
164 |
field_enable: 'Enable Yubikey authentication', |
|
165 |
field_api_key: 'Yubico API key:', |
|
166 |
field_api_key_id: 'Yubico numeric ID:', |
|
167 |
field_auth_server: 'Authentication server URL:', |
|
168 |
field_enroll_limit: 'Number of enrolled keys permitted per account:', |
|
8
032ca892b9a2
Added option to enroll Yubikey during registration + option in admin CP to require enrollment
Dan
parents:
5
diff
changeset
|
169 |
field_reg_require_otp_title: 'Yubikey required for registration:', |
032ca892b9a2
Added option to enroll Yubikey during registration + option in admin CP to require enrollment
Dan
parents:
5
diff
changeset
|
170 |
field_reg_require_otp_hint: 'If this is enabled, users will be asked to enroll a Yubikey during registration. The enrolled Yubikey will be authorized for the new account.', |
032ca892b9a2
Added option to enroll Yubikey during registration + option in admin CP to require enrollment
Dan
parents:
5
diff
changeset
|
171 |
field_reg_require_otp: 'Require Yubikey during registration', |
0 | 172 |
|
173 |
err_invalid_auth_server: 'The URL to the Yubikey authentication server that you entered is invalid.' |
|
174 |
} |
|
175 |
} |
|
176 |
} |
|
177 |
} |
|
178 |
</code> |
|
179 |
**!*/ |
|
180 |