+ /**
+ * Override for RequireValidatedEmail plugin. If we have a user who's
+ * not validated an e-mail, but did come from a trusted provider,
+ * we'll consider them ok.
+ */
+ function hasTrustedOpenID($user)
+ {
+ if ($this->trustedOpenIDs && class_exists('User_openid')) {
+ foreach ($this->trustedOpenIDs as $regex) {
+ $oid = new User_openid();
+ $oid->user_id = $user->id;
+ $oid->find();
+ while ($oid->fetch()) {
+ if (preg_match($regex, $oid->canonical)) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => 'Require Validated Email',
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Craig Andrews, Evan Prodromou, Brion Vibber',
+ 'homepage' => 'http://status.net/wiki/Plugin:RequireValidatedEmail',
+ 'rawdescription' =>
+ _m('The Require Validated Email plugin disables posting for accounts that do not have a validated email address.'));
+ return true;
+ }
+}