add collections widget to connections page - and some more work on realms
This commit is contained in:
		| @@ -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); | ||||
|   | ||||
| @@ -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 '; | ||||
|   | ||||
| @@ -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 ", | ||||
|   | ||||
| @@ -1 +1 @@ | ||||
| 2014-08-16.769 | ||||
| 2014-08-17.770 | ||||
|   | ||||
| @@ -1,5 +1,6 @@ | ||||
| [region=aside] | ||||
| [widget=follow][/widget] | ||||
| [widget=collections][var=mode][connections[/arg][/widget] | ||||
| [widget=suggestions][/widget] | ||||
| [widget=findpeople][/widget] | ||||
| [/region] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user