Эх сурвалжийг харах

Yealink directory listing for extensions, groups, users contacts (#1588)

* Fix Yealink provisioning for contacts/groups

Fix the Yealink provision templates to allow for directory_extensions,
groups and users.

* Fix group_uuid and user_uuid messup

* Yealink directory and provisioning changes

Includes the changes from PR 1582 with some fixes to the SQL.

Also merged all the directory_* options into ONE directory.xml

Will need to call the it with any of these:

http://mydomain/app/provision/?file=directory.xml&contacts=groups

http://mydomain/app/provision/?file=directory.xml&contacts=users

http://mydomain/app/provision/?file=directory.xml&contacts=extensions

http://mydomain/app/provision/?file=directory.xml&contacts=all
Chris Black 9 жил өмнө
parent
commit
979bd8a428
1 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 3 3
      contacts.php

+ 3 - 3
contacts.php

@@ -76,13 +76,13 @@ else {
 		$sql .= "and ( \n"; //only contacts assigned to current user's group(s) and those not assigned to any group
 		$sql .= "	contact_uuid in ( \n";
 		$sql .= "		select contact_uuid from v_contact_groups ";
-		$sql .= "		where group_uuid in ('".implode("','", $user_group_uuids)."') ";
+		$sql .= "		where group_uuid in ('".implode("','", array_filter($user_group_uuids))."') ";
 		$sql .= "		and domain_uuid = '".$_SESSION['domain_uuid']."' ";
 		$sql .= "	) \n";
 		$sql .= "	or \n";
 		$sql .= "	contact_uuid not in ( \n";
 		$sql .= "		select contact_uuid from v_contact_groups ";
-		$sql .= "		where user_uuid = '".$_SESSION['user_uuid']."' ";
+		$sql .= "		where group_uuid = '".$_SESSION['group_uuid']."' ";
 		$sql .= "		and domain_uuid = '".$_SESSION['domain_uuid']."' ";
 		$sql .= "	) \n";
 		$sql .= ") \n";
@@ -105,7 +105,7 @@ else {
 		$sql .= "and ( \n"; //only contacts assigned to current user's group(s) and those not assigned to any group
 		$sql .= "	contact_uuid in ( \n";
 		$sql .= "		select contact_uuid from v_contact_groups ";
-		$sql .= "		where group_uuid in ('".implode("','", $user_group_uuids)."') ";
+		$sql .= "		where group_uuid in ('".implode("','", array_filter($user_group_uuids))."') ";
 		$sql .= "		and domain_uuid = '".$_SESSION['domain_uuid']."' ";
 		$sql .= "	) \n";
 		$sql .= "	or contact_uuid in ( \n";