1
by Ricardo Kirkner
Initial release |
1 |
<!--
|
2 |
Copyright 2009 William Norris
|
|
3 |
Copyright 2009 Anthony Lenton
|
|
4 |
Copyright 2012 Canonical
|
|
5 |
||
6 |
This file is part of vbulletin-openid-integration.
|
|
7 |
||
8 |
vbulletin-openid-integration is free software: you can redistribute it and/or
|
|
9 |
modify it under the terms of the GNU Lesser Public License as published by
|
|
10 |
the Free Software Foundation, either version 3 of the License, or
|
|
11 |
(at your option) any later version.
|
|
12 |
||
13 |
vbulletin-openid-integration is distributed in the hope that it will be
|
|
14 |
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16 |
GNU Lesser Public License for more details.
|
|
17 |
||
18 |
You should have received a copy of the GNU Lesser Public License
|
|
19 |
along with vbulletin-openid-integration. If not, see <http://www.gnu.org/licenses/>.
|
|
20 |
-->
|
|
21 |
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
22 |
||
23 |
<product productid="openid" active="1"> |
|
24 |
<title>OpenID</title> |
|
25 |
<description>OpenID Authentication</description> |
|
26 |
<version>1.0.0</version> |
|
27 |
<codes>
|
|
28 |
<code version="1.0"> |
|
29 |
<installcode><![CDATA[ |
|
30 |
require_once('openid_utils.php');
|
|
31 |
$secret = generate_password(15);
|
|
32 |
$vbulletin->options['openid_secret'] = $secret;
|
|
33 |
require_once('openid_store.php');
|
|
34 |
_createDBTables($vbulletin);
|
|
35 |
]]></installcode> |
|
36 |
<uninstallcode><![CDATA[ |
|
37 |
require_once('openid_store.php');
|
|
38 |
_removeDBTables($vbulletin);
|
|
39 |
]]></uninstallcode> |
|
40 |
</code>
|
|
41 |
</codes>
|
|
42 |
<templates>
|
|
43 |
<template name="openid_redirect_form" templatetype="template" username="achuni" version="1.0.0"><![CDATA[ |
|
44 |
<html><head><title>OpenID request</title></head>
|
|
45 |
<body onload="document.getElementById('$form_id').submit();"
|
|
46 |
style="text-align: center;">
|
|
47 |
<div style="background: lightyellow; border: 1px solid black; margin: 30px 20%; padding: 5px 15px;">
|
|
48 |
<p> $text_redirect </p>
|
|
49 |
</div>
|
|
50 |
$form_html
|
|
51 |
</body></html>]]></template> |
|
52 |
<template name="openid_request_email" templatetype="template" username="achuni" version="1.0.0"><![CDATA[$stylevar[htmldoctype] |
|
53 |
<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
|
|
54 |
<head>
|
|
55 |
$headinclude
|
|
56 |
<title>$vboptions[bbtitle] - $vbphrase[registration]</title>
|
|
57 |
</head>
|
|
58 |
<body>
|
|
59 |
||
60 |
$header
|
|
61 |
||
62 |
<br />
|
|
63 |
||
64 |
<if condition="$show['errors']">
|
|
65 |
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
|
|
66 |
<tr>
|
|
67 |
<td class="tcat">The following errors occurred during your registration:</td>
|
|
68 |
</tr>
|
|
69 |
<tr>
|
|
70 |
<td class="alt1"><ul>$errorlist</ul></td>
|
|
71 |
</tr>
|
|
72 |
</table>
|
|
73 |
<br />
|
|
74 |
</if>
|
|
75 |
||
76 |
<form action="login.php?do=login" name="login" method="post">
|
|
77 |
<input type="hidden" name="do" value="login" />
|
|
78 |
<input type="hidden" name="openid" value="$openid" />
|
|
79 |
<input type="hidden" name="openid_confirm" value="$openid_confirm" />
|
|
80 |
<input type="hidden" name="openid_username" value="$openid_username" />
|
|
81 |
<input type="hidden" name="openid_action" value="request_email" />
|
|
82 |
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
|
|
83 |
<tr>
|
|
84 |
<td class="tcat"><phrase 1="$vboptions[bbtitle]">$vbphrase[register_at_x]</phrase></td>
|
|
85 |
</tr>
|
|
86 |
<tr>
|
|
87 |
<td class="panelsurround" align="center">
|
|
88 |
<div class="panel">
|
|
89 |
<div style="width:$stylevar[formwidth]" align="$stylevar[left]">
|
|
90 |
||
91 |
<fieldset class="fieldset">
|
|
92 |
<legend>$vbphrase[email_address]</legend>
|
|
93 |
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="400">
|
|
94 |
<tr>
|
|
95 |
<td>
|
|
96 |
$vbphrase[email_address]:<br />
|
|
97 |
<input type="text" class="bginput" name="email" size="25" maxlength="50" value="$email" dir="ltr" />
|
|
98 |
</td>
|
|
99 |
<td>
|
|
100 |
Confirm email address:<br />
|
|
101 |
<input type="text" class="bginput" name="email_confirm" size="25" maxlength="50" value="$email_confirm" dir="ltr" />
|
|
102 |
</td>
|
|
103 |
</tr>
|
|
104 |
</table>
|
|
105 |
</fieldset>
|
|
106 |
</div>
|
|
107 |
</div>
|
|
108 |
<div style="margin-top:$stylevar[cellpadding]px">
|
|
109 |
<input type="submit" class="button" value="Complete Registration" accesskey="s" />
|
|
110 |
<input type="reset" class="button" name="Reset" value="$vbphrase[reset_fields]" />
|
|
111 |
</div>
|
|
112 |
</td>
|
|
113 |
</tr>
|
|
114 |
</table>
|
|
115 |
</form>
|
|
116 |
||
117 |
$footer
|
|
118 |
||
119 |
</body>
|
|
120 |
</html>]]></template> |
|
121 |
<template name="openid_request_user_pass" templatetype="template" username="achuni" version="1.0.0"><![CDATA[ |
|
122 |
$stylevar[htmldoctype]
|
|
123 |
<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
|
|
124 |
<head>
|
|
125 |
$headinclude
|
|
126 |
<title>$vboptions[bbtitle] - $vbphrase[registration]</title>
|
|
127 |
</head>
|
|
128 |
<body>
|
|
129 |
||
130 |
$header
|
|
131 |
||
132 |
<br />
|
|
133 |
||
134 |
<if condition="$show['errors']">
|
|
135 |
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
|
|
136 |
<tr>
|
|
137 |
<td class="tcat">$vbphrase[openid_first_time]</td>
|
|
138 |
</tr>
|
|
139 |
<tr>
|
|
140 |
<td class="alt1"><ul>$errorlist</ul></td>
|
|
141 |
</tr>
|
|
142 |
</table>
|
|
143 |
<br />
|
|
144 |
</if>
|
|
145 |
||
146 |
<form action="login.php?do=login" name="login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
|
|
147 |
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
|
|
148 |
<tr>
|
|
149 |
<td class="tcat">$vbphrase[openid_fieldset_assoc_address]</td>
|
|
150 |
</tr>
|
|
151 |
<tr>
|
|
152 |
<td class="panelsurround" align="center">
|
|
153 |
<ul>$vbphrase[openid_description_assoc]</ul>
|
|
154 |
<div class="panel" style="width:$stylevar[formwidth]">
|
|
155 |
<div style="width:$stylevar[formwidth]" align="$stylevar[left]">
|
|
156 |
||
157 |
<!-- login form -->
|
|
158 |
<input type="hidden" name="do" value="login" />
|
|
159 |
<input type="hidden" name="openid" value="$openid" />
|
|
160 |
<input type="hidden" name="openid_confirm" value="$openid_confirm" />
|
|
161 |
<input type="hidden" name="openid_action" value="request_user" />
|
|
162 |
<script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
|
|
163 |
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
|
|
164 |
<tr>
|
|
165 |
<td style="white-space: nowrap;"><label for="navbar_username">$vbphrase[username]</label></td>
|
|
166 |
<td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$openid_username" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
|
|
167 |
</tr>
|
|
168 |
<tr>
|
|
169 |
<td><label for="navbar_password">$vbphrase[password]</label></td>
|
|
170 |
<td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
|
|
171 |
</tr>
|
|
172 |
<tr>
|
|
173 |
<td nowrap="nowrap" colspan="2"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>
|
|
174 |
</tr>
|
|
175 |
</table>
|
|
176 |
<input type="hidden" name="s" value="$session[sessionhash]" />
|
|
177 |
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken] . "" />
|
|
178 |
<input type="hidden" name="do" value="login" />
|
|
179 |
<input type="hidden" name="vb_login_md5password" />
|
|
180 |
<input type="hidden" name="vb_login_md5password_utf" />
|
|
181 |
<!-- / login form -->
|
|
182 |
</div>
|
|
183 |
</div>
|
|
184 |
<div style="margin-top:$stylevar[cellpadding]px">
|
|
185 |
<input type="submit" class="button" tabindex="104" value="$vbphrase[openid_button_assoc]" accesskey="s" title="$vbphrase[enter_username_to_login_or_register]" />
|
|
186 |
<input type="reset" class="button" name="Reset" value="$vbphrase[reset_fields]" />
|
|
187 |
</div>
|
|
188 |
</td>
|
|
189 |
</tr>
|
|
190 |
</table>
|
|
191 |
</form>
|
|
192 |
<br/>
|
|
193 |
||
194 |
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
|
|
195 |
<tr>
|
|
196 |
<td class="tcat">$vbphrase[openid_fieldset_register]</td>
|
|
197 |
</tr>
|
|
198 |
<tr>
|
|
199 |
<td class="alt1"><ul>$vbphrase[openid_description_register]</ul></td>
|
|
200 |
</tr>
|
|
201 |
</table>
|
|
202 |
||
203 |
$footer
|
|
204 |
||
205 |
</body>
|
|
206 |
</html>
|
|
207 |
]]>
|
|
208 |
</template>
|
|
209 |
<template name="openid_login_box" templatetype="template" date="1152640721" username="wnorris" version="1.0.0"><![CDATA[ |
|
210 |
<!-- OpenID Login Box -->
|
|
211 |
<div id="openid_login">
|
|
212 |
<a href="#"><img style="border:0" src="$stylevar[imgdir_button]/openid.png" alt="OpenID" /></a>
|
|
213 |
<script type="text/javascript">vbmenu_register("openid_login");</script>
|
|
214 |
</div>
|
|
215 |
||
216 |
<div class="vbmenu_popup" id="openid_login_menu" style="display:none">
|
|
217 |
<table cellpadding="4" cellspacing="1" border="0">
|
|
218 |
<tr>
|
|
219 |
<td class="thead">OpenID Login</td>
|
|
220 |
</tr>
|
|
221 |
<tr>
|
|
222 |
<td class="vbmenu_option" title="nohilite">
|
|
223 |
<form action="login.php" method="post">
|
|
224 |
<input type="hidden" name="do" value="login" />
|
|
225 |
<input type="text" style="background:white url(http://openid.net/login-bg.gif) no-repeat 1px 1px; padding-left:20px" class="bginput" name="openid" size="20" /> <input type="submit" class="button" value="Go" /><br />
|
|
226 |
</form>
|
|
227 |
</td>
|
|
228 |
</tr>
|
|
229 |
</table>
|
|
230 |
</div>
|
|
231 |
<!-- / OpenID Login Box -->
|
|
232 |
]]></template> |
|
233 |
</templates>
|
|
234 |
<plugins>
|
|
235 |
<plugin active="1"> |
|
236 |
<title>OpenID Login Box</title> |
|
237 |
<hookname>cache_templates</hookname> |
|
238 |
<phpcode><![CDATA[$globaltemplates = array_merge($globaltemplates, array('openid_login_box', 'openid_request_email', 'openid_redirect_form'));]]></phpcode> |
|
239 |
</plugin>
|
|
240 |
<plugin active="1"> |
|
241 |
<title>Fix OpenID POST vars</title> |
|
242 |
<hookname>global_start</hookname> |
|
243 |
<phpcode><![CDATA[if (THIS_SCRIPT == 'login' AND $_REQUEST['do'] == 'login' AND ($_REQUEST['openid'] OR $_REQUEST['openid.mode'] OR $_REQUEST['openid_mode'])) |
|
244 |
{
|
|
245 |
$_POST['do'] = 'login';
|
|
246 |
if (!$_POST['vb_login_username']) {
|
|
247 |
$_POST['vb_login_username'] = '.';
|
|
248 |
}
|
|
249 |
}]]></phpcode> |
|
250 |
</plugin>
|
|
251 |
<plugin active="1"> |
|
252 |
<title>OpenID Authentication</title> |
|
253 |
<hookname>login_failure</hookname> |
|
254 |
<phpcode><![CDATA[include('openid_authenticate.php');]]></phpcode> |
|
255 |
</plugin>
|
|
256 |
<plugin active="1"> |
|
257 |
<title>OpenID associate existing user </title> |
|
258 |
<hookname>login_process</hookname> |
|
259 |
<phpcode><![CDATA[include('openid_associate.php');]]></phpcode> |
|
260 |
</plugin>
|
|
261 |
<plugin active="1"> |
|
262 |
<title>OpenID Login Box</title> |
|
263 |
<hookname>parse_templates</hookname> |
|
264 |
<phpcode><![CDATA[eval('$openid_login_box = "' . fetch_template('openid_login_box') . '";');]]></phpcode> |
|
265 |
</plugin>
|
|
266 |
</plugins>
|
|
267 |
<phrases>
|
|
268 |
<phrasetype name="vBulletin Settings" fieldname="vbsettings"> |
|
269 |
<phrase name="setting_openid_field_desc"><![CDATA[Name of the custom profile field used for storing OpenIDs.]]></phrase> |
|
270 |
<phrase name="setting_openid_field_title"><![CDATA[OpenID Profile Field]]></phrase> |
|
271 |
<phrase name="setting_openid_secret_desc"><![CDATA[A randomly generated secret to avoid OpenID tampering during automatic registration, after authenticating with the provider, but before we create the user.]]></phrase> |
|
272 |
<phrase name="setting_openid_secret_title"><![CDATA[A Random Secret]]></phrase> |
|
273 |
<phrase name="setting_openid_math_desc"><![CDATA[Does this PHP installation have advanced math support such as gmp or bcmath?]]></phrase> |
|
274 |
<phrase name="setting_openid_math_title"><![CDATA[Math Support]]></phrase> |
|
275 |
<phrase name="setting_openid_auto_register_desc"><![CDATA[Automatically register a new user when an unknown OpenID is authenticated?]]></phrase> |
|
276 |
<phrase name="setting_openid_auto_register_title"><![CDATA[Automatic User Registration]]></phrase> |
|
277 |
<phrase name="setting_openid_path_desc"><![CDATA[If the OpenID libraries aren't available on the standard include path, enter the directory where they are installed.]]></phrase> |
|
278 |
<phrase name="setting_openid_path_title"><![CDATA[Library Path]]></phrase> |
|
279 |
<phrase name="setting_openid_allowedproviders_desc"><![CDATA[Coma-separated list of allowed providers. Each provider is taken as a regex to check if a particular server should be allowed. Leave blank to allow all providers.]]></phrase> |
|
280 |
<phrase name="setting_openid_allowedproviders_title"><![CDATA[Allowed Providers]]></phrase> |
|
281 |
<phrase name="settinggroup_openid"><![CDATA[OpenID]]></phrase> |
|
282 |
</phrasetype>
|
|
283 |
<phrasetype name="GLOBAL" fieldname="global"> |
|
284 |
<phrase name="openid_fieldset_assoc_address"><![CDATA[Associate OpenID to an existing account]]></phrase> |
|
285 |
<phrase name="openid_fieldset_register"><![CDATA[Register a new account]]></phrase> |
|
286 |
<phrase name="openid_description_assoc"><![CDATA[If you already have a forum account and want to associate this ID to it, please fill in this form.]]></phrase> |
|
287 |
<phrase name="openid_description_register"><![CDATA[If you don't yet have a forum account and want to register a new one, please <a href="register.php">click here</a>.]]></phrase> |
|
288 |
<phrase name="openid_button_assoc"><![CDATA[Associate my ID to this account]]></phrase> |
|
289 |
<phrase name="openid_first_time"><![CDATA[It's the first time you sign in using this OpenID]]></phrase> |
|
290 |
<phrase name="openid_no_auto_register"><![CDATA[Sorry, you'll need to first associate this OpenID to an existing forum user, <b><big>or</big></b> register a new account to be able to sign in with your OpenID, as automatic user registration is disabled.]]></phrase> |
|
291 |
</phrasetype>
|
|
292 |
<phrasetype name="Error Messages" fieldname="error"> |
|
293 |
<phrase name="openid_tamperedform"><![CDATA[Inconsistencies were detected in your form values. Please re-authenticate with your OpenID provider]]></phrase> |
|
294 |
<phrase name="openid_server_not_allowed"><![CDATA[Sorry, we currently don't accept OpenIDs from your server ({1})]]></phrase> |
|
295 |
<phrase name="openid_redirect"><![CDATA[You are about to be redirected to your OpenID provider. If you are not redirected automatically, please click the continue button below.]]></phrase> |
|
296 |
</phrasetype>
|
|
297 |
</phrases>
|
|
298 |
<options>
|
|
299 |
<settinggroup name="openid" displayorder="999"> |
|
300 |
<setting varname="openid_path" displayorder="10"> |
|
301 |
<datatype>free</datatype> |
|
302 |
</setting>
|
|
303 |
<setting varname="openid_math" displayorder="20"> |
|
304 |
<datatype>boolean</datatype> |
|
305 |
<optioncode>yesno</optioncode> |
|
306 |
<defaultvalue>0</defaultvalue> |
|
307 |
</setting>
|
|
308 |
<setting varname="openid_auto_register" displayorder="30"> |
|
309 |
<datatype>boolean</datatype> |
|
310 |
<optioncode>yesno</optioncode> |
|
311 |
<defaultvalue>0</defaultvalue> |
|
312 |
</setting>
|
|
313 |
<setting varname="openid_field" displayorder="50"> |
|
314 |
<datatype>free</datatype> |
|
315 |
<defaultvalue>OpenID</defaultvalue> |
|
316 |
</setting>
|
|
317 |
<setting varname="openid_allowedproviders" displayorder="60"> |
|
318 |
<datatype>free</datatype> |
|
319 |
</setting>
|
|
320 |
<setting varname="openid_secret" displayorder="70"> |
|
321 |
<datatype>free</datatype> |
|
322 |
<defaultvalue>CHANGEME</defaultvalue> |
|
323 |
</setting>
|
|
324 |
</settinggroup>
|
|
325 |
</options>
|
|
326 |
</product>
|