More configuration options for location sharing
This commit is contained in:
parent
29a1669c01
commit
39bdda9c7e
@ -999,12 +999,19 @@ class User extends Memcached_DataObject
|
||||
|
||||
function shareLocation()
|
||||
{
|
||||
$cfg = common_config('location', 'share');
|
||||
|
||||
if ($cfg == 'always') {
|
||||
return true;
|
||||
} else if ($cfg == 'never') {
|
||||
return false;
|
||||
} else { // user
|
||||
$share = true;
|
||||
|
||||
$prefs = User_location_prefs::staticGet('user_id', $this->id);
|
||||
|
||||
if (empty($prefs)) {
|
||||
$share = common_config('location', 'share');
|
||||
$share = common_config('location', 'sharedefault');
|
||||
} else {
|
||||
$share = $prefs->share_location;
|
||||
$prefs->free();
|
||||
@ -1012,4 +1019,5 @@ class User extends Memcached_DataObject
|
||||
|
||||
return $share;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -226,7 +226,8 @@ $default =
|
||||
'message' =>
|
||||
array('contentlimit' => null),
|
||||
'location' =>
|
||||
array(),
|
||||
array('share' => 'user', // whether to share location; 'always', 'user', 'never'
|
||||
'sharedefault' => true),
|
||||
'omb' =>
|
||||
array('timeout' => 5), // HTTP request timeout in seconds when contacting remote hosts for OMB updates
|
||||
'logincommand' =>
|
||||
|
Loading…
Reference in New Issue
Block a user