Revision 7859,
1.2 KB
checked in by alexandrecorreia, 11 years ago
(diff) |
Ticket #2507 - Correções dos retornos, padronização das variáveis
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | class SearchUserResource extends AdminAdapter |
---|
4 | { |
---|
5 | |
---|
6 | public function post($request) |
---|
7 | { |
---|
8 | // to Receive POST Params (use $this->params) |
---|
9 | parent::post($request); |
---|
10 | |
---|
11 | if( $this->isLoggedIn() ) |
---|
12 | { |
---|
13 | //Permission |
---|
14 | $permission = array(); |
---|
15 | $permission['action'] = 'list_users'; |
---|
16 | $permission['apps'] = $this->getUserApps(); |
---|
17 | |
---|
18 | //Load Conf Admin |
---|
19 | $this->loadConfAdmin(); |
---|
20 | |
---|
21 | if( $this->validatePermission($permission) ) |
---|
22 | { |
---|
23 | $searchUser = $this->getParam('accountSearchUser'); |
---|
24 | |
---|
25 | if( trim($searchUser) == "" && isset($searchUser) ) |
---|
26 | Errors::runException( "ADMIN_SEARCH_USER_EMPTY" ); |
---|
27 | |
---|
28 | $list = $this->listUsers( $searchUser ); |
---|
29 | |
---|
30 | $user = array(); |
---|
31 | |
---|
32 | foreach( $list as $_u ) |
---|
33 | { |
---|
34 | $user['accountId'] = $_u['account_id']; |
---|
35 | $user['accountLid'] = $_u['account_lid']; |
---|
36 | $user['accountCn'] = $_u['account_cn']; |
---|
37 | $user['accountMail'] = $_u['account_mail']; |
---|
38 | } |
---|
39 | |
---|
40 | if( count($list) > 0 ) |
---|
41 | { |
---|
42 | $this->setResult( array( "searchUser" => $user ) ); |
---|
43 | } |
---|
44 | else |
---|
45 | { |
---|
46 | Errors::runException( "ADMIN_USERS_NOT_FOUND" ); |
---|
47 | } |
---|
48 | } |
---|
49 | else |
---|
50 | { |
---|
51 | Errors::runException( "ACCESS_NOT_PERMITTED" ); |
---|
52 | } |
---|
53 | |
---|
54 | } |
---|
55 | |
---|
56 | return $this->getResponse(); |
---|
57 | } |
---|
58 | } |
---|
59 | |
---|
60 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.