~canonical-isd-hackers/vbulletin-openid-integration/trunk

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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<!--
Copyright 2009 William Norris
Copyright 2009 Anthony Lenton
Copyright 2012 Canonical

This file is part of vbulletin-openid-integration.

vbulletin-openid-integration is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

vbulletin-openid-integration is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser Public License for more details.

You should have received a copy of the GNU Lesser Public License
along with vbulletin-openid-integration.  If not, see <http://www.gnu.org/licenses/>.
-->
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="openid" active="1">
    <title>OpenID</title>
    <description>OpenID Authentication</description>
    <version>1.0.0</version>
    <codes>
        <code version="1.0">
            <installcode><![CDATA[
require_once('openid_utils.php');
$secret = generate_password(15);
$vbulletin->options['openid_secret'] = $secret;
require_once('openid_store.php');
_createDBTables($vbulletin);
]]></installcode>
            <uninstallcode><![CDATA[
require_once('openid_store.php');
_removeDBTables($vbulletin);
            ]]></uninstallcode>
        </code>
    </codes>
    <templates>
        <template name="openid_redirect_form" templatetype="template" username="achuni" version="1.0.0"><![CDATA[
<html><head><title>OpenID request</title></head>
<body onload="document.getElementById('$form_id').submit();"
      style="text-align: center;">
  <div style="background: lightyellow; border: 1px solid black; margin: 30px 20%; padding: 5px 15px;">
    <p> $text_redirect </p>
  </div>
  $form_html
</body></html>]]></template>
        <template name="openid_request_email" templatetype="template" username="achuni" version="1.0.0"><![CDATA[$stylevar[htmldoctype]
<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - $vbphrase[registration]</title>
</head>
<body>

$header

<br />

<if condition="$show['errors']">
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
    <tr>
        <td class="tcat">The following errors occurred during your registration:</td>
    </tr>
    <tr>
        <td class="alt1"><ul>$errorlist</ul></td>
    </tr>
    </table>
    <br />
</if>

<form action="login.php?do=login" name="login" method="post">
<input type="hidden" name="do" value="login" />
<input type="hidden" name="openid" value="$openid" />
<input type="hidden" name="openid_confirm" value="$openid_confirm" />
<input type="hidden" name="openid_username" value="$openid_username" />
<input type="hidden" name="openid_action" value="request_email" />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
    <td class="tcat"><phrase 1="$vboptions[bbtitle]">$vbphrase[register_at_x]</phrase></td>
</tr>
<tr>
    <td class="panelsurround" align="center">
    <div class="panel">
        <div style="width:$stylevar[formwidth]" align="$stylevar[left]">

            <fieldset class="fieldset">
                <legend>$vbphrase[email_address]</legend>
                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="400">
                <tr>
                    <td>
                        $vbphrase[email_address]:<br />
                        <input type="text" class="bginput" name="email" size="25" maxlength="50" value="$email" dir="ltr" />
                    </td>
                    <td>
                        Confirm email address:<br />
                        <input type="text" class="bginput" name="email_confirm" size="25" maxlength="50" value="$email_confirm" dir="ltr" />
                    </td>
                </tr>
                </table>
            </fieldset>
        </div>
    </div>
    <div style="margin-top:$stylevar[cellpadding]px">
        <input type="submit" class="button" value="Complete Registration" accesskey="s" />
        <input type="reset" class="button" name="Reset" value="$vbphrase[reset_fields]" />
    </div>
    </td>
</tr>
</table>
</form>

$footer

</body>
</html>]]></template>
        <template name="openid_request_user_pass" templatetype="template" username="achuni" version="1.0.0"><![CDATA[
$stylevar[htmldoctype]
<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - $vbphrase[registration]</title>
</head>
<body>

$header

<br />

<if condition="$show['errors']">
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
    <tr>
        <td class="tcat">$vbphrase[openid_first_time]</td>
    </tr>
    <tr>
        <td class="alt1"><ul>$errorlist</ul></td>
    </tr>
    </table>
    <br />
</if>

<form action="login.php?do=login" name="login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
    <td class="tcat">$vbphrase[openid_fieldset_assoc_address]</td>
</tr>
<tr>
    <td class="panelsurround" align="center">
    <ul>$vbphrase[openid_description_assoc]</ul>
    <div class="panel" style="width:$stylevar[formwidth]">
        <div style="width:$stylevar[formwidth]" align="$stylevar[left]">

        <!-- login form -->
        <input type="hidden" name="do" value="login" />
        <input type="hidden" name="openid" value="$openid" />
        <input type="hidden" name="openid_confirm" value="$openid_confirm" />
        <input type="hidden" name="openid_action" value="request_user" />
        <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
        <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
        <tr>
            <td style="white-space: nowrap;"><label for="navbar_username">$vbphrase[username]</label></td>
            <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>
        </tr>
        <tr>
            <td><label for="navbar_password">$vbphrase[password]</label></td>
            <td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
        </tr>
        <tr>
            <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>
        </tr>
        </table>
        <input type="hidden" name="s" value="$session[sessionhash]" />
        <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken] . "" />
        <input type="hidden" name="do" value="login" />
        <input type="hidden" name="vb_login_md5password" />
        <input type="hidden" name="vb_login_md5password_utf" />
        <!-- / login form -->
        </div>
    </div>
    <div style="margin-top:$stylevar[cellpadding]px">
        <input type="submit" class="button" tabindex="104" value="$vbphrase[openid_button_assoc]" accesskey="s"  title="$vbphrase[enter_username_to_login_or_register]" />
        <input type="reset" class="button" name="Reset" value="$vbphrase[reset_fields]" />
    </div>
    </td>
</tr>
</table>
</form>
<br/>

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
    <td class="tcat">$vbphrase[openid_fieldset_register]</td>
</tr>
<tr>
    <td class="alt1"><ul>$vbphrase[openid_description_register]</ul></td>
</tr>
</table>

$footer

</body>
</html>
]]>
</template>
        <template name="openid_login_box" templatetype="template" date="1152640721" username="wnorris" version="1.0.0"><![CDATA[
<!-- OpenID Login Box -->
<div id="openid_login">
    <a href="#"><img style="border:0" src="$stylevar[imgdir_button]/openid.png" alt="OpenID" /></a>
    <script type="text/javascript">vbmenu_register("openid_login");</script>
</div>

<div class="vbmenu_popup" id="openid_login_menu" style="display:none">
    <table cellpadding="4" cellspacing="1" border="0">
        <tr>
            <td class="thead">OpenID Login</td>
        </tr>
        <tr>
            <td class="vbmenu_option" title="nohilite">
            <form action="login.php" method="post">
                <input type="hidden" name="do" value="login" />
                <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" />&nbsp;<input type="submit" class="button" value="Go"  /><br />
            </form>
            </td>
        </tr>
    </table>
</div>
<!-- / OpenID Login Box -->
        ]]></template>
    </templates>
    <plugins>
        <plugin active="1">
            <title>OpenID Login Box</title>
            <hookname>cache_templates</hookname>
            <phpcode><![CDATA[$globaltemplates = array_merge($globaltemplates, array('openid_login_box', 'openid_request_email', 'openid_redirect_form'));]]></phpcode>
        </plugin>
        <plugin active="1">
            <title>Fix OpenID POST vars</title>
            <hookname>global_start</hookname>
            <phpcode><![CDATA[if (THIS_SCRIPT == 'login' AND $_REQUEST['do'] == 'login' AND ($_REQUEST['openid'] OR $_REQUEST['openid.mode'] OR $_REQUEST['openid_mode']))
{
    $_POST['do'] = 'login';
    if (!$_POST['vb_login_username']) {
        $_POST['vb_login_username'] = '.';
    }
}]]></phpcode>
        </plugin>
        <plugin active="1">
            <title>OpenID Authentication</title>
            <hookname>login_failure</hookname>
            <phpcode><![CDATA[include('openid_authenticate.php');]]></phpcode>
        </plugin>
        <plugin active="1">
            <title>OpenID associate existing user </title>
            <hookname>login_process</hookname>
            <phpcode><![CDATA[include('openid_associate.php');]]></phpcode>
        </plugin>
        <plugin active="1">
            <title>OpenID Login Box</title>
            <hookname>parse_templates</hookname>
            <phpcode><![CDATA[eval('$openid_login_box = "' . fetch_template('openid_login_box') . '";');]]></phpcode>
        </plugin>
    </plugins>
    <phrases>
        <phrasetype name="vBulletin Settings" fieldname="vbsettings">
            <phrase name="setting_openid_field_desc"><![CDATA[Name of the custom profile field used for storing OpenIDs.]]></phrase>
            <phrase name="setting_openid_field_title"><![CDATA[OpenID Profile Field]]></phrase>
            <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>
            <phrase name="setting_openid_secret_title"><![CDATA[A Random Secret]]></phrase>
            <phrase name="setting_openid_math_desc"><![CDATA[Does this PHP installation have advanced math support such as gmp or bcmath?]]></phrase>
            <phrase name="setting_openid_math_title"><![CDATA[Math Support]]></phrase>
            <phrase name="setting_openid_auto_register_desc"><![CDATA[Automatically register a new user when an unknown OpenID is authenticated?]]></phrase>
            <phrase name="setting_openid_auto_register_title"><![CDATA[Automatic User Registration]]></phrase>
            <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>
            <phrase name="setting_openid_path_title"><![CDATA[Library Path]]></phrase>
            <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>
            <phrase name="setting_openid_allowedproviders_title"><![CDATA[Allowed Providers]]></phrase>
            <phrase name="settinggroup_openid"><![CDATA[OpenID]]></phrase>
        </phrasetype>
        <phrasetype name="GLOBAL" fieldname="global">
            <phrase name="openid_fieldset_assoc_address"><![CDATA[Associate OpenID to an existing account]]></phrase>
            <phrase name="openid_fieldset_register"><![CDATA[Register a new account]]></phrase>
            <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>
            <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>
            <phrase name="openid_button_assoc"><![CDATA[Associate my ID to this account]]></phrase>
            <phrase name="openid_first_time"><![CDATA[It's the first time you sign in using this OpenID]]></phrase>
            <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>
        </phrasetype>
        <phrasetype name="Error Messages" fieldname="error">
            <phrase name="openid_tamperedform"><![CDATA[Inconsistencies were detected in your form values.  Please re-authenticate with your OpenID provider]]></phrase>
            <phrase name="openid_server_not_allowed"><![CDATA[Sorry, we currently don't accept OpenIDs from your server ({1})]]></phrase>
            <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>
        </phrasetype>
    </phrases>
    <options>
        <settinggroup name="openid" displayorder="999">
            <setting varname="openid_path" displayorder="10">
                <datatype>free</datatype>
            </setting>
            <setting varname="openid_math" displayorder="20">
                <datatype>boolean</datatype>
                <optioncode>yesno</optioncode>
                <defaultvalue>0</defaultvalue>
            </setting>
            <setting varname="openid_auto_register" displayorder="30">
                <datatype>boolean</datatype>
                <optioncode>yesno</optioncode>
                <defaultvalue>0</defaultvalue>
            </setting>
            <setting varname="openid_field" displayorder="50">
                <datatype>free</datatype>
                <defaultvalue>OpenID</defaultvalue>
            </setting>
            <setting varname="openid_allowedproviders" displayorder="60">
                <datatype>free</datatype>
            </setting>
            <setting varname="openid_secret" displayorder="70">
                <datatype>free</datatype>
                <defaultvalue>CHANGEME</defaultvalue>
            </setting>
        </settinggroup>
    </options>
</product>