- Timestamp:
- 02/07/13 17:08:23 (12 years ago)
- Location:
- sandbox/webservice/api
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/webservice/api/adapters/AdminAdapter.php
r7873 r7875 112 112 } 113 113 114 protected function listUsersLiteral($params) 115 { 116 $list = $this->listUsers($params); 117 118 foreach( $list as $key => $users ) 119 { 120 if( strtolower(trim($params)) === strtolower(trim($users['account_lid']))) 121 { 122 return $list[$key]; 123 } 124 } 125 126 return false; 127 } 128 114 129 protected function listUsers($params) 115 130 { … … 118 133 $acl = $adminListUser->read_acl($GLOBALS['phpgw']->accounts->data['account_lid']); 119 134 120 $search = trim(preg_replace("/[^a-z_0-9_-_._@ ]/", "", $params));135 $search = trim(preg_replace("/[^a-z_0-9_-_._@\\s]/", "", $params)); 121 136 122 137 $accounts = $adminListUser->get_list( 'accounts', $search, $acl['contexts'] ); -
sandbox/webservice/api/rest/admin/GetUsersResource.php
r7866 r7875 20 20 $uidUser = $this->getParam('accountUidNumber'); 21 21 $searchUser = $this->getParam('accountSearchUser'); 22 22 $searchUserLiteral= $this->getParam('accountSearchUserLID'); 23 23 24 //Validate Fields 24 25 $uidUser = str_replace("*","",$uidUser); … … 27 28 $searchUser = str_replace("*","", $searchUser); 28 29 $searchUser = str_replace("%","", $searchUser); 30 31 $searchUserLiteral = str_replace("*","", $searchUserLiteral); 32 $searchUserLiteral = str_replace("%","", $searchUserLiteral); 29 33 30 34 if( trim($uidUser) != "" && isset($uidUser) ) … … 67 71 if( $this->validatePermission($permission) ) 68 72 { 69 $list = $this->listUsers( $searchUser );70 71 73 // Return list 72 74 $return = array(); 73 75 74 foreach( $list as $key => $users)76 if( trim($searchUser) != "" && isset($searchUser) ) 75 77 { 76 $return[$key]['accountId'] = $users['account_id']; 77 $return[$key]['accountLid'] = $users['account_lid']; 78 $return[$key]['accountCn'] = $users['account_cn']; 79 $return[$key]['accountMail'] = $users['account_mail']; 78 $list = $this->listUsers( $searchUser ); 79 80 foreach( $list as $key => $users ) 81 { 82 $return[$key]['accountId'] = $users['account_id']; 83 $return[$key]['accountLid'] = $users['account_lid']; 84 $return[$key]['accountCn'] = $users['account_cn']; 85 $return[$key]['accountMail'] = $users['account_mail']; 86 } 87 } 88 else 89 { 90 $list = $this->listUsersLiteral($searchUserLiteral); 91 92 $return = $list; 80 93 } 81 94 82 if( count($ list) > 0 )95 if( count($return) > 0 ) 83 96 { 84 97 $this->setResult( array( "users" => $return ) );
Note: See TracChangeset
for help on using the changeset viewer.