summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-10-07 10:32:29 -0400
committerEvan Prodromou <evan@status.net>2010-10-07 10:32:29 -0400
commit1e3d5f80258811ce1c2154fcd971297e24264894 (patch)
treed1e1e5ac3c68ba92384cca0c6bde29038701d727 /plugins
parentfa45805d6d7f42884b507361ba51028c5180f384 (diff)
hide notice form if not able to post
Diffstat (limited to 'plugins')
-rw-r--r--plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php b/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
index a7d7874f1..6c0ef37d5 100644
--- a/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
+++ b/plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
@@ -216,4 +216,23 @@ class RequireValidatedEmailPlugin extends Plugin
_m('Disables posting without a validated email address.'));
return true;
}
+
+ /**
+ * Hide the notice form if the user isn't able to post.
+ *
+ * @param Action $action action being shown
+ *
+ * @return boolean hook value
+ */
+
+ function onStartShowNoticeForm($action)
+ {
+ $user = common_current_user();
+ if (!empty($user)) { // it's a remote notice
+ if (!$this->validated($user)) {
+ return false;
+ }
+ }
+ return true;
+ }
}