diff options
author | friendica <info@friendica.com> | 2014-08-17 17:48:41 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-08-17 17:48:41 -0700 |
commit | 82eb265a20d73beff7673299a6c4ab8a4d8b8673 (patch) | |
tree | 8e67b7f7a86f800e810d7c45f15368ce91c748bc | |
parent | bf3dc80233147a1dab9f034a192750f765d0436b (diff) | |
download | volse-hubzilla-82eb265a20d73beff7673299a6c4ab8a4d8b8673.tar.gz volse-hubzilla-82eb265a20d73beff7673299a6c4ab8a4d8b8673.tar.bz2 volse-hubzilla-82eb265a20d73beff7673299a6c4ab8a4d8b8673.zip |
add collections widget to connections page - and some more work on realms
-rw-r--r-- | include/widgets.php | 7 | ||||
-rw-r--r-- | include/zot.php | 16 | ||||
-rw-r--r-- | mod/connections.php | 3 | ||||
-rw-r--r-- | version.inc | 2 | ||||
-rw-r--r-- | view/pdl/mod_connections.pdl | 1 |
5 files changed, 27 insertions, 2 deletions
diff --git a/include/widgets.php b/include/widgets.php index 96bced87f..1aa018fb6 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -48,6 +48,13 @@ function widget_collections($args) { $abook_id = 0; $wmode = 0; break; + case 'connections': + $every = 'connections'; + $each = 'group'; + $edit = true; + $current = $_REQUEST['gid']; + $abook_id = 0; + $wmode = 0; case 'groups': $every = 'connections'; $each = argv(0); diff --git a/include/zot.php b/include/zot.php index bd9526f2d..8dcc19522 100644 --- a/include/zot.php +++ b/include/zot.php @@ -989,8 +989,22 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) { // Are we a directory server of some kind? + $other_realm = false; + $realm = get_directory_realm(); + if(array_key_exists('site',$arr) + && array_key_exists('realm',$arr['site']) + && (strpos($arr['site']['realm'],$realm) !== false)) + $other_realm = true; + if($dirmode != DIRECTORY_MODE_NORMAL) { - if(array_key_exists('profile',$arr) && is_array($arr['profile'])) { + + // We're some kind of directory server. However we can only add directory information + // if the entry is in the same realm (or is a sub-realm). Sub-realms are denoted by + // including the parent realm in the name. e.g. 'RED_GLOBAL:foo' would allow an entry to + // be in directories for the local realm (foo) and also the RED_GLOBAL realm. + + + if(array_key_exists('profile',$arr) && is_array($arr['profile']) && (! $other_realm)) { $profile_changed = import_directory_profile($xchan_hash,$arr['profile'],$address,$ud_flags, 1); if($profile_changed) { $what .= 'profile '; diff --git a/mod/connections.php b/mod/connections.php index 1875ed908..028889647 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -337,6 +337,9 @@ function connections_content(&$a) { } $sql_extra .= (($searching) ? protect_sprintf(" AND xchan_name like '%$search_txt%' ") : ""); + if($_REQUEST['gid']) { + $sql_extra .= " and xchan_hash in ( select xchan from group_member where gid = " . intval($_REQUEST['gid']) . " and uid = " . intval(local_user()) . " ) "; + } $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and not (abook_flags & %d) and not (xchan_flags & %d ) $sql_extra $sql_extra2 ", diff --git a/version.inc b/version.inc index 652a04db0..6d17789e1 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2014-08-16.769 +2014-08-17.770 diff --git a/view/pdl/mod_connections.pdl b/view/pdl/mod_connections.pdl index fc86e4490..fd3f25483 100644 --- a/view/pdl/mod_connections.pdl +++ b/view/pdl/mod_connections.pdl @@ -1,5 +1,6 @@ [region=aside] [widget=follow][/widget] +[widget=collections][var=mode][connections[/arg][/widget] [widget=suggestions][/widget] [widget=findpeople][/widget] [/region] |