@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | /** |
49 | 49 | * set user's object property data |
50 | - * |
|
50 | + * |
|
51 | 51 | * @param array $data |
52 | 52 | * @param boolean $forceEncryptPassword |
53 | 53 | * @return \Admin\Entity\User |
@@ -125,30 +125,30 @@ |
||
125 | 125 | */ |
126 | 126 | public function exchangeArray($data = array(), $forceEncryptPassword = false) |
127 | 127 | { |
128 | - if (isset($data['id']) && !empty($data["id"]) ) { |
|
128 | + if (isset($data['id']) && !empty($data["id"])) { |
|
129 | 129 | $this->id = ($data['id']); |
130 | 130 | $this->user_id = ($data['id']); |
131 | - } elseif (isset($data['user_id']) && !empty($data["user_id"]) ) { |
|
131 | + } elseif (isset($data['user_id']) && !empty($data["user_id"])) { |
|
132 | 132 | $this->id = ($data['user_id']); |
133 | 133 | $this->user_id = ($data['user_id']); |
134 | 134 | } |
135 | - $this->username = (isset($data['username'])) ? $data['username'] : $this->username; |
|
136 | - $this->email = (isset($data['email'])) ? $data['email'] : $this->email; |
|
137 | - if (isset($data['displayName']) ) { |
|
135 | + $this->username = (isset($data['username'])) ? $data['username'] : $this->username; |
|
136 | + $this->email = (isset($data['email'])) ? $data['email'] : $this->email; |
|
137 | + if (isset($data['displayName'])) { |
|
138 | 138 | $this->display_name = $data['displayName']; |
139 | 139 | $this->displayName = $data['displayName']; |
140 | - } elseif (isset($data['display_name']) ) { |
|
140 | + } elseif (isset($data['display_name'])) { |
|
141 | 141 | $this->display_name = $data['display_name']; |
142 | 142 | $this->displayName = $data['display_name']; |
143 | 143 | } |
144 | - if (isset($data["password"]) && $forceEncryptPassword ) { |
|
144 | + if (isset($data["password"]) && $forceEncryptPassword) { |
|
145 | 145 | $bcrypt = new Bcrypt; |
146 | 146 | $bcrypt->setCost(null); // @TODO $this->getUserService()->getOptions()->getPasswordCost()); |
147 | 147 | $data["password"] = $bcrypt->create($data['password']); |
148 | 148 | } |
149 | - $this->password = (isset($data['password'])) ? $data['password'] : $this->password; |
|
149 | + $this->password = (isset($data['password'])) ? $data['password'] : $this->password; |
|
150 | 150 | $this->state = (isset($data['state'])) ? $data['state'] : $this->state; |
151 | - $this->aclrole = (isset($data['aclrole'])) ? $data['aclrole'] : $this->aclrole; |
|
151 | + $this->aclrole = (isset($data['aclrole'])) ? $data['aclrole'] : $this->aclrole; |
|
152 | 152 | $this->token = (isset($data['token'])) ? $data['token'] : $this->token; |
153 | 153 | |
154 | 154 | return $this; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function fetchAll() |
32 | 32 | { |
33 | 33 | $resultSet = $this->tableGateway->select( |
34 | - function (Select $select) { |
|
34 | + function(Select $select) { |
|
35 | 35 | $select->order('roleslug ASC'); |
36 | 36 | } |
37 | 37 | ); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | public function getAclroleBySlug($role_slug) |
53 | 53 | { |
54 | - $role_slug = trim(strip_tags($role_slug)); |
|
54 | + $role_slug = trim(strip_tags($role_slug)); |
|
55 | 55 | $rowset = $this->tableGateway->select( |
56 | 56 | array( |
57 | 57 | 'roleslug' => $role_slug, |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | 'rolename' => $Aclrole->rolename, |
72 | 72 | ); |
73 | 73 | |
74 | - $id = (int)$Aclrole->aclroles_id; |
|
74 | + $id = (int) $Aclrole->aclroles_id; |
|
75 | 75 | if ($id == 0) { |
76 | 76 | $this->tableGateway->insert($data); |
77 | 77 | } else { |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function fetchAll() |
32 | 32 | { |
33 | 33 | $resultSet = $this->tableGateway->select( |
34 | - function (Select $select) { |
|
34 | + function(Select $select) { |
|
35 | 35 | $select->order('resourceslug ASC'); |
36 | 36 | } |
37 | 37 | ); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | public function getAclresourceBySlug($resource_slug) |
53 | 53 | { |
54 | - $resource_slug = trim(strip_tags($resource_slug)); |
|
54 | + $resource_slug = trim(strip_tags($resource_slug)); |
|
55 | 55 | $rowset = $this->tableGateway->select( |
56 | 56 | array( |
57 | 57 | 'resourceslug' => $resource_slug, |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | 'resourcename' => $Aclresource->resourcename, |
72 | 72 | ); |
73 | 73 | |
74 | - $id = (int)$Aclresource->aclresources_id; |
|
74 | + $id = (int) $Aclresource->aclresources_id; |
|
75 | 75 | if ($id == 0) { |
76 | 76 | $this->tableGateway->insert($data); |
77 | 77 | } else { |
@@ -70,7 +70,7 @@ |
||
70 | 70 | 'state' => $Acl->state, |
71 | 71 | ); |
72 | 72 | |
73 | - $id = (int)$Acl->acl_id; |
|
73 | + $id = (int) $Acl->acl_id; |
|
74 | 74 | if ($id == 0) { |
75 | 75 | $this->tableGateway->insert($data); |
76 | 76 | } else { |
@@ -34,10 +34,10 @@ |
||
34 | 34 | |
35 | 35 | public function exchangeArray($data) |
36 | 36 | { |
37 | - $this->acl_id = (isset($data['acl_id'])) ? $data['acl_id'] : null; |
|
37 | + $this->acl_id = (isset($data['acl_id'])) ? $data['acl_id'] : null; |
|
38 | 38 | $this->aclroles_id = (isset($data['aclroles_id'])) ? $data['aclroles_id'] : null; |
39 | 39 | $this->aclresources_id = (isset($data['aclresources_id'])) ? $data['aclresources_id'] : null; |
40 | - $this->state = (isset($data['state'])) ? $data['state'] : null; |
|
40 | + $this->state = (isset($data['state'])) ? $data['state'] : null; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | public function getArrayCopy() |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | public function exchangeArray($data) |
35 | 35 | { |
36 | - $this->aclroles_id = (isset($data['aclroles_id'])) ? $data['aclroles_id'] : null; |
|
36 | + $this->aclroles_id = (isset($data['aclroles_id'])) ? $data['aclroles_id'] : null; |
|
37 | 37 | $this->roleslug = (isset($data['roleslug'])) ? $data['roleslug'] : null; |
38 | 38 | $this->rolename = (isset($data['rolename'])) ? $data['rolename'] : null; |
39 | 39 | } |
@@ -33,14 +33,14 @@ |
||
33 | 33 | public function __invoke( $resource ) |
34 | 34 | { |
35 | 35 | /** |
36 | - * @var Zend\Permissions\Acl\Acl $acl |
|
36 | + * @var Zend\Permissions\Acl\Acl $acl |
|
37 | 37 | **/ |
38 | 38 | $acl = $this->view->navigation()->getAcl(); |
39 | 39 | if (empty($resource) || !$acl->hasResource($resource) ) { |
40 | 40 | return true; |
41 | 41 | } |
42 | 42 | /** |
43 | - * @var \Admin\Entity\User $user |
|
43 | + * @var \Admin\Entity\User $user |
|
44 | 44 | **/ |
45 | 45 | $user = $this->view->zfcUserIdentity(); // ->getIdentity(); |
46 | 46 | if ($user) { // ($this->getAuthService()->hasIdentity()) { |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | * @access public |
31 | 31 | * @return \ZfcUser\Entity\UserInterface |
32 | 32 | */ |
33 | - public function __invoke( $resource ) |
|
33 | + public function __invoke($resource) |
|
34 | 34 | { |
35 | 35 | /** |
36 | 36 | * @var Zend\Permissions\Acl\Acl $acl |
37 | 37 | **/ |
38 | 38 | $acl = $this->view->navigation()->getAcl(); |
39 | - if (empty($resource) || !$acl->hasResource($resource) ) { |
|
39 | + if (empty($resource) || !$acl->hasResource($resource)) { |
|
40 | 40 | return true; |
41 | 41 | } |
42 | 42 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } else { |
50 | 50 | $role = 'public'; |
51 | 51 | } |
52 | - return ( $acl->isAllowed($role, $resource) ); |
|
52 | + return ($acl->isAllowed($role, $resource)); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -33,14 +33,14 @@ |
||
33 | 33 | public function __invoke( $resource ) |
34 | 34 | { |
35 | 35 | /** |
36 | - * @var \Zend\Permissions\Acl\Acl $acl |
|
36 | + * @var \Zend\Permissions\Acl\Acl $acl |
|
37 | 37 | **/ |
38 | 38 | $acl = $this->view->navigation()->getAcl(); |
39 | 39 | if (empty($resource) || !$acl->hasResource($resource) ) { |
40 | 40 | return true; |
41 | 41 | } |
42 | 42 | /** |
43 | - * @var \Admin\Entity\User $user |
|
43 | + * @var \Admin\Entity\User $user |
|
44 | 44 | **/ |
45 | 45 | $user = $this->view->zfcUserIdentity(); // ->getIdentity(); |
46 | 46 | if ($user) { // ($this->getAuthService()->hasIdentity()) { |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | * @access public |
31 | 31 | * @return \ZfcUser\Entity\UserInterface |
32 | 32 | */ |
33 | - public function __invoke( $resource ) |
|
33 | + public function __invoke($resource) |
|
34 | 34 | { |
35 | 35 | /** |
36 | 36 | * @var \Zend\Permissions\Acl\Acl $acl |
37 | 37 | **/ |
38 | 38 | $acl = $this->view->navigation()->getAcl(); |
39 | - if (empty($resource) || !$acl->hasResource($resource) ) { |
|
39 | + if (empty($resource) || !$acl->hasResource($resource)) { |
|
40 | 40 | return true; |
41 | 41 | } |
42 | 42 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } else { |
50 | 50 | $role = 'public'; |
51 | 51 | } |
52 | - return ( !$acl->isAllowed($role, $resource) ); |
|
52 | + return (!$acl->isAllowed($role, $resource)); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | array( |
66 | 66 | 'html' => $htmlOutput, |
67 | 67 | 'jsonVar1' => 'jsonVal2', |
68 | - 'jsonArray' => array(1,2,3,4,5,6) |
|
68 | + 'jsonArray' => array(1, 2, 3, 4, 5, 6) |
|
69 | 69 | ) |
70 | 70 | ); |
71 | 71 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'jsonArray' => array(1, 2, 3, 4, 5, 6) |
85 | 85 | ); |
86 | 86 | $isAjax = $this->getRequest()->isXmlHttpRequest(); |
87 | - return isAjax?new JsonModel($data):new ViewModel($data); |
|
87 | + return isAjax ? new JsonModel($data) : new ViewModel($data); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |