@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | public $user; |
7 | 7 | public $is_admin = false; |
8 | 8 | |
9 | - function __construct($title, $adminGroup='LDAPAdmins') |
|
9 | + function __construct($title, $adminGroup = 'LDAPAdmins') |
|
10 | 10 | { |
11 | 11 | $this->user = FlipSession::getUser(); |
12 | 12 | $this->is_admin = $this->userIsAdmin($adminGroup); |
@@ -47,13 +47,13 @@ discard block |
||
47 | 47 | $ret = '<li>'; |
48 | 48 | $href = $this->getHrefForDropdown($link); |
49 | 49 | $ret .= $this->createLink($name.' <i class="fa fa-arrow-right"></i>', $href); |
50 | - $ret.='<ul>'; |
|
50 | + $ret .= '<ul>'; |
|
51 | 51 | $subNames = array_keys($link); |
52 | 52 | foreach($subNames as $subName) |
53 | 53 | { |
54 | - $ret.=$this->getLinkByName($subName, $link); |
|
54 | + $ret .= $this->getLinkByName($subName, $link); |
|
55 | 55 | } |
56 | - $ret.='</ul></li>'; |
|
56 | + $ret .= '</ul></li>'; |
|
57 | 57 | return $ret; |
58 | 58 | } |
59 | 59 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | const CARD_YELLOW = 'panel-yellow'; |
109 | 109 | const CARD_RED = 'panel-red'; |
110 | 110 | |
111 | - function add_card($iconName, $bigText, $littleText, $link='#', $color = self::CARD_BLUE, $textColor=false) |
|
111 | + function add_card($iconName, $bigText, $littleText, $link = '#', $color = self::CARD_BLUE, $textColor = false) |
|
112 | 112 | { |
113 | 113 | $card = '<div class="col-lg-3 col-md-6"> |
114 | 114 | <div class="panel '.$color.'"> |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $this->body .= $card; |
136 | 136 | } |
137 | 137 | |
138 | - function printPage($header=true) |
|
138 | + function printPage($header = true) |
|
139 | 139 | { |
140 | 140 | if($this->user === false || $this->user === null) |
141 | 141 | { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @param string $email The email address to send from |
150 | 150 | * @param string $name The name to associate with the from address |
151 | 151 | */ |
152 | - public function setFromAddress($email, $name=false) |
|
152 | + public function setFromAddress($email, $name = false) |
|
153 | 153 | { |
154 | 154 | $address = $email; |
155 | 155 | if($name !== false) |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @param string $email The email address to send to |
166 | 166 | * @param string $name The name to associate with the address |
167 | 167 | */ |
168 | - public function addToAddress($email, $name=false) |
|
168 | + public function addToAddress($email, $name = false) |
|
169 | 169 | { |
170 | 170 | $this->addAddress($this->to, $email, $name); |
171 | 171 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * @param string $email The email address to send to |
177 | 177 | * @param string $name The name to associate with the address |
178 | 178 | */ |
179 | - public function addCCAddress($email, $name=false) |
|
179 | + public function addCCAddress($email, $name = false) |
|
180 | 180 | { |
181 | 181 | $this->addAddress($this->cc, $email, $name); |
182 | 182 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @param string $email The email address to send to |
188 | 188 | * @param string $name The name to associate with the address |
189 | 189 | */ |
190 | - public function addBCCAddress($email, $name=false) |
|
190 | + public function addBCCAddress($email, $name = false) |
|
191 | 191 | { |
192 | 192 | $this->addAddress($this->bcc, $email, $name); |
193 | 193 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @param string $email The email address to send to |
200 | 200 | * @param string $name The name to associate with the address |
201 | 201 | */ |
202 | - protected function addAddress(&$list, $email, $name=false) |
|
202 | + protected function addAddress(&$list, $email, $name = false) |
|
203 | 203 | { |
204 | 204 | $address = $email; |
205 | 205 | if($name !== false) |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * @param string $email The email address to reply to |
216 | 216 | * @param string $name The name to associate with the from address |
217 | 217 | */ |
218 | - public function setReplyTo($email, $name=false) |
|
218 | + public function setReplyTo($email, $name = false) |
|
219 | 219 | { |
220 | 220 | $address = $email; |
221 | 221 | if($name !== false) |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public function appendToHTMLBody($body) |
264 | 264 | { |
265 | - $this->htmlBody.= $body; |
|
265 | + $this->htmlBody .= $body; |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | */ |
273 | 273 | public function appendToTextBody($body) |
274 | 274 | { |
275 | - $this->textBody.= $body; |
|
275 | + $this->textBody .= $body; |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | /** |
@@ -335,14 +335,14 @@ discard block |
||
335 | 335 | { |
336 | 336 | throw new \Exception('Message must have a from address'); |
337 | 337 | } |
338 | - $rawMessage.= 'From: '.$this->encodeRecipients($from)."\n"; |
|
338 | + $rawMessage .= 'From: '.$this->encodeRecipients($from)."\n"; |
|
339 | 339 | if(!empty($this->cc)) |
340 | 340 | { |
341 | - $rawMessage.= 'CC: '. $this->encodeRecipients($this->getCCAddresses())."\n"; |
|
341 | + $rawMessage .= 'CC: '.$this->encodeRecipients($this->getCCAddresses())."\n"; |
|
342 | 342 | } |
343 | 343 | if(!empty($this->bcc)) |
344 | 344 | { |
345 | - $rawMessage.= 'BCC: '. $this->encodeRecipients($this->getBCCAddresses())."\n"; |
|
345 | + $rawMessage .= 'BCC: '.$this->encodeRecipients($this->getBCCAddresses())."\n"; |
|
346 | 346 | } |
347 | 347 | $rawMessage .= 'Subject: '.$this->getSubject()."\n"; |
348 | 348 | $rawMessage .= 'MIME-Version: 1.0'."\n"; |
@@ -352,25 +352,25 @@ discard block |
||
352 | 352 | $textBody = $this->getTextBody(); |
353 | 353 | if($textBody !== false && strlen($textBody) > 0) |
354 | 354 | { |
355 | - $rawMessage.= "\n--alt-{$boundary}\n"; |
|
356 | - $rawMessage.= "Content-Type: text/plain\n\n"; |
|
357 | - $rawMessage.= $textBody."\n"; |
|
355 | + $rawMessage .= "\n--alt-{$boundary}\n"; |
|
356 | + $rawMessage .= "Content-Type: text/plain\n\n"; |
|
357 | + $rawMessage .= $textBody."\n"; |
|
358 | 358 | } |
359 | - $htmlBody = $this->getHTMLBody(); |
|
359 | + $htmlBody = $this->getHTMLBody(); |
|
360 | 360 | if($htmlBody !== false && strlen($htmlBody) > 0) |
361 | 361 | { |
362 | 362 | $rawMessage .= "\n--alt-{$boundary}\n"; |
363 | 363 | $rawMessage .= 'Content-Type: text/html; charset="UTF-8"'."\n\n"; |
364 | 364 | $rawMessage .= $htmlBody."\n"; |
365 | 365 | } |
366 | - $rawMessage.= "\n--alt-{$boundary}--\n"; |
|
366 | + $rawMessage .= "\n--alt-{$boundary}--\n"; |
|
367 | 367 | foreach($this->attachments as $attachment) |
368 | 368 | { |
369 | - $rawMessage.= "\n--{$boundary}\n"; |
|
370 | - $rawMessage.= 'Content-Type: '. $attachment['mimeType'].'; name="'.$attachment['name']."\"\n"; |
|
371 | - $rawMessage.= 'Content-Disposition: attachment'."\n"; |
|
372 | - $rawMessage.= 'Content-Transfer-Encoding: base64'."\n\n"; |
|
373 | - $rawMessage.= chunk_split(base64_encode($attachment['data']), 76, "\n")."\n"; |
|
369 | + $rawMessage .= "\n--{$boundary}\n"; |
|
370 | + $rawMessage .= 'Content-Type: '.$attachment['mimeType'].'; name="'.$attachment['name']."\"\n"; |
|
371 | + $rawMessage .= 'Content-Disposition: attachment'."\n"; |
|
372 | + $rawMessage .= 'Content-Transfer-Encoding: base64'."\n\n"; |
|
373 | + $rawMessage .= chunk_split(base64_encode($attachment['data']), 76, "\n")."\n"; |
|
374 | 374 | } |
375 | 375 | $rawMessage .= "\n--{$boundary}--\n"; |
376 | 376 | return $rawMessage; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | private function createCSV(&$array) |
118 | 118 | { |
119 | - if (count($array) == 0) |
|
119 | + if(count($array) == 0) |
|
120 | 120 | { |
121 | 121 | return null; |
122 | 122 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $keys = array_keys(get_object_vars($first)); |
136 | 136 | } |
137 | 137 | fputcsv($df, $keys); |
138 | - foreach ($array as $row) |
|
138 | + foreach($array as $row) |
|
139 | 139 | { |
140 | 140 | if(is_array($row)) |
141 | 141 | { |
@@ -287,12 +287,12 @@ discard block |
||
287 | 287 | $this->error($errorHandler); |
288 | 288 | } |
289 | 289 | |
290 | - function get_json_body($array=false) |
|
290 | + function get_json_body($array = false) |
|
291 | 291 | { |
292 | 292 | return $this->getJsonBody($array); |
293 | 293 | } |
294 | 294 | |
295 | - function getJsonBody($array=false) |
|
295 | + function getJsonBody($array = false) |
|
296 | 296 | { |
297 | 297 | $body = $this->request->getBody(); |
298 | 298 | return json_decode($body, $array); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $browserName = $this->getBrowserName(); |
61 | 61 | if($browserName === 'IE' && $this->getBrowserMajorVer() <= 7) |
62 | 62 | { |
63 | - header( 'Location: /badbrowser.php' ) ; |
|
63 | + header('Location: /badbrowser.php'); |
|
64 | 64 | } |
65 | 65 | else if($browserName === 'Chrome' && $this->getBrowserMajorVer() >= 36) |
66 | 66 | { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | private function getBrowser() |
91 | 91 | { |
92 | - static $browser;//No accident can arise from depending on an unset variable. |
|
92 | + static $browser; //No accident can arise from depending on an unset variable. |
|
93 | 93 | if(!isset($browser)) |
94 | 94 | { |
95 | 95 | $browser = $this->browscap->getBrowser(); |
@@ -190,16 +190,16 @@ discard block |
||
190 | 190 | * |
191 | 191 | * @return string The tag as a string |
192 | 192 | */ |
193 | - protected function createOpenTag($tagName, $attribs=array(), $selfClose=false) |
|
193 | + protected function createOpenTag($tagName, $attribs = array(), $selfClose = false) |
|
194 | 194 | { |
195 | 195 | $tag = '<'.$tagName; |
196 | 196 | $attribNames = array_keys($attribs); |
197 | 197 | foreach($attribNames as $attribName) |
198 | 198 | { |
199 | - $tag.=' '.$attribName; |
|
199 | + $tag .= ' '.$attribName; |
|
200 | 200 | if($attribs[$attribName]) |
201 | 201 | { |
202 | - $tag.='="'.$attribs[$attribName].'"'; |
|
202 | + $tag .= '="'.$attribs[$attribName].'"'; |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | if($selfClose) |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * |
230 | 230 | * @return string The link |
231 | 231 | */ |
232 | - public function createLink($linkName, $linkTarget='#') |
|
232 | + public function createLink($linkName, $linkTarget = '#') |
|
233 | 233 | { |
234 | 234 | $startTag = $this->createOpenTag('a', array('href'=>$linkTarget)); |
235 | 235 | $endTag = $this->createCloseTag('a'); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * |
246 | 246 | * @param string $prefix The prefix to append to each line |
247 | 247 | */ |
248 | - protected function printIeCompatability($prefix='') |
|
248 | + protected function printIeCompatability($prefix = '') |
|
249 | 249 | { |
250 | 250 | //IE 8 doesn't support HTML 5. Install the shim... |
251 | 251 | if($this->getBrowserMajorVer() < 9) |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | * |
264 | 264 | * @param string $prefix The prefix to append to each line |
265 | 265 | */ |
266 | - protected function printHead($prefix='') |
|
266 | + protected function printHead($prefix = '') |
|
267 | 267 | { |
268 | 268 | echo $prefix.'<HEAD>'; |
269 | 269 | if($this->getBrowserName() === 'IE') |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | * |
285 | 285 | * @param string $prefix The prefix to append to each line |
286 | 286 | */ |
287 | - protected function printBody($prefix='') |
|
287 | + protected function printBody($prefix = '') |
|
288 | 288 | { |
289 | 289 | echo $prefix.'<BODY '.$this->body_tags.'>'; |
290 | 290 | echo $prefix.$prefix.$this->body."\n"; |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | { |
322 | 322 | $requestURI = substr($requestURI, 1); |
323 | 323 | } |
324 | - return 'http'.(isset($_SERVER['HTTPS'])?'s':'').'://'.$_SERVER['HTTP_HOST'].'/'.$requestURI; |
|
324 | + return 'http'.(isset($_SERVER['HTTPS']) ? 's' : '').'://'.$_SERVER['HTTP_HOST'].'/'.$requestURI; |
|
325 | 325 | } |
326 | 326 | } |
327 | 327 | /* vim: set tabstop=4 shiftwidth=4 expandtab: */ |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | if(isset($params['$expand'])) |
68 | 68 | { |
69 | - $this->expand = explode(',',$params['$expand']); |
|
69 | + $this->expand = explode(',', $params['$expand']); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | { |
75 | 75 | if(isset($params['select'])) |
76 | 76 | { |
77 | - $this->select = explode(',',$params['select']); |
|
77 | + $this->select = explode(',', $params['select']); |
|
78 | 78 | } |
79 | 79 | else if(isset($params['$select'])) |
80 | 80 | { |
81 | - $this->select = explode(',',$params['$select']); |
|
81 | + $this->select = explode(',', $params['$select']); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | if(isset($params['$orderby'])) |
88 | 88 | { |
89 | 89 | $this->orderby = array(); |
90 | - $orderby = explode(',',$params['$orderby']); |
|
90 | + $orderby = explode(',', $params['$orderby']); |
|
91 | 91 | $count = count($orderby); |
92 | 92 | for($i = 0; $i < $count; $i++) |
93 | 93 | { |
94 | - $exp = explode(' ',$orderby[$i]); |
|
94 | + $exp = explode(' ', $orderby[$i]); |
|
95 | 95 | if(count($exp) === 1) |
96 | 96 | { |
97 | 97 | //Default to assending |
@@ -16,14 +16,14 @@ |
||
16 | 16 | * |
17 | 17 | * This class can be serialized to various formats |
18 | 18 | */ |
19 | -class SerializableObject implements ArrayAccess,JsonSerializable |
|
19 | +class SerializableObject implements ArrayAccess, JsonSerializable |
|
20 | 20 | { |
21 | 21 | /** |
22 | 22 | * Create the object from an array |
23 | 23 | * |
24 | 24 | * @param array $array The array of object properties |
25 | 25 | */ |
26 | - public function __construct($array=false) |
|
26 | + public function __construct($array = false) |
|
27 | 27 | { |
28 | 28 | if($array !== false && is_array($array)) |
29 | 29 | { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | - function count($filter=false) |
|
54 | + function count($filter = false) |
|
55 | 55 | { |
56 | 56 | if($this->data !== null) |
57 | 57 | { |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | - function search($filter=false, $select=false, $count=false, $skip=false, $sort=false, $params=false) |
|
76 | + function search($filter = false, $select = false, $count = false, $skip = false, $sort = false, $params = false) |
|
77 | 77 | { |
78 | 78 | if($this->data !== null) |
79 | 79 | { |
@@ -7,15 +7,15 @@ |
||
7 | 7 | $classname = ltrim($classname, '\\'); |
8 | 8 | $filename = ''; |
9 | 9 | $namespace = ''; |
10 | - if ($lastNsPos = strrpos($classname, '\\')) |
|
10 | + if($lastNsPos = strrpos($classname, '\\')) |
|
11 | 11 | { |
12 | 12 | $namespace = substr($classname, 0, $lastNsPos); |
13 | 13 | $classname = substr($classname, $lastNsPos + 1); |
14 | - $filename = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; |
|
14 | + $filename = str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR; |
|
15 | 15 | } |
16 | 16 | if(strlen($namespace)) |
17 | 17 | { |
18 | - $namespace.=DIRECTORY_SEPARATOR; |
|
18 | + $namespace .= DIRECTORY_SEPARATOR; |
|
19 | 19 | } |
20 | 20 | $filename = __DIR__.'/../libs/mongofill/src/'.$namespace.$classname.'.php'; |
21 | 21 | if(is_readable($filename)) |
@@ -5,12 +5,12 @@ discard block |
||
5 | 5 | { |
6 | 6 | protected $data = null; |
7 | 7 | |
8 | - function count($filter=false) |
|
8 | + function count($filter = false) |
|
9 | 9 | { |
10 | 10 | throw new \Exception('Unimplemented'); |
11 | 11 | } |
12 | 12 | |
13 | - function search($filter=false, $select=false, $count=false, $skip=false, $sort=false, $params=false) |
|
13 | + function search($filter = false, $select = false, $count = false, $skip = false, $sort = false, $params = false) |
|
14 | 14 | { |
15 | 15 | if($this->data === null) |
16 | 16 | { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | throw new \Exception('Unimplemented'); |
30 | 30 | } |
31 | 31 | |
32 | - function read($filter=false, $select=false, $count=false, $skip=false, $sort=false, $params=false) |
|
32 | + function read($filter = false, $select = false, $count = false, $skip = false, $sort = false, $params = false) |
|
33 | 33 | { |
34 | 34 | return $this->search($filter, $select, $count, $skip, $sort, $params); |
35 | 35 | } |