[guadec-web] Registration testing role hack
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [guadec-web] Registration testing role hack
- Date: Thu, 27 Jun 2013 14:34:04 +0000 (UTC)
commit c309c2238ea1796065d8a2bad31727db205cec1d
Author: Rui Matos <tiagomatos gmail com>
Date: Tue Jun 25 00:33:04 2013 +0200
Registration testing role hack
wordcamp-base/custom/custom.php | 7 +++++++
wordcamp-base/template-registration.php | 9 +++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/wordcamp-base/custom/custom.php b/wordcamp-base/custom/custom.php
index 810b651..13f513c 100644
--- a/wordcamp-base/custom/custom.php
+++ b/wordcamp-base/custom/custom.php
@@ -200,4 +200,11 @@ function my_reset_password_message($content, $key) {
return $message;
}
+
+function create_registration_role()
+{
+ add_role('registration', 'Registration', array('read' => true));
+}
+add_action('init', 'create_registration_role');
+
?>
diff --git a/wordcamp-base/template-registration.php b/wordcamp-base/template-registration.php
index c79cae6..d965892 100644
--- a/wordcamp-base/template-registration.php
+++ b/wordcamp-base/template-registration.php
@@ -677,6 +677,14 @@ if (is_user_logged_in()) {
global $current_user;
get_currentuserinfo();
+ $u = wp_get_current_user();
+ foreach ($u->roles as $r) {
+ if ($r != 'registration') {
+ echo "<p>Registration isn't available at this time.</p>";
+ goto out;
+ }
+ }
+
$completed = (bool)$wpdb->get_var("select completed from $table_name where user_ID = $current_user->ID");
$pending_registration = ($wpdb->num_rows > 0 && !$completed);
@@ -706,6 +714,7 @@ if (is_user_logged_in()) {
wp_register("Don't have a GUADEC account yet? ", "");
}
+out:
echo "</div></div></div></div>";
get_sidebar();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]