Merge lp:~joey/linaro-wordpress-registration-form/lce12updates into lp:linaro-wordpress-registration-form

Proposed by Joey Stanford
Status: Merged
Approved by: James Tunnicliffe
Approved revision: 63
Merged at revision: 62
Proposed branch: lp:~joey/linaro-wordpress-registration-form/lce12updates
Merge into: lp:linaro-wordpress-registration-form
Diff against target: 396 lines (+246/-36)
2 files modified
launchpad_login.php (+212/-0)
linaro_connect.php (+34/-36)
To merge this branch: bzr merge lp:~joey/linaro-wordpress-registration-form/lce12updates
Reviewer Review Type Date Requested Status
James Tunnicliffe (community) Approve
Review via email: mp+117935@code.launchpad.net

Commit message

Changes made to open up LCE12 registration. Added the Launchpad Login Wordpress file to the branch since it's customized for registration.

Description of the change

Changes made to open up LCE12 registration. Added the Launchpad Login Wordpress file to the branch since it's customized for registration.

To post a comment you must log in.
Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'launchpad_login.php'
2--- launchpad_login.php 1970-01-01 00:00:00 +0000
3+++ launchpad_login.php 2012-08-02 15:54:40 +0000
4@@ -0,0 +1,212 @@
5+<?php
6+/*
7+ * Wordpress Launchpad plugin
8+ * Copyright (C) 2009-2010 Canonical Ltd.
9+ *
10+ * This program is free software: you can redistribute it and/or modify
11+ * it under the terms of the GNU Affero General Public License as published by
12+ * the Free Software Foundation, either version 3 of the License, or
13+ * (at your option) any later version.
14+ *
15+ * This program is distributed in the hope that it will be useful,
16+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
17+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+ * GNU Affero General Public License for more details.
19+ *
20+ * You should have received a copy of the GNU Affero General Public License
21+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
22+ */
23+
24+/**
25+ * Custom WordPress User Page for Launchpad login
26+ *
27+ * V1.0 - Launchpad Devs
28+ * V2.0 - Danilo Segan
29+ * V3.0 - Joey Stanford/Ian Davenport
30+ */
31+?>
32+<style type="text/css">
33+html {
34+ background: black!important;
35+}
36+body {
37+ background: black!important;
38+ color: white;
39+ font-size: 10pt;
40+}
41+div#login {
42+ width: 50em;
43+ margin: 2em auto!important;
44+}
45+div#login ol {
46+ margin-left: 2em;
47+ margin-right: 2em;
48+}
49+div#login ol li {
50+ margin-bottom: 0.5em;
51+}
52+
53+div#submit input[type=submit] {
54+ font-size: 140%;
55+ padding: 0.5em;
56+}
57+
58+div#logincontent {
59+ background: white;
60+ color: #444;
61+ padding: 2em;
62+ -webkit-border-radius: 1em;
63+ -moz-border-radius: 1em;
64+ border-radius: 1em;
65+}
66+div#logincontent p {
67+ padding-bottom: 1em;
68+}
69+#loginform {
70+ padding-bottom:15px;
71+}
72+
73+#loginform div.submit {
74+ text-align: center;
75+ float:none;
76+}
77+</style>
78+</head>
79+<body class="login">
80+<div id="login">
81+ <h2><a href="<?php
82+ echo apply_filters('login_headerurl',
83+ 'http://connect.linaro.org/events/event/lce12-copenhagen/'); ?>"
84+ title="<?php echo apply_filters('login_headertitle', __('Linaro')); ?>">
85+ <img src="http://www.linaro.org/remote/images/linaro-connect-logo.png" alt="<?php bloginfo('name'); ?>" />
86+ </a></h2>
87+ <h2>Registration for Linaro Connect Europe 2012 (LCE12)</h2>
88+
89+<div id="logincontent">
90+<?php
91+// Reproduce WP's message showing from wp-login.php
92+global $wp_error;
93+if (empty($wp_error)) {
94+ $wp_error = new WP_Error();
95+}
96+
97+global $message;
98+if (!empty($message)) {
99+ echo apply_filters('login_message', $message) . "\n";
100+}
101+
102+// Compute $redirect_to
103+if (isset( $_REQUEST['redirect_to'])) {
104+ $redirect_to = $_REQUEST['redirect_to'];
105+} else {
106+ $redirect_to = admin_url();
107+}
108+
109+// In case a plugin uses $error rather than the $errors object
110+global $error;
111+if (!empty($error)) {
112+ $wp_error->add('error', $error);
113+ unset($error);
114+}
115+
116+// Some parts of this script use the main login form to display a message
117+if (isset($_GET['loggedout']) && TRUE == $_GET['loggedout']) {
118+ $wp_error->add('loggedout', __('You are now logged out.'), 'message');
119+}
120+
121+if ($wp_error->get_error_code()) {
122+ $errors = '';
123+ $messages = '';
124+ foreach ($wp_error->get_error_codes() as $code) {
125+ $severity = $wp_error->get_error_data($code);
126+ foreach ($wp_error->get_error_messages($code) as $error) {
127+ if ('message' == $severity)
128+ $messages .= ' ' . $error . "<br />\n";
129+ else
130+ $errors .= ' ' . $error . "<br />\n";
131+ }
132+ }
133+ if (!empty($errors)) {
134+ echo '<div id="login_error">' . apply_filters('login_errors', $errors) . "</div>\n";
135+ }
136+ if (!empty($messages)) {
137+ echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n";
138+ }
139+}
140+
141+ $login_button = __('Login');
142+
143+// if (strpos(openid_launchpad_get_server(), 'ubuntu') === false) {
144+// $login_button = __('Login with Launchpad');
145+// } else {
146+// $login_button = __('Login with Ubuntu Single Sign On');
147+// }
148+?>
149+
150+
151+<p>
152+ There are 2 steps we will take you through to complete your LCE12 registration:
153+</p>
154+
155+<ol>
156+<li>
157+ <strong>Connect your Launchpad account to the event:</strong>
158+ This will enable you to subscribe to meetings during the week that most
159+ interest you and create your own personal schedule. If you do not yet have
160+ a Launchpad account, it will be created as part of the registration
161+ process.
162+</li>
163+
164+
165+<li>
166+ <strong>Complete our registration form:</strong> This provides Linaro with key
167+ information for each of our delegates, to help ensure you have a
168+ successful event
169+</li>
170+</ol>
171+
172+<p>
173+ The registration will take between 5 – 10 minutes to complete. After you
174+ have connected your Launchpad account, you can save your registration
175+ form at any point and complete it later.
176+</p>
177+
178+<p>
179+ When you complete the form, the details will be e-mailed to you and you
180+ can amend them at any point up to the start of the event.
181+</p>
182+
183+<p>
184+ If you have any problems, mail
185+ <a href="mailto:connect@linaro.org">connect@linaro.org</a>.
186+</p>
187+
188+<p>Now press Login to proceed…</p>
189+
190+<form name="loginform" id="loginform"
191+ action="<?php echo site_url('wp-login.php', 'login_post') ?>"
192+ method="post">
193+ <div class="submit">
194+ <input type="submit" name="launchpad" value="<?php echo
195+ $login_button; ?>" id="lplogin" />
196+ <input type="hidden" name="redirect_to"
197+ value="<?php echo attribute_escape($redirect_to); ?>" />
198+ <input type="hidden" name="testcookie" value="1" />
199+ </div>
200+</form>
201+
202+</div>
203+<p class="text-align: left;">
204+ <a href="http://connect.linaro.org/events/event/lce12-copenhagen/" title="<?php _e('Are you lost?')
205+ ?>" style="color: #afa;">
206+ <?php printf(__('&laquo; Back to %s'), get_bloginfo('title', 'display' )); ?>
207+ </a>
208+</p>
209+</div>
210+
211+
212+<script type="text/javascript">
213+try{document.getElementById('lplogin').focus();}catch(e){}
214+</script>
215+</body>
216+</html>
217
218=== modified file 'linaro_connect.php'
219--- linaro_connect.php 2012-03-02 10:52:12 +0000
220+++ linaro_connect.php 2012-08-02 15:54:40 +0000
221@@ -3,7 +3,7 @@
222 Plugin Name: Linaro Connect Registration
223 Plugin URI: https://launchpad.net/linaro-wordpress-registration-form
224 Description: Allow WordPress users easy registration for Linaro Connects
225-Version: 0.2
226+Version: 0.3
227 Author: Linaro
228 Author URI: https://launchpad.net/~danilo
229 License: AGPL3
230@@ -17,59 +17,56 @@
231
232 Greetings from Linaro Connect!
233
234-Congratulations on registering for our Q2.12 event at the Gold Coast Hotel,
235-Hong Kong - where you can expect another great week of planning,
236+Congratulations on registering LCE12 at the Bella Center, Copenhagen,
237+- where you can expect another great week of planning,
238 discussing and hacking the future of Linux on ARM.
239
240 Please store this e-mail somewhere safe, as it represents all the details
241 you have provided us related to your attendance. If any of the details are
242 incorrect, you can change them here:
243
244- http://connect.linaro.org/register-connect/
245+ http://connect.linaro.org/register-connect/
246
247 If you have requested a visa invitation letter, you can expect it to arrive
248-within 2 weeks. Please contact events@linaro.org if you need it more
249+within 2 weeks. Please contact connect@linaro.org if you need it more
250 quickly, or if you haven't received it within this time.
251
252-Between now and Linaro Connect Q2.12, we highly recommend you check the
253+Between now and LCE12, we highly recommend you check the
254 event website frequently. In particular, make sure you read the Get Involved
255-<http://connect.linaro.org/events/event/linaro-connect-q2-12/#getinvolved> section soon,
256+<http://connect.linaro.org/events/event/lce12-copenhagen/#getinvolved> section soon,
257 and monitor our Schedule
258-<http://connect.linaro.org/events/event/linaro-connect-q2-12/#schedule> page where you
259-can subscribe to sessions you are particularly interested in attending
260+<http://connect.linaro.org/events/event/lce12-copenhagen/#schedule> page where you
261+can subscribe to sessions you are particularly interested in attending.
262
263-We're looking forward to seeing you in May, and if you need any
264+We're looking forward to seeing you in October, and if you need any
265 additional information before then, contact us at the e-mail address below
266
267-
268 Your Linaro Connect Planning Team
269
270-Contact Us: events@linaro.org
271-Website: connect.linaro.org/lcq2-12
272+Contact Us: connect@linaro.org
273+Website: http://connect.linaro.org/events/event/lce12-copenhagen/
274 EOT;
275
276 global $connect_save_email;
277 $connect_save_email = <<<EOT
278 Greetings from Linaro Connect!
279
280-You have partially completed registration for our Q2.12 event at
281-the Gold Coast Hotel, Hong Kong - where you can expect another great week
282+You have partially completed registration for LCE12 at
283+the Bella Center, Copenhagen - where you can expect another great week
284 of planning, discussing and hacking the future of Linux on ARM.
285
286 Your details are saved, but it is important you complete registration as
287-soon as possible as these details help Linaro organise a successful event.
288-
289+soon as possible as these details help Linaro organize a successful event.
290
291 When you are ready to complete your registration, click the Register Now
292-button on the Linaro Connect Q2.12 website or go directly to
293-
294- http://connect.linaro.org/register-connect/
295-
296+button on the LCE12 website or go directly to
297+
298+http://connect.linaro.org/register-connect/
299
300 Your Linaro Connect Planning Team
301
302-Contact Us: events@linaro.org
303-Website: connect.linaro.org/lcq2-12
304+Contact Us: connect@linaro.org
305+Website: http://connect.linaro.org/events/event/lce12-copenhagen/
306 EOT;
307
308
309@@ -295,7 +292,7 @@
310 "TI", "Samsung", "ST Ericsson", "None of the Above");
311 // This is a complete set of options for Linaro engineering team selection.
312 private static $teams = array(
313- "None", "Kernel", "Toolchain", "Power Management", "Graphics", "Multimedia",
314+ "None", "Kernel", "Toolchain", "Power Management", "Graphics",
315 "Member Services", "Android", "Developer Platform", "Infrastructure",
316 "Validation", "Project Management", "Office of the CTO", "Management", "Other");
317 private static $attendance_type = array(1 => "In person",
318@@ -344,7 +341,8 @@
319 }
320
321 $countries = array("HK" => "Hong Kong",
322- "US" => "USA");
323+ "US" => "USA",
324+ "DK" => "Denmark");
325 $destination_country = $countries[$event->location_country];
326
327 return <<<EOT
328@@ -547,16 +545,16 @@
329
330 static function emailRegistered($registration, $user, $event) {
331 global $connect_registration_email;
332- mail($user->user_email, 'Linaro Connect Q2.12 Registration',
333+ mail($user->user_email, 'LCE12 Registration',
334 $connect_registration_email,
335- 'From: events@linaro.org');
336+ 'From: connect@linaro.org');
337 }
338
339 static function emailSaved($registration, $user, $event) {
340 global $connect_save_email;
341- mail($user->user_email, 'Linaro Connect Q2.12 Registration',
342+ mail($user->user_email, 'LCE12 Registration',
343 $connect_save_email,
344- 'From: events@linaro.org');
345+ 'From: connect@linaro.org');
346 }
347
348 static function renderForm($text) {
349@@ -579,22 +577,22 @@
350 important you complete registration as soon as possible as these details
351 help Linaro organise a successful event.</p>
352
353- <p>When you are ready to complete your registration, click the Register Now
354- button on the <a href=\"http://connect.linaro.org/\">Linaro Connect Q2.12
355+ <p>When you are ready to complete your registration, click the Register
356+ Now button on the <a href=\"http://connect.linaro.org/\">LCE12
357 website</a>.</p>";
358 self::emailSaved($registration, $user, $event);
359 return str_replace(self::form_tag, $warn, $text);
360
361 } elseif (self::$button == 'register' && $field_errors === true) {
362 $warn = "
363- <p>Congratulations on registering for Linaro Connect Q2.12.</p>
364+ <p>Congratulations on registering for LCE12.</p>
365 <p>You should receive an email confirming your registration in a
366 few minutes.</p>
367 <p>You will also be subscribed to a mailing list used solely
368 for sending notifications about the Connect event you've
369 just registered for. If you want to be removed from this
370 list, contact
371- <a href=\"mailto:events@linaro.org\">events@linaro.org</a>.</p>";
372+ <a href=\"mailto:connect@linaro.org\">connect@linaro.org</a>.</p>";
373 self::emailRegistered($registration, $user, $event);
374 return str_replace(self::form_tag, $warn, $text);
375 }
376@@ -676,9 +674,9 @@
377
378 <div>
379 <p>Clicking the button "Register" below registers you for
380- Linaro Connect Q2.12 in Hong Kong. If you wish to cancel
381+ LCE12 in Copenhagen. If you wish to cancel
382 your registration, please contact
383- <a href="mailto:events@linaro.org">events@linaro.org</a>.</p>
384+ <a href="mailto:connect@linaro.org">connect@linaro.org</a>.</p>
385 </div>
386 <div>
387 <input name="save" type="submit" id="save" value="Save and complete later" />
388@@ -686,7 +684,7 @@
389 </div>
390 <div>
391 <p>Unless you notify us otherwise by email at
392- <a href="mailto:events@linaro.org">events@linaro.org</a>,
393+ <a href="mailto:connect@linaro.org">connect@linaro.org</a>,
394 you agree that by attending Linaro Connect you grant permission
395 for us to use any photographs taken at the event, which may or
396 may not include you, to be used for Linaro's marketing purposes.

Subscribers

People subscribed via source and target branches