summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-10 10:07:52 -0800
committerBrion Vibber <brion@pobox.com>2010-03-10 10:07:52 -0800
commit9b75e162c7002c1f29fa4ba6c1bfab7fb6b163f8 (patch)
tree048a7386747a577cc7c5106ddee080f79f80546e
parentddb656fcd2a3233b26e28987d2f3425944908d30 (diff)
parent69b2f19b6fef793aa607c6d8f4590b93e2565626 (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
-rw-r--r--plugins/RequireValidatedEmail/README2
-rw-r--r--plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php23
-rw-r--r--plugins/RequireValidatedEmail/locale/RequireValidatedEmail.po31
3 files changed, 53 insertions, 3 deletions
diff --git a/plugins/RequireValidatedEmail/README b/plugins/RequireValidatedEmail/README
index ccd94d271..46ee24d5f 100644
--- a/plugins/RequireValidatedEmail/README
+++ b/plugins/RequireValidatedEmail/README
@@ -14,8 +14,6 @@ registered prior to that timestamp.
Todo:
-* make email field required on registration form
* add a more visible indicator that validation is still outstanding
-* localization for UI strings
* test with XMPP, API posting
diff --git a/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php b/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
index 3581f1de9..ccefa14f6 100644
--- a/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
+++ b/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
@@ -54,13 +54,34 @@ class RequireValidatedEmailPlugin extends Plugin
$user = User::staticGet('id', $notice->profile_id);
if (!empty($user)) { // it's a remote notice
if (!$this->validated($user)) {
- throw new ClientException(_("You must validate your email address before posting."));
+ throw new ClientException(_m("You must validate your email address before posting."));
}
}
return true;
}
/**
+ * Event handler for registration attempts; rejects the registration
+ * if email field is missing.
+ *
+ * @param RegisterAction $action
+ * @return bool hook result code
+ */
+ function onStartRegistrationTry($action)
+ {
+ $email = $action->trimmed('email');
+
+ if (empty($email)) {
+ $action->showForm(_m('You must provide an email address to register.'));
+ return false;
+ }
+
+ // Default form will run address format validation and reject if bad.
+
+ return true;
+ }
+
+ /**
* Check if a user has a validated email address or has been
* otherwise grandfathered in.
*
diff --git a/plugins/RequireValidatedEmail/locale/RequireValidatedEmail.po b/plugins/RequireValidatedEmail/locale/RequireValidatedEmail.po
new file mode 100644
index 000000000..49ac4f6f4
--- /dev/null
+++ b/plugins/RequireValidatedEmail/locale/RequireValidatedEmail.po
@@ -0,0 +1,31 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-03-10 10:05-0800\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: RequireValidatedEmailPlugin.php:57
+msgid "You must validate your email address before posting."
+msgstr ""
+
+#: RequireValidatedEmailPlugin.php:75
+msgid "You must provide an email address to register."
+msgstr ""
+
+#: RequireValidatedEmailPlugin.php:128
+msgid ""
+"The Require Validated Email plugin disables posting for accounts that do not "
+"have a validated email address."
+msgstr ""