summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorbus Iff2011-12-14 13:16:43 (GMT)
committer Morbus Iff2011-12-14 13:16:43 (GMT)
commit34da989d543d9b21e09241a6734c6eb98d79a670 (patch)
tree8142332614314a6008ba4c1b7518f8f04c38d0e4
parent93b7172940f5ae6719b7092ca495d8e1a42e5fdc (diff)
Switching TRUE to NULL in opt-out.
-rw-r--r--achievements.api.php3
-rw-r--r--achievements_optout/achievements_optout.module9
2 files changed, 9 insertions, 3 deletions
diff --git a/achievements.api.php b/achievements.api.php
index 9515192..74b0ed9 100644
--- a/achievements.api.php
+++ b/achievements.api.php
@@ -258,7 +258,8 @@ function example_query_alter(QueryAlterableInterface $query) {
* The user ID whose access is being questioned.
*
* @return
- * TRUE if the $uid can earn achievements, FALSE if they can't.
+ * TRUE if the $uid can earn achievements, FALSE if they can't,
+ * or NULL if there's no change to the user's default access.
*/
function example_achievements_access_earn($uid) {
$account = user_load($uid);
diff --git a/achievements_optout/achievements_optout.module b/achievements_optout/achievements_optout.module
index 9390884..0ca3d2b 100644
--- a/achievements_optout/achievements_optout.module
+++ b/achievements_optout/achievements_optout.module
@@ -44,6 +44,11 @@ function achievements_optout_achievements_access_earn($uid) {
->fieldCondition('achievements_optout', 'value', 1);
$result = $query->execute();
- // results? you opted for no access.
- return count($result) ? FALSE : TRUE;
+ // they've opted out.
+ if (count($result)) {
+ return FALSE;
+ }
+
+ // NULL for "no change".
+ return NULL;
} \ No newline at end of file