[Freeswitch-svn] [commit] r12798 - freeswitch/trunk/scripts/contrib/swk/php/amfphp

FreeSWITCH SVN silik0n at freeswitch.org
Thu Mar 26 15:01:48 PDT 2009


Author: silik0n
Date: Thu Mar 26 17:01:48 2009
New Revision: 12798

Log:
the start of merging the xml_curl fork to the amf fork

Modified:
   freeswitch/trunk/scripts/contrib/swk/php/amfphp/freeswitch.php

Modified: freeswitch/trunk/scripts/contrib/swk/php/amfphp/freeswitch.php
==============================================================================
--- freeswitch/trunk/scripts/contrib/swk/php/amfphp/freeswitch.php	(original)
+++ freeswitch/trunk/scripts/contrib/swk/php/amfphp/freeswitch.php	Thu Mar 26 17:01:48 2009
@@ -272,6 +272,13 @@
 		return $results;
 	}
 
+	public function getDirDomainbyName($domain_name){
+		$query = sprintf("select * from domains where name = '%s'", $domain_name);
+		$stmt = $this->dbh->query($query);
+		$results = $stmt->fetchAll();
+		return $results[0];
+	}
+
 	public function getDirDomain($domains_uid){
 		$dbh = $this->getDbh();
 		$query = sprintf("select * from domain_params where domains_uid = $domains_uid");
@@ -327,6 +334,13 @@
 
 
 	/* Directory User Methods */
+	public function getDirUsersByDomainUidByUsername($domain_uid, $user_name){
+		$query = sprintf("select * from users where domains_uid = '%s' and username = '%s'", $domain_uid, $user_name);
+		$stmt = $this->dbh->query($query);
+		$results = $stmt->fetchAll();
+		return $results[0];
+	}
+
 	public function getDirUser($user_uid){
 		$dbh = $this->getDbh();
 		$query = sprintf("select * from user_params where users_uid = $user_uid");
@@ -399,6 +413,13 @@
 		return $results;
 	}
 
+	public function getDirGroupsByDomianUidByUserUid($domain_uid, $user_uid){
+		$query = sprintf("select a.uid as groupUid, a.name as groupName, b.uid as usersUid from groups as a, group_members as b where a.uid = b.groups_uid and b.domains_uid = %s and b.users_uid = %s", $domain_uid, $user_uid) ;
+		$stmt = $this->dbh->query($query);
+		$results = $stmt->fetchAll();
+		return $results;
+	}
+
 	public function getDirGroup($groups_uid){
 		$dbh = $this->getDbh();
 		$query = sprintf("select a.uid as groupMemberUid, a.users_uid as usersUid, b.username as usersUsername from group_members as a, users as b where a.groups_uid = $groups_uid and a.users_uid = b.uid") ;



More information about the Freeswitch-svn mailing list