@@ -42,10 +42,13 @@ discard block |
||
42 | 42 | $args = array(); |
43 | 43 | $args['RawMessage'] = array(); |
44 | 44 | $args['RawMessage']['Data'] = $email->getRawMessage(); |
45 | - try { |
|
45 | + try |
|
46 | + { |
|
46 | 47 | $res = $this->ses->sendRawEmail($args); |
47 | 48 | return $res; |
48 | - } catch(\Exception $e) { |
|
49 | + } |
|
50 | + catch(\Exception $e) |
|
51 | + { |
|
49 | 52 | return false; |
50 | 53 | } |
51 | 54 | } |
@@ -66,9 +69,12 @@ discard block |
||
66 | 69 | $args['Message']['Body']['Text']['Data'] = $email->getTextBody(); |
67 | 70 | $args['Message']['Body']['Html']['Data'] = $email->getHtmlBody(); |
68 | 71 | $args['ReplyToAddresses'] = array($email->getReplyTo()); |
69 | - try { |
|
72 | + try |
|
73 | + { |
|
70 | 74 | return $this->ses->sendEmail($args); |
71 | - } catch(\Exception $e) { |
|
75 | + } |
|
76 | + catch(\Exception $e) |
|
77 | + { |
|
72 | 78 | return false; |
73 | 79 | } |
74 | 80 | } |
@@ -59,8 +59,8 @@ |
||
59 | 59 | return array($address); |
60 | 60 | } |
61 | 61 | $ret = array(); |
62 | - $ret[0] = trim(substr($address, $pos+1), '>'); |
|
63 | - $ret[1] = substr($address, 0, $pos-1); |
|
62 | + $ret[0] = trim(substr($address, $pos + 1), '>'); |
|
63 | + $ret[1] = substr($address, 0, $pos - 1); |
|
64 | 64 | return $ret; |
65 | 65 | } |
66 | 66 |
@@ -15,12 +15,12 @@ |
||
15 | 15 | |
16 | 16 | public function open($savePath, $sessionName) |
17 | 17 | { |
18 | - $this->dataTable = \Flipside\DataSetFactory::getDataTableByNames($this->dataSetName, $this->dataTableName); |
|
19 | - if($this->dataTable) |
|
20 | - { |
|
21 | - return true; |
|
22 | - } |
|
23 | - return false; |
|
18 | + $this->dataTable = \Flipside\DataSetFactory::getDataTableByNames($this->dataSetName, $this->dataTableName); |
|
19 | + if($this->dataTable) |
|
20 | + { |
|
21 | + return true; |
|
22 | + } |
|
23 | + return false; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function close() |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | public function gc($maxlifetime) |
64 | 64 | { |
65 | - $date = date("Y-m-d H:i:s", time()-$maxlifetime); |
|
65 | + $date = date("Y-m-d H:i:s", time() - $maxlifetime); |
|
66 | 66 | $filter = new \Flipside\Data\Filter("sessionLastAccess lt $date"); |
67 | 67 | return $this->dataTable->delete($filter); |
68 | 68 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $odata = $request->getAttribute('odata', new \Flipside\ODataParams(array())); |
109 | 109 | $params = $this->manipulateParameters($request, $odata); |
110 | 110 | $areas = $dataTable->read($odata->filter, $odata->select, $odata->top, |
111 | - $odata->skip, $odata->orderby, $params); |
|
111 | + $odata->skip, $odata->orderby, $params); |
|
112 | 112 | if($areas === false) |
113 | 113 | { |
114 | 114 | $areas = array(); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $odata = $request->getAttribute('odata', new \Flipside\ODataParams(array())); |
160 | 160 | $filter = $this->getFilterForPrimaryKey($args['name']); |
161 | 161 | $areas = $dataTable->read($filter, $odata->select, $odata->top, |
162 | - $odata->skip, $odata->orderby); |
|
162 | + $odata->skip, $odata->orderby); |
|
163 | 163 | if(empty($areas)) |
164 | 164 | { |
165 | 165 | return $response->withStatus(404); |
@@ -83,7 +83,7 @@ |
||
83 | 83 | //The underlying API call gave us back a different content type. Just pass that on... |
84 | 84 | return $response; |
85 | 85 | } |
86 | - $overrides = $request->getAttribute('serializeOverrides'); |
|
86 | + $overrides = $request->getAttribute('serializeOverrides'); |
|
87 | 87 | if($overrides->has($this->format)) |
88 | 88 | { |
89 | 89 | return $this->reserializeBody($response, $overrides->get($this->format)); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $settings = array("settings"=>["determineRouteBeforeAppMiddleware"=>true, 'displayErrorDetails'=> true]); |
12 | 12 | parent::__construct($settings); |
13 | 13 | $c = $this->getContainer(); |
14 | - $c['errorHandler'] = function($c) { return new WebErrorHandler();}; |
|
14 | + $c['errorHandler'] = function($c) { return new WebErrorHandler(); }; |
|
15 | 15 | $this->add(new AuthMiddleware()); |
16 | 16 | $this->add(new ODataMiddleware()); |
17 | 17 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | public function registerAPI($uri, $api) |
25 | 25 | { |
26 | - $group = $this->group($uri, function() use($api){$api->setup($this);}); |
|
26 | + $group = $this->group($uri, function() use($api){$api->setup($this); }); |
|
27 | 27 | $group->add(new \Flipside\Http\Rest\SerializationMiddleware()); |
28 | 28 | $group->add(new \Flipside\Http\Rest\CORSMiddleware($this->getContainer())); |
29 | 29 | } |
@@ -11,7 +11,9 @@ discard block |
||
11 | 11 | $settings = array("settings"=>["determineRouteBeforeAppMiddleware"=>true, 'displayErrorDetails'=> true]); |
12 | 12 | parent::__construct($settings); |
13 | 13 | $c = $this->getContainer(); |
14 | - $c['errorHandler'] = function($c) { return new WebErrorHandler();}; |
|
14 | + $c['errorHandler'] = function($c) |
|
15 | + { |
|
16 | +return new WebErrorHandler();}; |
|
15 | 17 | $this->add(new AuthMiddleware()); |
16 | 18 | $this->add(new ODataMiddleware()); |
17 | 19 | } |
@@ -23,7 +25,9 @@ discard block |
||
23 | 25 | |
24 | 26 | public function registerAPI($uri, $api) |
25 | 27 | { |
26 | - $group = $this->group($uri, function() use($api){$api->setup($this);}); |
|
28 | + $group = $this->group($uri, function() use($api) |
|
29 | + { |
|
30 | +$api->setup($this);}); |
|
27 | 31 | $group->add(new \Flipside\Http\Rest\SerializationMiddleware()); |
28 | 32 | $group->add(new \Flipside\Http\Rest\CORSMiddleware($this->getContainer())); |
29 | 33 | } |
@@ -137,16 +137,16 @@ |
||
137 | 137 | { |
138 | 138 | if($isGroup) |
139 | 139 | { |
140 | - array_push($this->tmpMembers, array('gid' => $name)); |
|
140 | + array_push($this->tmpMembers, array('gid' => $name)); |
|
141 | 141 | } |
142 | 142 | else |
143 | 143 | { |
144 | - array_push($this->tmpMembers, array('uid' => $name)); |
|
144 | + array_push($this->tmpMembers, array('uid' => $name)); |
|
145 | 145 | } |
146 | 146 | if($flush) |
147 | 147 | { |
148 | 148 | $gid = $this->getGroupName(); |
149 | - $memberDT = $this->auth->getDataTable('groupUserMap'); |
|
149 | + $memberDT = $this->auth->getDataTable('groupUserMap'); |
|
150 | 150 | //Get all cu rrent direct members |
151 | 151 | $existing = $memberDT->read(new \Flipside\Data\Filter('groupCN eq "'.$gid.'"')); |
152 | 152 | $exCount = count($existing); |
@@ -80,7 +80,7 @@ |
||
80 | 80 | $data = $userDT->read($filter); |
81 | 81 | if(strlen($data[0]['userPassword']) === 0) |
82 | 82 | { |
83 | - $data[0]['userPassword'] = openssl_random_pseudo_bytes(10); |
|
83 | + $data[0]['userPassword'] = openssl_random_pseudo_bytes(10); |
|
84 | 84 | } |
85 | 85 | $hash = hash('sha512', $data[0]['uid'].';'.$data[0]['userPassword'].';'.$data[0]['mail']); |
86 | 86 | $update = array('resetHash' => $hash); |
@@ -131,7 +131,7 @@ |
||
131 | 131 | private function hashLDAPPassword($password, $salt) |
132 | 132 | { |
133 | 133 | $shaHashed = sha1($password.$salt); |
134 | - $packed = pack("H*",$shaHashed); |
|
134 | + $packed = pack("H*", $shaHashed); |
|
135 | 135 | $encoded = base64_encode($packed.$salt); |
136 | 136 | return "{SSHA}".$encoded; |
137 | 137 | } |
@@ -131,7 +131,7 @@ |
||
131 | 131 | private function hashLDAPPassword($password, $salt) |
132 | 132 | { |
133 | 133 | $shaHashed = sha1($password.$salt); |
134 | - $packed = pack("H*",$shaHashed); |
|
134 | + $packed = pack("H*", $shaHashed); |
|
135 | 135 | $encoded = base64_encode($packed.$salt); |
136 | 136 | return "{SSHA}".$encoded; |
137 | 137 | } |
@@ -219,7 +219,8 @@ |
||
219 | 219 | public function getGroupByName($name) |
220 | 220 | { |
221 | 221 | $group = $this->getEntityByFilter('group', "cn eq '$name'", '\Flipside\Auth\SQLGroup'); |
222 | - if($group === null) { |
|
222 | + if($group === null) |
|
223 | + { |
|
223 | 224 | return $this->getEntityByFilter('group', "gid eq '$name'", '\Flipside\Auth\SQLGroup'); |
224 | 225 | } |
225 | 226 | return $group; |