summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-28 14:43:34 -0800
committerEvan Prodromou <evan@status.net>2009-12-28 14:43:34 -0800
commit39bdda9c7e7ee7571298c84c406a9dd74805f050 (patch)
tree953d39f93f2e3738e792e925486d92433e1ecfbf /classes
parent29a1669c01135faf125b2e53718a4112f14525fd (diff)
More configuration options for location sharing
Diffstat (limited to 'classes')
-rw-r--r--classes/User.php26
1 files changed, 17 insertions, 9 deletions
diff --git a/classes/User.php b/classes/User.php
index 2bcb7c2a0..34151778c 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -999,17 +999,25 @@ class User extends Memcached_DataObject
function shareLocation()
{
- $share = true;
+ $cfg = common_config('location', 'share');
- $prefs = User_location_prefs::staticGet('user_id', $this->id);
+ if ($cfg == 'always') {
+ return true;
+ } else if ($cfg == 'never') {
+ return false;
+ } else { // user
+ $share = true;
- if (empty($prefs)) {
- $share = common_config('location', 'share');
- } else {
- $share = $prefs->share_location;
- $prefs->free();
- }
+ $prefs = User_location_prefs::staticGet('user_id', $this->id);
- return $share;
+ if (empty($prefs)) {
+ $share = common_config('location', 'sharedefault');
+ } else {
+ $share = $prefs->share_location;
+ $prefs->free();
+ }
+
+ return $share;
+ }
}
}